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,FormService,LinkDirectoryService,SearchPagesService,SearchService,ServerDirectoryService,SitemapService,SurveyService,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
FieldsModifier and TypeFieldDescriptionprotected ContextThe context.protected StringThe feature nameprotected ServiceManagerThe service managerThe map of model itemsprotected ClientSideElement.ScriptThe script configuredprotected StringThe plugin nameprotected RepeaterDefinitionParserThe repeater definition parserprotected ServiceParameterDefinitionParserThe service parameter definition parserprotected ViewThe view of the serviceprotected ViewAndParametersParserThe view and parameters parser -
Constructor Summary
Constructors -
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.voidconfigure(Configuration configuration) protected IntegerconfigureDialogBoxDimension(Configuration configuration, String dimensionName) Configure the dimensions of the dialog boxprotected voidconfigureIndexation(Configuration configuration) Configure the indexation process.
This class only allow to index the value of some parameters (not repeaters).protected voidconfigureParameters(Configuration parametersConfiguration) Configure the service parametersvoidcontextualize(Context context) voiddispose()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 viewvoidFill the index with service data.
This method is called during the containing page indexation process.booleanisCacheable(Page currentPage, ZoneItem zoneItem) Returns true if the result of this service may be cached, depending on theZoneItemcontaining an instance of this service.booleanGet whether the service is private, i.e.voidservice(ServiceManager smanager) voidsetPluginInfo(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, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItemMethods 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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
dispose
- Specified by:
disposein interfaceDisposable
-
configure
- Specified by:
configurein 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:PluginAwareSets 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:
setPluginInfoin 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:ServiceReturns the plugin's name.- Specified by:
getPluginNamein interfaceService- Returns:
- the plugin's name.
-
getId
Description copied from interface:ModelRetrieves the model id (an id must be unique in the familyModel.getFamilyId() -
getName
Description copied from interface:LabelableGet the name. -
isCacheable
Description copied from interface:ServiceReturns true if the result of this service may be cached, depending on theZoneItemcontaining an instance of this service.- Specified by:
isCacheablein interfaceService- Parameters:
currentPage- the currentPagecontaining the service.zoneItem- theZoneItemcontaining 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:LabelableRetrieves the label. -
getDescription
Description copied from interface:LabelableRetrieves the description.- Specified by:
getDescriptionin interfaceLabelable- Returns:
- the description.
-
getCategory
Description copied from interface:ServiceRetrieves the category of the service.- Specified by:
getCategoryin interfaceService- Returns:
- the category.
-
getIconGlyph
Description copied from interface:ServiceRetrieves the CSS class to use for glyph icon- Specified by:
getIconGlyphin interfaceService- Returns:
- the glyph name.
-
getIconDecorator
Description copied from interface:ServiceRetrieves the CSS class to use for decorator above the main icon- Specified by:
getIconDecoratorin interfaceService- Returns:
- the glyph name.
-
getSmallIcon
Description copied from interface:ServiceRetrieves the URL of the icon without the context path.- Specified by:
getSmallIconin interfaceService- Returns:
- the icon URL for the small image 16x16.
-
getMediumIcon
Description copied from interface:ServiceRetrieves the URL of the icon without the context path.- Specified by:
getMediumIconin interfaceService- Returns:
- the icon URL for the medium image 32x32.
-
getLargeIcon
Description copied from interface:ServiceRetrieves the URL of the icon without the context path.- Specified by:
getLargeIconin interfaceService- Returns:
- the icon URL for the large image 48x48.
-
getCreationBoxHeight
Description copied from interface:ServiceGets the height of the creation dialog box.- Specified by:
getCreationBoxHeightin interfaceService- Returns:
- the height of the creation dialog box
-
getCreationBoxWidth
Description copied from interface:ServiceGets the width of the creation dialog box.- Specified by:
getCreationBoxWidthin interfaceService- Returns:
- the width of the creation dialog box
-
getURL
Description copied from interface:ServiceReturns the service's Cocoon-URL. -
getParametersScript
Description copied from interface:ServiceThis method return the script that will be used to display parameters field.- Specified by:
getParametersScriptin interfaceService- Returns:
- The script. Can be null.
-
getCSSFiles
Description copied from interface:ServiceReturns the list of CSS files needed to correctly display the service's in BO, such as the service's icon- Specified by:
getCSSFilesin interfaceService- Returns:
- The list of CSS files needed. Must not be null.
-
isPrivate
Description copied from interface:ServiceGet whether the service is private, i.e. should not be created by the regular service interface. -
getRight
Description copied from interface:ServiceGet the right needed to create an instance of this service. -
index
Description copied from interface:ServiceFill 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:ModelItemAccessorRetrieves all the model items of this accessor- Specified by:
getModelItemsin interfaceModelItemAccessor- Returns:
- the model items
-
getParameters
Description copied from interface:ServiceRetrieves the service's parameters definitions- Specified by:
getParametersin interfaceService- Returns:
- the service's parameters definitions
-
getView
Description copied from interface:ServiceRetrieves the service's view
-