Package org.ametys.cms.repository
Class ModifiableContentHelper
- java.lang.Object
-
- org.ametys.cms.repository.ModifiableContentHelper
-
- All Implemented Interfaces:
Component
public class ModifiableContentHelper extends Object implements Component
Provides helper methods to use theModifiableContentAPI onDefaultContents.
-
-
Constructor Summary
Constructors Constructor Description ModifiableContentHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyTitle(Content srcContent, ModifiableContent targetContent)Copy the title of the source content to the target contentvoidsetCreationDate(DefaultContent content, Date creationDate)Set aDefaultContentcreation date.voidsetCreator(DefaultContent content, UserIdentity user)Set aDefaultContentuser.voidsetFirstValidationDate(DefaultContent content, Date validationDate)Set aDefaultContentfirst validation date.voidsetLastContributor(DefaultContent content, UserIdentity user)Set aDefaultContentcontributor.voidsetLastMajorValidationDate(DefaultContent content, Date validationDate)Set aDefaultContentlast major validation date.voidsetLastModified(DefaultContent content, Date lastModified)Set aDefaultContentlast modification date.voidsetLastValidationDate(DefaultContent content, Date validationDate)Set aDefaultContentlast validation date.voidsetOutgoingReferences(DefaultContent content, Map<String,OutgoingReferences> references)Store the outgoing references on the content.voidsetTitle(DefaultContent content, String title)Set the title of non-multilingualDefaultContent.voidsetTitle(DefaultContent content, String title, Locale locale)Set aDefaultContenttitle for the given locale.
-
-
-
Constructor Detail
-
ModifiableContentHelper
public ModifiableContentHelper()
-
-
Method Detail
-
setTitle
public void setTitle(DefaultContent content, String title, Locale locale) throws AmetysRepositoryException
Set aDefaultContenttitle for the given locale.- Parameters:
content- theDefaultContentto set.title- the title to set.locale- The locale. Can be null if the content is not a multilingual content.- Throws:
AmetysRepositoryException- if an error occurs.
-
setTitle
public void setTitle(DefaultContent content, String title) throws AmetysRepositoryException
Set the title of non-multilingualDefaultContent. Be careful! Use only if content's title is not a multilingual string. If not sure usesetTitle(DefaultContent, String, Locale)instead.- Parameters:
content- theDefaultContentto set.title- the title to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTitle
public void copyTitle(Content srcContent, ModifiableContent targetContent) throws AmetysRepositoryException
Copy the title of the source content to the target content- Parameters:
srcContent- The source contenttargetContent- The target content- Throws:
AmetysRepositoryException- if an error occurs.
-
setCreator
public void setCreator(DefaultContent content, UserIdentity user) throws AmetysRepositoryException
Set aDefaultContentuser.- Parameters:
content- theDefaultContentto set.user- the user to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setCreationDate
public void setCreationDate(DefaultContent content, Date creationDate) throws AmetysRepositoryException
Set aDefaultContentcreation date.- Parameters:
content- theDefaultContentto set.creationDate- the creation date to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastContributor
public void setLastContributor(DefaultContent content, UserIdentity user) throws AmetysRepositoryException
Set aDefaultContentcontributor.- Parameters:
content- theDefaultContentto set.user- the contributor to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastModified
public void setLastModified(DefaultContent content, Date lastModified) throws AmetysRepositoryException
Set aDefaultContentlast modification date.- Parameters:
content- theDefaultContentto set.lastModified- the last modification date to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setFirstValidationDate
public void setFirstValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
Set aDefaultContentfirst validation date.- Parameters:
content- theDefaultContentto set.validationDate- the first validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastValidationDate
public void setLastValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
Set aDefaultContentlast validation date.- Parameters:
content- theDefaultContentto set.validationDate- the last validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastMajorValidationDate
public void setLastMajorValidationDate(DefaultContent content, Date validationDate) throws AmetysRepositoryException
Set aDefaultContentlast major validation date.- Parameters:
content- theDefaultContentto set.validationDate- the last major validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setOutgoingReferences
public void setOutgoingReferences(DefaultContent content, Map<String,OutgoingReferences> references) throws AmetysRepositoryException
Store the outgoing references on the content.- Parameters:
content- The content concerned by these outgoing references.references- A non null map of outgoing references grouped by metadata (key are metadata path)- Throws:
AmetysRepositoryException- if an error occurs.
-
-