public class CommentsListProvider extends BaseFacesSessionBean implements ICommentsListProvider
Modifier and Type | Field and Description |
---|---|
protected ICommentEntry[] |
comments |
protected String |
containerID |
protected IURI |
containerURI |
protected IContext |
context |
fExpireWithPageFlow
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
Constructor and Description |
---|
CommentsListProvider() |
Modifier and Type | Method and Description |
---|---|
protected IContext |
acquireContext() |
String |
addComment(String text,
boolean isHtml,
List<org.apache.commons.fileupload.FileItem> 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
|
IAclManager |
createAclManager(String userID,
String resourceType) |
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<org.apache.commons.fileupload.FileItem> attachments,
List<String> deleteAttachments)
Updates an existing comment
|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
createMethodBinding, createMethodExpression, createValueBinding, createValueExpression, createValueExpression, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
protected IContext context
protected String containerID
protected IURI containerURI
protected ICommentEntry[] comments
public CommentsListProvider() throws PortalException
PortalException
public IAclManager createAclManager(String userID, String resourceType) throws Exception
Exception
public String getContainerID()
ICommentsListProvider
getContainerID
in interface ICommentsListProvider
public void setContainerID(String containerID) throws PortalException
ICommentsListProvider
setContainerID
in interface ICommentsListProvider
PortalException
protected void release()
BaseFacesSessionBean
release
in class BaseFacesSessionBean
public String addComment(String text, boolean isHtml, List<org.apache.commons.fileupload.FileItem> attachments) throws Exception
ICommentsListProvider
addComment
in interface ICommentsListProvider
text
- comment textisHtml
- if text is in HTML formatattachments
- list of attachmentsException
public boolean canCreateComment() throws Exception
ICommentsListProvider
canCreateComment
in interface ICommentsListProvider
Exception
public boolean canDeleteComment(String commentID) throws Exception
ICommentsListProvider
canDeleteComment
in interface ICommentsListProvider
Exception
public boolean canUpdateComment(String commentID) throws Exception
ICommentsListProvider
canUpdateComment
in interface ICommentsListProvider
Exception
public void deleteComment(String commentID) throws Exception
ICommentsListProvider
deleteComment
in interface ICommentsListProvider
Exception
public ICommentEntry[] getCommentsList() throws Exception
ICommentsListProvider
getCommentsList
in interface ICommentsListProvider
Exception
public void updateComment(String commentID, String text, List<org.apache.commons.fileupload.FileItem> attachments, List<String> deleteAttachments) throws Exception
ICommentsListProvider
updateComment
in interface ICommentsListProvider
commentID
- commentID to updatetext
- new text for commentattachments
- list of new or updates attachmentsdeleteAttachments
- list of deleted attachments (by name)Exception
public void refresh()
ICommentsListProvider
refresh
in interface ICommentsListProvider
protected IContext acquireContext()
protected void releaseContext(IContext context)