public class MboxHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
generateLocationName(Resource currentResource,
WCMMode wcmMode,
String... ambitMappings)
Generates the location name used by this location in Adobe Target.
|
static List<String> |
getClientContextParameterNames(Resource resource,
InheritanceValueMap pageProperties,
ConfigurationManager configurationManager)
Returns the names of the ClientContext parameters which should be sent as part of mbox calls
|
static String |
getCustomMboxJsPath(Resource resource,
Page currentPage,
ConfigurationManager cfgMgr)
Returns the repository path to a custom
mbox.js file for the current specified resource and currentPage |
static Map<String,String> |
getMappedClientContextParameterNames(Resource resource,
InheritanceValueMap pageProperties,
ConfigurationManager configurationManager)
Returns the names and mapped values of the ClientContext parameters which should be sent as part of mbox calls
|
static String |
getMboxId(Resource rsrc)
Generates an mbox ID.
|
static String |
getMboxId(String location)
Generates an mbox ID from an mbox location.
|
static String |
getMboxName(Resource rsrc)
Returns a name for the
Resource. |
static Map<String,String> |
getStaticParameters(Resource resource)
Returns the static parameters configured for this target component.
|
static boolean |
isAccurateRendering(Resource resource)
Returns true if the mbox represented by the
resource has accurateTargeting enabled. |
static String |
qualifyMboxNameOrId(String mboxNameOrId,
WCMMode wcmMode)
Adds the WCM mode qualifier to the mbox name, if necessary
|
static String |
qualifyMboxNameOrId(String mboxNameOrId,
WCMMode wcmMode,
String ambitName)
Adds the necessary qualifiers (WCM Mode and the name of the ambit) to the mbox name
|
static Resource |
searchStartElement(Resource resource)
Search the start element for the current element type.
|
public static String getMboxName(Resource rsrc)
Resource. As name the jcr:title with
removed whitespaces is used if available. If no jcr:title is specified,
a name is generated by getMboxId(Resource).public static String generateLocationName(Resource currentResource, WCMMode wcmMode, String... ambitMappings)
WCMMode is WCMMode.DISABLED then it's omitted. If not, the "--author" suffix is used.public static String getMboxId(Resource rsrc)
rsrc - Resource of start/end elementResourcepublic static String qualifyMboxNameOrId(String mboxNameOrId, WCMMode wcmMode)
mboxNameOrId - the mbox namewcmMode - the WCMModeWCMMode.DISABLED then the return value is the one passed in the mboxNameOrId parameterpublic static String qualifyMboxNameOrId(String mboxNameOrId, WCMMode wcmMode, String ambitName)
mboxNameOrId - the actual mbox namewcmMode - the WCMModeambitName - the name of the ambit, if this mbox belongs to a site using MSMWCMMode.DISABLED and the ambit name is "master" then the return value is the one passed on the mboxNameOrId parameterpublic static String getMboxId(String location)
jcr:content is stripped from it.location - the mbox locationgetMboxId(Resource)public static Resource searchStartElement(Resource resource)
resource - Resourcepublic static String getCustomMboxJsPath(Resource resource, Page currentPage, ConfigurationManager cfgMgr) throws RepositoryException
mbox.js file for the current specified resource and currentPageresource - ResourcecurrentPage - current PagecfgMgr - ConfigurationManagermbox.js file or null if the default one should be usedRepositoryException - RepositoryExceptionpublic static boolean isAccurateRendering(Resource resource) throws RepositoryException
resource has accurateTargeting enabled.resource - Resourceresource has accurateTargeting enabled.RepositoryException - RepositoryExceptionpublic static List<String> getClientContextParameterNames(Resource resource, InheritanceValueMap pageProperties, ConfigurationManager configurationManager) throws RepositoryException
This method merges the directly defined parameter names with the parameters names inherited from a Adobe Target framework.
resource - the target resourcepageProperties - InheritanceValueMapconfigurationManager - ConfigurationManagerRepositoryException - RepositoryExceptionpublic static Map<String,String> getMappedClientContextParameterNames(Resource resource, InheritanceValueMap pageProperties, ConfigurationManager configurationManager) throws RepositoryException
This method merges the directly defined parameter names with the parameters names inherited from a Adobe Target framework.
The mapped values are usually defined by the Framework. In case they are defined statically on the
component the property name is transformed by transforming all slashes ('/') to dots ('.').
resource - the target resourcepageProperties - InheritanceValueMapconfigurationManager - ConfigurationManagerRepositoryException - RepositoryExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved