Class DefaultPage<F extends DefaultPageFactory>
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<F>
-
- org.ametys.web.repository.page.jcr.DefaultPage<F>
-
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,MovableAmetysObject
,RemovableAmetysObject
,TagAwareAmetysObject
,TaggableAmetysObject
,TraversableAmetysObject
,MetadataAwarePagesContainer
,ModifiablePage
,MoveablePage
,Page
,PagesContainer
,SiteAwareAmetysObject
public class DefaultPage<F extends DefaultPageFactory> extends DefaultTraversableAmetysObject<F> implements ModifiablePage, CopiableAmetysObject, MoveablePage
Page
implementation stored into a JCR node usingametys:defaultPage
node type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.web.repository.page.Page
Page.LinkType, Page.PageType
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTACHMENTS_NODE_NAME
Constant for the attachment node name.static String
METADATA_LONG_TITLE
Constant for long title metadata.static String
METADATA_PUBLICATION_END_DATE
Constant for publication end date metadata.static String
METADATA_PUBLICATION_START_DATE
Constant for publication start date metadata.static String
METADATA_REFERERS
Constant for referers metadata.static String
METADATA_ROBOTS_DISALLOW
Constant for robots metadata.static String
METADATA_SITE
Constants for site Metadata*static String
METADATA_SITEMAP
Constants for sitemap Metadata*static String
METADATA_TEMPLATE
Constant for template metadata.static String
METADATA_TITLE
Constant for title metadata.static String
METADATA_TYPE
Constant for title metadata.static String
METADATA_URL
Constant for title metadata.static String
METADATA_URLTYPE
Constant for title metadata.static String
METADATA_VISIBLE
Constant for the visible attribute.static String
ZONE_NODE_TYPE
Constant for the zone node type.static String
ZONES_NODE_NAME
Constant for the zones node name.static String
ZONES_NODE_TYPE
Constant for the zones node type.
-
Constructor Summary
Constructors Constructor Description DefaultPage(Node node, String parentPath, F factory)
Creates aDefaultPage
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReferer(String ametysObjectId)
Add a newAmetysObject
referencing this page.boolean
canMoveTo(AmetysObject newParent)
Test if a move can be a success or if it is impossible (e.g.void
copyTo(ModifiableDataHolder dataHolder)
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.DefaultPage
copyTo(ModifiableTraversableAmetysObject parent, String name)
Copy the currentAmetysObject
to the given object.DefaultPage
copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo)
Copy the currentAmetysObject
to the given object if it is not in the restriction list.ModifiableZone
createZone(String name)
Creates a given zone.void
dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context)
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathvoid
dataToSAX(ContentHandler contentHandler, DataContext context)
Generates SAX events for data contained in thisDataHolder
Page
getChildPageAt(int index)
Gets the childPage
at the given positionAmetysObjectIterable<? extends Page>
getChildrenPages()
Retrieves child pages.AmetysObjectIterable<? extends Page>
getChildrenPages(boolean includeInvisiblePage)
Retrieves child pages.ModifiableModelLessDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.int
getDepth()
Get the page depthString
getLongTitle()
Retrieves the long title.ModifiableCompositeMetadata
getMetadataHolder()
Returns the rootCompositeMetadata
of thisAmetysObject
.String
getPathInSitemap()
Computes the path relative to the current sitemap.Set<String>
getReferers()
Retrieves allAmetysObject
ids referencing this page.ResourceCollection
getRootAttachments()
Retrieves the attachments root nodeSite
getSite()
Returns this object's site.Sitemap
getSitemap()
Retrieves the sitemap containing the current sitemap.String
getSitemapName()
Returns this page's sitemap nameString
getSiteName()
Returns this object's site name.Set<String>
getTags()
Retrieves current tags.String
getTemplate()
Retrieves the template name.ModifiableModelAwareDataHolder
getTemplateParametersHolder()
Get the view parametersString
getTitle()
Retrieves the title.Page.PageType
getType()
Retrieves the type.String
getURL()
Retrieves the linked URL.Page.LinkType
getURLType()
Retrieves the linked URL type.ModifiableZone
getZone(String name)
Retrieves a given zone.AmetysObjectIterable<ModifiableZone>
getZones()
Retrieves the zones.boolean
hasZone(String name)
Determine if a zone existsboolean
isVisible()
Determine if the page is visible into navigation elementsvoid
moveTo(AmetysObject newParent, boolean renameIfExist)
Move the current object as a new child of the given object.void
orderBefore(AmetysObject siblingNode)
Order a node before another sibling node (or as the last node)void
removeReferer(String ametysObjectId)
Removes anAmetysObject
referencing this page.void
setLongTitle(String title)
Set the long title.void
setSitemapName(String sitemapName)
Set the sitemap name.void
setSiteName(String siteName)
Set the site name.void
setTemplate(String template)
Set the template name.void
setTitle(String title)
Set the title.void
setType(Page.PageType type)
Set the type.void
setURL(Page.LinkType type, String url)
Set the linked URL.void
setVisible(boolean isVisible)
Set the visibility of the pagevoid
tag(String tag)
Tags.void
untag(String tag)
Untags.-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
dataToSAX, getDataNames, getRepositoryData
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
getComposite, getParentDataHolder, getRootDataHolder, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX, hasValue, hasValueOrEmpty
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValues
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
-
-
-
Field Detail
-
METADATA_TITLE
public static final String METADATA_TITLE
Constant for title metadata.- See Also:
- Constant Field Values
-
METADATA_LONG_TITLE
public static final String METADATA_LONG_TITLE
Constant for long title metadata.- See Also:
- Constant Field Values
-
METADATA_TYPE
public static final String METADATA_TYPE
Constant for title metadata.- See Also:
- Constant Field Values
-
METADATA_URL
public static final String METADATA_URL
Constant for title metadata.- See Also:
- Constant Field Values
-
METADATA_URLTYPE
public static final String METADATA_URLTYPE
Constant for title metadata.- See Also:
- Constant Field Values
-
METADATA_TEMPLATE
public static final String METADATA_TEMPLATE
Constant for template metadata.- See Also:
- Constant Field Values
-
METADATA_REFERERS
public static final String METADATA_REFERERS
Constant for referers metadata.- See Also:
- Constant Field Values
-
METADATA_VISIBLE
public static final String METADATA_VISIBLE
Constant for the visible attribute.- See Also:
- Constant Field Values
-
METADATA_ROBOTS_DISALLOW
public static final String METADATA_ROBOTS_DISALLOW
Constant for robots metadata.- See Also:
- Constant Field Values
-
ZONES_NODE_NAME
public static final String ZONES_NODE_NAME
Constant for the zones node name.- See Also:
- Constant Field Values
-
ZONES_NODE_TYPE
public static final String ZONES_NODE_TYPE
Constant for the zones node type.- See Also:
- Constant Field Values
-
ZONE_NODE_TYPE
public static final String ZONE_NODE_TYPE
Constant for the zone node type.- See Also:
- Constant Field Values
-
ATTACHMENTS_NODE_NAME
public static final String ATTACHMENTS_NODE_NAME
Constant for the attachment node name.- See Also:
- Constant Field Values
-
METADATA_SITE
public static final String METADATA_SITE
Constants for site Metadata*- See Also:
- Constant Field Values
-
METADATA_SITEMAP
public static final String METADATA_SITEMAP
Constants for sitemap Metadata*- See Also:
- Constant Field Values
-
METADATA_PUBLICATION_START_DATE
public static final String METADATA_PUBLICATION_START_DATE
Constant for publication start date metadata.- See Also:
- Constant Field Values
-
METADATA_PUBLICATION_END_DATE
public static final String METADATA_PUBLICATION_END_DATE
Constant for publication end date metadata.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultPage
public DefaultPage(Node node, String parentPath, F factory)
Creates aDefaultPage
.- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultPageFactory
which creates the AmetysObject.
-
-
Method Detail
-
getTags
public Set<String> getTags() throws AmetysRepositoryException
Description copied from interface:TagAwareAmetysObject
Retrieves current tags.- Specified by:
getTags
in interfaceTagAwareAmetysObject
- Returns:
- the current tags.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
tag
public void tag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObject
Tags.- Specified by:
tag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to add.- Throws:
AmetysRepositoryException
- if an error occurs.
-
untag
public void untag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObject
Untags.- Specified by:
untag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to remove.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTitle
public String getTitle() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the title.- Specified by:
getTitle
in interfacePage
- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTitle
public void setTitle(String title) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the title.- Specified by:
setTitle
in interfaceModifiablePage
- Parameters:
title
- the title.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLongTitle
public String getLongTitle() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the long title.- Specified by:
getLongTitle
in interfacePage
- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLongTitle
public void setLongTitle(String title) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the long title.- Specified by:
setLongTitle
in interfaceModifiablePage
- Parameters:
title
- the title.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSitemap
public Sitemap getSitemap() throws AmetysRepositoryException
Description copied from interface:PagesContainer
Retrieves the sitemap containing the current sitemap.- Specified by:
getSitemap
in interfacePagesContainer
- Returns:
- the sitemap containing the current sitemap.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDepth
public int getDepth() throws AmetysRepositoryException
Description copied from interface:Page
Get the page depth- Specified by:
getDepth
in interfacePage
- Returns:
- the page depth
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSite
public Site getSite() throws AmetysRepositoryException
Description copied from interface:SiteAwareAmetysObject
Returns this object's site.- Specified by:
getSite
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSiteName
public String getSiteName()
Description copied from interface:SiteAwareAmetysObject
Returns this object's site name.- Specified by:
getSiteName
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site name.
-
setSiteName
public void setSiteName(String siteName)
Description copied from interface:ModifiablePage
Set the site name.- Specified by:
setSiteName
in interfaceModifiablePage
- Parameters:
siteName
- the site name.
-
getSitemapName
public String getSitemapName() throws AmetysRepositoryException
Description copied from interface:PagesContainer
Returns this page's sitemap name- Specified by:
getSitemapName
in interfacePagesContainer
- Returns:
- this page's sitemap name
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setSitemapName
public void setSitemapName(String sitemapName) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the sitemap name.- Specified by:
setSitemapName
in interfaceModifiablePage
- Parameters:
sitemapName
- the sitemap name.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPathInSitemap
public String getPathInSitemap() throws AmetysRepositoryException
Description copied from interface:PagesContainer
Computes the path relative to the current sitemap.- Specified by:
getPathInSitemap
in interfacePagesContainer
- Returns:
- the path relative to the current sitemap.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getType
public Page.PageType getType() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the type.- Specified by:
getType
in interfacePage
- Returns:
- the type.
- Throws:
AmetysRepositoryException
- if an error occurs.- See Also:
Page.PageType
-
setType
public void setType(Page.PageType type) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the type.- Specified by:
setType
in interfaceModifiablePage
- Parameters:
type
- the type.- Throws:
AmetysRepositoryException
- if an error occurs.- See Also:
Page.PageType
-
getURL
public String getURL() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the linked URL.- Specified by:
getURL
in interfacePage
- Returns:
- the linked URL.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getURLType
public Page.LinkType getURLType() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the linked URL type.- Specified by:
getURLType
in interfacePage
- Returns:
- the linked URL type.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setURL
public void setURL(Page.LinkType type, String url) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the linked URL.- Specified by:
setURL
in interfaceModifiablePage
- Parameters:
type
- the type of linkurl
- the linked URL (depending on the type)- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTemplate
public String getTemplate() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the template name.- Specified by:
getTemplate
in interfacePage
- Returns:
- the template name or
null
if none has been set. - Throws:
AmetysRepositoryException
- if an error occurs.
-
setTemplate
public void setTemplate(String template) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the template name.- Specified by:
setTemplate
in interfaceModifiablePage
- Parameters:
template
- the template name.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getZones
public AmetysObjectIterable<ModifiableZone> getZones() throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Retrieves the zones.- Specified by:
getZones
in interfaceModifiablePage
- Specified by:
getZones
in interfacePage
- Returns:
- the zones.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasZone
public boolean hasZone(String name) throws AmetysRepositoryException
Description copied from interface:Page
Determine if a zone exists- Specified by:
hasZone
in interfacePage
- Parameters:
name
- The name of the zone- Returns:
- true if the zone exists
- Throws:
AmetysRepositoryException
- If an error occured
-
getZone
public ModifiableZone getZone(String name) throws UnknownZoneException, AmetysRepositoryException
Description copied from interface:ModifiablePage
Retrieves a given zone.- Specified by:
getZone
in interfaceModifiablePage
- Specified by:
getZone
in interfacePage
- Parameters:
name
- the name of the zone.- Returns:
- the given zone.
- Throws:
UnknownZoneException
- if there is no zone for the given name.AmetysRepositoryException
- if an error occurs.
-
createZone
public ModifiableZone createZone(String name) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Creates a given zone.- Specified by:
createZone
in interfaceModifiablePage
- Parameters:
name
- the name of the zone.- Returns:
- the given zone.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getRootAttachments
public ResourceCollection getRootAttachments() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves the attachments root node- Specified by:
getRootAttachments
in interfacePage
- Returns:
- The the attachments root node
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getReferers
public Set<String> getReferers() throws AmetysRepositoryException
Description copied from interface:Page
Retrieves allAmetysObject
ids referencing this page.- Specified by:
getReferers
in interfacePage
- Returns:
- the
AmetysObject
ids referencing this page. - Throws:
AmetysRepositoryException
- if an error occurs.
-
addReferer
public void addReferer(String ametysObjectId) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Add a newAmetysObject
referencing this page.- Specified by:
addReferer
in interfaceModifiablePage
- Parameters:
ametysObjectId
- theAmetysObject
ids referencing this page.- Throws:
AmetysRepositoryException
- if an error occurs.
-
removeReferer
public void removeReferer(String ametysObjectId) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Removes anAmetysObject
referencing this page.- Specified by:
removeReferer
in interfaceModifiablePage
- Parameters:
ametysObjectId
- theAmetysObject
ids referencing this page.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages() throws AmetysRepositoryException
Description copied from interface:PagesContainer
Retrieves child pages.- Specified by:
getChildrenPages
in interfacePagesContainer
- Returns:
- the child pages.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePage) throws AmetysRepositoryException
Description copied from interface:PagesContainer
Retrieves child pages.- Specified by:
getChildrenPages
in interfacePagesContainer
- Parameters:
includeInvisiblePage
- true to include invisible pages- Returns:
- the child pages.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildPageAt
public Page getChildPageAt(int index) throws UnknownAmetysObjectException, AmetysRepositoryException
Description copied from interface:PagesContainer
Gets the childPage
at the given position- Specified by:
getChildPageAt
in interfacePagesContainer
- Parameters:
index
- the position of thePage
within the ordered set of its sibling objects.- Returns:
- the
Page
if found - Throws:
UnknownAmetysObjectException
- if no child page was found at this positionAmetysRepositoryException
- if an error occurs
-
copyTo
public DefaultPage copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo
- A restrict list ofCopiableAmetysObject
authorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public DefaultPage copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException
Description copied from interface:DataHolder
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.- Specified by:
copyTo
in interfaceDataAwareAmetysObject
- Specified by:
copyTo
in interfaceDataHolder
- Parameters:
dataHolder
- The destination dataHolder. Can not be null.- Throws:
UndefinedItemPathException
- if one of the copied data is not defined by the model of the destinationModifiableModelAwareDataHolder
BadItemTypeException
- if the type defined by the model of the destinationModifiableModelAwareDataHolder
doesn't match the copied valueUnknownTypeException
- if there is no available type compatible with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
NotUniqueTypeException
- if there is more than one available types compatibles with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
-
moveTo
public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
Description copied from interface:MovableAmetysObject
Move the current object as a new child of the given object. This node will be the last child. You should call canMoveTo to know if this is a supported operation.- Specified by:
moveTo
in interfaceMovableAmetysObject
- Parameters:
newParent
- The new parent for the current object. Can not be null. Can not be a child of the current node. Must be a TraversableAmetyObject.renameIfExist
- true to rename moved page if a page with same name already exist- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if a page with the same name already exists.
-
canMoveTo
public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
Description copied from interface:MovableAmetysObject
Test if a move can be a success or if it is impossible (e.g. due to the implementation of the target)- Specified by:
canMoveTo
in interfaceMovableAmetysObject
- Parameters:
newParent
- See moveTo.- Returns:
- true if the move operation may succeed. If false is returned and you call moveTo anyway, you may encontered a RuntimeException (such as UnsupportedOperationException)
- Throws:
AmetysRepositoryException
- if an error occurs.
-
orderBefore
public void orderBefore(AmetysObject siblingNode) throws AmetysRepositoryException
Description copied from interface:MovableAmetysObject
Order a node before another sibling node (or as the last node)- Specified by:
orderBefore
in interfaceMovableAmetysObject
- Parameters:
siblingNode
- The node that will be the next sibling node of the current node. Must have the same parent as the current node. Can be null to set the current node as the last node.- Throws:
AmetysRepositoryException
- if an error occurs.
-
isVisible
public boolean isVisible() throws AmetysRepositoryException
Description copied from interface:Page
Determine if the page is visible into navigation elements- Specified by:
isVisible
in interfacePage
- Returns:
- true if the page is visible.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setVisible
public void setVisible(boolean isVisible) throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Set the visibility of the page- Specified by:
setVisible
in interfaceModifiablePage
- Parameters:
isVisible
- the page visibility.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDataHolder
public ModifiableModelLessDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getMetadataHolder
public ModifiableCompositeMetadata getMetadataHolder()
Description copied from class:SimpleAmetysObject
Returns the rootCompositeMetadata
of thisAmetysObject
.- Specified by:
getMetadataHolder
in interfaceMetadataAwareAmetysObject
- Specified by:
getMetadataHolder
in interfaceModifiableMetadataAwareAmetysObject
- Overrides:
getMetadataHolder
in classSimpleAmetysObject<F extends DefaultPageFactory>
- Returns:
- the root
CompositeMetadata
of thisAmetysObject
-
getTemplateParametersHolder
public ModifiableModelAwareDataHolder getTemplateParametersHolder() throws AmetysRepositoryException
Description copied from interface:ModifiablePage
Get the view parameters- Specified by:
getTemplateParametersHolder
in interfaceModifiablePage
- Specified by:
getTemplateParametersHolder
in interfacePage
- Returns:
- the view parameters
- Throws:
AmetysRepositoryException
- if an error occurs.
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException
Description copied from interface:ModelLessDataHolder
Generates SAX events for data contained in thisDataHolder
- Specified by:
dataToSAX
in interfaceModelLessDataAwareAmetysObject
- Specified by:
dataToSAX
in interfaceModelLessDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventscontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationUnknownTypeException
- if there is no compatible type with the saxed valueNotUniqueTypeException
- if there are many compatible types (there is no way to determine which type is the good one) with the saxed value
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException
Description copied from interface:DataHolder
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Specified by:
dataToSAX
in interfaceDataAwareAmetysObject
- Specified by:
dataToSAX
in interfaceDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAXcontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
-