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; } }
/** * @param xdsiModel * @return */ private Dataset getRootInfo(XDSIModel xdsiModel) { Dataset rootInfo = DcmObjectFactory.getInstance().newDataset(); DcmElement sq = rootInfo.putSQ(Tags.ConceptNameCodeSeq); Dataset item = sq.addNewItem(); CodeItem selectedDocTitle = xdsiModel.selectedDocTitle(); item.putSH(Tags.CodeValue, selectedDocTitle.getCodeValue()); item.putSH(Tags.CodingSchemeDesignator, selectedDocTitle.getCodeDesignator()); item.putLO(Tags.CodeMeaning, selectedDocTitle.getCodeMeaning()); return rootInfo; }
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; } }