/** * Constructor * * @param contentData The ContentData object this object wraps * @param property The property the ContentData is attached too */ public ScriptContentData(ContentData contentData, QName property) { this.contentData = contentData; this.property = property; this.isDirty = ContentData.hasContent(contentData); }
/** * Constructor * * @param contentData The ContentData object this object wraps * @param property The property the ContentData is attached too */ public ScriptContentData(ContentData contentData, QName property) { this.contentData = contentData; this.property = property; this.isDirty = ContentData.hasContent(contentData); }
@Override public void onContentPropertyUpdate(NodeRef nodeRef, QName propertyQName, ContentData beforeValue, ContentData afterValue) { boolean hasContentBefore = ContentData.hasContent(beforeValue) && beforeValue.getSize() > 0; boolean hasContentAfter = ContentData.hasContent(afterValue) && afterValue.getSize() > 0; // There are some shortcuts here if (!hasContentBefore && !hasContentAfter) { // Really, nothing happened return; } else if (EqualsHelper.nullSafeEquals(beforeValue, afterValue)) { // Still, nothing happening return; } eventsService.contentWrite(nodeRef, propertyQName, afterValue); }
@Override public void onContentPropertyUpdate(NodeRef nodeRef, QName propertyQName, ContentData beforeValue, ContentData afterValue) { boolean hasContentBefore = ContentData.hasContent(beforeValue) && beforeValue.getSize() > 0; boolean hasContentAfter = ContentData.hasContent(afterValue) && afterValue.getSize() > 0; // There are some shortcuts here if (!hasContentBefore && !hasContentAfter) { // Really, nothing happened return; } else if (EqualsHelper.nullSafeEquals(beforeValue, afterValue)) { // Still, nothing happening return; } eventsService.contentWrite(nodeRef, propertyQName, afterValue); }
ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value); if (ContentData.hasContent(contentData))
ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value); if (ContentData.hasContent(contentData))
if (!ContentData.hasContent(beforeContent) || beforeContent.getSize() == 0) if (!ContentData.hasContent(afterContent) || afterContent.getSize() == 0)
if (!ContentData.hasContent(beforeContent) || beforeContent.getSize() == 0) if (!ContentData.hasContent(afterContent) || afterContent.getSize() == 0)
boolean hasContentBefore = ContentData.hasContent(beforeValue) && (!ignoreEmptyContent || beforeValue.getSize() > 0); boolean hasContentAfter = ContentData.hasContent(afterValue) && (!ignoreEmptyContent || afterValue.getSize() > 0);
boolean hasContentBefore = ContentData.hasContent(beforeValue) && (!ignoreEmptyContent || beforeValue.getSize() > 0); boolean hasContentAfter = ContentData.hasContent(afterValue) && (!ignoreEmptyContent || afterValue.getSize() > 0);
Serializable value = this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT); ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value); if (!ContentData.hasContent(contentData))
Serializable value = this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT); ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value); if (!ContentData.hasContent(contentData))
contentData = (ContentData) NODE_SERVICE.getProperty(newNode1, ContentModel.PROP_CONTENT); assertNotNull(contentData); assertEquals(true, ContentData.hasContent(contentData));