Package org.apache.wiki.api.core
Interface Page
- All Superinterfaces:
java.lang.Cloneable,java.lang.Comparable<Page>
- All Known Subinterfaces:
Attachment
- All Known Implementing Classes:
Attachment,DynamicAttachment,WikiPage
public interface Page extends java.lang.Cloneable, java.lang.Comparable<Page>
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALIASA special variable name for storing a page alias.static java.lang.StringAUTHORA special variable name for storing the author.static java.lang.StringCHANGENOTEA special variable name for storing a changenote.static java.lang.StringDESCRIPTION"Summary" is a short summary of the page.static java.lang.StringREDIRECTA special variable name for storing a redirect notestatic java.lang.StringVIEWCOUNTA special variable name for storing a viewcount. -
Method Summary
Modifier and Type Method Description Pageclone()AclgetAcl()Returns the Acl for this page.<T> TgetAttribute(java.lang.String key)A WikiPage may have a number of attributes, which might or might not be available.java.util.Map<java.lang.String,java.lang.Object>getAttributes()Returns the full attributes Map, in case external code needs to iterate through the attributes.java.lang.StringgetAuthor()Returns author name, or null, if no author has been defined.java.util.DategetLastModified()Returns the date when this page was last modified.java.lang.StringgetName()Returns the name of the page.longgetSize()Returns the size of the page.intgetVersion()Returns the version that this WikiPage instance represents.java.lang.StringgetWiki()Returns the wiki name for this pagebooleanhasMetadata()Returnstrueif the page has valid metadata; that is, it has been parsed.voidinvalidateMetadata()This method will remove all metadata from the page.<T> TremoveAttribute(java.lang.String key)Removes an attribute from the page, if it exists.voidsetAcl(Acl acl)Sets the Acl for this page.voidsetAttribute(java.lang.String key, java.lang.Object attribute)Sets an metadata attribute.voidsetAuthor(java.lang.String author)Sets the author of the page.voidsetHasMetadata()Sets the metadata flag to true.voidsetLastModified(java.util.Date date)Sets the last modification date.voidsetSize(long size)Sets the size.voidsetVersion(int version)Sets the page version.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
DESCRIPTION
"Summary" is a short summary of the page. It is a String.- See Also:
- Constant Field Values
-
ALIAS
A special variable name for storing a page alias.- See Also:
- Constant Field Values
-
REDIRECT
A special variable name for storing a redirect note- See Also:
- Constant Field Values
-
AUTHOR
A special variable name for storing the author.- See Also:
- Constant Field Values
-
CHANGENOTE
A special variable name for storing a changenote.- See Also:
- Constant Field Values
-
VIEWCOUNT
A special variable name for storing a viewcount.- See Also:
- Constant Field Values
-
-
Method Details
-
getName
java.lang.String getName()Returns the name of the page.- Returns:
- The page name.
-
getLastModified
java.util.Date getLastModified()Returns the date when this page was last modified.- Returns:
- The last modification date
-
setLastModified
Sets the last modification date. In general, this is only changed by the provider.- Parameters:
date- The date
-
setVersion
Sets the page version. In general, this is only changed by the provider.- Parameters:
version- The version number
-
getVersion
int getVersion()Returns the version that this WikiPage instance represents.- Returns:
- the version number of this page.
-
getSize
long getSize()Returns the size of the page.- Returns:
- the size of the page.
- Since:
- 2.1.109
-
setSize
Sets the size. Typically called by the provider only.- Parameters:
size- The size of the page.- Since:
- 2.1.109
-
setAuthor
Sets the author of the page. Typically called only by the provider.- Parameters:
author- The author name.
-
getAuthor
java.lang.String getAuthor()Returns author name, or null, if no author has been defined.- Returns:
- Author name, or possibly null.
-
getWiki
java.lang.String getWiki()Returns the wiki name for this page- Returns:
- The name of the wiki.
-
invalidateMetadata
void invalidateMetadata()This method will remove all metadata from the page. -
hasMetadata
boolean hasMetadata()Returnstrueif the page has valid metadata; that is, it has been parsed. Note that this method is a kludge to support our pre-3.0 metadata system, and as such will go away with the new API.- Returns:
- true, if the page has metadata.
-
setHasMetadata
void setHasMetadata()Sets the metadata flag to true. Never call. -
getAttribute
A WikiPage may have a number of attributes, which might or might not be available. Typically attributes are things that do not need to be stored with the wiki page to the page repository, but are generated on-the-fly. A provider is not required to save them, but they can do that if they really want.- Parameters:
key- The key using which the attribute is fetched- Returns:
- The attribute. If the attribute has not been set, returns null.
-
setAttribute
Sets an metadata attribute.- Parameters:
key- The key for the attribute used to fetch the attribute later on.attribute- The attribute value- See Also:
getAttribute(String)
-
removeAttribute
Removes an attribute from the page, if it exists.- Parameters:
key- The key for the attribute- Returns:
- If the attribute existed, returns the object.
- Since:
- 2.1.111
-
getAttributes
java.util.Map<java.lang.String,java.lang.Object> getAttributes()Returns the full attributes Map, in case external code needs to iterate through the attributes.- Returns:
- The attribute Map. Please note that this is a direct reference, not a copy.
-
getAcl
Returns the Acl for this page. May returnnull, in case there is no Acl defined, or it has not yet been set bysetAcl(Acl).- Returns:
- The access control list. May return null, if there is no acl.
-
setAcl
Sets the Acl for this page. Note that method does not persist the Acl itself to back-end storage or in page markup; it merely sets the internal field that stores the Acl. To persist the Acl, callers should invokeAclManager.setPermissions(org.apache.wiki.api.core.Page, org.apache.wiki.api.core.Acl).- Parameters:
acl- The Acl to set
-
clone
-