Re-import Imported Package

In the GUI, if you attempt to import an previously imported return package, the user is prompted to confirm this is what they intend, and the package is then re-imported. Is the same functionality available via the SDK? The regular `.ImportReturnPackage` method on a FileBasedProject doesn't seem to provide any options, and indeed only throws an InvalidOperationException later with the stack trace below. Is there another approach to importing that can be taken?

Is it possible to recreate the functionality exposed in the GUI via the SDK?

Stack Trace:
This property is only available once the package has been imported.
   at Sdl.ProjectApi.Implementation.PackageOperation.get_Files()
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.CreateReturnPackageImportObject(IReturnPackageImport rpi)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.ImportReturnPackage(String returnPackageFilePath, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
   at Sdl.ProjectAutomation.FileBased.FileBasedProject.ImportReturnPackage(String returnPackageFilePath)

Parents
  • Shaun,

    Thanks for raising this.  The exception thrown from project API implementation is a bug we are looking into fixing to ensure any exception as least contains useful information.  Additionally, the current API does not expose any option to control reimporting/processing of the return package.  SDL are also looking into adding this feature and I will feed back on this as the investigation continues.

    Regards, Ian

    Ian Davies  |  Senior Product Manager | SDL | Language Technologies Division |  +44 7826843819

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply
  • Shaun,

    Thanks for raising this.  The exception thrown from project API implementation is a bug we are looking into fixing to ensure any exception as least contains useful information.  Additionally, the current API does not expose any option to control reimporting/processing of the return package.  SDL are also looking into adding this feature and I will feed back on this as the investigation continues.

    Regards, Ian

    Ian Davies  |  Senior Product Manager | SDL | Language Technologies Division |  +44 7826843819

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Children