com.aspose.tasks

Interfaces

Classes

Exceptions

com.aspose.tasks

Class ExtendedAttributeDefinition



  • public class ExtendedAttributeDefinition
    extends Object

    Represents an extended attribute definition associated with a project.

    • Method Detail

      • addLookupValue

        public final void addLookupValue(Value value)
        Adds a value to the internal lookup list. This is a preferable way for manipulations with the ValueList. This method works only for ExtendedAttributeDefinition instances which have CalculationType equals to Tasks.CalculationType.Lookup.
        Parameters:
        value - The specified Value item.
      • compareTo

        public int compareTo(ExtendedAttributeDefinition o)
        Compares this object with another instance of the @{code ExtendedAttributeDefinition} class.
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute()

        Creates a new extended attribute with the field ID which equals to this object's field ID value.

        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(String textValue)

        Creates a new extended attribute with the field ID which equals to this object's field ID value and the specified text value.

        Parameters:
        textValue - The specified text value.
        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If current attribute's CfType is not 'Text'
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(BigDecimal numericValue)

        Creates a new extended attribute with the field ID which equals to this object's field ID value and the specified numeric value.

        Parameters:
        numericValue - The specified numeric value.
        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If current attribute's CfType is not 'Number' or 'Cost'
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(Date dateTimeValue)

        Creates a new extended attribute with the field ID which equals to this object's field ID value and the specified date value.

        Parameters:
        dateTimeValue - The specified datetime value.
        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If current attribute's CfType is not 'Date', 'Start' or 'Finish'
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(Duration durationValue)

        Creates a new extended attribute with the field ID which equals to this object's field ID value and the specified duration value.

        Parameters:
        durationValue - The specified duration value.
        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If current attribute's CfType is not 'Duration'
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(boolean flagValue)

        Creates a new extended attribute with the field ID which equals to this object's field ID value and the specified flag value.

        Parameters:
        flagValue - The specified flag value.
        Returns:
        returns created instance of the ExtendedAttribute class with the fieldID which equals to this object's fieldID value.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If current attribute's CfType is not 'Flag'
      • createExtendedAttribute

        public final ExtendedAttribute createExtendedAttribute(Value lookupValue)
        Creates new extended attribute linked with specified Value item.
        Parameters:
        lookupValue - The specified Value item. lookupValue should be previously added to the ExtendedAttributeDefinition using addLookupValue method.
        Returns:
        returns created instance of the ExtendedAttribute class linked with specified Value item.
      • createLookupDefinition

        public static ExtendedAttributeDefinition createLookupDefinition()
        Factory method which creates an extended attribute definition with lookup. It has CalculationType equals to Tasks.CalculationType.Lookup. After creation you should manually specify the value for CfType, FieldId and Alias. Prefer using the stronger method createLookupTaskDefinition(CustomFieldType,ExtendedAttributeTask,String) or createLookupResourceDefinition(CustomFieldType,ExtendedAttributeResource,String).
        Returns:
        ExtendedAttributeDefinition
      • createLookupResourceDefinition

        public static ExtendedAttributeDefinition createLookupResourceDefinition(int fieldId,
                                                                                 String alias)

        Factory method which creates an extended attribute definition with lookup. It has CalculationType equals to Tasks.CalculationType.Lookup and can be used in Resources only. You are required to specify fieldId and alias when call this method. The field type is inferred from field id.

        Parameters:
        fieldId - The specified ExtendedAttributeResource field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified fieldId and alias.
      • createLookupResourceDefinition

        public static ExtendedAttributeDefinition createLookupResourceDefinition(int customFieldType,
                                                                                 int fieldId,
                                                                                 String alias)

        Factory method which creates an extended attribute definition with lookup. It has CalculationType equals to Tasks.CalculationType.Lookup and can be used in Resources only. You are required to specify customFieldType, fieldId and alias when call this method.

        Parameters:
        customFieldType - The specified CustomFieldType type.
        fieldId - The specified ExtendedAttributeResource field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified customFieldType, fieldId and alias.
      • createLookupTaskDefinition

        public static ExtendedAttributeDefinition createLookupTaskDefinition(int fieldId,
                                                                             String alias)

        Factory method which creates an extended attribute definition with lookup. It has CalculationType equals to Tasks.CalculationType.Lookup and can be used in Tasks only. You are required to specify fieldId and alias when call this method. The field type is inferred from field id.

        Parameters:
        fieldId - The specified ExtendedAttributeTask field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified fieldId and alias.
      • createLookupTaskDefinition

        public static ExtendedAttributeDefinition createLookupTaskDefinition(int customFieldType,
                                                                             int fieldId,
                                                                             String alias)

        Factory method which creates an extended attribute definition with lookup. It has CalculationType equals to Tasks.CalculationType.Lookup and can be used in Tasks only. You are required to specify customFieldType, fieldId and alias when call this method.

        Parameters:
        customFieldType - The specified CustomFieldType type.
        fieldId - The specified ExtendedAttributeTask field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified customFieldType, fieldId and alias.
      • createResourceDefinition

        public static ExtendedAttributeDefinition createResourceDefinition(int customFieldType,
                                                                           int fieldId,
                                                                           String alias)
        Factory method which creates a simple extended attribute definition, which Microsoft Project shows as "None". It has CalculationType equals to Tasks.CalculationType.None and can be used in Resource only. You are required to specify customFieldType, fieldId and alias when call this method.

        Parameters:
        customFieldType - The specified CustomFieldType type.
        fieldId - The specified ExtendedAttributeResource field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified customFieldType, fieldId and alias.
      • createResourceDefinition

        public static ExtendedAttributeDefinition createResourceDefinition(int fieldId,
                                                                           String alias)

        Factory method which creates a simple extended attribute definition, which Microsoft Project shows as "None". It has CalculationType equals to Tasks.CalculationType.None and can be used in Resource only. You are required to specify fieldId and alias when call this method. The field type is inferred from field id.

        Parameters:
        fieldId - The specified ExtendedAttributeResource field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified fieldId and alias.
      • createTaskDefinition

        public static ExtendedAttributeDefinition createTaskDefinition(int customFieldType,
                                                                       int fieldId,
                                                                       String alias)

        Factory method which creates a simple extended attribute definition, which Microsoft Project shows as "None". It has CalculationType equals to Tasks.CalculationType.None and can be used in Tasks only. You are required to specify customFieldType, fieldId and alias when calling this method.

        Parameters:
        customFieldType - The specified CustomFieldType type.
        fieldId - The specified ExtendedAttributeTask field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified customFieldType, fieldId and alias.
      • createTaskDefinition

        public static ExtendedAttributeDefinition createTaskDefinition(int fieldId,
                                                                       String alias)

        Factory method which creates a simple extended attribute definition, which Microsoft Project shows as "None". It has CalculationType equals to Tasks.CalculationType.None and can be used in Tasks only. You are required to specify fieldId and alias when calling this method. The field type is inferred from field id.

        Parameters:
        fieldId - The specified ExtendedAttributeTask field ID.
        alias - The specified string alias.
        Returns:
        Created instance of the ExtendedAttributeDefinition class with specified fieldId and alias.
      • equals

        public boolean equals(Object obj)

        Returns a flag indicating whether this instance is equal to the specified object.

        Overrides:
        equals in class Object
        Parameters:
        obj - the specified object to compare to this instance.
        Returns:
        a flag indicating whether this instance is equal to the specified object.
      • getAlias

        public final String getAlias()
        Returns the alias of a custom field. Read/write String.
        Returns:
        custom field alias.
      • setAlias

        public final void setAlias(String value)
        Sets the alias of a custom field. Read/write String.
        Parameters:
        value - custom field alias.
      • getAppendNewValues

        public final boolean getAppendNewValues()
        Determines whether new values added to a project are automatically added to the list. Read/write boolean. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        true if new values added to a project are automatically added to the list.
      • setAppendNewValues

        public final void setAppendNewValues(boolean value)
        Determines whether new values added to a project are automatically added to the list. Read/write boolean. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Parameters:
        value - true if new values added to a project are automatically added to the list.
      • getAutoRollDown

        public final boolean getAutoRollDown()
        Determines whether an automatic rolldown to assignments is enabled. Read/write boolean. Currently supported for Xml format only.
        Returns:
        true if an automatic rolldown to assignments is enabled.
      • setAutoRollDown

        public final void setAutoRollDown(boolean value)
        Determines whether an automatic rolldown to assignments is enabled. Read/write boolean. Currently supported for Xml format only.
        Parameters:
        value - true if an automatic rolldown to assignments is enabled.
      • getCalculationType

        public final int getCalculationType()
        Determines whether rollups are calculated for a task and group summary rows. Read/write CalculationType. Currently supported for Xml format only.
        Returns:
        calculation type.
      • setCalculationType

        public final void setCalculationType(int value)
        Determines whether rollups are calculated for a task and group summary rows. Read/write CalculationType. Currently supported for Xml format only.
        Parameters:
        value - calculation type.
      • getCfType

        public final int getCfType()
        Returns the type of a custom field. Read/write CustomFieldType.
        Returns:
        custom field type.
      • getDefault

        public final String getDefault()
        Returns the default value in the list. Read/write String. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        the default value in the list.
      • setDefault

        public final void setDefault(String value)
        Sets the default value in the list. Read/write String. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Parameters:
        value - the default value in the list.
      • getDefaultGuid

        public final String getDefaultGuid()
        Returns the Guid of the default lookup table entry. Read/write String. Currently supported for Xml format only.
        Returns:
        default lookup table entry Guid.
      • setDefaultGuid

        public final void setDefaultGuid(String value)
        Sets the Guid of the default lookup table entry. Read/write String. Currently supported for Xml format only.
        Parameters:
        value - default lookup table entry Guid.
      • getElementType

        public final int getElementType()
        Returns a value which determines whether the extended attribute is associated with a task, a resource, or an assignment. Read/write ElementType. Currently supported for Xml format only.
        Returns:
        returns extended attribute element type.
      • setElementType

        public final void setElementType(int value)
        Sets a value which determines whether the extended attribute is associated with a task, a resource, or an assignment.
        Parameters:
        value - a flag which determines whether the extended attribute is associated with a task, a resource, or an assignment.
      • getFieldId

        public final String getFieldId()
        Corresponds to the Pid of a custom field. Use string representation of a constant from Aspose.Tasks.ExtendedAttributeTask class to specify FieldId property. Preferable way to set FieldId property is to create ExtendedAttributeDefinition using one of the dedicated factory methods like createTaskDefinition or createLookupTaskDefinition.
        Returns:
        custom field Id.
      • setFieldId

        public final void setFieldId(String value)
        Corresponds to the Pid of a custom field. Use string representation of a constant from Aspose.Tasks.ExtendedAttributeTask class to specify FieldId property. Preferable way to set FieldId property is to create ExtendedAttributeDefinition using one of the dedicated factory methods like createTaskDefinition or createLookupTaskDefinition.
      • getFieldName

        public final String getFieldName()
        Returns the name of a custom field. Read/write String. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        the name of a custom field.
      • getFormula

        public final String getFormula()
        Returns the formula that Microsoft Project uses to populate a custom task field. Read/write string. Currently supported for Xml format only.
        Returns:
        custom field formula.
      • getGuid

        public final String getGuid()
        Returns the Guid of a custom field. Currently supported for Xml format only.
        Returns:
        custom field Guid.
      • setGuid

        public final void setGuid(String value)
        Sets the Guid of a custom field. Currently supported for Xml format only.
        Parameters:
        value - custom field Guid.
      • getLookupUid

        public final String getLookupUid()
        Returns the Guid of the lookup table associated with a custom field.
        Returns:
        custom field lookup table Guid.
      • getMaxMultiValues

        public final int getMaxMultiValues()
        Returns the maximum number of values you can setInternal in a picklist. Read/write int. Currently supported for Xml format only.
        Returns:
        the maximum number of values.
      • setMaxMultiValues

        public final void setMaxMultiValues(int value)
        Sets the maximum number of values you can setInternal in a picklist. Read/write int. Currently supported for Xml format only.
        Parameters:
        value - the maximum number of values.
      • getParentProject

        public final Project getParentProject()
        Returns a parent project for the ExtendedAttributeDefinition instance.
        Returns:
        returns a parent project for this object.
      • getPhoneticsAlias

        public final String getPhoneticsAlias()
        Returns the phonetic pronunciation of the alias of a custom field. Read/write String. Currently supported for Xml format only.
        Returns:
        custom field phonetic pronunciation.
      • setPhoneticsAlias

        public final void setPhoneticsAlias(String value)
        Sets the phonetic pronunciation of the alias of a custom field. Read/write String. Currently supported for Xml format only.
        Parameters:
        value - custom field phonetic pronunciation.
      • getRestrictValues

        public final boolean getRestrictValues()
        Determines whether only values in the list are allowed in a file. Read/write boolean. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        true if only values in the list are allowed in a file.
      • setRestrictValues

        public final void setRestrictValues(boolean value)
        Determines whether only values in the list are allowed in a file. Read/write boolean. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Parameters:
        value - true if only values in the list are allowed in a file.
      • getRollupType

        public final int getRollupType()
        Returns the way rollups are calculated. Read/write RollupType. Currently supported for Xml format only.
        Returns:
        rollup type.
      • setRollupType

        public final void setRollupType(int value)
        Sets the way rollups are calculated. Read/write RollupType. Currently supported for Xml format only.
        Parameters:
        value - rollup type.
      • getSecondaryGuid

        public final String getSecondaryGuid()
        Returns secondary guid of extended attribute. Read/write String. This is new for MS Project 2010 property.
        Returns:
        secondary guid.
      • setSecondaryGuid

        public final void setSecondaryGuid(String value)
        Sets secondary guid of extended attribute. Read/write String. This is new for MS Project 2010 property.
        Parameters:
        value - secondary guid.
      • getSecondaryPid

        public final String getSecondaryPid()
        Returns the secondary Pid of a custom field. Read/write String. Currently supported for Xml format only.
        Returns:
        custom field secondary Pid.
      • setSecondaryPid

        public final void setSecondaryPid(String value)
        Sets the secondary Pid of a custom field. Read/write String. Currently supported for Xml format only.
        Parameters:
        value - custom field secondary Pid.
      • getUserDef

        public final boolean getUserDef()
        Determines whether a custom field is user defined. Read/write boolean. Currently supported for Xml format only.
        Returns:
        true if a custom field is user defined.
      • setUserDef

        public final void setUserDef(boolean value)
        Determines whether a custom field is user defined. Read/write boolean. Currently supported for Xml format only.
        Parameters:
        value - true if a custom field is user defined.
      • getValueList

        public final List<Value> getValueList()
        Returns a list of values for this object. When values of extended attributes are specified as properties of elements in the schema, they may either be specified by values or by references to the values contained in this list. Applications may assume ordering of the list by ordering specified here. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        custom field list of values.
      • getValuelistSortOrder

        public final int getValuelistSortOrder()
        Returns the way value lists are sorted. Values are: 0=Descending, 1=Ascending. Read/write int. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Returns:
        the way value lists are sorted.
      • setValuelistSortOrder

        public final void setValuelistSortOrder(int value)
        Sets the way value lists are sorted. Values are: 0=Descending, 1=Ascending. Read/write int. Currently supported for MSP 2003/2007 Xml and MSP 2003 mpp formats.
        Parameters:
        value - the way value lists are sorted.
      • hashCode

        public int hashCode()
        Returns a hash code for this ExtendedAttributeDefinition.
        Overrides:
        hashCode in class Object
        Returns:
        Returns a hash code value for this object.
      • removeLookupValue

        public final void removeLookupValue(Value value)
        Removes a value from the internal lookup list. This is a preferable way for manipulations with the ValueList. This method works only for ExtendedAttributeDefinition instances which have CalculationType equals to Tasks.CalculationType.Lookup.
        Parameters:
        value - Value of lookup item to remove.
      • setFormula

        public final void setFormula(String value)
        Sets the formula that Microsoft Project uses to populate a custom task field. Read/write string. Currently supported for Xml format only.
        Parameters:
        value - custom field formula.