/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visitExtendedDocument(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedDocument) */ @Override protected void visitExtendedDocument(ExtendedDocument artifact) { //grab the content type from an any-attribute setContentType(MediaType.APPLICATION_OCTET_STREAM_TYPE); if ((artifact.getOtherAttributes().keySet().contains(SrampConstants.SRAMP_CONTENT_TYPE_QNAME))) { String contentTypeStr = artifact.getOtherAttributes().get(SrampConstants.SRAMP_CONTENT_TYPE_QNAME); if (contentTypeStr != null) { setContentType(MediaType.valueOf(contentTypeStr)); } } }
/** * @see org.overlord.sramp.common.visitors.HierarchicalArtifactVisitorAdapter#visitExtendedDocument(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedDocument) */ @Override protected void visitExtendedDocument(ExtendedDocument artifact) { String extendedType = getProperty(jcrNode, "sramp:extendedType"); //$NON-NLS-1$ String contentType = getProperty(jcrNode,"jcr:content/jcr:mimeType"); //$NON-NLS-1$ String contentLength = String.valueOf(getPropertyLength(jcrNode,"jcr:content/jcr:data")); //$NON-NLS-1$ artifact.setExtendedType(extendedType); if (contentType != null && contentLength != null) { artifact.getOtherAttributes().put(SrampConstants.SRAMP_CONTENT_SIZE_QNAME, contentLength); artifact.getOtherAttributes().put(SrampConstants.SRAMP_CONTENT_TYPE_QNAME, contentType); } }
/** * @see org.artificer.common.visitors.HierarchicalArtifactVisitor#visitExtendedDocument(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedDocument) */ @Override protected void visitExtendedDocument(ExtendedDocument artifact) { super.visitExtendedDocument(artifact); ArtificerDocumentArtifact artificerDocumentArtifact = (ArtificerDocumentArtifact) artificerArtifact; String extendedType = artificerDocumentArtifact.getType(); String contentType = artificerDocumentArtifact.getMimeType(); long contentLength = artificerDocumentArtifact.getContentSize(); artifact.setExtendedType(extendedType); if (contentType != null) { artifact.getOtherAttributes().put(ArtificerConstants.SRAMP_CONTENT_SIZE_QNAME, contentLength + ""); artifact.getOtherAttributes().put(ArtificerConstants.SRAMP_CONTENT_TYPE_QNAME, contentType); } }