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, setLoggerprotected 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 ServiceableServiceExceptionpublic void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void dispose()
dispose in interface Disposablepublic void configure(Configuration configuration) throws ConfigurationException
configure in interface ConfigurableConfigurationExceptionprotected 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)
PluginAwaresetPluginInfo in interface PluginAwarepluginName - Unique identifier for the plugin hosting the extensionfeatureName - Unique feature identifier (unique for a given pluginName)id - Unique identifier of this componentpublic String getPluginName()
ServicegetPluginName in interface Servicepublic boolean isCacheable(Page currentPage, ZoneItem zoneItem)
ServiceZoneItem containing an instance of this service.isCacheable in interface ServicecurrentPage - the current Page containing the service.zoneItem - the ZoneItem containing an instance of this service.public I18nizableText getLabel()
Servicepublic I18nizableText getDescription()
ServicegetDescription in interface Servicepublic I18nizableText getCategory()
ServicegetCategory in interface Servicepublic String getIconGlyph()
ServicegetIconGlyph in interface Servicepublic String getIconDecorator()
ServicegetIconDecorator in interface Servicepublic String getSmallIcon()
ServicegetSmallIcon in interface Servicepublic String getMediumIcon()
ServicegetMediumIcon in interface Servicepublic String getLargeIcon()
ServicegetLargeIcon in interface Servicepublic String getURL()
Servicepublic Map<String,ServiceParameterOrRepeater> getParameters()
ServicegetParameters in interface Servicepublic List<ServiceParameterGroup> getParameterGroups()
ServicegetParameterGroups in interface Servicepublic ClientSideElement.Script getParametersScript()
ServicegetParametersScript in interface Servicepublic List<ClientSideElement.ScriptFile> getCSSFiles()
ServicegetCSSFiles in interface Servicepublic boolean isPrivate()
Servicepublic String getRight()
Servicepublic void index(ZoneItem zoneItem, SolrInputDocument document)
Serviceprotected 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