Menu

#329 Issues with Importing MSPDI XML into Asta

v1.0_(example)
closed-fixed
Jon Iles
None
5
2018-10-23
2018-10-22
Dave McKay
No

Hi Jon,

I have a customer who needs to interface with Asta Powerpoint, and we've been exploring the best ways to do this. Importing .pp files using mpxj works great. I've come across some issues going the other way though, using Microsoft XML. Asta can be a bit picky, and is far from informative when it fails to import, but through trial-and-error I've indentified the following prerequisites:

  1. Base Calendars require an ID.
  2. Task Predecessors require lag details.
  3. Tasks require a Duration and a Duration format.
  4. Top-level Task Outline Numbers need to be unique.

I've attached potential patches to 7.7.0 which achieve the above, and we're good to go here so far. I haven't explored what implications exists for native users of the MSPDI output though, so it may be worth refactoring to allow finer control via a config option.

The most contentious patch is likely the one for Task.java. I could be wrong, but I think generateOutlineNumber() will always set the outline # to 0 for a top-level task: the Unique ID is never set at the point the method is called, and so will always be undefined (0).

Best regards,

Dave.

3 Attachments

Discussion

  • Jon Iles

    Jon Iles - 2018-10-22

    Thanks for the patches - just looking at them now. For the task change, I'm assuming you are providing your own unique ID. Can you revert the change you made to Task.java , and try calling:

    project.updateStructure();
    

    after you've finished creating the tasks. That should correctly generate the outline number for you.
    Alternatively you could turn off auto outline number generation:

    file.getProjectConfig().setAutoOutlineNumber(false);
    

    if Asta doesn't need the outline number values.

     
    • Dave McKay

      Dave McKay - 2018-10-22

      Cheers, Jon, updatestructure() is exactly what I'm after. Let's forget that Task.java patch!

       
  • Jon Iles

    Jon Iles - 2018-10-22

    I've messed around with the diff a bit, but functionally this should be the same. Can you take a look at https://github.com/joniles/mpxj/pull/69 and confirm if this works for you?

     
    • Dave McKay

      Dave McKay - 2018-10-22

      The revised MSPDIWriter patch is fine, but DatatypeConverter throws an exception:

      Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
         at net.sf.mpxj.mspdi.DatatypeConverter.printDurationTimeUnits(Duration duration, Boolean estimated)
         at net.sf.mpxj.mspdi.MSPDIWriter.writeTask(Task )
         at net.sf.mpxj.mspdi.MSPDIWriter.writeTasks(Project )
         at net.sf.mpxj.mspdi.MSPDIWriter.write(ProjectFile projectFile, OutputStream stream)
         at net.sf.mpxj.writer.AbstractProjectWriter.write(ProjectFile projectFile, String fileName)
      
       
  • Jon Iles

    Jon Iles - 2018-10-22

    Ah - that was half an edit. I've done the other half of the edit and updated the branch. Should work as expected now!

     
    • Dave McKay

      Dave McKay - 2018-10-23

      Still get the exception. PARENT_FILE is null. If I move the

      DatatypeConverter.setParentFile(m_projectFile);

      call northwards in the MSPDIWriter.write method, as per the attached patch, all is okay.

       

      Last edit: Dave McKay 2018-10-23
  • Jon Iles

    Jon Iles - 2018-10-23

    I really need a test case which exercises this! I'll look at the patch now.

     
  • Jon Iles

    Jon Iles - 2018-10-23

    OK, that's on the branch now. I'll publish a new release of MPXJ once you're happy with the change.

     
    • Dave McKay

      Dave McKay - 2018-10-23

      Good to go now with that last patch, Jon. Thanks.

       
  • Jon Iles

    Jon Iles - 2018-10-23
    • status: open --> closed-fixed
    • assigned_to: Jon Iles
     
  • Jon Iles

    Jon Iles - 2018-10-23

    Merged into master - thanks for the patch!

     

Log in to post a comment.

MongoDB Logo MongoDB