org.mmbase.applications.mmbob
Class PostArea

java.lang.Object
  extended by org.mmbase.applications.mmbob.PostArea

public class PostArea
extends Object

This seems to be a wrapper around a Node of type 'postareas'.

Version:
$Id: PostArea.java 35620 2009-06-03 13:46:59Z michiel $:
Author:
Daniel Ockeloen
Javadoc:

Constructor Summary
PostArea(Forum parent, Node node)
          Constructor
 
Method Summary
 boolean addModerator(Poster mp)
          add moderator status to given poster for this postarea
 void childRemoved(PostThread t)
          remove a postthread from the postthreads and signal the parent forum that Thread was removed
 void decPinnedCount()
          decrease the numberofpinned threads in the postarea
 String filterContent(String body)
           
 String getDescription()
          get the description of the postarea
 String getGuestReadModeType()
           
 String getGuestWriteModeType()
           
 int getId()
          get the MMBase objectnumber of the postarea
 String getLastPoster()
          get the accountname/nick of the last poster in the postarea
 int getLastPosterNumber()
          get the last poster in the postarea
 int getLastPostNumber()
          get the last post in the postarea
 int getLastPostThreadNumber()
          get the last postthread in the postarea
 int getLastPostTime()
          get the date/time of the last post in the postarea
 String getLastSubject()
          get the subject of the last post in the postarea
 int getMemorySize()
           
 Enumeration<Poster> getModerators()
          Deprecated. returning enumerations?!
 String getModeratorsLine(String baseurl)
          get the moderators line in html
 String getName()
          get the name of the postarea
 String getNavigationLine(String baseurl, int page, int pagesize, String cssclass)
          get a (html) navigationline to "walk through" the different pages of PostThreads for a postarea
 Enumeration<Poster> getNonModerators(String searchKey)
          Deprecated. returning enumerations?!
 int getPageCount(int pagesize)
          get the number of pages for this postarea
 Forum getParent()
          get the parent forum of this postarea
 int getPos()
           
 int getPostCount()
          get the number of posts in this postarea
 int getPostingsLoadedCount()
           
 PostThread getPostThread(String id)
          get a postthread by it's MMbase Objectnumber
 int getPostThreadCount()
          get the number of postthreads of the postarea
 int getPostThreadCountAvg()
          get the average number of posts per postthread
 int getPostThreadLoadedCount()
           
 Enumeration<PostThread> getPostThreads()
          get all the postthreads in the postarea
 Iterator<PostThread> getPostThreads(int page, int pagecount)
          get an iterator of the postthreads in the postarea
 String getShortName()
           
 int getSpeedPostTime()
           
 String getThreadStartLevel()
           
 int getViewCount()
          get the number of views in this postarea
 void incPinnedCount()
          increase the numberofpinned threads in the postarea
 boolean isModerator(String nick)
          determine if the given accountname/nick is a moderator of this postarea
 void maintainMemoryCaches()
          called to maintain the memorycaches
 boolean movePostThread(String postthreadid, String newpostareaid, Poster poster)
           
 int newPost(String subject, Poster poster, String body, String mood, boolean parsed)
          create a new postthread in the postarea
 boolean remove()
          remove the postarea remove the postarea.
 boolean removeModerator(Poster mp)
          remove the moderator status of the poster regarding this postarea
 boolean removePostThread(String postthreadid)
          remove a postthread by it's MMbase objectnumber
protected  void resort(PostThread child)
          re-add the given PostThread to the postthreads-Vector
 boolean save()
          save the postarea (add it to the SyncQueue)
 List<Posting> searchPostings(List results, String searchkey, int posterid)
           
 List<Posting> searchPostings(String searchkey, int posterid)
           
 void setDescription(String description)
          set a description for the postarea
 void setGuestReadModeType(String guestreadmodetype)
           
 void setGuestWriteModeType(String guestwritemodetype)
           
 void setId(int id)
          set the MMBase objectnumber for the postarea
 void setLastSubject(String subject)
           
 void setName(String name)
          set the name for the postarea
 void setPos(int pos)
           
 void setThreadStartLevel(String threadstartlevel)
           
 void signalNewReply(PostThread child)
          signal the postarea that there is a new reply
 void signalRemovedReply(PostThread child)
          signal the postarea that a reply was removed so it cat update the postcount etc ..
 void signalViewsChanged(PostThread child)
          signal the postarea that the number of views has been changed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostArea

public PostArea(Forum parent,
                Node node)
Constructor

Parameters:
parent - forum
node - postarea
Method Detail

setId

public void setId(int id)
set the MMBase objectnumber for the postarea

Parameters:
id - MMBase objectnumber

setName

public void setName(String name)
set the name for the postarea

Parameters:
name - postareaname

setDescription

public void setDescription(String description)
set a description for the postarea

Parameters:
description - postareadescription

getName

public String getName()
get the name of the postarea

Returns:
postareaname

getShortName

public String getShortName()

getDescription

public String getDescription()
get the description of the postarea

Returns:
postareadescription

getId

public int getId()
get the MMBase objectnumber of the postarea

Returns:
MMBase objectnumber

getPostThreadCount

public int getPostThreadCount()
get the number of postthreads of the postarea

Returns:
number of postthreads

getPostThreadCountAvg

public int getPostThreadCountAvg()
get the average number of posts per postthread

Returns:
average number of posts per postthread

getPostThreadLoadedCount

public int getPostThreadLoadedCount()

getPostingsLoadedCount

public int getPostingsLoadedCount()

getMemorySize

public int getMemorySize()

getPageCount

public int getPageCount(int pagesize)
get the number of pages for this postarea

Parameters:
pagesize - maximum number of postthreads per page
Returns:
the number of pages for this postarea

getPostCount

public int getPostCount()
get the number of posts in this postarea

Returns:
number of posts

getViewCount

public int getViewCount()
get the number of views in this postarea

Returns:
number of views

getLastPoster

public String getLastPoster()
get the accountname/nick of the last poster in the postarea

Returns:
accountname/nick

getLastPosterNumber

public int getLastPosterNumber()
get the last poster in the postarea

Returns:
last poster

getLastPostThreadNumber

public int getLastPostThreadNumber()
get the last postthread in the postarea

Returns:
last postthreadnumber

getLastPostNumber

public int getLastPostNumber()
get the last post in the postarea

Returns:
postnumber

getLastPostTime

public int getLastPostTime()
get the date/time of the last post in the postarea

Returns:
date/time of the last post

getLastSubject

public String getLastSubject()
get the subject of the last post in the postarea

Returns:
subject of the last post

setLastSubject

public void setLastSubject(String subject)

getPostThreads

public Enumeration<PostThread> getPostThreads()
get all the postthreads in the postarea

Returns:
all the postthreads

getPostThreads

public Iterator<PostThread> getPostThreads(int page,
                                           int pagecount)
get an iterator of the postthreads in the postarea

Parameters:
page - which page in the sequence
pagecount - maximum number of PostThreads on the page
Returns:
postthreads

getPostThread

public PostThread getPostThread(String id)
get a postthread by it's MMbase Objectnumber

Parameters:
id - MMbase Objectnumber
Returns:
postthread

getNavigationLine

public String getNavigationLine(String baseurl,
                                int page,
                                int pagesize,
                                String cssclass)
get a (html) navigationline to "walk through" the different pages of PostThreads for a postarea

Parameters:
baseurl - url
page - which page in the sequence
pagesize - maximum number of postthreads to be shown on one page
cssclass - cssclass to be used to display the navigationline
Returns:
navigationline in html

getModerators

public Enumeration<Poster> getModerators()
Deprecated. returning enumerations?!

get the moderators of the postarea

Returns:
moderators

getNonModerators

public Enumeration<Poster> getNonModerators(String searchKey)
Deprecated. returning enumerations?!

get all posters that are no moderator of the postarea

Returns:
non-moderators

isModerator

public boolean isModerator(String nick)
determine if the given accountname/nick is a moderator of this postarea

Parameters:
nick - accountname/nick to be evaluated
Returns:
true if the account is moderator. Also true if the account is administrator of the parent forum.

removeModerator

public boolean removeModerator(Poster mp)
remove the moderator status of the poster regarding this postarea

Parameters:
mp - Poster with moderator status
Returns:
Always false

addModerator

public boolean addModerator(Poster mp)
add moderator status to given poster for this postarea

Parameters:
mp - Poster
Returns:
true if the action succeeded

getModeratorsLine

public String getModeratorsLine(String baseurl)
get the moderators line in html

Parameters:
baseurl -
Returns:
moderatorsline in html

incPinnedCount

public void incPinnedCount()
increase the numberofpinned threads in the postarea


decPinnedCount

public void decPinnedCount()
decrease the numberofpinned threads in the postarea


newPost

public int newPost(String subject,
                   Poster poster,
                   String body,
                   String mood,
                   boolean parsed)
create a new postthread in the postarea

Parameters:
subject - subject of the new postthread
poster - accountname/nick of the poster that posts the new postthread
body - body of the new postthread
Returns:
MMbase objectnumber of the newly created postthread or -1 if the postthread-nodemanager could not be found

signalNewReply

public void signalNewReply(PostThread child)
signal the postarea that there is a new reply

Parameters:
child - postthread

signalRemovedReply

public void signalRemovedReply(PostThread child)
signal the postarea that a reply was removed so it cat update the postcount etc ..

Parameters:
child - postthread

resort

protected void resort(PostThread child)
re-add the given PostThread to the postthreads-Vector

Parameters:
child - postthread

movePostThread

public boolean movePostThread(String postthreadid,
                              String newpostareaid,
                              Poster poster)

getParent

public Forum getParent()
get the parent forum of this postarea

Returns:
Forum

signalViewsChanged

public void signalViewsChanged(PostThread child)
signal the postarea that the number of views has been changed

Parameters:
child -

save

public boolean save()
save the postarea (add it to the SyncQueue)


remove

public boolean remove()
remove the postarea remove the postarea. This method will first (try to) remove all postthreads.

Returns:
true if it succeeds, false if it doesn't

removePostThread

public boolean removePostThread(String postthreadid)
remove a postthread by it's MMbase objectnumber

Parameters:
postthreadid - MMbase objectnumber of the postthread
Returns:
true if it succeeds, false if it doesn't

childRemoved

public void childRemoved(PostThread t)
remove a postthread from the postthreads and signal the parent forum that Thread was removed

Parameters:
t - postthread

maintainMemoryCaches

public void maintainMemoryCaches()
called to maintain the memorycaches


getGuestReadModeType

public String getGuestReadModeType()

getGuestWriteModeType

public String getGuestWriteModeType()

getThreadStartLevel

public String getThreadStartLevel()

filterContent

public String filterContent(String body)

getSpeedPostTime

public int getSpeedPostTime()

searchPostings

public List<Posting> searchPostings(String searchkey,
                                    int posterid)

searchPostings

public List<Posting> searchPostings(List results,
                                    String searchkey,
                                    int posterid)

setGuestReadModeType

public void setGuestReadModeType(String guestreadmodetype)

setGuestWriteModeType

public void setGuestWriteModeType(String guestwritemodetype)

setThreadStartLevel

public void setThreadStartLevel(String threadstartlevel)

setPos

public void setPos(int pos)

getPos

public int getPos()


MMBase 2.0-SNAPSHOT - null