Class ContentTypeInformationsHelper
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.contenttypeseditor.ContentTypeInformationsHelper
-
- All Implemented Interfaces:
PluginAware
,Component
,LogEnabled
,Serviceable
public class ContentTypeInformationsHelper extends AbstractLogEnabled implements Component, Serviceable, PluginAware
Helper to retrieve content type infos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContentTypeInformationsHelper.ContentTypeAttributeDataType
Enumeration of metadata type
-
Field Summary
Fields Modifier and Type Field Description (package private) Map<String,Language>
_availableLanguages
protected ContentTypeExtensionPoint
_contentTypeExtensionPoint
The content type extension point instanceprotected I18nUtils
_i18nUtils
Utility methods helping the management of internationalizable textprotected LanguagesManager
_langageManager
The langage manager instanceprivate String
_pluginName
protected RightsExtensionPoint
_rightsExtensionPoint
The rights extension point instancestatic String
ROLE
The Avalon role name
-
Constructor Summary
Constructors Constructor Description ContentTypeInformationsHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<String>
_getAttributeNames(Collection<? extends ModelItem> modelItems)
private String
_getConfiguration(Configuration configuration)
private Map<String,Object>
_getContentValues(ContentAttributeDefinition definition)
private Map<String,Object>
_getElementDefinitionValues(ElementDefinition definition, boolean resolveMultilingualString)
private List<Map<String,Object>>
_getEnhancedEnumerators(ElementDefinition definition)
private Map<String,Object>
_getIndexingFieldDetails(IndexingField indexingField)
private List<String>
_getIndexingFieldPath(IndexingField indexingField)
private I18nizableText
_getIndexingFieldType(IndexingField indexingField)
private List<Map<String,Object>>
_getIndexingModel(ContentType cType)
private Map<String,Object>
_getModelItemValues(ContentType contentType, ModelItem modelItem, boolean resolveMultilingualString)
private Map<String,Object>
_getModelViewItemValues(ContentType contentType, ModelViewItem modelViewItem, boolean hideInheritedModelItems, boolean resolveMultilingualString)
private Map<String,Object>
_getRepeaterValues(RepeaterDefinition definition, boolean resolveMultilingualString)
private Map<String,Object>
_getRichTextValues(RichTextAttributeDefinition definition)
private I18nizableText
_getRightLabel(String rightId)
private Map<String,Object>
_getSimpleViewItemGroupValues(ContentType contentType, SimpleViewItemGroup fieldset, boolean hideInheritedModelItems, boolean resolveMultilingualString)
private List<Map<String,Object>>
_getSuperTypesInfos(ContentType cType)
private Map<String,String>
_getTextForAvailableLanguages(I18nizableText text, boolean useRawValues)
Get translations of a text for each available languagesprivate Map<String,Object>
_getValidatorParameters(ElementDefinition definition, boolean resolveMultilingualString)
private List<Map<String,Object>>
_getViews(ContentType contentType, boolean hideInheritedModelItems, boolean resolveMultilingualString)
private Map<String,Object>
_getViewValues(ContentType contentType, View view, boolean hideInheritedModelItems, boolean resolveMultilingualString)
private List<Map<String,Object>>
_getWidgetParameters(ElementDefinition definition, boolean resolveMultilingualString)
private boolean
_hasImages(ContentType contentType)
private boolean
_isMandatoryElementDefinition(ElementDefinition definition)
private Map<String,Object>
_processViewItemContainerChildren(ContentType contentType, ViewItemContainer viewItemContainer, boolean hideInheritedModelItems, boolean resolveMultilingualString)
Map<String,Object>
getContentTypeInfos(String contentTypeId, boolean hideInheritedModelItems, boolean resolveMultilingualString)
Retrieves content type informationObject
getEnhancedMultilingualString(I18nizableText text, boolean resolveMultilingualString)
Get values in different language of an i18n textList<Map<String,Object>>
getModelItemsInformation(ContentType contentType, boolean hideInheritedModelItems, boolean resolveMultilingualString)
Get model items' information of a content typevoid
service(ServiceManager serviceManager)
void
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
The content type extension point instance
-
_rightsExtensionPoint
protected RightsExtensionPoint _rightsExtensionPoint
The rights extension point instance
-
_i18nUtils
protected I18nUtils _i18nUtils
Utility methods helping the management of internationalizable text
-
_langageManager
protected LanguagesManager _langageManager
The langage manager instance
-
_availableLanguages
Map<String,Language> _availableLanguages
-
_pluginName
private String _pluginName
-
-
Constructor Detail
-
ContentTypeInformationsHelper
public ContentTypeInformationsHelper()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
getContentTypeInfos
public Map<String,Object> getContentTypeInfos(String contentTypeId, boolean hideInheritedModelItems, boolean resolveMultilingualString)
Retrieves content type information- Parameters:
contentTypeId
- the content type's identifierhideInheritedModelItems
-true
to hide inherited model items of a content type according to contentTypeId parameterresolveMultilingualString
- iftrue
, the multilingual string will be returned as simple strings- Returns:
- a
Map
containing all information about the content type
-
_hasImages
private boolean _hasImages(ContentType contentType)
-
_getRightLabel
private I18nizableText _getRightLabel(String rightId)
-
_getSuperTypesInfos
private List<Map<String,Object>> _getSuperTypesInfos(ContentType cType)
-
_getAttributeNames
private Collection<String> _getAttributeNames(Collection<? extends ModelItem> modelItems)
-
getModelItemsInformation
public List<Map<String,Object>> getModelItemsInformation(ContentType contentType, boolean hideInheritedModelItems, boolean resolveMultilingualString)
Get model items' information of a content type- Parameters:
contentType
- The content typehideInheritedModelItems
-true
to hide inherited mode items of content typeresolveMultilingualString
- Iftrue
, the multilingual string will be returned as simple strings- Returns:
- Model items' information of a content type
-
_getModelItemValues
private Map<String,Object> _getModelItemValues(ContentType contentType, ModelItem modelItem, boolean resolveMultilingualString)
-
_getElementDefinitionValues
private Map<String,Object> _getElementDefinitionValues(ElementDefinition definition, boolean resolveMultilingualString)
-
_getWidgetParameters
private List<Map<String,Object>> _getWidgetParameters(ElementDefinition definition, boolean resolveMultilingualString)
-
_getEnhancedEnumerators
private List<Map<String,Object>> _getEnhancedEnumerators(ElementDefinition definition)
-
_isMandatoryElementDefinition
private boolean _isMandatoryElementDefinition(ElementDefinition definition)
-
_getValidatorParameters
private Map<String,Object> _getValidatorParameters(ElementDefinition definition, boolean resolveMultilingualString)
-
_getConfiguration
private String _getConfiguration(Configuration configuration)
-
_getRichTextValues
private Map<String,Object> _getRichTextValues(RichTextAttributeDefinition definition)
-
_getContentValues
private Map<String,Object> _getContentValues(ContentAttributeDefinition definition)
-
_getRepeaterValues
private Map<String,Object> _getRepeaterValues(RepeaterDefinition definition, boolean resolveMultilingualString)
-
_getViews
private List<Map<String,Object>> _getViews(ContentType contentType, boolean hideInheritedModelItems, boolean resolveMultilingualString)
-
_getViewValues
private Map<String,Object> _getViewValues(ContentType contentType, View view, boolean hideInheritedModelItems, boolean resolveMultilingualString)
-
_processViewItemContainerChildren
private Map<String,Object> _processViewItemContainerChildren(ContentType contentType, ViewItemContainer viewItemContainer, boolean hideInheritedModelItems, boolean resolveMultilingualString)
-
_getSimpleViewItemGroupValues
private Map<String,Object> _getSimpleViewItemGroupValues(ContentType contentType, SimpleViewItemGroup fieldset, boolean hideInheritedModelItems, boolean resolveMultilingualString)
-
_getModelViewItemValues
private Map<String,Object> _getModelViewItemValues(ContentType contentType, ModelViewItem modelViewItem, boolean hideInheritedModelItems, boolean resolveMultilingualString)
-
_getIndexingModel
private List<Map<String,Object>> _getIndexingModel(ContentType cType)
-
_getIndexingFieldPath
private List<String> _getIndexingFieldPath(IndexingField indexingField)
-
_getIndexingFieldType
private I18nizableText _getIndexingFieldType(IndexingField indexingField)
-
_getIndexingFieldDetails
private Map<String,Object> _getIndexingFieldDetails(IndexingField indexingField)
-
getEnhancedMultilingualString
public Object getEnhancedMultilingualString(I18nizableText text, boolean resolveMultilingualString)
Get values in different language of an i18n text- Parameters:
text
- An i18n textresolveMultilingualString
- When true return a text- Returns:
- values in different language of an i18n text
-
_getTextForAvailableLanguages
private Map<String,String> _getTextForAvailableLanguages(I18nizableText text, boolean useRawValues)
Get translations of a text for each available languages- Parameters:
text
- An i18n textuseRawValues
- true to use the raw values- Returns:
- All translations of a text
-
-