Adding Custom Columns in the Gantt Chart

You can add custom columns to the Gantt chart, filter on them, and make them editable.

  1. Add custom column settings:
    1. Override getCustomColumnSettingsMapList () in emxGantt JPO.
    2. Call super.getCustomColumnSettingsMapList. It will return a MapList.
    3. Run getCustomColumnSettingsMapList () which will receive 3 values in the argument: objectId, rootType, and viewId.
    4. Create a separate map for each custom attribute you want to display in the Gantt chart table.
    5. Populate the map with the following keys:

      • ProgramCentralConstants.COLUMN_LABEL_PROPERTY_KEY:

        The value is the property key which will be added in the Project Management string resource properties file.

      • ProgramCentralConstants.COLUMN_VALUE_DATA_TYPE:

        The value is the data type of the column value. Supported data types are String, Float, and Date.

        An enum has been provided which has all possible values for this key. You must use this enum to set the value for this key.

        The values are as follows:

        String: CustomColumnDataTypeEnum.STRING.getDatatype()

        Float: CustomColumnDataTypeEnum.FLOAT.getDatatype()

        Date: CustomColumnDataTypeEnum.DATE.getDatatype()

      • ProgramCentralConstants.COLUMN_SELECTABLE:

        Selectable which value will be shown in Gantt chart column.

      • ProgramCentralConstants.COLUMN_INDEX:

        The value is the index at which the user wants to add the custom attribute column.

      • ProgramCentralConstants.COLUMN_EDITABLE:

        This value will decide if the added column will be editable or read-only. To edit the value, the user has to double-click the column. A date chooser will appear at the right side for a date type column.

      • ProgramCentralConstants.COLUMN_EXCLUDE_IN_REFINEMENT:

        This value decides if the added column will appear in the refinement or not.

    6. Add all populated maps to MapList which is returned at step b.
    7. Return the MapList.
  2. Make the following changes in dpm-services.xml and tsk-services-v2.xml:
    1. Open MQL from the server directory (for example, "C:\enoviaV6R2019x\server\win_b64\code\bin\mql.exe").
    2. MQL> set context user creator;
    3. MQL> verb on;
    4. In cases where a custom attribute is added on the "Task Management" type: run MQL> print page tsk-services-v2 output "<directory path>\tsk-services-v2.xml". The file name should be tsk-services-v2.xml. It will save a local copy of tsk-services-v2.xml in your directory path.
    5. Add the fields you want to fetch for the custom column in the following format under the <ds:service name="tasks"> tag in the service file saved in step d.

      For example, <ds:field name="{FieldName}" ><ds:selectable expression="{ Expression }" format="{ Format_Of _Data }" type="bus" autosave="true"/></ds:field>

      {FieldName} : field name must be the same as the property key value for the custom column label value or as the ProgramCentralConstants.COLUMN_LABEL_PROPERTY_KEY" value defined in the English file.

      {Expression}: same as the selectable given in the JPO configuration.

      {format_Of _Data} : isodate, in cases when the column is of the Date type.

    6. After modification, put the modify service in MQL using the following command:

      MQL> modify page tsk-services-v2 file “<directory path>\tsk-services-v2.xml”;

    7. In cases where a custom attribute is added on the "Project Space" type: run MQL> print page dpm-services output "<directory path>\dpm-services.xml"; The file name should be dpm-services.xml. It will save a local copy of dpm-services.xml in your directory path.
    8. Add the fields you want to fetch for the custom column in the following format under the <ds:service name="dpm.projects"> tag in the service file saved in step g.

      For example:

      <ds:field name="{FieldName}" ><ds:selectable expression="{ Expression }" format="{ Format_Of _Data }" type="bus" autosave="true"/></ds:field>

      {FieldName} : field name must be same as the property key value for the custom column label value or as the ProgramCentralConstants.COLUMN_LABEL_PROPERTY_KEY" value defined in the English file.

      {Expression}: same as the selectable given in the JPO configuration.

      {format_Of _Data} : isodate, if the column is a Date type.

    9. After modification, put the modify service in MQL using the following command:

      MQL> modify page dpm-services file “<directory path>\dpm-services.xml”;