public class WikiPage extends Object implements Cloneable, Comparable<WikiPage>
Modifier and Type | Field and Description |
---|---|
static String |
ALIAS
A special variable name for storing a page alias.
|
static String |
AUTHOR
A special variable name for storing the author.
|
static String |
CHANGENOTE
A special variable name for storing a changenote.
|
static String |
DESCRIPTION
"Summary" is a short summary of the page.
|
static String |
REDIRECT
A special variable name for storing a redirect note
|
static String |
VIEWCOUNT
A special variable name for storing a viewcount.
|
Constructor and Description |
---|
WikiPage(WikiEngine engine,
String name)
Create a new WikiPage using a given engine and name.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a deep clone of a WikiPage.
|
int |
compareTo(WikiPage page)
Compares a page with another by name using the defined PageNameComparator.
|
Acl |
getAcl()
Returns the Acl for this page.
|
Object |
getAttribute(String key)
A WikiPage may have a number of attributes, which might or might not be
available.
|
Map<String,Object> |
getAttributes()
Returns the full attributes Map, in case external code needs
to iterate through the attributes.
|
String |
getAuthor()
Returns author name, or null, if no author has been defined.
|
Date |
getLastModified()
Returns the date when this page was last modified.
|
String |
getName()
Returns the name of the page.
|
long |
getSize()
Returns the size of the page.
|
int |
getVersion()
Returns the version that this WikiPage instance represents.
|
String |
getWiki()
Returns the wiki name for this page
|
int |
hashCode() |
boolean |
hasMetadata()
Returns
true if the page has valid metadata; that is, it has been parsed. |
void |
invalidateMetadata()
This method will remove all metadata from the page.
|
Object |
removeAttribute(String key)
Removes an attribute from the page, if it exists.
|
void |
setAcl(Acl acl)
Sets the Acl for this page.
|
void |
setAttribute(String key,
Object attribute)
Sets an metadata attribute.
|
void |
setAuthor(String author)
Sets the author of the page.
|
void |
setHasMetadata()
Sets the metadata flag to true.
|
void |
setLastModified(Date date)
Sets the last modification date.
|
void |
setSize(long size)
Sets the size.
|
void |
setVersion(int version)
Sets the page version.
|
String |
toString()
Returns a debug-suitable version of the page.
|
public static final String DESCRIPTION
public static final String ALIAS
public static final String REDIRECT
public static final String AUTHOR
public static final String CHANGENOTE
public static final String VIEWCOUNT
public WikiPage(WikiEngine engine, String name)
engine
- The WikiEngine that owns this page.name
- The name of the page.public Object getAttribute(String key)
key
- The key using which the attribute is fetchedpublic void setAttribute(String key, Object attribute)
key
- The key for the attribute used to fetch the attribute later on.attribute
- The attribute valuegetAttribute(String)
public Map<String,Object> getAttributes()
public Object removeAttribute(String key)
key
- The key for the attributepublic Date getLastModified()
public void setLastModified(Date date)
date
- The datepublic void setVersion(int version)
version
- The version numberpublic int getVersion()
public long getSize()
public void setSize(long size)
size
- The size of the page.public Acl getAcl()
null
,
in case there is no Acl defined, or it has not
yet been set by setAcl(Acl)
.public void setAcl(Acl acl)
AclManager.setPermissions(WikiPage, Acl)
.acl
- The Acl to setpublic void setAuthor(String author)
author
- The author name.public String getAuthor()
public void invalidateMetadata()
public boolean hasMetadata()
true
if 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.public void setHasMetadata()
public Object clone()
public int compareTo(WikiPage page)
compareTo
in interface Comparable<WikiPage>
page
- The page to compare againstCopyright © 2001-2019 The Apache Software Foundation. All rights reserved.