Пример #1
0
 public boolean exportXDSI(XDSIModel xdsiModel) throws Exception {
   if (xdsiModel.getNumberOfInstances() < 1) {
     throw new IllegalArgumentException("No Instances selected!");
   }
   Collection items = getObserverContextItems(getAuthorPerson(xdsiModel.getUser()));
   Dataset rootInfo = getRootInfo(xdsiModel);
   List contentItems = getContentItems(xdsiModel);
   contentItems.addAll(items);
   try {
     Boolean b;
     if (!xdsiModel.isPdfExport()) {
       Dataset keyObjectDS = getKeyObject(xdsiModel.getInstances(), rootInfo, contentItems);
       b =
           (Boolean)
               server.invoke(
                   xdsiServiceName,
                   "sendSOAP",
                   new Object[] {keyObjectDS, xdsiModel.listMetadataProperties()},
                   new String[] {Dataset.class.getName(), Properties.class.getName()});
     } else {
       String docUID = (String) xdsiModel.getInstances().iterator().next();
       b =
           (Boolean)
               server.invoke(
                   xdsiServiceName,
                   "exportPDF",
                   new Object[] {docUID, xdsiModel.listMetadataProperties()},
                   new String[] {String.class.getName(), Properties.class.getName()});
     }
     return b.booleanValue();
   } catch (Exception e) {
     log.warn("Failed to export Selection:", e);
     throw e;
   }
 }
Пример #2
0
 public boolean createFolder(XDSIModel model) throws Exception {
   try {
     Boolean b =
         (Boolean)
             server.invoke(
                 xdsiServiceName,
                 "createFolder",
                 new Object[] {model.listMetadataProperties()},
                 new String[] {Properties.class.getName()});
     return b.booleanValue();
   } catch (Exception e) {
     log.warn("Failed to create Folder:", e);
     throw e;
   }
 }