public class CreateContentFunction extends AbstractContentWorkflowComponent implements com.opensymphony.workflow.FunctionProvider
| Modifier and Type | Field and Description |
|---|---|
protected ObservationManager |
_observationManager
Observation manager available to subclasses.
|
protected AmetysObjectResolver |
_resolver
Ametys object resolver available to subclasses.
|
static String |
CONTENT_LANGUAGE_KEY
Constant for storing the content language to use into the transient variables map.
|
static String |
CONTENT_MIXINS_KEY
Constant for storing the content type to use into the transient variables map.
|
static String |
CONTENT_NAME_KEY
Constant for storing the content name to use into the transient variables map.
|
static String |
CONTENT_TITLE_KEY
Constant for storing the content title to use into the transient variables map.
|
static String |
CONTENT_TYPES_KEY
Constant for storing the content type to use into the transient variables map.
|
static String |
PARENT_CONTENT_ID_KEY
Constant for storing the content language to use into the transient variables map.
|
static String |
PARENT_CONTENT_METADATA_PATH_KEY
Constant for storing the content language to use into the transient variables map.
|
CONTENT_KEY_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY| Constructor and Description |
|---|
CreateContentFunction() |
| Modifier and Type | Method and Description |
|---|---|
protected ModifiableWorkflowAwareContent |
_createContent(Map transientVars,
String desiredContentName,
ModifiableTraversableAmetysObject contentsNode)
Create the content object.
|
protected ModifiableTraversableAmetysObject |
_getContentRoot(Map transientVars)
Retrieve the content root.
|
protected String |
_getNonNullVar(Map transientVars,
String name,
String exceptionName)
Get a workflow parameter, throwing an exception if it is null.
|
protected String |
_getObjectType(Map transientVars)
Return the type of the object to be created.
|
protected ModifiableTraversableAmetysObject |
_getSubContentRoot(String parentContentId,
String parentContentMetadataPath)
Get the content root when creating a sub-content.
|
protected List<Future> |
_notifyContentAdded(Content content,
Map transientVars)
Notify observers that the content has been created
|
protected void |
_populateAdditionalData(Map transientVars,
ModifiableContent content)
Populate the content.
|
protected void |
_populateContent(Map transientVars,
ModifiableContent content)
Populate the content.
|
void |
execute(Map transientVars,
Map args,
com.opensymphony.module.propertyset.PropertySet ps) |
protected UserIdentity |
getSystemUser()
Get the user to use when the content is created in a background environment.
|
void |
service(ServiceManager manager) |
getContentaddWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUserpublic static final String CONTENT_NAME_KEY
public static final String CONTENT_TITLE_KEY
public static final String CONTENT_TYPES_KEY
public static final String CONTENT_MIXINS_KEY
public static final String CONTENT_LANGUAGE_KEY
public static final String PARENT_CONTENT_ID_KEY
public static final String PARENT_CONTENT_METADATA_PATH_KEY
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
public CreateContentFunction()
public void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class AbstractWorkflowComponentServiceExceptionpublic void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException
execute in interface com.opensymphony.workflow.FunctionProvidercom.opensymphony.workflow.WorkflowExceptionprotected List<Future> _notifyContentAdded(Content content, Map transientVars) throws com.opensymphony.workflow.WorkflowException
content - The content addedtransientVars - The workflow varsFuture objects of the asynchronous observerscom.opensymphony.workflow.WorkflowException - If an error occurredprotected ModifiableWorkflowAwareContent _createContent(Map transientVars, String desiredContentName, ModifiableTraversableAmetysObject contentsNode)
transientVars - the workflow parameters.desiredContentName - the desired content name.contentsNode - the content root node in the repository.protected String _getObjectType(Map transientVars)
transientVars - The workflow varsprotected ModifiableTraversableAmetysObject _getContentRoot(Map transientVars) throws com.opensymphony.workflow.WorkflowException
transientVars - the workflow parameters.com.opensymphony.workflow.WorkflowException - if an error occursprotected ModifiableTraversableAmetysObject _getSubContentRoot(String parentContentId, String parentContentMetadataPath) throws com.opensymphony.workflow.WorkflowException
parentContentId - the parent content ID.parentContentMetadataPath - the path of the metadata in which to create the sub-content.com.opensymphony.workflow.WorkflowException - if an error occurs.protected String _getNonNullVar(Map transientVars, String name, String exceptionName) throws com.opensymphony.workflow.WorkflowException
transientVars - the workflow parameters.name - the variable name.exceptionName - label of the exception to throw if the variable is null.com.opensymphony.workflow.WorkflowException - If an error occurredprotected void _populateContent(Map transientVars, ModifiableContent content) throws com.opensymphony.workflow.WorkflowException
transientVars - the transient variables.content - the content.com.opensymphony.workflow.WorkflowException - if an error occurs.protected UserIdentity getSystemUser()
protected void _populateAdditionalData(Map transientVars, ModifiableContent content) throws com.opensymphony.workflow.WorkflowException
transientVars - the transient variables.content - the content.com.opensymphony.workflow.WorkflowException - if an error occurs.