Package org.ametys.web.repository.site
Class DefaultSiteType
java.lang.Object
org.ametys.web.repository.site.DefaultSiteType
- All Implemented Interfaces:
Model
,ModelItemAccessor
,ModelItemContainer
,PluginAware
,SiteType
,Configurable
,Serviceable
,ThreadSafe
- Direct Known Subclasses:
ProjectWorkspaceSiteType
public class DefaultSiteType
extends Object
implements SiteType, Configurable, PluginAware, ThreadSafe, Serviceable
Type of site which is retrieved from a XML configuration.
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nizableText
Description.protected I18nUtils
Component gathering utility methods for internationalizable text translationI18nUtils
protected String
Glyph iconprotected String
Site type id.protected I18nizableText
Label.protected String
Large icon URI 48x48.protected String
Medium icon URI 32x32.protected String
Site type name.protected List<ElementDefinition>
The model items of this site typeprotected String
Plugin name.protected SiteConfigurationExtensionPoint
The site configuration extension pointprotected String
Small icon URI 16x16.protected SourceResolver
The source resolverprotected View
The site type view, built from site parameter categories and groupsFields inherited from interface org.ametys.web.repository.site.SiteType
DEFAULT_SITE_TYPE_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected I18nizableText
_parseI18nizableText
(Configuration config, String name) Parse an i18n text.protected String
_parseIcon
(Configuration configuration, String name) Parse an icon pathvoid
configure
(Configuration configuration) Retrieves the description of the site type.Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family IdRetrieves 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 of the site type.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()
Retrieves the name of the site type.Retrieves the name of the plugin declaring this site type.Retrieves the URL of the icon without the context path.getView()
Retrieves the site type view, built from site parameter categories and groupsvoid
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, hasModelItem
Methods inherited from interface org.ametys.web.repository.site.SiteType
getModelItem, isPrivateType, siteInitiallyRestricted
-
Field Details
-
_pluginName
Plugin name. -
_id
Site type id. -
_name
Site type name. -
_label
Label. -
_description
Description. -
_iconGlyph
Glyph icon -
_smallIcon
Small icon URI 16x16. -
_mediumIcon
Medium icon URI 32x32. -
_largeIcon
Large icon URI 48x48. -
_parameters
The model items of this site type -
_view
The site type view, built from site parameter categories and groups -
_srcResolver
The source resolver -
_siteConfigurationExtensionPoint
The site configuration extension point -
_i18nUtils
Component gathering utility methods for internationalizable text translationI18nUtils
-
-
Constructor Details
-
DefaultSiteType
public DefaultSiteType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getId
Description copied from interface:Model
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
-
getFamilyId
Description copied from interface:Model
Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Id- Specified by:
getFamilyId
in interfaceModel
- Returns:
- content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
-
getName
Description copied from interface:SiteType
Retrieves the name of the site type. -
getLabel
Description copied from interface:SiteType
Retrieves the label of the site type. -
getDescription
Description copied from interface:SiteType
Retrieves the description of the site type.- Specified by:
getDescription
in interfaceSiteType
- Returns:
- the description.
-
getIconGlyph
Description copied from interface:SiteType
Retrieves the CSS class to use for glyph icon- Specified by:
getIconGlyph
in interfaceSiteType
- Returns:
- the glyph name.
-
getLargeIcon
Description copied from interface:SiteType
Retrieves the URL of the icon without the context path.- Specified by:
getLargeIcon
in interfaceSiteType
- Returns:
- the icon URL for the large image 48x48.
-
getMediumIcon
Description copied from interface:SiteType
Retrieves the URL of the icon without the context path.- Specified by:
getMediumIcon
in interfaceSiteType
- Returns:
- the icon URL for the medium sized image 32x32.
-
getSmallIcon
Description copied from interface:SiteType
Retrieves the URL of the icon without the context path.- Specified by:
getSmallIcon
in interfaceSiteType
- Returns:
- the icon URL for the small image 16x16.
-
getPluginName
Description copied from interface:SiteType
Retrieves the name of the plugin declaring this site type.- Specified by:
getPluginName
in interfaceSiteType
- Returns:
- the name of the plugin.
-
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
-
getModelItems
Description copied from interface:ModelItemAccessor
Retrieves all the model items of this accessor- Specified by:
getModelItems
in interfaceModelItemAccessor
- Specified by:
getModelItems
in interfaceSiteType
- Returns:
- the model items
-
getView
Description copied from interface:SiteType
Retrieves the site type view, built from site parameter categories and groups -
_parseI18nizableText
protected I18nizableText _parseI18nizableText(Configuration config, String name) throws ConfigurationException Parse an i18n text.- Parameters:
config
- the configuration to use.name
- the child name.- Returns:
- the i18n text.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseIcon
Parse an icon path- Parameters:
configuration
- the configuration to usename
- the child name.- Returns:
- The icon path
- Throws:
ConfigurationException
- if the configuration is not valid.
-