Class EditorUtils
- java.lang.Object
-
- de.hybris.platform.integrationbackoffice.widgets.editor.utility.EditorUtils
-
public final class EditorUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<ComposedTypeModel,java.util.List<ListItemDTO>>convertIntegrationObjectToDTOMap(ReadService readService, IntegrationObjectModel integrationObject)Converts an integration object's contents to a map of lists of DTOsstatic IntegrationObjectModelcorrectRoot(IntegrationObjectModel selectedIO, java.lang.String rootCode)Corrects an IntegrationObject's root property which is located at the IntegrationObjectItemModel level.static org.zkoss.zul.ComboitemcreateComboItem(java.lang.String label, java.lang.Object value)static org.zkoss.zul.ListitemcreateListItem(ListItemDTO dto, boolean isComplex, java.util.List<java.lang.String> labels, boolean inEditMode)static org.zkoss.zul.MenupopupcreateMenuPopup(java.util.List<java.lang.String> labels)static org.zkoss.zul.TreeitemcreateTreeItem(TreeNodeData value, boolean expanded)static java.util.Set<AttributeDescriptorModel>filterAttributesForAttributesMap(ReadService readService, ComposedTypeModel parentType)Filters a set of attribute descriptors for types that are not on the blackliststatic java.util.Set<AttributeDescriptorModel>filterAttributesForTree(ReadService readService, ComposedTypeModel parentType)Filters a set of attribute descriptors for Composed and Enumeration types that are not on the blackliststatic ListItemStructureTypegetListItemStructureType(ReadService readService, AttributeDescriptorModel attributeDescriptor)Determines the structure type of the given AttributeDescriptorModelstatic java.lang.StringgetNameFromLabel(java.lang.String label)static IntegrationObjectItemModelgetRootIntegrationObjectItem(IntegrationObjectModel integrationObject)Determine the root ComposedType from a IntegrationObject's IntegrationObjectItems.static java.util.Set<AttributeDescriptorModel>getStructuredAttributes(java.util.List<ListItemDTO> dtoList)Gets the attribute descriptors of collection and map attributes from a list of DTOsstatic java.lang.StringgetTypeFromLabel(java.lang.String label)static booleanisInTreeChildren(java.lang.String label, org.zkoss.zul.Treechildren treechildren)static java.util.List<ListItemDTO>updateDTOs(java.util.List<ListItemDTO> oldDTOs, java.util.List<ListItemDTO> newDTOs)Updates attributes of a list of DTOs by getting the attributes of another list of DTOs
-
-
-
Method Detail
-
createComboItem
public static org.zkoss.zul.Comboitem createComboItem(java.lang.String label, java.lang.Object value)
-
createTreeItem
public static org.zkoss.zul.Treeitem createTreeItem(TreeNodeData value, boolean expanded)
-
createListItem
public static org.zkoss.zul.Listitem createListItem(ListItemDTO dto, boolean isComplex, java.util.List<java.lang.String> labels, boolean inEditMode)
-
createMenuPopup
public static org.zkoss.zul.Menupopup createMenuPopup(java.util.List<java.lang.String> labels)
-
getNameFromLabel
public static java.lang.String getNameFromLabel(java.lang.String label)
-
getTypeFromLabel
public static java.lang.String getTypeFromLabel(java.lang.String label)
-
isInTreeChildren
public static boolean isInTreeChildren(java.lang.String label, org.zkoss.zul.Treechildren treechildren)
-
getRootIntegrationObjectItem
public static IntegrationObjectItemModel getRootIntegrationObjectItem(IntegrationObjectModel integrationObject)
Determine the root ComposedType from a IntegrationObject's IntegrationObjectItems. The root is the IntegrationObjectItem which has no parent IntegrationObjectItem. Algorithm: every IntegrationObjectItem is also an IntegrationObjectItemAttribute with ReturnIntegrationObjectItem != null, except for the root.
-
filterAttributesForTree
public static java.util.Set<AttributeDescriptorModel> filterAttributesForTree(ReadService readService, ComposedTypeModel parentType)
Filters a set of attribute descriptors for Composed and Enumeration types that are not on the blacklist- Parameters:
readService- the IntegrationBackofficeReadService to read from the type systemparentType- the parent ComposedTypeModel to get the attribute descriptors to filter- Returns:
- a filtered set of AttributeDescriptorModel
-
filterAttributesForAttributesMap
public static java.util.Set<AttributeDescriptorModel> filterAttributesForAttributesMap(ReadService readService, ComposedTypeModel parentType)
Filters a set of attribute descriptors for types that are not on the blacklist- Parameters:
readService- the IntegrationBackofficeReadService to read from the type systemparentType- the parent ComposedTypeModel to get the attribute descriptors to filter- Returns:
- a filtered and sorted set of AttributeDescriptorModel
-
updateDTOs
public static java.util.List<ListItemDTO> updateDTOs(java.util.List<ListItemDTO> oldDTOs, java.util.List<ListItemDTO> newDTOs)
Updates attributes of a list of DTOs by getting the attributes of another list of DTOs- Parameters:
oldDTOs- a list of DTOs with attributes to updatenewDTOs- a list of DTOs containing updated attributes- Returns:
- a list of DTOs with updated attributes
-
convertIntegrationObjectToDTOMap
public static java.util.Map<ComposedTypeModel,java.util.List<ListItemDTO>> convertIntegrationObjectToDTOMap(ReadService readService, IntegrationObjectModel integrationObject)
Converts an integration object's contents to a map of lists of DTOs- Parameters:
readService- the ReadService to read from the type systemintegrationObject- an integration object to convert- Returns:
- a map of lists of DTOs
-
getListItemStructureType
public static ListItemStructureType getListItemStructureType(ReadService readService, AttributeDescriptorModel attributeDescriptor)
Determines the structure type of the given AttributeDescriptorModel- Parameters:
readService- the ReadService to read from the type systemattributeDescriptor- the AttributeDescriptor tp evaluate- Returns:
- The structure type of the currently evaluated AttributeDescriptor
-
getStructuredAttributes
public static java.util.Set<AttributeDescriptorModel> getStructuredAttributes(java.util.List<ListItemDTO> dtoList)
Gets the attribute descriptors of collection and map attributes from a list of DTOs- Parameters:
dtoList- a list of ListItemDTO- Returns:
- a set of AttributeDescriptorModel of CollectionType or MapType attributes
-
correctRoot
public static IntegrationObjectModel correctRoot(IntegrationObjectModel selectedIO, java.lang.String rootCode)
Corrects an IntegrationObject's root property which is located at the IntegrationObjectItemModel level. This method will set all other item's root boolean to false, except for the actual root.- Parameters:
selectedIO- Currently selected IO in the UIrootCode- Code of the root item- Returns:
- The same IO, but with root type property corrected to contain a single valid root
-
-