private void checkMimetype(ExtrinsicObjectType obj, String[] mimes) throws XDSException { String mime = obj.getMimeType(); boolean unknownMime = true; for (int j = 0; j < mimes.length ; j++) { if (mimes[j].equals(mime)) { unknownMime = false; break; } } if (unknownMime) { throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "Mimetype is not suppoerted! mimetype:"+mime, null); } }
boolean unsupportedMimetype = true; for (int j = 0 ; j < mimetypes.length ; j++) { if (mimetypes[j].equals(eo.getMimeType())) { unsupportedMimetype = false; break; throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Mimetype not supported:"+eo.getMimeType(), null); xdsDoc = (XDSDocument) ManagementFactory.getPlatformMBeanServer().invoke(new ObjectName("dcm4chee.xds2:service=Store"), "storeDocument", new Object[]{docUID, doc.getValue(), eo.getMimeType()}, new String[]{String.class.getName(), byte[].class.getName(), String.class.getName()}); if ( xdsDoc != null ) {
"DocumentEntry: Missing entryUUID attribute!", null); if (eoType.getMimeType() == null || eoType.getMimeType().trim().length() < 2) { throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "DocumentEntry: Missing mimeType attribute! ExtrinsicObject:"+eoType.getId(), null);
boolean unsupportedMimetype = true; for (int j = 0 ; j < mimetypes.length ; j++) { if (mimetypes[j].equals(eo.getMimeType())) { unsupportedMimetype = false; break; throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Mimetype not supported:"+eo.getMimeType(), null); storedDocs[i] = storage.storeDocument(groupID, docUID, doc.getValue(), eo.getMimeType()); if (storedDocs[i].isCommitted()) { log.warn("Document already exists! docUid:"+docUID);
public ExtrinsicObject toExtrinsicObject(ExtrinsicObjectType eoType) throws XDSException { ExtrinsicObject eo; XDSDocumentEntry doc = null; if (XDSConstants.UUID_XDSDocumentEntry.equals(eoType.getObjectType())) { XDSValidator.checkDocumentEntryMetadata(eoType); doc = new XDSDocumentEntry(); eo = doc; List<ExternalIdentifierType> list = eoType.getExternalIdentifier(); if (list != null) { for (ExternalIdentifierType eiType : list) { if (XDSConstants.UUID_XDSDocumentEntry_patientId.equals(eiType.getIdentificationScheme())) { doc.setPatient(getPatient(eiType)); } else if (XDSConstants.UUID_XDSDocumentEntry_uniqueId.equals(eiType.getIdentificationScheme())) { XDSValidator.checkAlreadyExists(eiType.getValue(), eoType, session); doc.setUniqueId(eiType.getValue()); } } } doc.setSourcePatient(getPatient(getSlotValue(eoType, XDSConstants.SLOT_NAME_SOURCE_PATIENT_ID), true)); } else { eo = new ExtrinsicObject(); } toPersistenceObj(eoType, eo); eo.setMimeType(eoType.getMimeType()); return eo; }