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 ServiceManager
The service manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) protected ContentTypeExtensionPoint
Get the content type extension pointprotected ContentTypesHelper
Get content types helpergetDisplayCode
(Content content) Get the display code of this contentvoid
service
(ServiceManager smanager) boolean
Check if an element is supportedMethods inherited from class org.ametys.odf.content.code.AbstractStaticProgramItemDisplayCodeProvider
getId, getLabel, setPluginInfo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in 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:DisplayCodeProvider
Get the display code of this content- Specified by:
getDisplayCode
in interfaceDisplayCodeProvider
- Parameters:
content
- the content- Returns:
- the display code
-
supports
Description copied from interface:Supporter
Check if an element is supported
-