com.webmethods.caf.faces.data.comments.impl
Class CommentsListProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.BaseFacesBean
      extended by com.webmethods.caf.faces.bean.BaseFacesSessionBean
          extended by com.webmethods.caf.faces.data.comments.impl.CommentsListProvider
All Implemented Interfaces:
IPageFlowScopeAdapter, ICommentsListProvider
Direct Known Subclasses:
TaskCommentsListProvider

public class CommentsListProvider
extends BaseFacesSessionBean
implements ICommentsListProvider


Field Summary
protected  ICommentEntry[] comments
           
protected  String containerID
           
protected  IURI containerURI
           
protected  IContext context
           
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
 
Constructor Summary
CommentsListProvider()
           
 
Method Summary
protected  IContext acquireContext()
           
 String addComment(String text, boolean isHtml, List attachments)
          Adds new comment
 boolean canCreateComment()
          If current user could create new comments
 boolean canDeleteComment(String commentID)
          If current user could delete specific comment
 boolean canUpdateComment(String commentID)
          If current user could update specific comment
 void deleteComment(String commentID)
          Deletes specified comment
 ICommentEntry[] getCommentsList()
          Returns list of all comments
 String getContainerID()
          Returns containerID for the comments list
 void refresh()
          Refreshes content of the provider
protected  void release()
          Override this method to release any resources associated with this session.
protected  void releaseContext(IContext context)
           
 void setContainerID(String containerID)
          Sets containerID for this comments list
 void updateComment(String commentID, String text, List attachments, List deleteAttachments)
          Updates an existing comment
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected IContext context

containerID

protected String containerID

containerURI

protected IURI containerURI

comments

protected ICommentEntry[] comments
Constructor Detail

CommentsListProvider

public CommentsListProvider()
                     throws PortalException
Throws:
PortalException
Method Detail

getContainerID

public String getContainerID()
Description copied from interface: ICommentsListProvider
Returns containerID for the comments list

Specified by:
getContainerID in interface ICommentsListProvider

setContainerID

public void setContainerID(String containerID)
                    throws PortalException
Description copied from interface: ICommentsListProvider
Sets containerID for this comments list

Specified by:
setContainerID in interface ICommentsListProvider
Throws:
PortalException

release

protected void release()
Description copied from class: BaseFacesSessionBean
Override this method to release any resources associated with this session. Please note, the FacesContext is not valid for this function

Specified by:
release in class BaseFacesSessionBean

addComment

public String addComment(String text,
                         boolean isHtml,
                         List attachments)
                  throws Exception
Description copied from interface: ICommentsListProvider
Adds new comment

Specified by:
addComment in interface ICommentsListProvider
Parameters:
text - comment text
isHtml - if text is in HTML format
attachments - list of attachments
Returns:
commentID
Throws:
Exception

canCreateComment

public boolean canCreateComment()
                         throws Exception
Description copied from interface: ICommentsListProvider
If current user could create new comments

Specified by:
canCreateComment in interface ICommentsListProvider
Throws:
Exception

canDeleteComment

public boolean canDeleteComment(String commentID)
                         throws Exception
Description copied from interface: ICommentsListProvider
If current user could delete specific comment

Specified by:
canDeleteComment in interface ICommentsListProvider
Throws:
Exception

canUpdateComment

public boolean canUpdateComment(String commentID)
                         throws Exception
Description copied from interface: ICommentsListProvider
If current user could update specific comment

Specified by:
canUpdateComment in interface ICommentsListProvider
Throws:
Exception

deleteComment

public void deleteComment(String commentID)
                   throws Exception
Description copied from interface: ICommentsListProvider
Deletes specified comment

Specified by:
deleteComment in interface ICommentsListProvider
Throws:
Exception

getCommentsList

public ICommentEntry[] getCommentsList()
                                throws Exception
Description copied from interface: ICommentsListProvider
Returns list of all comments

Specified by:
getCommentsList in interface ICommentsListProvider
Throws:
Exception

updateComment

public void updateComment(String commentID,
                          String text,
                          List attachments,
                          List deleteAttachments)
                   throws Exception
Description copied from interface: ICommentsListProvider
Updates an existing comment

Specified by:
updateComment in interface ICommentsListProvider
Parameters:
commentID - commentID to update
text - new text for comment
attachments - list of new or updates attachments
deleteAttachments - list of deleted attachments (by name)
Throws:
Exception

refresh

public void refresh()
Description copied from interface: ICommentsListProvider
Refreshes content of the provider

Specified by:
refresh in interface ICommentsListProvider

acquireContext

protected IContext acquireContext()

releaseContext

protected void releaseContext(IContext context)