Class EditContentTypeInformationHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contenttypeseditor.edition.EditContentTypeInformationHelper
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class EditContentTypeInformationHelper extends AbstractLogEnabled implements Component, Serviceable
This component propose method for helping to create and edit a content type
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_ametysObjectResolver
The ametys object resolver instanceprotected ContentAttributeTypeExtensionPoint
_contentAttributeTypeExtensionPoint
The extension point for available attribute typesprotected ContentTypeExtensionPoint
_contentTypeExtensionPoint
The content type extension point instanceprotected ContentTypeInformationsHelper
_contentTypeInformationHelper
The content type extension point instanceprotected ContentTypesHelper
_contentTypesHelper
The content type helperprotected ContentTypeStateComponent
_contentTypeStateComponent
The content type state component instanceprotected I18nUtils
_i18nUtils
The i18nUtils instanceprivate Collection<Map<String,Object>>
_newCategories
protected RightsExtensionPoint
_rightsExtensionPoint
The right extension point instanceprotected WidgetsManager
_widgetsManager
The widgets managerstatic String
ROLE
The Avalon role name
-
Constructor Summary
Constructors Constructor Description EditContentTypeInformationHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<Map<String,Object>>
_getModelItemsNames(Collection<? extends ModelItem> modelItems)
private Collection<Map<String,String>>
_getModelItemsPaths(Collection<? extends ModelItem> modelItems)
private Collection<Map<String,String>>
_getParentReferenceModelItems(Collection<? extends ModelItem> modelItems)
private Collection<Map<String,String>>
_getParentReferenceRecoverModelItems(Object recoverModelItem)
private Map<String,String>
_toMap(String name)
void
addNewCategory(Map<String,Object> newCategory)
Add a new category to list of new categoryboolean
areContentTypesCompatible(List<String> contentTypeIds)
Determine if content types are compatibleCollection<Map<String,Object>>
getAttributeNames(String contentTypeId)
Retrieves model item names of a content typeCollection<Map<String,String>>
getAttributePaths(String contentTypeId)
Get model items paths of the given content typeCollection<Map<String,String>>
getAttributeType()
Retrieves attribute typesCollection<Map<String,Object>>
getCategories()
Get all categories and categories created with the content type editorMap<String,Object>
getContentTypeInfos(List<Map<String,String>> superTypesIds)
Retrieve content type informationsList<String>
getInvalidContent(String contentTypeId, String mandatoryAttributeName)
Get invalid content if the attribute argument becomes mandatoryCollection<Map<String,String>>
getParentReferenceAttributes(String contentTypeId, List<String> superTypesIds, Object recoverAttributeList)
Get all attributes which can be parent referenceCollection<Map<String,String>>
getPluginNames()
Get names of active pluginsprivate Map<String,Object>
getView(String name, String iconGlyph)
Collection<Map<String,String>>
getWidgets()
Get all default widgetboolean
isEditableContentType(String contentTypeId)
Check if a content type is editableboolean
isExistingContentType(String contentTypeId)
Get if a content type existsvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
The content type helper
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
The content type extension point instance
-
_contentAttributeTypeExtensionPoint
protected ContentAttributeTypeExtensionPoint _contentAttributeTypeExtensionPoint
The extension point for available attribute types
-
_contentTypeInformationHelper
protected ContentTypeInformationsHelper _contentTypeInformationHelper
The content type extension point instance
-
_contentTypeStateComponent
protected ContentTypeStateComponent _contentTypeStateComponent
The content type state component instance
-
_rightsExtensionPoint
protected RightsExtensionPoint _rightsExtensionPoint
The right extension point instance
-
_i18nUtils
protected I18nUtils _i18nUtils
The i18nUtils instance
-
_ametysObjectResolver
protected AmetysObjectResolver _ametysObjectResolver
The ametys object resolver instance
-
_widgetsManager
protected WidgetsManager _widgetsManager
The widgets manager
-
_newCategories
private Collection<Map<String,Object>> _newCategories
-
-
Constructor Detail
-
EditContentTypeInformationHelper
public EditContentTypeInformationHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
areContentTypesCompatible
public boolean areContentTypesCompatible(List<String> contentTypeIds)
Determine if content types are compatible- Parameters:
contentTypeIds
- Ids of content types- Returns:
- True if content types are compatible
-
getPluginNames
public Collection<Map<String,String>> getPluginNames()
Get names of active plugins- Returns:
- Names of active plugins
-
getContentTypeInfos
public Map<String,Object> getContentTypeInfos(List<Map<String,String>> superTypesIds)
Retrieve content type informations- Parameters:
superTypesIds
- Ids of super content types- Returns:
- Content type informations : attributes of super content types and default views
-
getCategories
public Collection<Map<String,Object>> getCategories()
Get all categories and categories created with the content type editor- Returns:
- All categories
-
getAttributeType
public Collection<Map<String,String>> getAttributeType()
Retrieves attribute types- Returns:
- Existing attribute types
-
getAttributePaths
public Collection<Map<String,String>> getAttributePaths(String contentTypeId)
Get model items paths of the given content type- Parameters:
contentTypeId
- the content type's identifier- Returns:
- The model items paths of the given content type
-
_getModelItemsPaths
private Collection<Map<String,String>> _getModelItemsPaths(Collection<? extends ModelItem> modelItems)
-
getAttributeNames
public Collection<Map<String,Object>> getAttributeNames(String contentTypeId)
Retrieves model item names of a content type- Parameters:
contentTypeId
- The id of content type- Returns:
- Model item names of content type
-
_getModelItemsNames
private Collection<Map<String,Object>> _getModelItemsNames(Collection<? extends ModelItem> modelItems)
-
addNewCategory
public void addNewCategory(Map<String,Object> newCategory)
Add a new category to list of new category- Parameters:
newCategory
- The new category
-
isEditableContentType
public boolean isEditableContentType(String contentTypeId)
Check if a content type is editable- Parameters:
contentTypeId
- Id of content type- Returns:
- True if the content type is editable
-
getParentReferenceAttributes
public Collection<Map<String,String>> getParentReferenceAttributes(String contentTypeId, List<String> superTypesIds, Object recoverAttributeList)
Get all attributes which can be parent reference- Parameters:
contentTypeId
- The content type idsuperTypesIds
- Supertype of content typerecoverAttributeList
- Updated attributes of content type- Returns:
- all attributes which can be parent reference
-
_getParentReferenceRecoverModelItems
private Collection<Map<String,String>> _getParentReferenceRecoverModelItems(Object recoverModelItem)
-
_getParentReferenceModelItems
private Collection<Map<String,String>> _getParentReferenceModelItems(Collection<? extends ModelItem> modelItems)
-
getInvalidContent
public List<String> getInvalidContent(String contentTypeId, String mandatoryAttributeName)
Get invalid content if the attribute argument becomes mandatory- Parameters:
contentTypeId
- The id of content typemandatoryAttributeName
- The name of the attribute- Returns:
- a list with invalid content names
-
getWidgets
public Collection<Map<String,String>> getWidgets()
Get all default widget- Returns:
- All Default widget
-
isExistingContentType
public boolean isExistingContentType(String contentTypeId)
Get if a content type exists- Parameters:
contentTypeId
- The id of content type- Returns:
- True if the content type id exists
-
-