Menu

#347 MPPReader12/14: CustomFieldLookupTable is not populated for Resource OutlineCodes

v1.0_(example)
closed-fixed
nobody
None
5
2021-05-25
2021-05-07
No

If using MPPReader14 (or MPPReader12) we encountered, that the CustomFieldLookupTable is populated for Task-related OutlineCodes only, while Resource-related values are missing. In result of that, it is not possible to retrieve the select lists of Resource OutlineCodes.

Looking at the source, we found method below in MPPReader14 (Line 208).
It seems, that only Probs of "TBkndTask" are processed here, while Probs of "TBkndRsc" are ignored.
We did a test, adding the DirectoryEntry "TBkndRsc" and we were able to get the select lists of Resource OutlineCodes as expected :)

/**
    * This method extracts and collates the value list information
    * for custom column value lists.
    */
   private void processCustomValueLists() throws IOException
   {
      DirectoryEntry taskDir = (DirectoryEntry) m_projectDir.getEntry("TBkndTask");
      if (taskDir.hasEntry("Props"))
      {
         Props taskProps = new Props14(m_inputStreamFactory.getInstance(taskDir, "Props"));

         CustomFieldValueReader14 reader = new CustomFieldValueReader14(m_file.getProjectProperties(), m_file.getCustomFields(), m_outlineCodeVarMeta, m_outlineCodeVarData, m_outlineCodeFixedData, m_outlineCodeFixedData2, taskProps);
         reader.process();
      }
   }

Discussion

  • Markus Höger

    Markus Höger - 2021-05-11

    Simple testfile attached. (Created with MSP 2016)
    You can use the follwing code to reproduce the issue:

            net.sf.mpxj.mpp.MPPReader mppReader = new net.sf.mpxj.mpp.MPPReader();
            net.sf.mpxj.ProjectFile projectFile = mppReader.read(new java.io.File("Projekt1.mpp"));
    
            // Task:
            net.sf.mpxj.CustomField taskCfOutlineCode1 = projectFile.getCustomFields().getCustomField(TaskField.OUTLINE_CODE1);
            System.out.println(taskCfOutlineCode1.getLookupTable()); // Contains values [X, Y, Z] as expected.
    
            // Resource:
            net.sf.mpxj.CustomField resourceCfOutlineCode1 = projectFile.getCustomFields().getCustomField(ResourceField.OUTLINE_CODE1);
            System.out.println(resourceCfOutlineCode1.getLookupTable()); // Is empty, but should contain values [A, B, C].
    
     

    Last edit: Markus Höger 2021-05-11
  • Markus Höger

    Markus Höger - 2021-05-11

    Our workaround and possible fix:

    Add reading Probs of DirectoryEntry "TBkndRsc" to methods:

    • net.sf.mpxj.mpp.MPPReader14#processCustomValueLists
    • net.sf.mpxj.mpp.MPPReader12#processCustomValueLists

    analogous to "TBkndTask".

     
  • Jon Iles

    Jon Iles - 2021-05-23

    Hi, thanks for the suggestion. I've updated the code in git - hopefully this will now work as expected.

     
  • Jon Iles

    Jon Iles - 2021-05-23
    • status: open --> closed-fixed
     
  • Markus Höger

    Markus Höger - 2021-05-25

    Hi Jon!
    Thanks for fast reply and fixing.
    It works as expected now :)

     

Log in to post a comment.

MongoDB Logo MongoDB