Package org.ametys.web.service
Class StaticService
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.service.StaticService
- All Implemented Interfaces:
Model
,ModelItemAccessor
,ModelItemContainer
,LogEnabled
,PluginAware
,Labelable
,Service
,Disposable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AttachmentsService
,ExplorerFolderService
,FilteredContentsService
,FilteredPagesService
,LinkDirectoryService
,SearchPagesService
,SearchService
,ServerDirectoryService
,SitemapService
,SyndicationService
public class StaticService
extends AbstractLogEnabled
implements Service, Contextualizable, Configurable, PluginAware, Serviceable, Disposable
Class representing a business service.
A service is identified by an id and a Cocoon-URL.
This URL corresponds to a pipeline called by a page template.
URL must be relative to the sitemap of the plugin containing the service.
A service is identified by an id and a Cocoon-URL.
This URL corresponds to a pipeline called by a page template.
URL must be relative to the sitemap of the plugin containing the service.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The context.protected String
The feature nameprotected ServiceManager
The service managerThe map of model itemsprotected ClientSideElement.Script
The script configuredprotected String
The plugin nameprotected RepeaterDefinitionParser
The repeater definition parserprotected ServiceParameterDefinitionParser
The service parameter definition parserprotected View
The view of the serviceprotected ViewAndParametersParser
The view and parameters parser -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_configureClass
(Configuration configuration) Configure the js class nameprotected List<ClientSideElement.ScriptFile>
_configureImports
(Configuration configuration) Configure the import partprotected ClientSideElement.Script
_configureScript
(Configuration configuration) Configure the scriptprotected I18nizableText
_parseI18nizableText
(Configuration config, String name) Parse an i18n text.void
configure
(Configuration configuration) protected Integer
configureDialogBoxDimension
(Configuration configuration, String dimensionName) Configure the dimensions of the dialog boxprotected 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 parametersvoid
contextualize
(Context context) void
dispose()
Retrieves the category of the service.Gets the height of the creation dialog box.Gets the width of the creation dialog box.Returns the list of CSS files needed to correctly display the service's in BO, such as the service's iconRetrieves the description.Retrieves the CSS class to use for decorator above the main iconRetrieves the CSS class to use for glyph icongetId()
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
getLabel()
Retrieves the label.Retrieves the URL of the icon without the context path.Retrieves the URL of the icon without the context path.Retrieves all the model items of this accessorgetName()
Get the name.Retrieves the service's parameters definitionsThis method return the script that will be used to display parameters field.Returns the plugin's name.getRight()
Get the right needed to create an instance of this service.Retrieves the URL of the icon without the context path.getURL()
Returns the service's Cocoon-URL.getView()
Retrieves the service's viewvoid
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 theZoneItem
containing an instance of this service.boolean
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.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
Methods inherited from interface org.ametys.web.service.Service
getFamilyId
-
Field Details
-
_pluginName
The plugin name -
_featureName
The feature name -
_manager
The service manager -
_context
The context. -
_paramsScript
The script configured -
_view
The view of the service -
_modelItems
The map of model items -
_viewAndParametersParser
The view and parameters parser -
_serviceParameterDefinitionParser
The service parameter definition parser -
_repeaterDefinitionParser
The repeater definition parser
-
-
Constructor Details
-
StaticService
public StaticService()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
configureParameters
protected void configureParameters(Configuration parametersConfiguration) throws ConfigurationException Configure the service parameters- Parameters:
parametersConfiguration
- the parameters configuration- Throws:
ConfigurationException
- if a configuration exception occurred
-
configureIndexation
Configure the indexation process.
This class only allow to index the value of some parameters (not repeaters).- Parameters:
configuration
- the indexation configuration.- Throws:
ConfigurationException
- if an error occurs.
-
setPluginInfo
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
-
getPluginName
Description copied from interface:Service
Returns the plugin's name.- Specified by:
getPluginName
in interfaceService
- Returns:
- the plugin's name.
-
getId
Description copied from interface:Model
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
-
getName
Description copied from interface:Labelable
Get the name. -
isCacheable
Description copied from interface:Service
Returns true if the result of this service may be cached, depending on theZoneItem
containing an instance of this service.- Specified by:
isCacheable
in interfaceService
- Parameters:
currentPage
- the currentPage
containing the service.zoneItem
- theZoneItem
containing an instance of this service.
N.B: The ZoneItem can belong to a page that is not the current page, when it is inherited.- Returns:
- true if the result of this service may be cached.
-
getLabel
Description copied from interface:Labelable
Retrieves the label. -
getDescription
Description copied from interface:Labelable
Retrieves the description.- Specified by:
getDescription
in interfaceLabelable
- Returns:
- the description.
-
getCategory
Description copied from interface:Service
Retrieves the category of the service.- Specified by:
getCategory
in interfaceService
- Returns:
- the category.
-
getIconGlyph
Description copied from interface:Service
Retrieves the CSS class to use for glyph icon- Specified by:
getIconGlyph
in interfaceService
- Returns:
- the glyph name.
-
getIconDecorator
Description copied from interface:Service
Retrieves the CSS class to use for decorator above the main icon- Specified by:
getIconDecorator
in interfaceService
- Returns:
- the glyph name.
-
getSmallIcon
Description copied from interface:Service
Retrieves the URL of the icon without the context path.- Specified by:
getSmallIcon
in interfaceService
- Returns:
- the icon URL for the small image 16x16.
-
getMediumIcon
Description copied from interface:Service
Retrieves the URL of the icon without the context path.- Specified by:
getMediumIcon
in interfaceService
- Returns:
- the icon URL for the medium image 32x32.
-
getLargeIcon
Description copied from interface:Service
Retrieves the URL of the icon without the context path.- Specified by:
getLargeIcon
in interfaceService
- Returns:
- the icon URL for the large image 48x48.
-
getCreationBoxHeight
Description copied from interface:Service
Gets the height of the creation dialog box.- Specified by:
getCreationBoxHeight
in interfaceService
- Returns:
- the height of the creation dialog box
-
getCreationBoxWidth
Description copied from interface:Service
Gets the width of the creation dialog box.- Specified by:
getCreationBoxWidth
in interfaceService
- Returns:
- the width of the creation dialog box
-
getURL
Description copied from interface:Service
Returns the service's Cocoon-URL. -
getParametersScript
Description copied from interface:Service
This method return the script that will be used to display parameters field.- Specified by:
getParametersScript
in interfaceService
- Returns:
- The script. Can be null.
-
getCSSFiles
Description copied from interface:Service
Returns the list of CSS files needed to correctly display the service's in BO, such as the service's icon- Specified by:
getCSSFiles
in interfaceService
- Returns:
- The list of CSS files needed. Must not be null.
-
isPrivate
Description copied from interface:Service
Get whether the service is private, i.e. should not be created by the regular service interface. -
getRight
Description copied from interface:Service
Get the right needed to create an instance of this service. -
index
Description copied from interface:Service
Fill the index with service data.
This method is called during the containing page indexation process. -
_parseI18nizableText
Parse an i18n text.- Parameters:
config
- the configuration to use.name
- the child name.- Returns:
- the i18n text.
-
configureDialogBoxDimension
protected Integer configureDialogBoxDimension(Configuration configuration, String dimensionName) throws ConfigurationException Configure the dimensions of the dialog box- Parameters:
configuration
- the global configurationdimensionName
- the name of the dimension to configure- Returns:
- the value of the dimension
- Throws:
ConfigurationException
- if configuration is invalid
-
_configureScript
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException Configure the script- Parameters:
configuration
- the global configuration- Returns:
- The script created
- Throws:
ConfigurationException
- if configuration is invalid
-
_configureClass
Configure the js class name- Parameters:
configuration
- The configuration on action tag- Returns:
- The js class name
- Throws:
ConfigurationException
- If an error occurs
-
_configureImports
protected List<ClientSideElement.ScriptFile> _configureImports(Configuration configuration) throws ConfigurationException Configure the import part- Parameters:
configuration
- The imports configuration- Returns:
- The set of the complete url of imported file
- Throws:
ConfigurationException
- If an error occurs
-
getModelItems
Description copied from interface:ModelItemAccessor
Retrieves all the model items of this accessor- Specified by:
getModelItems
in interfaceModelItemAccessor
- Returns:
- the model items
-
getParameters
Description copied from interface:Service
Retrieves the service's parameters definitions- Specified by:
getParameters
in interfaceService
- Returns:
- the service's parameters definitions
-
getView
Description copied from interface:Service
Retrieves the service's view
-