Package org.ametys.odf.content.code
Class AttributeBasedDisplayCodeProvider
java.lang.Object
org.ametys.odf.content.code.AbstractStaticProgramItemDisplayCodeProvider
org.ametys.odf.content.code.AttributeBasedDisplayCodeProvider
- All Implemented Interfaces:
DisplayCodeProvider,PluginAware,Supporter<Content>,Configurable,Serviceable
- Direct Known Subclasses:
PegaseDisplayCodeProvider
public class AttributeBasedDisplayCodeProvider
extends AbstractStaticProgramItemDisplayCodeProvider
implements Serviceable
Implementation of a
Display code will be composed by attributes' values separated by '-' character.
Expected configuration is:
DisplayCodeProvider based on Content attributes.Display code will be composed by attributes' values separated by '-' character.
Expected configuration is:
<type id="CONTENT_TYPE_ID_1">
<item ref="path/of/attribute1"/>
<item ref="path/of/attribute2"/>
</type>
<type id="CONTENT_TYPE_ID_2">
<item ref="path/of/attribute1"/>
<item ref="path/of/attribute2"/>
</type>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe attributes composing the code by content typesprotected ServiceManagerThe service manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) protected ContentTypeExtensionPointGet the content type extension pointprotected ContentTypesHelperGet content types helpergetDisplayCode(Content content) Get the display code of this contentvoidservice(ServiceManager smanager) booleanCheck if an element is supportedMethods inherited from class org.ametys.odf.content.code.AbstractStaticProgramItemDisplayCodeProvider
getId, getLabel, setPluginInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.odf.content.code.DisplayCodeProvider
isActive
-
Field Details
-
_smanager
The service manager -
_attributesByTypes
The attributes composing the code by content types
-
-
Constructor Details
-
AttributeBasedDisplayCodeProvider
public AttributeBasedDisplayCodeProvider()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractStaticProgramItemDisplayCodeProvider- Throws:
ConfigurationException
-
getContentTypeExtensionPoint
Get the content type extension point- Returns:
- the content type extension point
-
getContentTypesHelper
Get content types helper- Returns:
- the content types helper
-
getDisplayCode
Description copied from interface:DisplayCodeProviderGet the display code of this content- Specified by:
getDisplayCodein interfaceDisplayCodeProvider- Parameters:
content- the content- Returns:
- the display code
-
supports
Description copied from interface:SupporterCheck if an element is supported
-