@Override public Rendition convertRendition(String objectId, RenditionData rendition) { if (rendition == null) { throw new IllegalArgumentException("Rendition must be set!"); } long length = (rendition.getBigLength() == null ? -1 : rendition.getBigLength().longValue()); int height = (rendition.getBigHeight() == null ? -1 : rendition.getBigHeight().intValue()); int width = (rendition.getBigWidth() == null ? -1 : rendition.getBigWidth().intValue()); return new RenditionImpl(this.session, objectId, rendition.getStreamId(), rendition.getRenditionDocumentId(), rendition.getKind(), length, rendition.getMimeType(), rendition.getTitle(), height, width); }
@Override public Rendition convertRendition(String objectId, RenditionData rendition) { if (rendition == null) { throw new IllegalArgumentException("Rendition must be set!"); } long length = (rendition.getBigLength() == null ? -1 : rendition.getBigLength().longValue()); int height = (rendition.getBigHeight() == null ? -1 : rendition.getBigHeight().intValue()); int width = (rendition.getBigWidth() == null ? -1 : rendition.getBigWidth().intValue()); return new RenditionImpl(this.session, objectId, rendition.getStreamId(), rendition.getRenditionDocumentId(), rendition.getKind(), length, rendition.getMimeType(), rendition.getTitle(), height, width); }
renditionInfo.setContentType(renditionData.getMimeType()); renditionInfo.setKind(renditionData.getKind()); renditionInfo.setId(renditionData.getStreamId()); result.add(renditionData); renditionInfos.add(renditionInfo);
writer.writeStartElement(PREFIX_CMIS, TAG_OBJECT_RENDITION, NAMESPACE_CMIS); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_STREAM_ID, rend.getStreamId()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_MIMETYPE, rend.getMimeType()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_LENGTH, rend.getBigLength());
/** * Converts a rendition object. */ public static CmisRenditionType convert(RenditionData rendition) { if (rendition == null) { return null; } CmisRenditionType result = new CmisRenditionType(); result.setHeight(rendition.getBigHeight()); result.setKind(rendition.getKind()); result.setLength(rendition.getBigLength()); result.setMimetype(rendition.getMimeType()); result.setRenditionDocumentId(rendition.getRenditionDocumentId()); result.setStreamId(rendition.getStreamId()); result.setTitle(rendition.getTitle()); result.setWidth(rendition.getBigWidth()); // handle extensions convertExtension(rendition, result); return result; }
/** * Converts a rendition. */ public static JSONObject convert(final RenditionData rendition) { if (rendition == null) { return null; } JSONObject result = new JSONObject(); result.put(JSON_RENDITION_STREAM_ID, rendition.getStreamId()); result.put(JSON_RENDITION_MIMETYPE, rendition.getMimeType()); result.put(JSON_RENDITION_LENGTH, rendition.getBigLength()); result.put(JSON_RENDITION_KIND, rendition.getKind()); setIfNotNull(JSON_RENDITION_TITLE, rendition.getTitle(), result); setIfNotNull(JSON_RENDITION_HEIGHT, rendition.getBigHeight(), result); setIfNotNull(JSON_RENDITION_WIDTH, rendition.getBigWidth(), result); setIfNotNull(JSON_RENDITION_DOCUMENT_ID, rendition.getRenditionDocumentId(), result); convertExtension(rendition, result); return result; }
for (RenditionData rendition : renditions) { RenditionInfoImpl renditionInfo = new RenditionInfoImpl(); renditionInfo.setId(rendition.getStreamId()); renditionInfo.setKind(rendition.getKind()); renditionInfo.setContentType(rendition.getMimeType());
/** * Converts a rendition. */ public static JSONObject convert(final RenditionData rendition) { if (rendition == null) { return null; } JSONObject result = new JSONObject(); result.put(JSON_RENDITION_STREAM_ID, rendition.getStreamId()); result.put(JSON_RENDITION_MIMETYPE, rendition.getMimeType()); result.put(JSON_RENDITION_LENGTH, rendition.getBigLength()); result.put(JSON_RENDITION_KIND, rendition.getKind()); setIfNotNull(JSON_RENDITION_TITLE, rendition.getTitle(), result); setIfNotNull(JSON_RENDITION_HEIGHT, rendition.getBigHeight(), result); setIfNotNull(JSON_RENDITION_WIDTH, rendition.getBigWidth(), result); setIfNotNull(JSON_RENDITION_DOCUMENT_ID, rendition.getRenditionDocumentId(), result); convertExtension(rendition, result); return result; }
for (RenditionData rendition : renditions) { RenditionInfoImpl renditionInfo = new RenditionInfoImpl(); renditionInfo.setId(rendition.getStreamId()); renditionInfo.setKind(rendition.getKind()); renditionInfo.setContentType(rendition.getMimeType());
writer.startTag(NAMESPACE_CMIS, TAG_OBJECT_RENDITION); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_STREAM_ID, rend.getStreamId()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_MIMETYPE, rend.getMimeType()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_LENGTH, rend.getBigLength());
renditionInfo.setId(rendition.getStreamId()); renditionInfo.setKind(rendition.getKind()); renditionInfo.setContentType(rendition.getMimeType());
renditionInfo.setId(rendition.getStreamId()); renditionInfo.setKind(rendition.getKind()); renditionInfo.setContentType(rendition.getMimeType());