public class StaticService extends AbstractLogEnabled implements Service, Contextualizable, Configurable, PluginAware, Serviceable, Disposable
Modifier and Type | Class and Description |
---|---|
protected static class |
StaticService.ServiceParameterOrRepeaterParser
Class for service parameter or repeater parser
|
private static class |
StaticService.ServiceParameterParser |
Modifier and Type | Field and Description |
---|---|
private I18nizableText |
_category |
protected Context |
_context
The context.
|
private List<ClientSideElement.ScriptFile> |
_cssFiles |
private I18nizableText |
_description |
private ThreadSafeComponentManager<Enumerator> |
_enumeratorManager |
protected String |
_featureName
The feature name
|
protected List<ServiceParameterGroup> |
_groups
The list of service parameter group
|
private String |
_iconDecorator |
private String |
_iconGlyph |
private String |
_id |
private boolean |
_isCacheable |
private boolean |
_isPrivate |
private I18nizableText |
_label |
private String |
_largeIcon |
protected ServiceManager |
_manager
The service manager
|
private String |
_mediumIcon |
protected Map<String,ServiceParameterOrRepeater> |
_parameters
The map of service parameters
|
private List<String> |
_parametersToIndex |
protected ClientSideElement.Script |
_paramsScript
The script configured
|
protected String |
_pluginName
The plugin name
|
private String |
_right
The right needed to create an instance of this service, blank or null if no right is needed.
|
private String |
_smallIcon |
private String |
_url |
private ThreadSafeComponentManager<Validator> |
_validatorManager |
Constructor and Description |
---|
StaticService() |
Modifier and Type | Method and Description |
---|---|
protected String |
_configureClass(Configuration configuration)
Configure the js class name
|
protected List<ClientSideElement.ScriptFile> |
_configureImports(Configuration configuration)
Configure the import part
|
protected ClientSideElement.Script |
_configureScript(Configuration configuration)
Configure the script
|
private String |
_configureThumbnail(Configuration valueConf,
String defaultImage) |
protected I18nizableText |
_parseI18nizableText(Configuration config,
String name)
Parse an i18n text.
|
void |
configure(Configuration configuration) |
protected void |
configureIndexation(Configuration configuration)
Configure the indexation process.
This class only allow to index the value of some parameters (not repeaters). |
protected void |
configureParameterGroup(ServiceParameterGroup group,
Configuration configuration,
StaticService.ServiceParameterOrRepeaterParser serviceParameterParser)
Deprecated.
|
protected void |
configureParameterGroup(ServiceParameterGroup group,
Configuration configuration,
String pluginName,
StaticService.ServiceParameterOrRepeaterParser serviceParameterParser)
Configure the service parameters.
|
protected void |
configureParameters(Configuration configuration,
StaticService.ServiceParameterOrRepeaterParser serviceParameterParser)
Configure the service parameters.
|
void |
contextualize(Context context) |
void |
dispose() |
I18nizableText |
getCategory()
Retrieves the category of the service.
|
List<ClientSideElement.ScriptFile> |
getCSSFiles()
Returns the list of CSS files needed to correctly display the service's in BO, such as the service's icon
|
I18nizableText |
getDescription()
Retrieves the description of the service.
|
String |
getIconDecorator()
Retrieves the CSS class to use for decorator above the main icon
|
String |
getIconGlyph()
Retrieves the CSS class to use for glyph icon
|
String |
getId()
Returns the service's id.
|
I18nizableText |
getLabel()
Retrieves the label of the service.
|
String |
getLargeIcon()
Retrieves the URL of the icon without the context path.
|
String |
getMediumIcon()
Retrieves the URL of the icon without the context path.
|
List<ServiceParameterGroup> |
getParameterGroups()
Returns the service parameter groups.
|
Map<String,ServiceParameterOrRepeater> |
getParameters()
Returns the service's parameters.
|
ClientSideElement.Script |
getParametersScript()
This method return the script that will be used to display parameters field.
|
String |
getPluginName()
Returns the plugin's name.
|
String |
getRight()
Get the right needed to create an instance of this service.
|
String |
getSmallIcon()
Retrieves the URL of the icon without the context path.
|
String |
getURL()
Returns the service's Cocoon-URL.
|
void |
index(ZoneItem zoneItem,
SolrInputDocument document)
Fill the index with service data.
This method is called during the containing page indexation process. |
boolean |
isCacheable(Page currentPage,
ZoneItem zoneItem)
Returns true if the result of this service may be cached, depending on the
ZoneItem containing an instance of this service. |
boolean |
isPrivate()
Get whether the service is private, i.e.
|
void |
service(ServiceManager smanager) |
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. |
getLogger, setLogger
protected String _pluginName
protected String _featureName
protected ServiceManager _manager
protected ClientSideElement.Script _paramsScript
protected List<ServiceParameterGroup> _groups
protected Map<String,ServiceParameterOrRepeater> _parameters
private I18nizableText _label
private I18nizableText _description
private I18nizableText _category
private String _iconGlyph
private String _iconDecorator
private String _smallIcon
private String _mediumIcon
private String _largeIcon
private List<ClientSideElement.ScriptFile> _cssFiles
private boolean _isCacheable
private boolean _isPrivate
private String _right
private List<String> _parametersToIndex
private ThreadSafeComponentManager<Validator> _validatorManager
private ThreadSafeComponentManager<Enumerator> _enumeratorManager
public StaticService()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void dispose()
dispose
in interface Disposable
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
protected void configureParameters(Configuration configuration, StaticService.ServiceParameterOrRepeaterParser serviceParameterParser) throws ConfigurationException
configuration
- the service configuration.serviceParameterParser
- the parser.ConfigurationException
- if an error occurs.protected void configureIndexation(Configuration configuration) throws ConfigurationException
configuration
- the indexation configuration.ConfigurationException
- if an error occurs.@Deprecated protected void configureParameterGroup(ServiceParameterGroup group, Configuration configuration, StaticService.ServiceParameterOrRepeaterParser serviceParameterParser) throws ConfigurationException
group
- the group to put the params in.configuration
- the service configuration.serviceParameterParser
- the parser.ConfigurationException
- if an error occurs.protected void configureParameterGroup(ServiceParameterGroup group, Configuration configuration, String pluginName, StaticService.ServiceParameterOrRepeaterParser serviceParameterParser) throws ConfigurationException
group
- the group to put the params in.configuration
- the service configuration.pluginName
- the plugin nameserviceParameterParser
- the parser.ConfigurationException
- if an error occurs.public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic String getPluginName()
Service
getPluginName
in interface Service
public boolean isCacheable(Page currentPage, ZoneItem zoneItem)
Service
ZoneItem
containing an instance of this service.isCacheable
in interface Service
currentPage
- the current Page
containing the service.zoneItem
- the ZoneItem
containing an instance of this service.public I18nizableText getLabel()
Service
public I18nizableText getDescription()
Service
getDescription
in interface Service
public I18nizableText getCategory()
Service
getCategory
in interface Service
public String getIconGlyph()
Service
getIconGlyph
in interface Service
public String getIconDecorator()
Service
getIconDecorator
in interface Service
public String getSmallIcon()
Service
getSmallIcon
in interface Service
public String getMediumIcon()
Service
getMediumIcon
in interface Service
public String getLargeIcon()
Service
getLargeIcon
in interface Service
public String getURL()
Service
public Map<String,ServiceParameterOrRepeater> getParameters()
Service
getParameters
in interface Service
public List<ServiceParameterGroup> getParameterGroups()
Service
getParameterGroups
in interface Service
public ClientSideElement.Script getParametersScript()
Service
getParametersScript
in interface Service
public List<ClientSideElement.ScriptFile> getCSSFiles()
Service
getCSSFiles
in interface Service
public boolean isPrivate()
Service
public String getRight()
Service
public void index(ZoneItem zoneItem, SolrInputDocument document)
Service
protected I18nizableText _parseI18nizableText(Configuration config, String name)
config
- the configuration to use.name
- the child name.private String _configureThumbnail(Configuration valueConf, String defaultImage)
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException
configuration
- the global configurationConfigurationException
- if configuration is invalidprotected String _configureClass(Configuration configuration) throws ConfigurationException
configuration
- The configuration on action tagConfigurationException
- If an error occursprotected List<ClientSideElement.ScriptFile> _configureImports(Configuration configuration) throws ConfigurationException
configuration
- The imports configurationConfigurationException
- If an error occurs