|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.WikiPage
public class WikiPage
Simple wrapper class for the Wiki page attributes. The Wiki page content is moved around in Strings, though.
Field Summary | |
---|---|
static String |
ALIAS
A special variable name for storing a page alias. |
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 |
Constructor Summary | |
---|---|
WikiPage(WikiEngine engine,
String name)
Create a new WikiPage using a given engine and name. |
Method Summary | |
---|---|
Object |
clone()
Creates a deep clone of a WikiPage. |
int |
compareTo(Object page)
Compares a page with another 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 |
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 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. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DESCRIPTION
public static final String ALIAS
public static final String REDIRECT
public static final String CHANGENOTE
Constructor Detail |
---|
public WikiPage(WikiEngine engine, String name)
engine
- The WikiEngine that owns this page.name
- The name of the page.Method Detail |
---|
public String getName()
public Object getAttribute(String key)
key
- The key using which the attribute is fetched
public 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 getAttributes()
public Object removeAttribute(String key)
key
- The key for the attribute
public 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 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()
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public int compareTo(Object page)
compareTo
in interface Comparable
page
- The object to compare against
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |