| Modifier and Type | Field and Description | 
|---|---|
protected ModifiableCompositeMetadata | 
_contentMetadataHolder
The content to comment 
 | 
protected String | 
_id
The id of the comment (unique in the content) 
 | 
protected ModifiableCompositeMetadata | 
_metadata
The metadata node of the comment 
 | 
static String | 
METADATA_COMMENT_AUTHOREMAIL
Constants for author email Metadata 
 | 
static String | 
METADATA_COMMENT_AUTHOREMAIL_HIDDEN
Constants for author email hidden Metadata 
 | 
static String | 
METADATA_COMMENT_AUTHORNAME
Constants for author name Metadata 
 | 
static String | 
METADATA_COMMENT_AUTHORURL
Constants for author url Metadata 
 | 
static String | 
METADATA_COMMENT_CONTENT
Constants for the content Metadata 
 | 
static String | 
METADATA_COMMENT_CREATIONDATE
Constants for creation Metadata 
 | 
static String | 
METADATA_COMMENT_VALIDATED
Constants for the validated status Metadata 
 | 
static String | 
METADATA_COMMENTS
Constants for comments Metadat* 
 | 
static String | 
METADATA_COMMENTS_NOTVALIDATED
Constants for comments Metadata validated 
 | 
static String | 
METADATA_COMMENTS_VALIDATED
Constants for comments Metadata not validted 
 | 
| Constructor and Description | 
|---|
Comment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder)
Creates a new comment on the content 
 | 
Comment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder,
       String commentId)
Retrieves a comment by its id 
 | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
getAuthorEmail()
Get the email of the author. 
 | 
String | 
getAuthorName()
Get the readable name of the author. 
 | 
String | 
getAuthorURL()
Get the url given by the author as its personnal site url. 
 | 
static Comment | 
getComment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder,
          String commentId)
Get a comment 
 | 
static List<Comment> | 
getComments(ModifiableCompositeMetadata contentUnversionnedMetadataHolder,
           boolean includeNotValidatedComments,
           boolean includeValidatedComments)
Get the comments of a content 
 | 
String | 
getContent()
Get the content of the comment. 
 | 
Date | 
getCreationDate()
Get the date and time the comment was created 
 | 
String | 
getId()
The comment id (unique to the content) 
 | 
ModifiableCompositeMetadata | 
getMetadata()
Get the composite metadata object holding the comment 
 | 
boolean | 
isEmailHidden()
Does the email of the authors have to be hidden ? 
 | 
boolean | 
isValidated()
Is the comment validated 
 | 
void | 
remove()
Remove the comment. 
 | 
void | 
setAuthorEmail(String email)
Set the email of the author. 
 | 
void | 
setAuthorName(String name)
Set the readable name of the author. 
 | 
void | 
setAuthorURL(String url)
Set the personnal site url of the author 
 | 
void | 
setContent(String content)
Set the content of the comment. 
 | 
void | 
setEmailHiddenStatus(boolean hideEmail)
Set the email hidden status. 
 | 
void | 
setValidated(boolean validated)
Set the validation status of the comment 
 | 
protected void | 
update()
Update the comment tag statistics 
 | 
public static final String METADATA_COMMENTS
public static final String METADATA_COMMENTS_VALIDATED
public static final String METADATA_COMMENTS_NOTVALIDATED
public static final String METADATA_COMMENT_CREATIONDATE
public static final String METADATA_COMMENT_AUTHORNAME
public static final String METADATA_COMMENT_AUTHOREMAIL
public static final String METADATA_COMMENT_AUTHOREMAIL_HIDDEN
public static final String METADATA_COMMENT_AUTHORURL
public static final String METADATA_COMMENT_CONTENT
public static final String METADATA_COMMENT_VALIDATED
protected ModifiableCompositeMetadata _contentMetadataHolder
protected ModifiableCompositeMetadata _metadata
public Comment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder, String commentId)
contentUnversionnedMetadataHolder - The unversionned metadate holder of the content hosting the commentcommentId - The id of the comment to retrieveAmetysRepositoryException - if an error occuredpublic Comment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder)
contentUnversionnedMetadataHolder - The unversionned metadate holder of the content where to add the new commentpublic ModifiableCompositeMetadata getMetadata()
public Date getCreationDate()
public String getAuthorName()
public void setAuthorName(String name)
name - The full name. Can be null to remove the name.public String getAuthorEmail()
public void setAuthorEmail(String email)
email - The email. Can be null to remove the email.public String getAuthorURL()
public void setAuthorURL(String url)
url - The url. Can be null to remove url.public boolean isEmailHidden()
public void setEmailHiddenStatus(boolean hideEmail)
hideEmail - true to set the email as hidden.public String getContent()
public void setContent(String content)
content - The content to set. Can be null to remove the content. Have to be a simple String (with \n or \t).public boolean isValidated()
public void setValidated(boolean validated)
validated - true the comment is validatedpublic void remove()
protected void update()
public static Comment getComment(ModifiableCompositeMetadata contentUnversionnedMetadataHolder, String commentId) throws AmetysRepositoryException
contentUnversionnedMetadataHolder - the contentcommentId - The commentAmetysRepositoryException - if the comment does not existpublic static List<Comment> getComments(ModifiableCompositeMetadata contentUnversionnedMetadataHolder, boolean includeNotValidatedComments, boolean includeValidatedComments) throws AmetysRepositoryException
contentUnversionnedMetadataHolder - The content to updateincludeNotValidatedComments - True to include the comments that are not validatedincludeValidatedComments - True to include the comments that are validatedAmetysRepositoryException - If an error occurred