| java.lang.Object com.ecyrd.jspwiki.WikiPage
All known Subclasses: com.ecyrd.jspwiki.attachment.Attachment,
WikiPage | public class WikiPage implements Cloneable,Comparable(Code) | | Simple wrapper class for the Wiki page attributes. The Wiki page
content is moved around in Strings, though.
|
Field Summary | |
final public static String | ALIAS A special variable name for storing a page alias. | final public static String | CHANGENOTE A special variable name for storing a changenote. | final public static String | DESCRIPTION "Summary" is a short summary of the page. | final public static String | REDIRECT |
Constructor Summary | |
public | WikiPage(WikiEngine engine, String name) Create a new WikiPage using a given engine and name. |
Method Summary | |
public Object | clone() Creates a deep clone of a WikiPage. | public int | compareTo(Object o) Compares a page with another. | public boolean | equals(Object o) A page is equal to another page if its name and version are equal. | public Acl | getAcl() Returns the Acl for this page. | public Object | getAttribute(String key) A WikiPage may have a number of attributes, which might or might not be
available. | public Map | getAttributes() Returns the full attributes Map, in case external code needs
to iterate through the attributes.
The attribute Map. | public String | getAuthor() Returns author name, or null, if no author has been defined. | public Date | getLastModified() Returns the date when this page was last modified. | public String | getName() Returns the name of the page. | public long | getSize() Returns the size of the page.
the size of the page. | public int | getVersion() Returns the version that this WikiPage instance represents. | public String | getWiki() | public boolean | hasMetadata() Returns true if the page has valid metadata; that is, it has been parsed. | public int | hashCode() | public void | invalidateMetadata() This method will remove all metadata from the page. | public Object | removeAttribute(String key) Removes an attribute from the page, if it exists. | public void | setAcl(Acl acl) Sets the Acl for this page. | public void | setAttribute(String key, Object attribute) Sets an metadata attribute. | public void | setAuthor(String author) Sets the author of the page. | public void | setHasMetadata() Sets the metadata flag to true. | public void | setLastModified(Date date) Sets the last modification date. | public void | setSize(long size) Sets the size. | public void | setVersion(int version) Sets the page version. | public String | toString() Returns a debug-suitable version of the page. |
ALIAS | final public static String ALIAS(Code) | | A special variable name for storing a page alias.
|
CHANGENOTE | final public static String CHANGENOTE(Code) | | A special variable name for storing a changenote.
|
DESCRIPTION | final public static String DESCRIPTION(Code) | | "Summary" is a short summary of the page. It is a String.
|
REDIRECT | final public static String REDIRECT(Code) | | A special variable name for storing a redirect note
|
WikiPage | public WikiPage(WikiEngine engine, String name)(Code) | | Create a new WikiPage using a given engine and name.
Parameters: engine - The WikiEngine that owns this page. Parameters: name - The name of the page. |
clone | public Object clone()(Code) | | Creates a deep clone of a WikiPage. Strings are not cloned, since
they're immutable. Attributes are not cloned, only the internal
HashMap (so if you modify the contents of a value of an attribute,
these will reflect back to everyone).
A deep clone of the WikiPage |
compareTo | public int compareTo(Object o)(Code) | | Compares a page with another. The primary sorting order
is according to page name, and if they have the same name,
then according to the page version.
Parameters: o - The object to compare against -1, 0 or 1 |
equals | public boolean equals(Object o)(Code) | | A page is equal to another page if its name and version are equal.
|
getAcl | public Acl getAcl()(Code) | | Returns the Acl for this page. May return null ,
in case there is no Acl defined, or it has not
yet been set by
WikiPage.setAcl(Acl) .
The access control list. May return null, if there is no acl. |
getAttribute | public Object getAttribute(String key)(Code) | | 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 The attribute. If the attribute has not been set, returns null. |
getAttributes | public Map getAttributes()(Code) | | Returns the full attributes Map, in case external code needs
to iterate through the attributes.
The attribute Map. Please note that this is a directreference, not a copy. |
getAuthor | public String getAuthor()(Code) | | Returns author name, or null, if no author has been defined.
Author name, or possibly null. |
getLastModified | public Date getLastModified()(Code) | | Returns the date when this page was last modified.
The last modification date |
getName | public String getName()(Code) | | Returns the name of the page.
The page name. |
getSize | public long getSize()(Code) | | Returns the size of the page.
the size of the page. since: 2.1.109 |
getVersion | public int getVersion()(Code) | | Returns the version that this WikiPage instance represents.
the version number of this page. |
getWiki | public String getWiki()(Code) | | Returns the wiki nanme for this page
The name of the wiki. |
hasMetadata | public boolean hasMetadata()(Code) | | Returns 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.
true, if the page has metadata. |
hashCode | public int hashCode()(Code) | | |
invalidateMetadata | public void invalidateMetadata()(Code) | | This method will remove all metadata from the page.
|
removeAttribute | public Object removeAttribute(String key)(Code) | | Removes an attribute from the page, if it exists.
Parameters: key - The key for the attribute If the attribute existed, returns the object. since: 2.1.111 |
setAttribute | public void setAttribute(String key, Object attribute)(Code) | | Sets an metadata attribute.
See Also: WikiPage.getAttribute() Parameters: key - The key for the attribute used to fetch the attribute later on. Parameters: attribute - The attribute value |
setAuthor | public void setAuthor(String author)(Code) | | Sets the author of the page. Typically called only by the provider.
Parameters: author - The author name. |
setHasMetadata | public void setHasMetadata()(Code) | | Sets the metadata flag to true. Never call.
|
setLastModified | public void setLastModified(Date date)(Code) | | Sets the last modification date. In general, this is only
changed by the provider.
Parameters: date - The date |
setSize | public void setSize(long size)(Code) | | Sets the size. Typically called by the provider only.
Parameters: size - The size of the page. since: 2.1.109 |
setVersion | public void setVersion(int version)(Code) | | Sets the page version. In general, this is only changed
by the provider.
Parameters: version - The version number |
toString | public String toString()(Code) | | Returns a debug-suitable version of the page.
A debug string. |
|
|