Package org.ametys.web.skin
Class SkinParametersModel
- java.lang.Object
-
- org.ametys.web.skin.SkinParametersModel
-
- All Implemented Interfaces:
Model,ModelItemContainer
public class SkinParametersModel extends Object implements Model
Model for Skin (do not mistake this withSkinModel)
-
-
Field Summary
Fields Modifier and Type Field Description private Context_contextprivate ServiceManager_managerprivate List<ElementDefinition>_parametersprivate List<CategorizedElementDefinitionWrapper>_parameterWrappersprivate Path_skinDirprivate String_skinNameprivate AbstractThreadSafeComponentExtensionPoint<? extends ElementType>_skinParameterTypeEP
-
Constructor Summary
Constructors Constructor Description SkinParametersModel(String skinName, Path skinDir, SkinParameterTypeExtensionPoint skinParameterTypeEP, Context context, ServiceManager manager)Create an instance of a model, based on the skin directory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Configuration_getConfigurationModel(Path skinDir)private void_initialize()private List<CategorizedElementDefinitionWrapper>_readSkinParameters()Read theCategorizedElementDefinitionWrapperfrom the skin directoryStringgetFamilyId()Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family IdStringgetId()Retrieves the model id (an id must be unique in the familyModel.getFamilyId()ElementDefinitiongetModelItem(String itemPath)Retrieves the model item at given pathCollection<ElementDefinition>getModelItems()Retrieves all the model items of this containerViewgetView()Retrieves the view of skin parameters-
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.ModelItemContainer
getChild, hasModelItem
-
-
-
-
Field Detail
-
_skinParameterTypeEP
private AbstractThreadSafeComponentExtensionPoint<? extends ElementType> _skinParameterTypeEP
-
_manager
private ServiceManager _manager
-
_parameterWrappers
private List<CategorizedElementDefinitionWrapper> _parameterWrappers
-
_parameters
private List<ElementDefinition> _parameters
-
-
Constructor Detail
-
SkinParametersModel
public SkinParametersModel(String skinName, Path skinDir, SkinParameterTypeExtensionPoint skinParameterTypeEP, Context context, ServiceManager manager) throws ProcessingException
Create an instance of a model, based on the skin directory- Parameters:
skinName- name of the skin (must be unique)skinDir- the skin directory where the configuration will be readskinParameterTypeEP- the skin parameter type extension pointcontext- the current contextmanager- the service manager- Throws:
ProcessingException- something went wrong while parsing the file
-
-
Method Detail
-
getModelItems
public Collection<ElementDefinition> getModelItems()
Description copied from interface:ModelItemContainerRetrieves all the model items of this container- Specified by:
getModelItemsin interfaceModelItemContainer- Returns:
- the model items
-
getModelItem
public ElementDefinition getModelItem(String itemPath) throws UndefinedItemPathException
Description copied from interface:ModelItemContainerRetrieves the model item at given path- Specified by:
getModelItemin interfaceModelItemContainer- Parameters:
itemPath- the item path- Returns:
- the model item.
- Throws:
UndefinedItemPathException- if there is no item defined at the given path
-
getView
public View getView()
Retrieves the view of skin parameters- Returns:
- the skin parameters' view
-
getId
public String getId()
Description copied from interface:ModelRetrieves the model id (an id must be unique in the familyModel.getFamilyId()
-
getFamilyId
public String getFamilyId()
Description copied from interface:ModelRetrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Id- Specified by:
getFamilyIdin interfaceModel- Returns:
- content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
-
_initialize
private void _initialize() throws ProcessingException
- Throws:
ProcessingException
-
_readSkinParameters
private List<CategorizedElementDefinitionWrapper> _readSkinParameters() throws ProcessingException
Read theCategorizedElementDefinitionWrapperfrom the skin directory- Returns:
- a list of
CategorizedElementDefinitionWrapper - Throws:
ProcessingException- error while reading the XML
-
_getConfigurationModel
private Configuration _getConfigurationModel(Path skinDir) throws ConfigurationException, SAXException, IOException
-
-