org.meshcms.core
Class PageInfo

java.lang.Object
  extended byorg.meshcms.core.PageInfo

public final class PageInfo
extends java.lang.Object

This class describes a web page with all the related info (path, title, hits and so on).


Constructor Summary
PageInfo(WebSite webSite, Path path)
          Creates a page info in the specified WebSite to describe the page available at the specified path.
 
Method Summary
 void addHit()
          Adds a hit to the count.
protected  void copyStatsFrom(PageInfo other)
           
 java.lang.String getCharset()
           
 java.lang.String getExcerpt()
          Return an excerpt of the page content
 int getHits()
          Returns the hit count for the last day.
 int getHits(int daysBefore)
          Returns the hit count for a previous day.
 java.lang.String[] getKeywords()
           
 long getLastModified()
          Returns the time of the last modification made to the page.
protected  int getLastStatsIndex()
           
 int getLevel()
          Returns the depth level of the page.
 java.lang.String getName()
          Returns the file name of the page.
 Path getPath()
          Returns the path of the page.
protected  int[] getStats()
           
 java.lang.String getTitle()
          Returns the title of the page.
 int getTotalHits()
          Returns the total hit count.
 void setCharset(java.lang.String charset)
           
 void setExcerpt(java.lang.String excerpt)
          Set an excerpt of the page content
 void setKeywords(java.lang.String[] keywords)
           
 void setLastModified(long lastModified)
          Sets the time of the last modification made to the page.
 void setTitle(java.lang.String title)
          Sets the title of the page.
 java.lang.String toString()
          Returns the title of the page (same as getTitle()).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageInfo

public PageInfo(WebSite webSite,
                Path path)
Creates a page info in the specified WebSite to describe the page available at the specified path.

Method Detail

getPath

public Path getPath()
Returns the path of the page.


setTitle

public void setTitle(java.lang.String title)
Sets the title of the page.


getTitle

public java.lang.String getTitle()
Returns the title of the page.


getName

public java.lang.String getName()
Returns the file name of the page.


addHit

public void addHit()
Adds a hit to the count.


getHits

public int getHits()
Returns the hit count for the last day.


getHits

public int getHits(int daysBefore)
Returns the hit count for a previous day.


getTotalHits

public int getTotalHits()
Returns the total hit count.


getStats

protected int[] getStats()

getLastStatsIndex

protected int getLastStatsIndex()

copyStatsFrom

protected void copyStatsFrom(PageInfo other)

getLevel

public int getLevel()
Returns the depth level of the page.


toString

public java.lang.String toString()
Returns the title of the page (same as getTitle()).


getLastModified

public long getLastModified()
Returns the time of the last modification made to the page.


setLastModified

public void setLastModified(long lastModified)
Sets the time of the last modification made to the page. This value should be set equal to the value of java.io.File.lastModified().


getCharset

public java.lang.String getCharset()

setCharset

public void setCharset(java.lang.String charset)

getKeywords

public java.lang.String[] getKeywords()

setKeywords

public void setKeywords(java.lang.String[] keywords)

getExcerpt

public java.lang.String getExcerpt()
Return an excerpt of the page content

Returns:
the excerpt

setExcerpt

public void setExcerpt(java.lang.String excerpt)
Set an excerpt of the page content

Parameters:
excerpt - the excerpt to set