public class DiffDisplayServiceImpl extends DefaultComponent implements DiffDisplayService
DiffDisplayService
.lastModified
Constructor and Description |
---|
DiffDisplayServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
getBooleanProperty(WidgetDefinition wDef,
String mode,
String property) |
protected PropertyDiffDisplay |
getComplexListFieldDiffDisplay(List<Serializable> listProperty,
List<Integer> listPropertyIndexes,
ListPropertyDiff listPropertyDiff,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes,
String styleClass) |
protected PropertyDiffDisplay |
getComplexListXPaths(String propertyName,
List<Integer> listPropertyIndexes,
ListPropertyDiff listPropertyDiff,
List<Serializable> leftListProperty,
List<Serializable> rightListProperty,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes) |
protected Map<String,Serializable> |
getComplexProperty(Serializable property)
Casts a
Serializable property to Map . |
protected Map<String,Serializable> |
getComplexPropertyIfNotNull(Serializable property)
Gets the complex property if the
property is not null. |
protected WidgetDefinition[] |
getComplexSubWidgetDefinitions(String category,
String propertyName,
Field field,
List<DiffFieldItemDefinition> complexFieldItemDefs,
boolean isDisplayItemIndexes,
boolean isContentDiffLinks) |
protected List<DiffBlockDefinition> |
getDefaultDiffBlockDefinitions(DocumentDiff docDiff) |
List<DiffDisplayBlock> |
getDefaultDiffDisplayBlocks(DocumentDiff docDiff,
DocumentModel leftDoc,
DocumentModel rightDoc) |
DiffBlockDefinition |
getDiffBlockDefinition(String name) |
Map<String,DiffBlockDefinition> |
getDiffBlockDefinitions() |
protected List<DiffBlockDefinition> |
getDiffBlockDefinitions(List<String> diffBlockRefs) |
protected List<String> |
getDiffBlockRefs(List<DiffBlockReferenceDescriptor> diffBlocks) |
DiffComplexFieldDefinition |
getDiffComplexField(String schemaName,
String fieldName) |
List<DiffComplexFieldDefinition> |
getDiffComplexFields() |
List<String> |
getDiffDisplay(String docType) |
protected DiffDisplayBlock |
getDiffDisplayBlock(DiffBlockDefinition diffBlockDefinition,
DocumentDiff docDiff,
DocumentModel leftDoc,
DocumentModel rightDoc) |
List<DiffDisplayBlock> |
getDiffDisplayBlocks(DocumentDiff docDiff,
DocumentModel leftDoc,
DocumentModel rightDoc) |
protected List<DiffDisplayBlock> |
getDiffDisplayBlocks(List<DiffBlockDefinition> diffBlockDefinitions,
DocumentDiff docDiff,
DocumentModel leftDoc,
DocumentModel rightDoc) |
Map<String,List<String>> |
getDiffDisplays() |
protected List<String> |
getDiffExcludedFieldRefs(List<DiffFieldDescriptor> diffExcludedFields) |
List<String> |
getDiffExcludedFields(String schemaName) |
Map<String,List<String>> |
getDiffExcludedSchemas() |
protected String |
getFieldDefinition(String fieldName,
String subPropertyName) |
protected PropertyDiffDisplay |
getFieldDiffDisplay(Serializable property,
PropertyDiff propertyDiff,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes,
boolean mustApplyStyleClass,
String styleClass) |
protected PropertyDiffDisplay |
getFieldXPaths(String propertyName,
PropertyDiff propertyDiff,
Serializable leftProperty,
Serializable rightProperty,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes,
List<DiffFieldItemDefinition> complexFieldItemDefs) |
protected PropertyDiffDisplay |
getFinalFieldDiffDisplay(Serializable fieldDiffDisplay,
PropertyDiff propertyDiff,
boolean mustApplyStyleClass,
String styleClass) |
protected WidgetDefinition |
getIndexSubwidgetDefinition() |
protected LayoutStore |
getLayoutStore()
Gets the layout store service.
|
protected PropertyDiffDisplay |
getListFieldDiffDisplay(List<Serializable> listProperty,
ListPropertyDiff listPropertyDiff,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes,
String styleClass)
Gets the list field diff display.
|
protected List<Serializable> |
getListProperty(Serializable property)
Casts or convert a
Serializable property to . |
protected List<Serializable> |
getListPropertyIfNotNull(Serializable property)
Gets the list property if the
property is not null. |
protected List<String> |
getNearestSuperTypeDiffDisplay(String docTypeName) |
protected List<String> |
getNearestSuperTypeDiffDisplay(String leftDocTypeName,
String rightDocTypeName) |
protected String |
getPropertyField(String propertyName) |
protected String |
getPropertyLabel(String propertyName) |
protected String |
getPropertyName(String schema,
String field)
Gets the property name.
|
protected String |
getPropertySchema(String propertyName) |
protected SchemaManager |
getSchemaManager()
Gets the schema manager.
|
protected String |
getSubPropertyFullName(String basePropertyName,
String subPropertyName) |
protected WidgetDefinition[] |
getSubWidgetDefinitions(String category,
String propertyName,
String propertyType,
Field field,
List<DiffFieldItemDefinition> complexFieldItemDefs,
boolean isDisplayItemIndexes,
boolean isContentDiffLinks) |
protected WidgetDefinition |
getWidgetDefinition(String category,
String propertyName,
String propertyType,
Field field,
List<DiffFieldItemDefinition> complexFieldItemDefs,
boolean isContentDiffLinksWidget) |
protected WidgetDefinition[] |
initSubWidgetDefinitions(boolean isDisplayItemIndexes,
int subWidgetCount) |
protected boolean |
isComplexType(Serializable property) |
protected boolean |
isDisplayAllItems(WidgetDefinition wDef) |
protected boolean |
isDisplayItemIndexes(WidgetDefinition wDef) |
protected boolean |
isFieldDefinitions(WidgetDefinition wDef) |
protected boolean |
isFieldDiffSignificant(Serializable leftProperty,
Serializable rightProperty)
Checks if the difference between the two specified properties is significant.
|
protected boolean |
isListType(Serializable property) |
protected boolean |
isSubWidgets(WidgetDefinition wDef) |
protected void |
putMimeTypeDiffDisplay(String schemaName,
String fieldName,
Map<String,PropertyDiffDisplay> schemaMap,
DocumentModel doc) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
registerDiffBlock(DiffBlockDescriptor descriptor) |
protected void |
registerDiffComplexField(DiffComplexFieldDescriptor descriptor)
Registers a diff complex field contrib.
|
protected void |
registerDiffDisplay(DiffDisplayDescriptor descriptor)
Registers a diff display contrib.
|
protected void |
registerDiffExcludedFields(DiffExcludedFieldsDescriptor descriptor)
Registers a diff excluded fields contrib.
|
protected void |
setComplexPropertyXPaths(Map<String,Serializable> complexPropertyXPaths,
String complexFieldItemName,
String subPropertyFullName,
Map<String,PropertyDiff> complexPropertyDiffMap,
Map<String,Serializable> leftComplexProperty,
Map<String,Serializable> rightComplexProperty,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes)
Sets the complex property xpaths.
|
protected void |
setFieldDiffDisplay(Serializable property,
PropertyDiff fieldDiff,
boolean isDisplayAllItems,
boolean isDisplayItemIndexes,
Map<String,Map<String,PropertyDiffDisplay>> value,
String schemaName,
String fieldName,
DocumentModel doc,
String styleClass)
Sets the field diff display.
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtension
protected static final String DIFF_DISPLAY_EXTENSION_POINT
protected static final String DIFF_DEFAULT_DISPLAY_EXTENSION_POINT
protected static final String DIFF_BLOCK_EXTENSION_POINT
protected static final String DIFF_WIDGET_CATEGORY
protected static final String DIFF_BLOCK_DEFAULT_TEMPLATE_PATH
protected static final String DIFF_BLOCK_LABEL_PROPERTY_NAME
protected static final String DIFF_BLOCK_DEFAULT_LABEL_PREFIX
protected static final String DIFF_WIDGET_LABEL_PREFIX
protected static final String CONTENT_DIFF_LINKS_WIDGET_NAME
protected static final String CONTENT_DIFF_LINKS_WIDGET_NAME_SUFFIX
protected static final String DIFF_WIDGET_FIELD_DEFINITION_VALUE
protected static final String DIFF_WIDGET_FIELD_DEFINITION_DIFFERENCE_TYPE
protected static final String DIFF_WIDGET_FIELD_DEFINITION_STYLE_CLASS
protected static final String DIFF_WIDGET_FIELD_DEFINITION_FILENAME
protected static final String DIFF_WIDGET_FIELD_DEFINITION_DISPLAY_HTML_CONVERSION
protected static final String DIFF_WIDGET_FIELD_DEFINITION_DISPLAY_TEXT_CONVERSION
protected static final String DIFF_WIDGET_PROPERTY_DISPLAY_ALL_ITEMS
protected static final String DIFF_WIDGET_PROPERTY_DISPLAY_ITEM_INDEXES
protected static final String DIFF_LIST_WIDGET_INDEX_SUBWIDGET_FIELD
protected static final String DIFF_LIST_WIDGET_INDEX_SUBWIDGET_TYPE
protected static final String DIFF_LIST_WIDGET_INDEX_SUBWIDGET_LABEL
protected static final String DIFF_LIST_WIDGET_VALUE_SUBWIDGET_FIELD
protected Map<String,List<String>> diffExcludedFieldsContribs
protected Map<String,Map<String,DiffComplexFieldDefinition>> diffComplexFieldsContribs
protected Map<String,List<String>> diffDisplayContribs
protected Map<String,DiffBlockDefinition> diffBlockContribs
public DiffDisplayServiceImpl()
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public Map<String,List<String>> getDiffExcludedSchemas()
getDiffExcludedSchemas
in interface DiffDisplayService
public List<String> getDiffExcludedFields(String schemaName)
getDiffExcludedFields
in interface DiffDisplayService
public List<DiffComplexFieldDefinition> getDiffComplexFields()
getDiffComplexFields
in interface DiffDisplayService
public DiffComplexFieldDefinition getDiffComplexField(String schemaName, String fieldName)
getDiffComplexField
in interface DiffDisplayService
public Map<String,List<String>> getDiffDisplays()
getDiffDisplays
in interface DiffDisplayService
public List<String> getDiffDisplay(String docType)
getDiffDisplay
in interface DiffDisplayService
public Map<String,DiffBlockDefinition> getDiffBlockDefinitions()
getDiffBlockDefinitions
in interface DiffDisplayService
public DiffBlockDefinition getDiffBlockDefinition(String name)
getDiffBlockDefinition
in interface DiffDisplayService
public List<DiffDisplayBlock> getDiffDisplayBlocks(DocumentDiff docDiff, DocumentModel leftDoc, DocumentModel rightDoc)
getDiffDisplayBlocks
in interface DiffDisplayService
public List<DiffDisplayBlock> getDefaultDiffDisplayBlocks(DocumentDiff docDiff, DocumentModel leftDoc, DocumentModel rightDoc)
protected List<String> getNearestSuperTypeDiffDisplay(String docTypeName)
protected List<String> getNearestSuperTypeDiffDisplay(String leftDocTypeName, String rightDocTypeName)
protected final void registerDiffExcludedFields(DiffExcludedFieldsDescriptor descriptor)
protected final void registerDiffComplexField(DiffComplexFieldDescriptor descriptor)
protected final void registerDiffDisplay(DiffDisplayDescriptor descriptor)
contribution
- the contributionprotected final List<String> getDiffBlockRefs(List<DiffBlockReferenceDescriptor> diffBlocks)
protected final List<String> getDiffExcludedFieldRefs(List<DiffFieldDescriptor> diffExcludedFields)
protected final void registerDiffBlock(DiffBlockDescriptor descriptor)
protected final List<DiffBlockDefinition> getDefaultDiffBlockDefinitions(DocumentDiff docDiff)
protected final List<DiffBlockDefinition> getDiffBlockDefinitions(List<String> diffBlockRefs)
protected final List<DiffDisplayBlock> getDiffDisplayBlocks(List<DiffBlockDefinition> diffBlockDefinitions, DocumentDiff docDiff, DocumentModel leftDoc, DocumentModel rightDoc)
protected final DiffDisplayBlock getDiffDisplayBlock(DiffBlockDefinition diffBlockDefinition, DocumentDiff docDiff, DocumentModel leftDoc, DocumentModel rightDoc)
protected boolean isFieldDiffSignificant(Serializable leftProperty, Serializable rightProperty)
For example in the case of a date property, checks if the difference is greater than 1 minute since we don't display seconds in the default date widget.
protected final boolean isDisplayAllItems(WidgetDefinition wDef)
protected final boolean isDisplayItemIndexes(WidgetDefinition wDef)
protected final boolean getBooleanProperty(WidgetDefinition wDef, String mode, String property)
protected void setFieldDiffDisplay(Serializable property, PropertyDiff fieldDiff, boolean isDisplayAllItems, boolean isDisplayItemIndexes, Map<String,Map<String,PropertyDiffDisplay>> value, String schemaName, String fieldName, DocumentModel doc, String styleClass)
property
- the propertyfieldDiff
- the field diffisDisplayAllItems
- the is display all itemsisDisplayItemIndexes
- the is display item indexesvalue
- the valueschemaName
- the schema namefieldName
- the field namedoc
- the docstyleClass
- the style classprotected final void putMimeTypeDiffDisplay(String schemaName, String fieldName, Map<String,PropertyDiffDisplay> schemaMap, DocumentModel doc)
protected final PropertyDiffDisplay getFieldDiffDisplay(Serializable property, PropertyDiff propertyDiff, boolean isDisplayAllItems, boolean isDisplayItemIndexes, boolean mustApplyStyleClass, String styleClass)
protected final PropertyDiffDisplay getFinalFieldDiffDisplay(Serializable fieldDiffDisplay, PropertyDiff propertyDiff, boolean mustApplyStyleClass, String styleClass)
protected final PropertyDiffDisplay getListFieldDiffDisplay(List<Serializable> listProperty, ListPropertyDiff listPropertyDiff, boolean isDisplayAllItems, boolean isDisplayItemIndexes, String styleClass)
listProperty
- the list propertylistPropertyDiff
- the list property diffisDisplayAllItems
- the is display all itemsisDisplayItemIndexes
- the is display item indexesstyleClass
- the style classprotected final PropertyDiffDisplay getComplexListFieldDiffDisplay(List<Serializable> listProperty, List<Integer> listPropertyIndexes, ListPropertyDiff listPropertyDiff, boolean isDisplayAllItems, boolean isDisplayItemIndexes, String styleClass)
protected final PropertyDiffDisplay getFieldXPaths(String propertyName, PropertyDiff propertyDiff, Serializable leftProperty, Serializable rightProperty, boolean isDisplayAllItems, boolean isDisplayItemIndexes, List<DiffFieldItemDefinition> complexFieldItemDefs)
protected final PropertyDiffDisplay getComplexListXPaths(String propertyName, List<Integer> listPropertyIndexes, ListPropertyDiff listPropertyDiff, List<Serializable> leftListProperty, List<Serializable> rightListProperty, boolean isDisplayAllItems, boolean isDisplayItemIndexes)
protected void setComplexPropertyXPaths(Map<String,Serializable> complexPropertyXPaths, String complexFieldItemName, String subPropertyFullName, Map<String,PropertyDiff> complexPropertyDiffMap, Map<String,Serializable> leftComplexProperty, Map<String,Serializable> rightComplexProperty, boolean isDisplayAllItems, boolean isDisplayItemIndexes)
complexPropertyXPaths
- the complex property xpathscomplexFieldItemName
- the complex field item namesubPropertyFullName
- the sub property full namecomplexPropertyDiffMap
- the complex property diff mapleftComplexProperty
- the left complex propertyrightComplexProperty
- the right complex propertyisDisplayAllItems
- the is display all itemsisDisplayItemIndexes
- the is display item indexesprotected boolean isListType(Serializable property)
protected boolean isComplexType(Serializable property)
protected List<Serializable> getListProperty(Serializable property)
Serializable
property to
.property
- the propertyClassCastException
- if the property
is not a
nor an array.protected List<Serializable> getListPropertyIfNotNull(Serializable property)
property
is not null.property
- the propertyproperty
is not null, null otherwiseNuxeoException
- if the property
is not a list.protected Map<String,Serializable> getComplexProperty(Serializable property)
Serializable
property to Map
.property
- the propertyClassCastException
- if the property
is not a
.protected Map<String,Serializable> getComplexPropertyIfNotNull(Serializable property)
property
is not null.property
- the propertyproperty
is not null, null otherwiseNuxeoException
- if the property
is not a list.protected final WidgetDefinition getWidgetDefinition(String category, String propertyName, String propertyType, Field field, List<DiffFieldItemDefinition> complexFieldItemDefs, boolean isContentDiffLinksWidget)
protected final boolean isSubWidgets(WidgetDefinition wDef)
protected final boolean isFieldDefinitions(WidgetDefinition wDef)
protected final String getFieldDefinition(String fieldName, String subPropertyName)
protected final WidgetDefinition[] getSubWidgetDefinitions(String category, String propertyName, String propertyType, Field field, List<DiffFieldItemDefinition> complexFieldItemDefs, boolean isDisplayItemIndexes, boolean isContentDiffLinks)
protected final WidgetDefinition[] getComplexSubWidgetDefinitions(String category, String propertyName, Field field, List<DiffFieldItemDefinition> complexFieldItemDefs, boolean isDisplayItemIndexes, boolean isContentDiffLinks)
protected final WidgetDefinition[] initSubWidgetDefinitions(boolean isDisplayItemIndexes, int subWidgetCount)
protected final WidgetDefinition getIndexSubwidgetDefinition()
protected final String getPropertyName(String schema, String field)
schema
- the schemafield
- the fieldprotected final String getSubPropertyFullName(String basePropertyName, String subPropertyName)
protected final String getPropertySchema(String propertyName)
protected final String getPropertyField(String propertyName)
protected final String getPropertyLabel(String propertyName)
protected final SchemaManager getSchemaManager()
protected final LayoutStore getLayoutStore()
Copyright © 2015 Nuxeo SA. All rights reserved.