Package org.ametys.cms.repository
Class ModifiableContentHelper
java.lang.Object
org.ametys.cms.repository.ModifiableContentHelper
- All Implemented Interfaces:
Component
Provides helper methods to use the
ModifiableContent API on DefaultContents.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_storeUserMetadata(DefaultContent content, String metadataName, UserIdentity user) Store a metadata of type user in the contentvoidcopyTitle(Content srcContent, ModifiableContent targetContent) Copy the title of the source content to the target contentvoidsetCreationDate(DefaultContent content, ZonedDateTime creationDate) Set aDefaultContentcreation date.voidsetCreator(DefaultContent content, UserIdentity user) Set aDefaultContentuser.voidsetFirstValidationDate(DefaultContent content, ZonedDateTime validationDate) Set aDefaultContentfirst validation date.voidsetFirstValidator(DefaultContent content, UserIdentity user) Set aDefaultContentfirst validator.voidsetLastContributor(DefaultContent content, UserIdentity user) Set aDefaultContentcontributor.voidsetLastMajorValidationDate(DefaultContent content, ZonedDateTime validationDate) Set aDefaultContentlast major validation date.voidsetLastMajorValidator(DefaultContent content, UserIdentity user) Set aDefaultContentlast major validator.voidsetLastModified(DefaultContent content, ZonedDateTime lastModified) Set aDefaultContentlast modification date.voidsetLastValidationDate(DefaultContent content, ZonedDateTime validationDate) Set aDefaultContentlast validation date.voidsetLastValidator(DefaultContent content, UserIdentity user) Set aDefaultContentlast validator.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.
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
ModifiableContentHelper
public ModifiableContentHelper()
-
-
Method Details
-
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
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
Set aDefaultContentuser.- Parameters:
content- theDefaultContentto set.user- the user to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setCreationDate
public void setCreationDate(DefaultContent content, ZonedDateTime 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, ZonedDateTime lastModified) throws AmetysRepositoryException Set aDefaultContentlast modification date.- Parameters:
content- theDefaultContentto set.lastModified- the last modification date to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setFirstValidator
public void setFirstValidator(DefaultContent content, UserIdentity user) throws AmetysRepositoryException Set aDefaultContentfirst validator.- Parameters:
content- theDefaultContentto set.user- the validator to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setFirstValidationDate
public void setFirstValidationDate(DefaultContent content, ZonedDateTime validationDate) throws AmetysRepositoryException Set aDefaultContentfirst validation date.- Parameters:
content- theDefaultContentto set.validationDate- the first validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastValidator
public void setLastValidator(DefaultContent content, UserIdentity user) throws AmetysRepositoryException Set aDefaultContentlast validator.- Parameters:
content- theDefaultContentto set.user- the validator to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastValidationDate
public void setLastValidationDate(DefaultContent content, ZonedDateTime validationDate) throws AmetysRepositoryException Set aDefaultContentlast validation date.- Parameters:
content- theDefaultContentto set.validationDate- the last validation date.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastMajorValidator
public void setLastMajorValidator(DefaultContent content, UserIdentity user) throws AmetysRepositoryException Set aDefaultContentlast major validator.- Parameters:
content- theDefaultContentto set.user- the validator to set.- Throws:
AmetysRepositoryException- if an error occurs.
-
setLastMajorValidationDate
public void setLastMajorValidationDate(DefaultContent content, ZonedDateTime 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 AmetysRepositoryExceptionStore 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.
-
_storeUserMetadata
protected void _storeUserMetadata(DefaultContent content, String metadataName, UserIdentity user) throws AmetysRepositoryException Store a metadata of type user in the content- Parameters:
content- the content described by the metadatametadataName- the name of the metadatauser- the value to set- Throws:
AmetysRepositoryException- when an error occurred
-