Class StaticZoneItem
- java.lang.Object
-
- org.ametys.plugins.blog.repository.StaticZoneItem
-
- All Implemented Interfaces:
AmetysObject,DataAwareAmetysObject,ModelLessDataAwareAmetysObject,DataHolder,ModelLessDataHolder,ZoneItem
public class StaticZoneItem extends Object implements ZoneItem
Wrapper to present a modifiable zoneItem into a unmodifiable one.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.web.repository.page.ZoneItem
ZoneItem.ZoneType
-
-
Field Summary
Fields Modifier and Type Field Description protected ZoneItem_zoneItemThe wrapped zone.-
Fields inherited from interface org.ametys.web.repository.page.ZoneItem
SERVICE_PARAMETERS_DATA_NAME
-
-
Constructor Summary
Constructors Constructor Description StaticZoneItem(ZoneItem zoneItem)Construct a static zone, wrapping a given zone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends Content>
CgetContent()Retrieves the content reference.ModelAwareDataHoldergetContentViewParametersHolder(String contentViewName)Get the content view parameters for a given viewModelLessDataHoldergetDataHolder()Returns theDataHolderof thisAmetysObject.StringgetId()Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>StringgetName()Retrieves the name of the current object.<A extends AmetysObject>
AgetParent()Returns the parent object in the Ametys hierarchy.StringgetParentPath()Returns the path of the parent object in the Ametys hierarchy.StringgetPath()Retrieves the path of the current object.StringgetServiceId()Retrieves the service id.ModelAwareDataHoldergetServiceParameters()Get the service parametersModelAwareDataHoldergetServiceViewParametersHolder(String serviceViewName)Get the service view parameters for a given viewZoneItem.ZoneTypegetType()Retrieves the type.StringgetViewName()Get the name of the view to render the Content with.ZonegetZone()Get the parent zone.ModelAwareDataHoldergetZoneItemParametersHolder()Get the view 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.plugins.repository.AmetysObject
equals, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, getDataNames, getRepositoryData
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToSAX, getComposite, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX
-
-
-
-
Constructor Detail
-
StaticZoneItem
public StaticZoneItem(ZoneItem zoneItem)
Construct a static zone, wrapping a given zone.- Parameters:
zoneItem- the zone to wrap.
-
-
Method Detail
-
getDataHolder
public ModelLessDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelLessDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
getName
public String getName() throws AmetysRepositoryException
Description copied from interface:AmetysObjectRetrieves the name of the current object.- Specified by:
getNamein interfaceAmetysObject- Returns:
- the name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getPath
public String getPath() throws AmetysRepositoryException
Description copied from interface:AmetysObjectRetrieves the path of the current object.- Specified by:
getPathin interfaceAmetysObject- Returns:
- the path.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getId
public String getId() throws AmetysRepositoryException
Description copied from interface:AmetysObjectRetrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>- Specified by:
getIdin interfaceAmetysObject- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException- if an error occurs.
-
getParent
public <A extends AmetysObject> A getParent() throws AmetysRepositoryException
Description copied from interface:AmetysObjectReturns the parent object in the Ametys hierarchy.- Specified by:
getParentin interfaceAmetysObject- Type Parameters:
A- the type of the parentAmetysObject.- Returns:
- the parent object or
nullif current object is the root. - Throws:
AmetysRepositoryException- if an error occurs.
-
getParentPath
public String getParentPath() throws AmetysRepositoryException
Description copied from interface:AmetysObjectReturns the path of the parent object in the Ametys hierarchy.- Specified by:
getParentPathin interfaceAmetysObject- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getType
public ZoneItem.ZoneType getType() throws AmetysRepositoryException
Description copied from interface:ZoneItemRetrieves the type.- Specified by:
getTypein interfaceZoneItem- Returns:
- the type.
- Throws:
AmetysRepositoryException- if an error occurs.- See Also:
ZoneItem.ZoneType
-
getContent
public <C extends Content> C getContent() throws AmetysRepositoryException
Description copied from interface:ZoneItemRetrieves the content reference.- Specified by:
getContentin interfaceZoneItem- Type Parameters:
C- the actual type ofContent.- Returns:
- the service id.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getViewName
public String getViewName() throws AmetysRepositoryException
Description copied from interface:ZoneItemGet the name of the view to render the Content with. It only makes sense if the ZoneItem is a Content reference.
If null is returned, in most cases, "main" should be assumed.- Specified by:
getViewNamein interfaceZoneItem- Returns:
- the view name, or null if not set.
- Throws:
AmetysRepositoryException- if an error occurs. TODO NEWATTRIBUTEAPI_SERVICE: remove the default implementation when all zone items implement the method
-
getServiceId
public String getServiceId() throws AmetysRepositoryException
Description copied from interface:ZoneItemRetrieves the service id.- Specified by:
getServiceIdin interfaceZoneItem- Returns:
- the service id.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getServiceParameters
public ModelAwareDataHolder getServiceParameters() throws AmetysRepositoryException
Description copied from interface:ZoneItemGet the service parameters- Specified by:
getServiceParametersin interfaceZoneItem- Returns:
- the service parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
getZoneItemParametersHolder
public ModelAwareDataHolder getZoneItemParametersHolder() throws AmetysRepositoryException
Description copied from interface:ZoneItemGet the view parameters- Specified by:
getZoneItemParametersHolderin interfaceZoneItem- Returns:
- the view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
getContentViewParametersHolder
public ModelAwareDataHolder getContentViewParametersHolder(String contentViewName) throws AmetysRepositoryException
Description copied from interface:ZoneItemGet the content view parameters for a given view- Specified by:
getContentViewParametersHolderin interfaceZoneItem- Parameters:
contentViewName- the view name- Returns:
- the content view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
getServiceViewParametersHolder
public ModelAwareDataHolder getServiceViewParametersHolder(String serviceViewName) throws AmetysRepositoryException
Description copied from interface:ZoneItemGet the service view parameters for a given view- Specified by:
getServiceViewParametersHolderin interfaceZoneItem- Parameters:
serviceViewName- the view name- Returns:
- the service view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
-