@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); }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_TITLE, rend.getTitle()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_HEIGHT, rend.getBigHeight()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_WIDTH, rend.getBigWidth()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_DOCUMENT_ID, rend.getRenditionDocumentId());
/** * 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; }
/** * 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; }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_TITLE, rend.getTitle()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_HEIGHT, rend.getBigHeight()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_WIDTH, rend.getBigWidth()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_RENDITION_DOCUMENT_ID, rend.getRenditionDocumentId());