Class MacMetadata
java.lang.Object
com.day.cq.analytics.testandtarget.mac.MacMetadata
Holds the Marketing Cloud Metadata which is attached to objects exported to Target. Not all objects require this
metadata, so for now it's only attached to offers and activities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String attributeName, String attributeValue) Adds a Marketing Cloud Metadata attribute / value pair to this offer request.addAttribute(String attributeName, String[] attributeValues) Adds a Marketing Cloud Metadata attribute / value pair to this offer request.static MacMetadatagenerateMandatoryMetadata(String editUrl, String remoteModifiedBy) Generates the mandatory metadata.Retrieves the list of the Marketing Cloud Metadata attributes.Retrieves the value of a specific attribute from this metadata setString[]Retrieves the value of a specific attribute from this metadata set, specifying what type should the returned value bevoidremoveAttribute(String attributeName) Removes a Marketing Cloud Metadata attribute from the list.
-
Constructor Details
-
MacMetadata
public MacMetadata()
-
-
Method Details
-
addAttribute
@Nonnull public MacMetadata addAttribute(@Nonnull String attributeName, @Nonnull String attributeValue) Adds a Marketing Cloud Metadata attribute / value pair to this offer request. The following restrictions apply:- the attributeName or attributeValue must not exceed 250 chars in length
- The maximum size of the MAC Metadata list is 15 items
RuntimeExceptionif any of the above mentioned restrictions are hit.- Parameters:
attributeName- the name of the attributeattributeValue- the value of the attribute- Returns:
MacMetadata
-
addAttribute
Adds a Marketing Cloud Metadata attribute / value pair to this offer request. The following restrictions apply:- the attributeName or attributeValue must not exceed 250 chars in length
- The maximum size of the MAC Metadata list is 15 items
RuntimeExceptionif any of the above mentioned restrictions are hit.- Parameters:
attributeName- the name of the attributeattributeValues- the values of the attributes- Returns:
MacMetadata
-
removeAttribute
Removes a Marketing Cloud Metadata attribute from the list.- Parameters:
attributeName- the name of the attribute.
-
getMarketingCloudMetadata
Retrieves the list of the Marketing Cloud Metadata attributes.- Returns:
- a
Maphaving the attribute names as keys and the attribute values as values.
-
getValue
Retrieves the value of a specific attribute from this metadata set -
getValues
Retrieves the value of a specific attribute from this metadata set, specifying what type should the returned value be- Parameters:
attributeName- the name of the attribute- Returns:
- the value cast to the specified type
-
generateMandatoryMetadata
@Nonnull public static MacMetadata generateMandatoryMetadata(@Nonnull String editUrl, @Nonnull String remoteModifiedBy) Generates the mandatory metadata. The mandatory metadata contains the following attributes:- The edit url of the object, i.e. the full URL used to open the object in it's editor in AEM
- The user that perform the last modification
- The source product name (in our case Adobe Experience Manager)
- Parameters:
editUrl- the URL which is used to access the objectremoteModifiedBy- the user which performed the last modification- Returns:
- a
MacMetadataobject containing the three attributes above
-