public class StaticService extends AbstractLogEnabled implements Service, Contextualizable, Configurable, PluginAware, Serviceable, Disposable
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 void |
_parseChildren(Configuration groupConfiguration,
ViewItemGroup viewItemGroup,
ModelItemGroup modelParent)
Parses children of a view item group
|
protected I18nizableText |
_parseI18nizableText(Configuration config,
String name)
Parse an i18n text.
|
protected ViewElement |
_parseParameter(Configuration paramConfiguration,
ModelItemGroup parent)
Parses a service parameter
|
protected ViewElement |
_parseParameter(Configuration paramConfiguration,
ModelItemGroup parent,
String pluginName)
Parses a service parameter
|
protected ModelViewItemGroup |
_parseRepeater(Configuration repeaterConfiguration,
ModelItemGroup parent)
Parses a repeater
|
protected ModelViewItemGroup |
_parseRepeater(Configuration repeaterConfiguration,
ModelItemGroup parent,
String pluginName)
Parses a repeater
|
protected SimpleViewItemGroup |
_parseSimpleViewItemGroup(Configuration groupConfiguration,
ModelItemGroup modelParent)
Parses a simple view item group (group or fieldset)
|
void |
configure(Configuration configuration) |
protected Integer |
configureDialogBoxDimension(Configuration configuration,
String dimensionName)
Configure the dimensions of the dialog box
|
protected void |
configureIndexation(Configuration configuration)
Configure the indexation process.
This class only allow to index the value of some parameters (not repeaters). |
protected void |
configureParameters(Configuration parametersConfiguration)
Configure the service parameters.
|
void |
contextualize(Context context) |
void |
dispose() |
I18nizableText |
getCategory()
Retrieves the category of the service.
|
Integer |
getCreationBoxHeight()
Gets the height of the creation dialog box.
|
Integer |
getCreationBoxWidth()
Gets the width of the creation dialog box.
|
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.
|
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()
Retrieves the model id (an id must be unique in the family
Model.getFamilyId() |
I18nizableText |
getLabel()
Retrieves the label.
|
String |
getLargeIcon()
Retrieves the URL of the icon without the context path.
|
String |
getMediumIcon()
Retrieves the URL of the icon without the context path.
|
Collection<ModelItem> |
getModelItems()
Retrieves all the model items of this container
|
String |
getName()
Get the name.
|
Map<String,ModelItem> |
getParameters()
Retrieves the service's parameters definitions
|
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.
|
View |
getView()
Retrieves the service's view
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFamilyId
getChild, getModelItem, hasModelItem
protected String _pluginName
protected String _featureName
protected ServiceManager _manager
protected ClientSideElement.Script _paramsScript
protected Map<String,ModelItem> _modelItems
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 Integer _creationBoxHeight
private Integer _creationBoxWidth
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
private ServiceParameterTypeExtensionPoint _serviceParameterTypeExtensionPoint
private ServiceParameterDefinitionParser _serviceParameterDefinitionParser
private RepeaterDefinitionParser _repeaterDefinitionParser
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 parametersConfiguration) throws ConfigurationException
parametersConfiguration
- the service parameters configuration.ConfigurationException
- if an error occurs.protected SimpleViewItemGroup _parseSimpleViewItemGroup(Configuration groupConfiguration, ModelItemGroup modelParent) throws ConfigurationException
groupConfiguration
- the item group configurationmodelParent
- The last model item group to use as parent for next definitionsConfigurationException
- if an error occursprotected ViewElement _parseParameter(Configuration paramConfiguration, ModelItemGroup parent) throws ConfigurationException
paramConfiguration
- the parameter configurationparent
- the parent of the service parameter. Can be null
if the parameter has no parentConfigurationException
- if an error occursprotected ViewElement _parseParameter(Configuration paramConfiguration, ModelItemGroup parent, String pluginName) throws ConfigurationException
paramConfiguration
- the parameter configurationparent
- the parent of the service parameter. Can be null
if the parameter has no parentpluginName
- Name of the plugin that defines this parameterConfigurationException
- if an error occursprotected ModelViewItemGroup _parseRepeater(Configuration repeaterConfiguration, ModelItemGroup parent) throws ConfigurationException
repeaterConfiguration
- the repeater configurationparent
- the parent of the repeater. Can be null
if the repeater has no parentConfigurationException
- if an error occursprotected ModelViewItemGroup _parseRepeater(Configuration repeaterConfiguration, ModelItemGroup parent, String pluginName) throws ConfigurationException
repeaterConfiguration
- the repeater configurationparent
- the parent of the repeater. Can be null
if the repeater has no parentpluginName
- Name of the plugin that defines this parameterConfigurationException
- if an error occursprotected void _parseChildren(Configuration groupConfiguration, ViewItemGroup viewItemGroup, ModelItemGroup modelParent) throws ConfigurationException
groupConfiguration
- the item group configurationviewItemGroup
- the item groupmodelParent
- The last model item group to use as parent for next definitionsConfigurationException
- if an error occursprotected void configureIndexation(Configuration configuration) throws ConfigurationException
configuration
- the indexation configuration.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 String getId()
Model
Model.getFamilyId()
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()
Labelable
public I18nizableText getDescription()
Labelable
getDescription
in interface Labelable
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 Integer getCreationBoxHeight()
Service
getCreationBoxHeight
in interface Service
public Integer getCreationBoxWidth()
Service
getCreationBoxWidth
in interface Service
public String getURL()
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 Integer configureDialogBoxDimension(Configuration configuration, String dimensionName) throws ConfigurationException
configuration
- the global configurationdimensionName
- the name of the dimension to configureConfigurationException
- if configuration is invalidprotected 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 occurspublic Collection<ModelItem> getModelItems()
ModelItemContainer
getModelItems
in interface ModelItemContainer
public Map<String,ModelItem> getParameters()
Service
getParameters
in interface Service