com.atlassian.confluence.pages
Class AbstractPage

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by com.atlassian.confluence.core.AbstractVersionedEntityObject
              extended by com.atlassian.confluence.core.ContentEntityObject
                  extended by com.atlassian.confluence.core.SpaceContentEntityObject
                      extended by com.atlassian.confluence.pages.AbstractPage
All Implemented Interfaces:
com.atlassian.bonnie.Searchable, Addressable, ContentTypeAware, HasLinkWikiMarkup, Versioned, Labelable, Spaced, Serializable, Cloneable, Comparable
Direct Known Subclasses:
BlogPost, Page

public abstract class AbstractPage
extends SpaceContentEntityObject
implements HasLinkWikiMarkup

Parent of the concrete Page and BlogPost classes

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.confluence.core.ContentEntityObject
CREATED, CURRENT, DELETED, MODIFIED
 
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
 
Constructor Summary
AbstractPage()
           
 
Method Summary
 void convertToHistoricalVersion()
          Remove all data from the object that does not need to be saved by historical versions.
 String getAttachmentsUrlPath()
           
 ContentEntityObject getContentEntityObject()
           
 AbstractPage getLatestVersion()
          Get the latest, current version of this versioned object.
 AbstractPage getOriginalVersionPage()
          if this page is a historical version, then this method returns the current/latest version of this page if this page is the latest version, then this returns null this method name should really be refactored to getCurrentVersionOfPage()
 int getPreviousVersion()
          Convenience method to get the immediately prior version since we can't perform arithmetic in velocity (assume that versions are sequential) Method is used in email templates where session is not available.
 Collection getSearchableDependants()
           
 List<Comment> getTopLevelComments()
           
 String getUrlPath()
           
static boolean hasInvalidTitleCharacters(String title)
           
static boolean isValidPageTitle(String title)
           
static boolean isValidPageTitleCharacter(char c)
           
static boolean isValidTitleLength(String title)
           
 void remove(PageManager pageManager)
          Remove this page from the world.
 void setOriginalVersionPage(AbstractPage originalVersionPage)
           
 void setTitle(String title)
           
 
Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
addTrackbackLink, getNameForComparison, getSpace, getSpaceKey, hashCode, isIndexable, isInSpace, setSpace
 
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addLabelling, addOutgoingLink, addPermission, addReferralLink, clone, compareTo, equals, getAttachmentNamed, getAttachments, getBodyAsString, getBodyAsStringWithoutMarkup, getBodyContent, getBodyContent, getBodyContents, getComments, getContentPermission, getContentPermissionSet, getContentStatus, getDefaultBodyType, getDisplayTitle, getExcerpt, getGlobalLabels, getIdAsString, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getLatestVersionsOfAttachments, getOutgoingLinks, getPermissions, getPersonalLabels, getReferralLinks, getRenderedVersionComment, getTeamLabels, getTitle, getTrackbackLinks, getType, getTypeEnum, getUserAccessor, getVersionComment, getVisibleLabels, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isFavourite, isRecentlyUpdatedFor, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeLabelling, removeOutgoingLink, removeReferralLink, removeTrackbackLink, setAttachments, setBodyAsString, setBodyContent, setBodyContents, setComments, setContent, setContentStatus, setOutgoingLinks, setReferralLinks, setTrackbackLinks, setUserAccessor, setVersionComment, toPageContext, toString, trash
 
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, setVersion
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreatorName, getLastModifierName, getRealClass, isPersistent, setCreatorName, setLastModifierName
 
Methods inherited from class com.atlassian.core.bean.EntityObject
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.core.HasLinkWikiMarkup
getLinkWikiMarkup
 
Methods inherited from interface com.atlassian.bonnie.Searchable
getId
 
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
 

Constructor Detail

AbstractPage

public AbstractPage()
Method Detail

isValidPageTitle

public static boolean isValidPageTitle(String title)

isValidTitleLength

public static boolean isValidTitleLength(String title)

hasInvalidTitleCharacters

public static boolean hasInvalidTitleCharacters(String title)

isValidPageTitleCharacter

public static boolean isValidPageTitleCharacter(char c)

getContentEntityObject

public ContentEntityObject getContentEntityObject()

setTitle

public void setTitle(String title)
Overrides:
setTitle in class ContentEntityObject

convertToHistoricalVersion

public void convertToHistoricalVersion()
Description copied from interface: Versioned
Remove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.

When using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time.

Specified by:
convertToHistoricalVersion in interface Versioned
Overrides:
convertToHistoricalVersion in class SpaceContentEntityObject

getOriginalVersionPage

public AbstractPage getOriginalVersionPage()
if this page is a historical version, then this method returns the current/latest version of this page if this page is the latest version, then this returns null this method name should really be refactored to getCurrentVersionOfPage()


setOriginalVersionPage

public void setOriginalVersionPage(AbstractPage originalVersionPage)

getPreviousVersion

public int getPreviousVersion()
Convenience method to get the immediately prior version since we can't perform arithmetic in velocity (assume that versions are sequential) Method is used in email templates where session is not available. Hence we cannot load previousVersions to return a page object


remove

public void remove(PageManager pageManager)
Remove this page from the world. This method should sever any inverse relationships this page may have with other objects.


getSearchableDependants

public Collection getSearchableDependants()
Specified by:
getSearchableDependants in interface com.atlassian.bonnie.Searchable
Overrides:
getSearchableDependants in class ContentEntityObject

getUrlPath

public String getUrlPath()
Specified by:
getUrlPath in interface Addressable
Specified by:
getUrlPath in class ContentEntityObject

getTopLevelComments

public List<Comment> getTopLevelComments()

getAttachmentsUrlPath

public String getAttachmentsUrlPath()
Overrides:
getAttachmentsUrlPath in class ContentEntityObject

getLatestVersion

public AbstractPage getLatestVersion()
Get the latest, current version of this versioned object. If this object is the current version, return this object.

Specified by:
getLatestVersion in interface Versioned
Overrides:
getLatestVersion in class AbstractVersionedEntityObject
Returns:
the current version of this object.


Copyright © 2003-2011 Atlassian. All Rights Reserved.