Class StaticHTMLEditorContentStyle
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.clientsideelement.styles.StaticHTMLEditorContentStyle
-
- All Implemented Interfaces:
HTMLEditorStyle
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SkinHTMLEditorContentStyle
public class StaticHTMLEditorContentStyle extends AbstractLogEnabled implements HTMLEditorStyle, Configurable, Serviceable, PluginAware
This implementation is based upon a static configuration. FIXME For now, this implementation only supports styles for contents ('content' category). It cannot provided styles for other richtext
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_featureName
The feature that declared the instanceprotected StyleCategory
_imageStyleCategory
The values of the fileprotected StyleCategory
_linkStyleCategory
The values of the fileprotected StyleCategory
_olStyleCategory
The values of the fileprotected StyleCategory
_paraStyleCategory
The values of the fileprotected String
_pluginName
The plugin that declared the instanceprotected SourceResolver
_resolver
Excalibur source resolverprotected StyleCategory
_tableStyleCategory
The values of the fileprotected StyleCategory
_ulStyleCategory
The values of the fileprotected static String[]
IMAGE_DEFAULT_ICONS
Default icons style for imageprotected static String[]
LINK_DEFAULT_ICONS
Default icons style for linkprotected static String[]
OL_DEFAULT_ICONS
Default icons style for ordered listprotected static String[]
TABLE_DEFAULT_ICONS
Default icons style for tableprotected static String[]
UL_DEFAULT_ICONS
Default icons style for unordered list-
Fields inherited from interface org.ametys.cms.clientsideelement.styles.HTMLEditorStyle
ROLE
-
-
Constructor Summary
Constructors Constructor Description StaticHTMLEditorContentStyle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configure(Configuration configuration, String defaultCatalogue, Map<String,Object> contextParameters)
Configure this instance upon a configurationprotected Style
_configureStyle(Configuration configuration, String defaultCatalogue, String[] defaultIcons, Map<String,Object> contextParameters)
Configure a styleprotected StyleCategory
_configureStyleCategory(Configuration styleConfiguration, String defaultCatalogue, String[] defaultIcons, Map<String,Object> contextParameters)
Configure this instance upon the style part of a configurationprotected String
_getImport(Configuration configuration, Map<String,Object> contextParameters)
Determine an url from a configuration node.void
configure(Configuration configuration)
Set<String>
getCategories()
Get the categories supported by this componentStyleCategory
getImage(String category, Map<String,Object> contextualParameters)
Get the list of styles for imagesStyleCategory
getLink(String category, Map<String,Object> contextualParameters)
Get the list of styles for linkStyleCategory
getOrderedList(String category, Map<String,Object> contextualParameters)
Get the list of styles for ordered listsStyleCategory
getPara(String category, Map<String,Object> contextualParameters)
Get the list of styles for paragraphsStyleCategory
getTable(String category, Map<String,Object> contextualParameters)
Get the list of styles for tablesStyleCategory
getUnorderedList(String category, Map<String,Object> contextualParameters)
Get the list of styles for unordered listsvoid
service(ServiceManager manager)
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.cms.clientsideelement.styles.HTMLEditorStyle
getBackOfficeCSSFiles, getInlineEditorCSSFiles
-
-
-
-
Field Detail
-
TABLE_DEFAULT_ICONS
protected static final String[] TABLE_DEFAULT_ICONS
Default icons style for table
-
LINK_DEFAULT_ICONS
protected static final String[] LINK_DEFAULT_ICONS
Default icons style for link
-
IMAGE_DEFAULT_ICONS
protected static final String[] IMAGE_DEFAULT_ICONS
Default icons style for image
-
UL_DEFAULT_ICONS
protected static final String[] UL_DEFAULT_ICONS
Default icons style for unordered list
-
OL_DEFAULT_ICONS
protected static final String[] OL_DEFAULT_ICONS
Default icons style for ordered list
-
_resolver
protected SourceResolver _resolver
Excalibur source resolver
-
_paraStyleCategory
protected StyleCategory _paraStyleCategory
The values of the file
-
_tableStyleCategory
protected StyleCategory _tableStyleCategory
The values of the file
-
_linkStyleCategory
protected StyleCategory _linkStyleCategory
The values of the file
-
_imageStyleCategory
protected StyleCategory _imageStyleCategory
The values of the file
-
_ulStyleCategory
protected StyleCategory _ulStyleCategory
The values of the file
-
_olStyleCategory
protected StyleCategory _olStyleCategory
The values of the file
-
_pluginName
protected String _pluginName
The plugin that declared the instance
-
_featureName
protected String _featureName
The feature that declared the instance
-
-
Constructor Detail
-
StaticHTMLEditorContentStyle
public StaticHTMLEditorContentStyle()
-
-
Method Detail
-
service
public void service(ServiceManager manager) 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
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configure
protected void _configure(Configuration configuration, String defaultCatalogue, Map<String,Object> contextParameters) throws ConfigurationException
Configure this instance upon a configuration- Parameters:
configuration
- The configurationdefaultCatalogue
- The default i18n catalogue to usecontextParameters
- Contextuals parameters transmitted by the environment.- Throws:
ConfigurationException
- If the configuration is incorrect
-
_configureStyleCategory
protected StyleCategory _configureStyleCategory(Configuration styleConfiguration, String defaultCatalogue, String[] defaultIcons, Map<String,Object> contextParameters) throws ConfigurationException
Configure this instance upon the style part of a configuration- Parameters:
styleConfiguration
- The style part of the configurationdefaultCatalogue
- The default i18n catalogue to usedefaultIcons
- the path to the button's default icons in small, medium and large sizecontextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The style that represents the values read
- Throws:
ConfigurationException
- If the configuration is incorrect
-
_getImport
protected String _getImport(Configuration configuration, Map<String,Object> contextParameters)
Determine an url from a configuration node.- Parameters:
configuration
- Read the optional plugin attribute and concatenate it to the value of the node. Can be nullcontextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The non-null path to the plugin resource
-
_configureStyle
protected Style _configureStyle(Configuration configuration, String defaultCatalogue, String[] defaultIcons, Map<String,Object> contextParameters) throws ConfigurationException
Configure a style- Parameters:
configuration
- The style configurationdefaultCatalogue
- The default i18n catalogue to usedefaultIcons
- the path to the button's default icons in small, medium and large sizecontextParameters
- Contextual parameters transmitted by the environment.- Returns:
- The style configured
- Throws:
ConfigurationException
- If the configuration is incorrect
-
getCategories
public Set<String> getCategories()
Description copied from interface:HTMLEditorStyle
Get the categories supported by this component- Specified by:
getCategories
in interfaceHTMLEditorStyle
- Returns:
- The categories supported. Cannot be null, but may be empty and of course contains the "" key for the default category.
-
getPara
public StyleCategory getPara(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for paragraphs- Specified by:
getPara
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getTable
public StyleCategory getTable(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for tables- Specified by:
getTable
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getLink
public StyleCategory getLink(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for link- Specified by:
getLink
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getImage
public StyleCategory getImage(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for images- Specified by:
getImage
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getUnorderedList
public StyleCategory getUnorderedList(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for unordered lists- Specified by:
getUnorderedList
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getOrderedList
public StyleCategory getOrderedList(String category, Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyle
Get the list of styles for ordered lists- Specified by:
getOrderedList
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
-