public class ModifiableContentHelper extends Object implements Component
ModifiableContent API on DefaultContents.| Constructor and Description |
|---|
ModifiableContentHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyTitle(Content srcContent,
ModifiableContent targetContent)
Copy the title of the source content to the target content
|
void |
setCreationDate(DefaultContent content,
Date creationDate)
Set a
DefaultContent creation date. |
void |
setCreator(DefaultContent content,
UserIdentity user)
Set a
DefaultContent user. |
void |
setFirstValidationDate(DefaultContent content,
Date validationDate)
Set a
DefaultContent first validation date. |
void |
setLanguage(DefaultContent content,
String language)
Set a
DefaultContent language. |
void |
setLastContributor(DefaultContent content,
UserIdentity user)
Set a
DefaultContent contributor. |
void |
setLastMajorValidationDate(DefaultContent content,
Date validationDate)
Set a
DefaultContent last major validation date. |
void |
setLastModified(DefaultContent content,
Date lastModified)
Set a
DefaultContent last modification date. |
void |
setLastValidationDate(DefaultContent content,
Date validationDate)
Set a
DefaultContent last validation date. |
void |
setMixinTypes(DefaultContent content,
String[] mixins)
Set
DefaultContent mixins. |
void |
setOutgoingReferences(DefaultContent content,
Map<String,OutgoingReferences> references)
Store the outgoing references on the content.
|
void |
setTitle(DefaultContent content,
String title)
Set the title of non-multilingual
DefaultContent. |
void |
setTitle(DefaultContent content,
String title,
Locale locale)
Set a
DefaultContent title for the given locale. |
void |
setType(DefaultContent content,
String type)
Set a
DefaultContent type. |
void |
setTypes(DefaultContent content,
String[] types)
Set
DefaultContent types. |
public ModifiableContentHelper()
public void setType(DefaultContent content, String type) throws AmetysRepositoryException
DefaultContent type.content - the DefaultContent to set.type - the type.AmetysRepositoryException - if an error occurs.public void setTypes(DefaultContent content, String[] types) throws AmetysRepositoryException
DefaultContent types.content - the DefaultContent to set.types - the types.AmetysRepositoryException - if an error occurs.public void setMixinTypes(DefaultContent content, String[] mixins) throws AmetysRepositoryException
DefaultContent mixins.content - the DefaultContent to set.mixins - the mixins.AmetysRepositoryException - if an error occurs.public void setLanguage(DefaultContent content, String language) throws AmetysRepositoryException
DefaultContent language.content - the DefaultContent to modify.language - the language to set.AmetysRepositoryException - if an error occurs.public void setTitle(DefaultContent content, String title, Locale locale) throws AmetysRepositoryException
DefaultContent title for the given locale.content - the DefaultContent to set.title - the title to set.locale - The locale. Can be null if the content is not a multilingual content.AmetysRepositoryException - if an error occurs.public void setTitle(DefaultContent content, String title) throws AmetysRepositoryException
DefaultContent.
Be careful! Use only if content's title is not a multilingual string. If not sure use setTitle(DefaultContent, String, Locale) instead.content - the DefaultContent to set.title - the title to set.AmetysRepositoryException - if an error occurs.public void copyTitle(Content srcContent, ModifiableContent targetContent) throws AmetysRepositoryException
srcContent - The source contenttargetContent - The target contentAmetysRepositoryException - if an error occurs.public void setCreator(DefaultContent content, UserIdentity user) throws AmetysRepositoryException
DefaultContent user.content - the DefaultContent to set.user - the user to set.AmetysRepositoryException - if an error occurs.public void setCreationDate(DefaultContent content, Date creationDate) throws AmetysRepositoryException
DefaultContent creation date.content - the DefaultContent to set.creationDate - the creation date to set.AmetysRepositoryException - if an error occurs.public void setLastContributor(DefaultContent content, UserIdentity user) throws AmetysRepositoryException
DefaultContent contributor.content - the DefaultContent to set.user - the contributor to set.AmetysRepositoryException - if an error occurs.public void setLastModified(DefaultContent content, Date lastModified) throws AmetysRepositoryException
DefaultContent last modification date.content - the DefaultContent to set.lastModified - the last modification date to set.AmetysRepositoryException - if an error occurs.public void setFirstValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
DefaultContent first validation date.content - the DefaultContent to set.validationDate - the first validation date.AmetysRepositoryException - if an error occurs.public void setLastValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
DefaultContent last validation date.content - the DefaultContent to set.validationDate - the last validation date.AmetysRepositoryException - if an error occurs.public void setLastMajorValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
DefaultContent last major validation date.content - the DefaultContent to set.validationDate - the last major validation date.AmetysRepositoryException - if an error occurs.public void setOutgoingReferences(DefaultContent content, Map<String,OutgoingReferences> references) throws AmetysRepositoryException
content - The content concerned by these outgoing references.references - A non null map of outgoing references grouped by metadata (key are metadata path)AmetysRepositoryException - if an error occurs.