F - the actual type of factory.public class DefaultPage<F extends DefaultPageFactory> extends DefaultTraversableAmetysObject<F> implements ModifiablePage, CopiableAmetysObject, MoveablePage
Page implementation stored into a JCR node using
ametys:defaultPage node type.Page.LinkType, Page.PageType| Modifier and Type | Field and 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 and Description |
|---|
DefaultPage(Node node,
String parentPath,
F factory)
Creates a
DefaultPage. |
| Modifier and Type | Method and Description |
|---|---|
void |
addReferer(String ametysObjectId)
Add a new
AmetysObject referencing this page. |
boolean |
canMoveTo(AmetysObject newParent)
Test if a move can be a success or if it is impossible (e.g.
|
DefaultPage |
copyTo(ModifiableTraversableAmetysObject parent,
String name)
Copy the current
AmetysObject to the given object. |
DefaultPage |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
List<String> restrictTo)
Copy the current
AmetysObject to the given object if it is not in the restriction list. |
ModifiableZone |
createZone(String name)
Creates a given zone.
|
Page |
getChildPageAt(int index)
Gets the child
Page at the given position |
AmetysObjectIterable<? extends Page> |
getChildrenPages()
Retrieves child pages.
|
AmetysObjectIterable<? extends Page> |
getChildrenPages(boolean includeInvisiblePage)
Retrieves child pages.
|
int |
getDepth()
Get the page depth
|
String |
getLongTitle()
Retrieves the long title.
|
String |
getPathInSitemap()
Computes the path relative to the current sitemap.
|
Set<String> |
getReferers()
Retrieves all
AmetysObject ids referencing this page. |
ResourceCollection |
getRootAttachments()
Retrieves the attachments root node
|
Site |
getSite()
Returns this object's site.
|
Sitemap |
getSitemap()
Retrieves the sitemap containing the current sitemap.
|
String |
getSitemapName()
Returns this page's sitemap name
|
String |
getSiteName()
Returns this object's site name.
|
Set<String> |
getTags()
Retrieves current tags.
|
String |
getTemplate()
Retrieves the template name.
|
String |
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 exists
|
boolean |
isVisible()
Determine if the page is visible into navigation elements
|
void |
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 an
AmetysObject 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 page
|
void |
tag(String tag)
Tags.
|
void |
untag(String tag)
Untags.
|
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, hasChild, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMetadataHoldergetChild, getChildAt, getChildPosition, getChildren, hasChildequals, getId, getName, getParent, getParentPath, getPath, hashCodegetMetadataHoldercreateChildneedsSave, rename, revertChanges, saveChangesremovegetNodepublic static final String METADATA_TITLE
public static final String METADATA_LONG_TITLE
public static final String METADATA_TYPE
public static final String METADATA_URL
public static final String METADATA_URLTYPE
public static final String METADATA_TEMPLATE
public static final String METADATA_REFERERS
public static final String METADATA_VISIBLE
public static final String METADATA_ROBOTS_DISALLOW
public static final String ZONES_NODE_NAME
public static final String ZONES_NODE_TYPE
public static final String ZONE_NODE_TYPE
public static final String ATTACHMENTS_NODE_NAME
public static final String METADATA_SITE
public static final String METADATA_SITEMAP
public static final String METADATA_PUBLICATION_START_DATE
public static final String METADATA_PUBLICATION_END_DATE
public DefaultPage(Node node, String parentPath, F factory)
DefaultPage.node - the node backing this AmetysObject.parentPath - the parent path in the Ametys hierarchy.factory - the DefaultPageFactory which creates the
AmetysObject.public Set<String> getTags() throws AmetysRepositoryException
TagAwareAmetysObjectgetTags in interface TagAwareAmetysObjectAmetysRepositoryException - if an error occurs.public void tag(String tag) throws AmetysRepositoryException
TaggableAmetysObjecttag in interface TaggableAmetysObjecttag - the tag to add.AmetysRepositoryException - if an error occurs.public void untag(String tag) throws AmetysRepositoryException
TaggableAmetysObjectuntag in interface TaggableAmetysObjecttag - the tag to remove.AmetysRepositoryException - if an error occurs.public String getTitle() throws AmetysRepositoryException
PagegetTitle in interface PageAmetysRepositoryException - if an error occurs.public void setTitle(String title) throws AmetysRepositoryException
ModifiablePagesetTitle in interface ModifiablePagetitle - the title.AmetysRepositoryException - if an error occurs.public String getLongTitle() throws AmetysRepositoryException
PagegetLongTitle in interface PageAmetysRepositoryException - if an error occurs.public void setLongTitle(String title) throws AmetysRepositoryException
ModifiablePagesetLongTitle in interface ModifiablePagetitle - the title.AmetysRepositoryException - if an error occurs.public Sitemap getSitemap() throws AmetysRepositoryException
PagesContainergetSitemap in interface PagesContainerAmetysRepositoryException - if an error occurs.public int getDepth() throws AmetysRepositoryException
PagegetDepth in interface PageAmetysRepositoryException - if an error occurs.public Site getSite() throws AmetysRepositoryException
SiteAwareAmetysObjectgetSite in interface SiteAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getSiteName()
SiteAwareAmetysObjectgetSiteName in interface SiteAwareAmetysObjectpublic void setSiteName(String siteName)
ModifiablePagesetSiteName in interface ModifiablePagesiteName - the site name.public String getSitemapName() throws AmetysRepositoryException
PagesContainergetSitemapName in interface PagesContainerAmetysRepositoryException - if an error occurs.public void setSitemapName(String sitemapName) throws AmetysRepositoryException
ModifiablePagesetSitemapName in interface ModifiablePagesitemapName - the sitemap name.AmetysRepositoryException - if an error occurs.public String getPathInSitemap() throws AmetysRepositoryException
PagesContainergetPathInSitemap in interface PagesContainerAmetysRepositoryException - if an error occurs.public Page.PageType getType() throws AmetysRepositoryException
PagegetType in interface PageAmetysRepositoryException - if an error occurs.Page.PageTypepublic void setType(Page.PageType type) throws AmetysRepositoryException
ModifiablePagesetType in interface ModifiablePagetype - the type.AmetysRepositoryException - if an error occurs.Page.PageTypepublic String getURL() throws AmetysRepositoryException
PagegetURL in interface PageAmetysRepositoryException - if an error occurs.public Page.LinkType getURLType() throws AmetysRepositoryException
PagegetURLType in interface PageAmetysRepositoryException - if an error occurs.public void setURL(Page.LinkType type, String url) throws AmetysRepositoryException
ModifiablePagesetURL in interface ModifiablePagetype - the type of linkurl - the linked URL (depending on the type)AmetysRepositoryException - if an error occurs.public String getTemplate() throws AmetysRepositoryException
PagegetTemplate in interface Pagenull if none has
been set.AmetysRepositoryException - if an error occurs.public void setTemplate(String template) throws AmetysRepositoryException
ModifiablePagesetTemplate in interface ModifiablePagetemplate - the template name.AmetysRepositoryException - if an error occurs.public AmetysObjectIterable<ModifiableZone> getZones() throws AmetysRepositoryException
ModifiablePagegetZones in interface ModifiablePagegetZones in interface PageAmetysRepositoryException - if an error occurs.public boolean hasZone(String name) throws AmetysRepositoryException
PagehasZone in interface Pagename - The name of the zoneAmetysRepositoryException - If an error occuredpublic ModifiableZone getZone(String name) throws UnknownZoneException, AmetysRepositoryException
ModifiablePagegetZone in interface ModifiablePagegetZone in interface Pagename - the name of the zone.UnknownZoneException - if there is no zone for the given name.AmetysRepositoryException - if an error occurs.public ModifiableZone createZone(String name) throws AmetysRepositoryException
ModifiablePagecreateZone in interface ModifiablePagename - the name of the zone.AmetysRepositoryException - if an error occurs.public ResourceCollection getRootAttachments() throws AmetysRepositoryException
PagegetRootAttachments in interface PageAmetysRepositoryException - if an error occurs.public Set<String> getReferers() throws AmetysRepositoryException
PageAmetysObject ids referencing this page.getReferers in interface PageAmetysObject ids referencing this page.AmetysRepositoryException - if an error occurs.public void addReferer(String ametysObjectId) throws AmetysRepositoryException
ModifiablePageAmetysObject referencing this page.addReferer in interface ModifiablePageametysObjectId - the AmetysObject ids referencing this page.AmetysRepositoryException - if an error occurs.public void removeReferer(String ametysObjectId) throws AmetysRepositoryException
ModifiablePageAmetysObject referencing this page.removeReferer in interface ModifiablePageametysObjectId - the AmetysObject ids referencing this page.AmetysRepositoryException - if an error occurs.public AmetysObjectIterable<? extends Page> getChildrenPages() throws AmetysRepositoryException
PagesContainergetChildrenPages in interface PagesContainerAmetysRepositoryException - if an error occurs.public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePage) throws AmetysRepositoryException
PagesContainergetChildrenPages in interface PagesContainerincludeInvisiblePage - true to include invisible pagesAmetysRepositoryException - if an error occurs.public Page getChildPageAt(int index) throws UnknownAmetysObjectException, AmetysRepositoryException
PagesContainerPage at the given positiongetChildPageAt in interface PagesContainerindex - the position of the Page within the ordered set of its sibling objects.Page if foundUnknownAmetysObjectException - if no child page was found at this positionAmetysRepositoryException - if an error occurspublic DefaultPage copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object if it is not in the restriction list. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 of CopiableAmetysObject authorized to be copiedAmetysRepositoryException - if an error occurs.public DefaultPage copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 objectAmetysRepositoryException - if an error occurs.public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
MovableAmetysObjectmoveTo in interface MovableAmetysObjectnewParent - 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 existAmetysRepositoryException - if an error occurs.RepositoryIntegrityViolationException - if a page with the same name already exists.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObjectcanMoveTo in interface MovableAmetysObjectnewParent - See moveTo.AmetysRepositoryException - if an error occurs.public void orderBefore(AmetysObject siblingNode) throws AmetysRepositoryException
MovableAmetysObjectorderBefore in interface MovableAmetysObjectsiblingNode - 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.AmetysRepositoryException - if an error occurs.public boolean isVisible() throws AmetysRepositoryException
PageisVisible in interface PageAmetysRepositoryException - if an error occurs.public void setVisible(boolean isVisible) throws AmetysRepositoryException
ModifiablePagesetVisible in interface ModifiablePageisVisible - the page visibility.AmetysRepositoryException - if an error occurs.