public class ModifiableContentHelper extends Object implements Component, Serviceable
ModifiableContent
API on DefaultContent
s.Modifier and Type | Field and Description |
---|---|
private ContentTypesHelper |
_contentTypesHelper |
static String |
METADATA_CONTRIBUTOR
Constants for last contributor Metadata*
|
static String |
METADATA_CREATION
Constants for lastModified Metadata*
|
static String |
METADATA_CREATOR
Constants for author Metadata*
|
static String |
METADATA_LANGUAGE
Constants for language Metadata*
|
static String |
METADATA_LAST_MAJORVALIDATION
Constants for lastMajorValidationDate Metadata*
|
static String |
METADATA_LAST_VALIDATION
Constants for lastValidationDate Metadata*
|
static String |
METADATA_MODIFIED
Constants for lastModified Metadata*
|
static String |
METADATA_OUTGOING_REFERENCE_NODETYPE
Constants for the outgoing reference property
|
static String |
METADATA_OUTGOING_REFERENCE_PROPERTY
Constants for the outgoing reference property
|
static String |
METADATA_OUTGOING_REFERENCES
Constants for the outgoing references node
|
static String |
METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
Constants for the outgoing references path property
|
static String |
METADATA_ROOT_OUTGOING_REFERENCES
Constants for the root outgoing references node
|
static String |
METADATA_TITLE
Constants for title Metadata*
|
static String |
ROLE
The Avalon role
|
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 |
service(ServiceManager manager) |
void |
setCreationDate(DefaultContent content,
Date creationDate)
Set a
DefaultContent creation date. |
void |
setCreator(DefaultContent content,
UserIdentity user)
Set a
DefaultContent user. |
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 static final String METADATA_ROOT_OUTGOING_REFERENCES
public static final String METADATA_OUTGOING_REFERENCES
public static final String METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
public static final String METADATA_OUTGOING_REFERENCE_PROPERTY
public static final String METADATA_OUTGOING_REFERENCE_NODETYPE
public static final String METADATA_LANGUAGE
public static final String METADATA_TITLE
public static final String METADATA_CREATOR
public static final String METADATA_CREATION
public static final String METADATA_LAST_VALIDATION
public static final String METADATA_LAST_MAJORVALIDATION
public static final String METADATA_CONTRIBUTOR
public static final String METADATA_MODIFIED
private ContentTypesHelper _contentTypesHelper
public ModifiableContentHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
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.
Be careful ! Can be invoked only if the metadata title already exists.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 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.