org.mmbase.applications.mmbob
Class Forum

java.lang.Object
  extended byorg.mmbase.applications.mmbob.Forum

public class Forum
extends Object

Author:
Daniel Ockeloen

Constructor Summary
Forum(Node node)
          Constructor
 
Method Summary
 boolean addAdministrator(Poster ap)
          add administrator to forum
 void addProfileDef(ProfileEntryDef cm)
           
 void addWordFilter(String name, String value)
           
 void childRemoved(Poster p)
          remove a poster from the posters
 Poster createPoster(String account, String password)
          create a new poster for the forum
 String filterContent(HashMap filterwords, String body)
           
 String filterContent(String body)
           
 String getAccountCreationType()
           
 String getAccountRemovalType()
           
 Enumeration getAdministrators()
          get the administrators of the forum
 String getAdministratorsLine(String baseurl)
          get the online administrators (comma-seperated)
 String getAlias()
           
 String getAvatarsDisabled()
           
 String getAvatarsGalleryEnabled()
           
 String getAvatarsUploadEnabled()
           
 boolean getCloneMaster()
           
 ForumConfig getConfig()
           
 String getContactInfoEnabled()
           
 String getDescription()
          get the description of the forum
 String getEmailtext(String role)
           
 String getExternalRootUrl()
           
 HashMap getFilterWords()
           
 String getFooterPath()
           
 String getFromEmailAddress()
           
 String getGuestReadModeType()
           
 String getGuestWriteModeType()
           
 String getGuiEdit(String key)
           
 String getHeaderPath()
           
 int getId()
          Get the MMBase objectnumber of the forum
 String getLanguage()
          Get the language of the forum
 String getLastPoster()
          get the accountname / nick of the last poster on the forum
 int getLastPosterNumber()
          get last poster on the forum
 int getLastPostNumber()
          provide the number of the last poster in this forum
 int getLastPostTime()
          get the date/time (Epoch) of the last post on the forum
 String getLastSubject()
          get the subject of the last post on the forum
 String getLoginModeType()
           
 String getLoginSystemType()
           
 String getLogoutModeType()
           
 int getMemorySize()
           
 String getName()
          get the name of the forum
 String getNavigationMethod()
           
 Enumeration getNonAdministrators(String searchkey)
           
 PostArea getPostArea(String id)
          get a postarea of this forum by it's MMbase objectnumber
 PostAreaConfig getPostAreaConfig(String name)
           
 int getPostAreaCount()
          get the number of postareas for this forum
 Enumeration getPostAreas()
          get all the postareas of this forum
 int getPostCount()
          get the number of posts on the forum
 Poster getPoster(int posterid)
          get a poster of this forum by it's MMBase Objectnumber
 Poster getPoster(String posterid)
          get a poster of this forum by it's accountname/nick (???)
 int getPosterExpireTime()
          get the expiretime for the posters in seconds
 Poster getPosterNick(String nick)
           
 Enumeration getPosters()
          get the posters of the forum
 int getPostersNewCount()
          get the number of new posters for the forum
 Enumeration getPostersOnline()
          get the posters that are online
 int getPostersOnlineCount()
          get the number of online posters for the forum
 int getPostersTotalCount()
          get the total number of posters in the forum
 int getPostingsLoadedCount()
           
 int getPostingsOverflowPostArea()
           
 int getPostingsOverflowThreadPage()
           
 int getPostingsPerPage()
           
 PostThread getPostThread(String postthreadid)
           
 int getPostThreadCount()
          get the total number of postthreads in this forum
 int getPostThreadLoadedCount()
           
 String getPrivateMessagesEnabled()
           
 ProfileEntryDef getProfileDef(String name)
           
 Iterator getProfileDefs()
           
 boolean getReplyOnEachPage()
           
 String getSmileysEnabled()
           
 int getSpeedPostTime()
           
 SubArea getSubArea(String name)
           
 ThreadObserver getThreadObserver(int id)
           
 String getThreadStartLevel()
           
 int getViewCount()
          get the number of views on the forum
 String getXSLTPostingsEven()
           
 String getXSLTPostingsOdd()
           
 boolean hasNick()
           
 boolean hasPoster(int posterid)
           
 boolean isAdministrator(String nick)
          determine if the given account is an administrator
 void leafsChanged()
          Well, what does this do, then?
 void maintainMemoryCaches()
          called to maintain the memorycaches
 int newFolder(int posterid, String newfolder)
          create a new folder (messagebox) for the given poster
 int newPostArea(String name, String description)
          create a new postarea for this forum
 void newPoster(Poster p)
          add a poster to the newposters-Vector
 void newPosterOnline(Poster p)
          add a poster to the onlineposters-Vector
 int newPrivateMessage(String poster, String to, String subject, String body)
          create a new private message
 boolean remove()
          remove the forum
 boolean removeAdministrator(Poster mp)
           
 boolean removeFolder(int posterid, String foldername)
          remove a folder(mailbox) for a poster
 void removeOnlinePoster(Poster p)
          remove a poster from the onlineposters-Vector
 boolean removePostArea(String id)
          remove a postarea of this forum by it's MMbase objectnumber
 void removeWordFilter(String name)
           
 void resetConfig()
           
 boolean save()
          "Save" the forum (add it to the syncQueue)
 boolean saveConfig()
           
 boolean saveDirect()
          "Save direct" the forum
 Vector searchPostings(String searchkey, int posterid)
           
 void setAlias(String alias)
           
 void setAvatarsGalleryEnabled(String mode)
           
 void setAvatarsUploadEnabled(String mode)
           
 boolean setBookmarkedChange(int id, Poster ap, boolean state)
           
 void setDescription(String description)
          Set the description of the forum
 boolean setEmailOnChange(int id, Poster ap, boolean state)
           
 void setGuestReadModeType(String type)
           
 void setGuestWriteModeType(String type)
           
 void setId(int id)
          Set the MMBase objectnumber of the forum
 void setLanguage(String language)
          Set the language of the forum
 void setLastSubject(String subject)
           
 void setLoginModeType(String type)
           
 void setLoginSystemType(String system)
           
 void setLogoutModeType(String type)
           
 void setName(String name)
          Set name of the forum
 void setNavigationMethod(String navigationmethod)
           
 void setNode(Node node)
          Set forum to node
 void setPostingsOverflowPostArea(int maxcount)
           
 void setPostingsOverflowThreadPage(int maxcount)
           
 void setPostingsPerPage(int maxcount)
           
 void setReplyOnEachPage(boolean value)
           
 void setSpeedPostTime(int delay)
           
 void signalNewPost(PostArea child)
          signal the forum that there is a new postthread updates the postthreadcount , and places it in the syncQueue
 void signalNewReply(PostArea child)
          signal the forum that there is a new reply updates the postcount, lastposttime, lastposter, lastpostsubject of ths forum, and places it in the syncQueue
 void signalRemovedPost(PostArea child)
          signal the forum that there was a postthread removed updates the postthreadcount , and places it in the syncQueue
 void signalRemovedReply(PostArea child)
          signal the forum that a reply was removed updates the postcount, lastposttime, lastposter, lastpostsubject of ths forum, and places it in the syncQueue
 void signalViewsChanged(PostArea child)
          signal the forum that there's a new view
 void syncTreeAreas()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Forum

public Forum(Node node)
Constructor

Parameters:
node - forum node
Method Detail

resetConfig

public void resetConfig()

setId

public void setId(int id)
Set the MMBase objectnumber of the forum

Parameters:
id - MMase objectnumber

setNode

public void setNode(Node node)
Set forum to node

Parameters:
node - forumnode

setName

public void setName(String name)
Set name of the forum

Parameters:
name -

setLanguage

public void setLanguage(String language)
Set the language of the forum

Parameters:
language -

getLanguage

public String getLanguage()
Get the language of the forum

Returns:
the language

setDescription

public void setDescription(String description)
Set the description of the forum

Parameters:
description -

getName

public String getName()
get the name of the forum

Returns:
name of the forum

getDescription

public String getDescription()
get the description of the forum

Returns:
description of the forum

getId

public int getId()
Get the MMBase objectnumber of the forum

Returns:
MMBase objectnumber of the forum

getPostCount

public int getPostCount()
get the number of posts on the forum

Returns:
number of posts on the furum

getViewCount

public int getViewCount()
get the number of views on the forum

Returns:
number of views

getLastPoster

public String getLastPoster()
get the accountname / nick of the last poster on the forum

Returns:
accountname / nick of the last poster on the forum

getLastPosterNumber

public int getLastPosterNumber()
get last poster on the forum

Returns:
poster id

getLastPostTime

public int getLastPostTime()
get the date/time (Epoch) of the last post on the forum

Returns:
date/time (Epoch) of the last post on the forum

getLastSubject

public String getLastSubject()
get the subject of the last post on the forum

Returns:
subject of the last post on the forum

setLastSubject

public void setLastSubject(String subject)

save

public boolean save()
"Save" the forum (add it to the syncQueue)

Returns:
true

saveConfig

public boolean saveConfig()

saveDirect

public boolean saveDirect()
"Save direct" the forum

Returns:
true

getAdministrators

public Enumeration getAdministrators()
get the administrators of the forum

Returns:
administrators

getNonAdministrators

public Enumeration getNonAdministrators(String searchkey)

getPosters

public Enumeration getPosters()
get the posters of the forum

Returns:
posters

searchPostings

public Vector searchPostings(String searchkey,
                             int posterid)

getPostThread

public PostThread getPostThread(String postthreadid)

getPostersOnline

public Enumeration getPostersOnline()
get the posters that are online

Returns:
online posters

isAdministrator

public boolean isAdministrator(String nick)
determine if the given account is an administrator

Parameters:
nick -
Returns:
true if the account is an administrator

getAdministratorsLine

public String getAdministratorsLine(String baseurl)
get the online administrators (comma-seperated)

Parameters:
baseurl -
Returns:
comma-seperated list of administrators-accounts for this forum. If the passed baseurl isn't empty it will make html-links for you

getPostArea

public PostArea getPostArea(String id)
get a postarea of this forum by it's MMbase objectnumber

Parameters:
id - MMbase objectnumber of the postarea

getSubArea

public SubArea getSubArea(String name)

removePostArea

public boolean removePostArea(String id)
remove a postarea of this forum by it's MMbase objectnumber

Parameters:
id - MMbase objectnumber of the postarea
Returns:
Feedback. true if the action was successful, false if it wasn't

removeFolder

public boolean removeFolder(int posterid,
                            String foldername)
remove a folder(mailbox) for a poster

Parameters:
posterid -
foldername -
Returns:
true if the action was successful

removeOnlinePoster

public void removeOnlinePoster(Poster p)
remove a poster from the onlineposters-Vector

Parameters:
p - posternode

getPostAreaCount

public int getPostAreaCount()
get the number of postareas for this forum

Returns:
number of postareas for this forum

getPostAreas

public Enumeration getPostAreas()
get all the postareas of this forum

Returns:
postareas

newPosterOnline

public void newPosterOnline(Poster p)
add a poster to the onlineposters-Vector

Parameters:
p - new online poster

newPoster

public void newPoster(Poster p)
add a poster to the newposters-Vector

Parameters:
p - new poster

newPostArea

public int newPostArea(String name,
                       String description)
create a new postarea for this forum

Parameters:
name - name of the new postarea
description - description of the new postarea
Returns:
MMBase objectnumber for the newly created postarea

syncTreeAreas

public void syncTreeAreas()

getPostThreadCount

public int getPostThreadCount()
get the total number of postthreads in this forum

Returns:
number of postthreads

leafsChanged

public void leafsChanged()
Well, what does this do, then?


signalNewReply

public void signalNewReply(PostArea child)
signal the forum that there is a new reply updates the postcount, lastposttime, lastposter, lastpostsubject of ths forum, and places it in the syncQueue

Parameters:
child - PostArea

signalRemovedReply

public void signalRemovedReply(PostArea child)
signal the forum that a reply was removed updates the postcount, lastposttime, lastposter, lastpostsubject of ths forum, and places it in the syncQueue

Parameters:
child - PostArea

signalNewPost

public void signalNewPost(PostArea child)
signal the forum that there is a new postthread updates the postthreadcount , and places it in the syncQueue

Parameters:
child - PostArea

signalRemovedPost

public void signalRemovedPost(PostArea child)
signal the forum that there was a postthread removed updates the postthreadcount , and places it in the syncQueue

Parameters:
child - PostArea

signalViewsChanged

public void signalViewsChanged(PostArea child)
signal the forum that there's a new view

Parameters:
child - PostArea

getPoster

public Poster getPoster(String posterid)
get a poster of this forum by it's accountname/nick (???)

Parameters:
posterid - accountname/nick
Returns:
Poster null if the account was not found

getPosterNick

public Poster getPosterNick(String nick)

getPoster

public Poster getPoster(int posterid)
get a poster of this forum by it's MMBase Objectnumber

Parameters:
posterid - MMBase Objectnumber of the poster
Returns:
Poster null if the poster was not found

hasPoster

public boolean hasPoster(int posterid)

getPostersTotalCount

public int getPostersTotalCount()
get the total number of posters in the forum

Returns:
number of posters in the forum

getPostersOnlineCount

public int getPostersOnlineCount()
get the number of online posters for the forum

Returns:
number of online posters

getPostersNewCount

public int getPostersNewCount()
get the number of new posters for the forum

Returns:
number of new posters

createPoster

public Poster createPoster(String account,
                           String password)
create a new poster for the forum

Parameters:
account - accountname to register
password - password to register
Returns:
newly created Poster-object null if creation failed

addAdministrator

public boolean addAdministrator(Poster ap)
add administrator to forum

Parameters:
ap - Poster
Returns:
always false (ToDo ??)

removeAdministrator

public boolean removeAdministrator(Poster mp)

childRemoved

public void childRemoved(Poster p)
remove a poster from the posters

Parameters:
p - poster

remove

public boolean remove()
remove the forum

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

getPosterExpireTime

public int getPosterExpireTime()
get the expiretime for the posters in seconds

Returns:
expiretime in seconds

newPrivateMessage

public int newPrivateMessage(String poster,
                             String to,
                             String subject,
                             String body)
create a new private message

Parameters:
poster - accountname/nick of the sending poster
to - accountname/nick of the recepient poster
subject - subject of the private message
body - body of the private message
Returns:
always -1 (ToDo ?)

newFolder

public int newFolder(int posterid,
                     String newfolder)
create a new folder (messagebox) for the given poster

Parameters:
posterid - MMBase objectnumber of the poster
newfolder - name of the new folder
Returns:
always -1 (ToDo?)

maintainMemoryCaches

public void maintainMemoryCaches()
called to maintain the memorycaches


getLastPostNumber

public int getLastPostNumber()
provide the number of the last poster in this forum


getPostAreaConfig

public PostAreaConfig getPostAreaConfig(String name)

getAccountCreationType

public String getAccountCreationType()

getAccountRemovalType

public String getAccountRemovalType()

getLoginModeType

public String getLoginModeType()

getLoginSystemType

public String getLoginSystemType()

getLogoutModeType

public String getLogoutModeType()

setLogoutModeType

public void setLogoutModeType(String type)

setLoginSystemType

public void setLoginSystemType(String system)

addProfileDef

public void addProfileDef(ProfileEntryDef cm)

setLoginModeType

public void setLoginModeType(String type)

getGuestReadModeType

public String getGuestReadModeType()

getThreadStartLevel

public String getThreadStartLevel()

setAvatarsUploadEnabled

public void setAvatarsUploadEnabled(String mode)

getAlias

public String getAlias()

setAlias

public void setAlias(String alias)

setAvatarsGalleryEnabled

public void setAvatarsGalleryEnabled(String mode)

setGuestReadModeType

public void setGuestReadModeType(String type)

getGuestWriteModeType

public String getGuestWriteModeType()

setGuestWriteModeType

public void setGuestWriteModeType(String type)

setNavigationMethod

public void setNavigationMethod(String navigationmethod)

getAvatarsDisabled

public String getAvatarsDisabled()

getAvatarsUploadEnabled

public String getAvatarsUploadEnabled()

getAvatarsGalleryEnabled

public String getAvatarsGalleryEnabled()

getHeaderPath

public String getHeaderPath()

getFooterPath

public String getFooterPath()

getFromEmailAddress

public String getFromEmailAddress()

getXSLTPostingsOdd

public String getXSLTPostingsOdd()

getNavigationMethod

public String getNavigationMethod()

getXSLTPostingsEven

public String getXSLTPostingsEven()

getContactInfoEnabled

public String getContactInfoEnabled()

getSmileysEnabled

public String getSmileysEnabled()

getPrivateMessagesEnabled

public String getPrivateMessagesEnabled()

getPostingsPerPage

public int getPostingsPerPage()

setPostingsPerPage

public void setPostingsPerPage(int maxcount)

setPostingsOverflowPostArea

public void setPostingsOverflowPostArea(int maxcount)

setPostingsOverflowThreadPage

public void setPostingsOverflowThreadPage(int maxcount)

setReplyOnEachPage

public void setReplyOnEachPage(boolean value)

setSpeedPostTime

public void setSpeedPostTime(int delay)

getProfileDefs

public Iterator getProfileDefs()

getProfileDef

public ProfileEntryDef getProfileDef(String name)

hasNick

public boolean hasNick()

getPostThreadLoadedCount

public int getPostThreadLoadedCount()

getPostingsLoadedCount

public int getPostingsLoadedCount()

getMemorySize

public int getMemorySize()

filterContent

public String filterContent(String body)

getFilterWords

public HashMap getFilterWords()

addWordFilter

public void addWordFilter(String name,
                          String value)

removeWordFilter

public void removeWordFilter(String name)

filterContent

public String filterContent(HashMap filterwords,
                            String body)

getCloneMaster

public boolean getCloneMaster()

getGuiEdit

public String getGuiEdit(String key)

getSpeedPostTime

public int getSpeedPostTime()

getPostingsOverflowPostArea

public int getPostingsOverflowPostArea()

getPostingsOverflowThreadPage

public int getPostingsOverflowThreadPage()

getThreadObserver

public ThreadObserver getThreadObserver(int id)

setEmailOnChange

public boolean setEmailOnChange(int id,
                                Poster ap,
                                boolean state)

setBookmarkedChange

public boolean setBookmarkedChange(int id,
                                   Poster ap,
                                   boolean state)

getEmailtext

public String getEmailtext(String role)

getExternalRootUrl

public String getExternalRootUrl()

getReplyOnEachPage

public boolean getReplyOnEachPage()

getConfig

public ForumConfig getConfig()


MMBase build 1.8.1.20060716