info.magnolia.module.forum.frontend.action
Class AbstractThreadAction<RD extends info.magnolia.rendering.template.RenderableDefinition>

java.lang.Object
  extended by info.magnolia.rendering.model.RenderingModelImpl<RD>
      extended by info.magnolia.module.forum.frontend.action.AbstractThreadAction<RD>
Type Parameters:
RD - - an instance of RenderableDefinition
All Implemented Interfaces:
info.magnolia.rendering.model.RenderingModel<RD>
Direct Known Subclasses:
ThreadList, ThreadNew, ThreadReply, ThreadView

public abstract class AbstractThreadAction<RD extends info.magnolia.rendering.template.RenderableDefinition>
extends info.magnolia.rendering.model.RenderingModelImpl<RD>

Abstract superclass for all forum thread actions providing functionality to access and modify threads, forum and posts.

Version:
$Id$
Author:
vsteller

Field Summary
protected  info.magnolia.cms.core.Content forum
           
protected  ForumConfiguration forumConfig
           
protected  String forumId
           
protected  ForumManager forumManager
           
protected static String PROPERTYNAME_FORUMID
           
protected static String PROPERTYNAME_THREADID
           
protected  info.magnolia.cms.core.Content thread
           
protected  String threadId
           
 
Fields inherited from class info.magnolia.rendering.model.RenderingModelImpl
content, contentMap, definition, parentModel
 
Fields inherited from interface info.magnolia.rendering.model.RenderingModel
SKIP_RENDERING
 
Constructor Summary
AbstractThreadAction(javax.jcr.Node content, RD renderable, info.magnolia.rendering.model.RenderingModel<?> parent)
           
 
Method Summary
 String execute()
          Initializes forum and thread properties with given ids.
 info.magnolia.cms.core.Content getForum()
           
 String getForumId()
           
 info.magnolia.cms.core.Content getThread()
           
 String getThreadId()
           
 boolean isAllowedToPost()
          Checks if current user is allowed to post on the current thread.
 boolean isAnonymous()
           
 boolean isShowingUnvalidatedMessages()
           
 void setForumId(String forumId)
           
 void setThreadId(String threadId)
           
protected  void setupForumIdFromContent()
           
protected  void setupThreadIdFromContent()
           
 
Methods inherited from class info.magnolia.rendering.model.RenderingModelImpl
getContent, getDef, getDefinition, getNode, getParent, getRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME_FORUMID

protected static final String PROPERTYNAME_FORUMID
See Also:
Constant Field Values

PROPERTYNAME_THREADID

protected static final String PROPERTYNAME_THREADID
See Also:
Constant Field Values

forumManager

protected final ForumManager forumManager

forumConfig

protected final ForumConfiguration forumConfig

forumId

protected String forumId

threadId

protected String threadId

forum

protected info.magnolia.cms.core.Content forum

thread

protected info.magnolia.cms.core.Content thread
Constructor Detail

AbstractThreadAction

public AbstractThreadAction(javax.jcr.Node content,
                            RD renderable,
                            info.magnolia.rendering.model.RenderingModel<?> parent)
Method Detail

execute

public String execute()
Initializes forum and thread properties with given ids.

Specified by:
execute in interface info.magnolia.rendering.model.RenderingModel<RD extends info.magnolia.rendering.template.RenderableDefinition>
Overrides:
execute in class info.magnolia.rendering.model.RenderingModelImpl<RD extends info.magnolia.rendering.template.RenderableDefinition>

setupThreadIdFromContent

protected void setupThreadIdFromContent()
                                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

setupForumIdFromContent

protected void setupForumIdFromContent()
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isShowingUnvalidatedMessages

public boolean isShowingUnvalidatedMessages()

isAnonymous

public boolean isAnonymous()

isAllowedToPost

public boolean isAllowedToPost()
Checks if current user is allowed to post on the current thread.


setForumId

public void setForumId(String forumId)

getForumId

public String getForumId()

setThreadId

public void setThreadId(String threadId)

getThreadId

public String getThreadId()

getForum

public info.magnolia.cms.core.Content getForum()

getThread

public info.magnolia.cms.core.Content getThread()


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.