public class NewsletterHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARAM_NEWSLETTER
Parameter Name for the Path to a newsletter
|
static java.lang.String |
PARAM_RECIPIENTS
Parameter Name for the MailingList the Newsletter should be sent to
|
static java.lang.String |
PARAM_TEST_PROFILE
Parameter Name for the an User-ID used to personlize a Newsletter for testing
|
static java.lang.String |
PARAM_TEST_TO
Parameter Name for the an User-ID used to send a Newsletter for testing
|
Constructor and Description |
---|
NewsletterHelper() |
Modifier and Type | Method and Description |
---|---|
static NewsLetter |
fromRequest(SlingHttpServletRequest request,
NewsletterEmailService service)
Reads the request parameter and tries to build a Newsletter from.
|
static java.lang.String |
getParameter(RequestParameterMap map,
java.lang.String key)
Utility to trim existing Parameter Values
|
static java.util.Collection<Resource> |
getUnpublishedResources(NewsLetter letter,
ResourceResolver resolver)
Collect the Resources referenced by the Newsletter and the Newsletters
Resource and check if they have been modified since last publish or if
they are not published at all
|
static boolean |
isPublishUptodate(NewsLetter letter,
ResourceResolver resolver)
Checks that no outdated resources, see
getUnpublishedResources , are referenced by the NewsLetter and
that the Newsletter is 'delivered' (see ReplicationStatus ). |
public static final java.lang.String PARAM_NEWSLETTER
public static final java.lang.String PARAM_RECIPIENTS
public static final java.lang.String PARAM_TEST_TO
public static final java.lang.String PARAM_TEST_PROFILE
public static NewsLetter fromRequest(SlingHttpServletRequest request, NewsletterEmailService service) throws RepositoryException
PARAM_NEWSLETTER
, falls back to
the Request's Resource
Helper tries to access a Page
if the Resource found is part of a Page
Subject and from are set, if present in Requestrequest
- to access parameter fromservice
- to build Newsletter withnull
if could not be build.RepositoryException
- in case of error accessing the Repositorypublic static java.util.Collection<Resource> getUnpublishedResources(NewsLetter letter, ResourceResolver resolver) throws RepositoryException
letter
- to inspectresolver
- to use for access to the ResourcesRepositoryException
- in case of error accessing the Repositorypublic static boolean isPublishUptodate(NewsLetter letter, ResourceResolver resolver)
getUnpublishedResources
, are referenced by the NewsLetter and
that the Newsletter is 'delivered' (see ReplicationStatus
).letter
- to inspectresolver
- to use for access to the ResourcesRepositoryException
- in case of error accessing the Repositorypublic static java.lang.String getParameter(RequestParameterMap map, java.lang.String key)
map
- to accesskey
- to return"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"