Class CreateNewsletterFunction
- java.lang.Object
-
- org.ametys.plugins.workflow.AbstractWorkflowComponent
-
- org.ametys.cms.workflow.AbstractContentWorkflowComponent
-
- org.ametys.cms.workflow.CreateContentFunction
-
- org.ametys.web.workflow.CreateContentFunction
-
- org.ametys.plugins.newsletter.workflow.CreateNewsletterFunction
-
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider,Initializable,Contextualizable,LogEnabled,Serviceable
public class CreateNewsletterFunction extends CreateContentFunction implements Initializable, Contextualizable
OSWorkflow function for creating a content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classCreateNewsletterFunction.IgnoreRootTagHandlerIgnore the root tag.protected classCreateNewsletterFunction.LocalImageHandlerLocal image handler: injects attributes so that the image will be properly handled.protected classCreateNewsletterFunction.NewsletterFilterAutomatic newsletter filter.
-
Field Summary
Fields Modifier and Type Field Description private CategoryProviderExtensionPoint_categoryProviderEPprotected Context_contextThe Avalon contextprivate ContentTypeExtensionPoint_cTypeExtPtprotected static String_DEFAULT_LEVELThe defaut content insertion level.protected static Set<String>_IGNORE_ATTRSThe list of attributes to ignore.private SAXParserFactory_saxParserFactoryprivate SourceResolver_sourceResolverprivate TransformerFactory_transformerFactoryprivate Properties_transformerPropertiesstatic StringNEWSLETTER_CATEGORY_KEYNewsletter category key.static StringNEWSLETTER_CONTENT_ID_MAP_KEYKey for content ID map when processing auto sections.static DateFormatNEWSLETTER_DATE_FORMATThe date format.static StringNEWSLETTER_DATE_KEYNewsletter date key.static StringNEWSLETTER_IS_AUTOMATIC_KEYNewsletter automatic property key.static StringNEWSLETTER_NUMBER_KEYNewsletter number key.static StringNEWSLETTER_PROCESS_AUTO_SECTIONS_KEYKey for "process auto sections".-
Fields inherited from class org.ametys.web.workflow.CreateContentFunction
_currentUserProvider, _siteManager, PAGE_KEY, PAGE_ZONE_KEY, SITE_KEY
-
Fields inherited from class org.ametys.cms.workflow.CreateContentFunction
_contentTypeEP, _contentTypeHelper, _observationManager, _resolver, CONTENT_LANGUAGE_KEY, CONTENT_MIXINS_KEY, CONTENT_NAME_KEY, CONTENT_TITLE_KEY, CONTENT_TITLE_VARIANTS_KEY, CONTENT_TYPES_KEY, PARENT_CONTENT_ID_KEY, PARENT_CONTENT_METADATA_PATH_KEY
-
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY
-
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
-
Constructor Summary
Constructors Constructor Description CreateNewsletterFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_getContent(String skinId, String templateId)private void_initContentRichText(ModifiableContent content, String skinId, String categoryID, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults)protected void_populateContent(Map transientVars, ModifiableContent content)Populate the content.private String_processAutoTags(String text, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults, String contentId)voidcontextualize(Context context)voidinitialize()voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.web.workflow.CreateContentFunction
_createContent, _getContentRoot, _notifyContentAdded, _populateAdditionalData
-
Methods inherited from class org.ametys.cms.workflow.CreateContentFunction
_eventParamsForContentAdded, _getNonNullVar, _getObjectType, _getSubContentRoot, _initWorkflow, _isMultilingual, _setTitle, execute, getSystemUser
-
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent
-
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
-
-
-
Field Detail
-
NEWSLETTER_CATEGORY_KEY
public static final String NEWSLETTER_CATEGORY_KEY
Newsletter category key.
-
NEWSLETTER_NUMBER_KEY
public static final String NEWSLETTER_NUMBER_KEY
Newsletter number key.
-
NEWSLETTER_DATE_KEY
public static final String NEWSLETTER_DATE_KEY
Newsletter date key.
-
NEWSLETTER_IS_AUTOMATIC_KEY
public static final String NEWSLETTER_IS_AUTOMATIC_KEY
Newsletter automatic property key.
-
NEWSLETTER_PROCESS_AUTO_SECTIONS_KEY
public static final String NEWSLETTER_PROCESS_AUTO_SECTIONS_KEY
Key for "process auto sections".
-
NEWSLETTER_CONTENT_ID_MAP_KEY
public static final String NEWSLETTER_CONTENT_ID_MAP_KEY
Key for content ID map when processing auto sections.
-
NEWSLETTER_DATE_FORMAT
public static final DateFormat NEWSLETTER_DATE_FORMAT
The date format.
-
_IGNORE_ATTRS
protected static final Set<String> _IGNORE_ATTRS
The list of attributes to ignore.
-
_DEFAULT_LEVEL
protected static final String _DEFAULT_LEVEL
The defaut content insertion level.- See Also:
- Constant Field Values
-
_sourceResolver
private SourceResolver _sourceResolver
-
_cTypeExtPt
private ContentTypeExtensionPoint _cTypeExtPt
-
_categoryProviderEP
private CategoryProviderExtensionPoint _categoryProviderEP
-
_transformerFactory
private TransformerFactory _transformerFactory
-
_transformerProperties
private Properties _transformerProperties
-
_saxParserFactory
private SAXParserFactory _saxParserFactory
-
-
Constructor Detail
-
CreateNewsletterFunction
public CreateNewsletterFunction()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classCreateContentFunction- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
_populateContent
protected void _populateContent(Map transientVars, ModifiableContent content) throws com.opensymphony.workflow.WorkflowException
Description copied from class:CreateContentFunctionPopulate the content.- Overrides:
_populateContentin classCreateContentFunction- Parameters:
transientVars- the transient variables.content- the content.- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurs.
-
_initContentRichText
private void _initContentRichText(ModifiableContent content, String skinId, String categoryID, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults) throws com.opensymphony.workflow.WorkflowException
- Throws:
com.opensymphony.workflow.WorkflowException
-
_processAutoTags
private String _processAutoTags(String text, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults, String contentId) throws com.opensymphony.workflow.WorkflowException
- Throws:
com.opensymphony.workflow.WorkflowException
-
_getContent
private String _getContent(String skinId, String templateId) throws IOException, com.opensymphony.workflow.WorkflowException
- Throws:
IOExceptioncom.opensymphony.workflow.WorkflowException
-
-