public class WikiPage
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALIAS
A special variable name for storing a page alias.
|
static java.lang.String |
CHANGENOTE
A special variable name for storing a changenote.
|
static java.lang.String |
DESCRIPTION
"Summary" is a short summary of the page.
|
static java.lang.String |
REDIRECT
A special variable name for storing a redirect note
|
Constructor and Description |
---|
WikiPage(WikiEngine engine,
java.lang.String name)
Create a new WikiPage using a given engine and name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a deep clone of a WikiPage.
|
int |
compareTo(java.lang.Object page)
Compares a page with another using the defined PageNameComparator.
|
boolean |
equals(java.lang.Object obj) |
Acl |
getAcl()
Returns the Acl for this page.
|
java.lang.Object |
getAttribute(java.lang.String key)
A WikiPage may have a number of attributes, which might or might not be
available.
|
java.util.Map |
getAttributes()
Returns the full attributes Map, in case external code needs
to iterate through the attributes.
|
java.lang.String |
getAuthor()
Returns author name, or null, if no author has been defined.
|
java.util.Date |
getLastModified()
Returns the date when this page was last modified.
|
int |
getLayerId() |
java.lang.String |
getName()
Returns the name of the page.
|
long |
getSize()
Returns the size of the page.
|
long |
getTransId() |
int |
getVersion()
Returns the version that this WikiPage instance represents.
|
java.lang.String |
getWiki()
Returns the wiki nanme 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.
|
java.lang.Object |
removeAttribute(java.lang.String key)
Removes an attribute from the page, if it exists.
|
void |
setAcl(Acl acl)
Sets the Acl for this page.
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
Sets an metadata attribute.
|
void |
setAuthor(java.lang.String author)
Sets the author of the page.
|
void |
setHasMetadata()
Sets the metadata flag to true.
|
void |
setLastModified(java.util.Date date)
Sets the last modification date.
|
void |
setLayerId(int layerId) |
void |
setSize(long size)
Sets the size.
|
void |
setTransId(long transId) |
void |
setVersion(int version)
Sets the page version.
|
java.lang.String |
toString()
Returns a debug-suitable version of the page.
|
public static final java.lang.String DESCRIPTION
public static final java.lang.String ALIAS
public static final java.lang.String REDIRECT
public static final java.lang.String CHANGENOTE
public WikiPage(WikiEngine engine, java.lang.String name)
engine
- The WikiEngine that owns this page.name
- The name of the page.public java.lang.String getName()
public java.lang.Object getAttribute(java.lang.String key)
key
- The key using which the attribute is fetchedpublic void setAttribute(java.lang.String key, java.lang.Object attribute)
key
- The key for the attribute used to fetch the attribute later on.attribute
- The attribute valuegetAttribute(String)
public java.util.Map getAttributes()
public java.lang.Object removeAttribute(java.lang.String key)
key
- The key for the attributepublic java.util.Date getLastModified()
public void setLastModified(java.util.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(java.lang.String author)
author
- The author name.public java.lang.String getAuthor()
public java.lang.String getWiki()
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()
@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int compareTo(java.lang.Object page)
compareTo
in interface java.lang.Comparable
page
- The object to compare against@CheckReturnValue public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public long getTransId()
public void setTransId(long transId)
transId
- the transId to setpublic int getLayerId()
public void setLayerId(int layerId)
layerId
- the layerId to setstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.