Class ItemImportController


  • @Controller
    @RequestMapping("/import/")
    public class ItemImportController
    extends java.lang.Object
    A REST resource for uploading and executing IMPEX files.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void importFromStream​(java.lang.String poolName, java.lang.Long publicationId, java.lang.String resultCallbackUrl, java.io.InputStream inputStream)
      Performs upload of an ImpEx file and import of the items containing in the file.
      protected byte[] inputStreamToByteArray​(java.io.InputStream inputStream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ItemImportController

        public ItemImportController()
    • Method Detail

      • importFromStream

        @RequestMapping(value="/pools/{poolName}/publications/{publicationId}",
                        method=PUT,
                        consumes="application/octet-stream",
                        produces={"application/json","application/xml"})
        @ResponseStatus(OK)
        public void importFromStream​(@PathVariable("poolName")
                                     java.lang.String poolName,
                                     @PathVariable("publicationId")
                                     java.lang.Long publicationId,
                                     @RequestHeader("Result-Callback-URL")
                                     java.lang.String resultCallbackUrl,
                                     java.io.InputStream inputStream)
                              throws java.io.IOException
        Performs upload of an ImpEx file and import of the items containing in the file.
        Parameters:
        poolName - pool whose items are being imported
        publicationId - the publicationId
        resultCallbackUrl - the callback URL to use when returning the ItemImportResult
        inputStream - input stream to the impex script
        Throws:
        java.io.IOException
      • inputStreamToByteArray

        protected byte[] inputStreamToByteArray​(java.io.InputStream inputStream)
                                         throws java.io.IOException
        Throws:
        java.io.IOException