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
_context
private ServiceManager
_manager
private List<ElementDefinition>
_parameters
private List<CategorizedElementDefinitionWrapper>
_parameterWrappers
private Path
_skinDir
private String
_skinName
private 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 theCategorizedElementDefinitionWrapper
from the skin directoryString
getFamilyId()
Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family IdString
getId()
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
ElementDefinition
getModelItem(String itemPath)
Retrieves the model item at given pathCollection<ElementDefinition>
getModelItems()
Retrieves all the model items of this containerView
getView()
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:ModelItemContainer
Retrieves all the model items of this container- Specified by:
getModelItems
in interfaceModelItemContainer
- Returns:
- the model items
-
getModelItem
public ElementDefinition getModelItem(String itemPath) throws UndefinedItemPathException
Description copied from interface:ModelItemContainer
Retrieves the model item at given path- Specified by:
getModelItem
in 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:Model
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
-
getFamilyId
public String 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)
-
_initialize
private void _initialize() throws ProcessingException
- Throws:
ProcessingException
-
_readSkinParameters
private List<CategorizedElementDefinitionWrapper> _readSkinParameters() throws ProcessingException
Read theCategorizedElementDefinitionWrapper
from 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
-
-