public class AssetFacadeImpl extends Object implements AssetFacade
Constructor and Description |
---|
AssetFacadeImpl(ICS ics) |
Modifier and Type | Method and Description |
---|---|
protected Object |
evaluateProfileExpression(String profileName, Map<String,Object> profileValues, String pattern)
Evaluate the profile expression value against the profile data, returning the profile value.
|
List<AssetResultRow> |
executeContentQuery(String siteName, Long assetId, String assetName, int limit, String sortingField, boolean ascending)
Execute a ContentQuery to retrieve the results
|
AssetId |
filterSingleAsset(AssetId asset, String desiredLocale, String dimensionSetName)
Filter an asset based on a DimensionSet and a preferred locale
|
List<String> |
getAllAssociations(AssetId id)
Get a list of all defined associations for a given asset
|
List<String> |
getAllAttributes(AssetId id)
Get a list of all defined attributes back for given asset id
|
AssetId |
getAssetByName(String siteName, String assetType, String assetName)
Retrieve an asset id from an asset name; for the possible multiple returns (assets with same names), we will return the first asset from the list
|
protected String |
getExpressionForProfileName(String valueSource, String profileName)
Returns the appropriate expression for the given profileName from the valueSource field of the visitor attribute.
|
String |
getField(String assettype, String id, String fieldName)
Get a field for a given asset type and id
|
String |
getICSVar(String name)
Get an ICS variable given name
|
List<AssetId> |
getImmediateChildren(String siteName, AssetId assetId)
Get the immediate children of a given flex parent asset
|
Long |
getPublicationId(String assetName)
Get the publication id given a publication name
|
List<RecommendedAssetId> |
getRecommendations(String recommendationName, String visitorId, String profileName, Map<String,Object> profile, String segments, String sitename, boolean keepSegments)
Get a list of recommended assets
|
AssetId |
getRelative(AssetId asset, String locale)
Get a relative of a given asset using the preferred locale
|
Collection<AssetId> |
getRelatives(AssetId assetId)
Retrieve the relatives of a given asset in a Collection
|
List<AssetId> |
getSegments(String alias, String profileName, Map<String,Object> profile, String sitename)
Get the segments that the visitor belongs to with visitor alias and visitor attributes
|
String |
getSubtype(AssetId asset)
Get the subtype for a given asset
|
boolean |
isAssetInSite(AssetId asset, String site) |
boolean |
isAttributeExist(AssetData assetData, String attribute)
Check if an Attribute exist in current assetData
|
boolean |
isValid(AssetId id, Date date)
Check an asset is valid or not for a given date
|
String |
makeBlobLink(BlobLinkInfo linkInfo)
Generate a blob link given table, identifierColumnName, identifier, and columnname with given BlobLinkInfo
|
String |
makeLink(LinkInfo linkInfo)
Generate a link given asset, template name and LinkInfo
|
protected void |
populateScalarDataFromProfile(com.openmarket.gator.interfaces.IVisitorDataManager vdm, String profileName, Map<String,Object> profileData, Long siteId, Map<String,String> scalarAttributesSet)
Populates ScalarVars data from the given profile.
|
String |
processEmbeddedLink(InputStream data)
Process the embeddedLink inside a binary attribute and return the processed result
|
String |
processEmbeddedLink(String data)
Process the embeddedLink inside a String/Text attribute and return the processed result
|
AssetData |
read(AssetId assetId, List<String> attributes)
Reads given set attribute data and returns an AssetData instance containing them.
|
Iterable<AssetData> |
read(List<AssetId> assetIds, boolean immediateOnly)
Read a list of AssetData given a list of AssetIds
|
protected void |
restoreVisitorAttributes(com.openmarket.gator.interfaces.IVisitorDataManager vdm, Map<String,String> scalarAttributesSet) |
List<AssetId> |
retainSegments(String alias, String profileName, Map<String,Object> profile, String segments, String sitename)
Get the segments from the specified list that the visitor belongs to with visitor alias and visitor attributes
|
public AssetFacadeImpl(ICS ics)
public Iterable<AssetData> read(List<AssetId> assetIds, boolean immediateOnly) throws AssetAccessException
AssetFacade
read
in interface AssetFacade
assetIds
- the list of asset ids to readAssetAccessException
- rethrown excetpionpublic AssetData read(AssetId assetId, List<String> attributes) throws AssetAccessException
AssetFacade
read
in interface AssetFacade
assetId
- AssetId to read attributes forattributes
- names of the attributesAssetAccessException
- if thrown if the AssetId does not exist or attribute names passed are incorrect for the asset. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.public List<String> getAllAttributes(AssetId id)
AssetFacade
getAllAttributes
in interface AssetFacade
id
- the asset id to get attributes forpublic List<String> getAllAssociations(AssetId id)
AssetFacade
getAllAssociations
in interface AssetFacade
id
- the asset id to get attributes forpublic String getICSVar(String name)
AssetFacade
getICSVar
in interface AssetFacade
name
- the name of the ICS variablepublic String getField(String assettype, String id, String fieldName)
AssetFacade
getField
in interface AssetFacade
assettype
- the asset typeid
- the id of the assetfieldName
- the name of the field to get value forpublic String getSubtype(AssetId asset) throws AssetAccessException
AssetFacade
getSubtype
in interface AssetFacade
asset
- the asset idAssetAccessException
- an AssetAccessExceptionpublic boolean isValid(AssetId id, Date date)
AssetFacade
isValid
in interface AssetFacade
id
- the asset iddate
- the date of interestpublic AssetId getRelative(AssetId asset, String locale)
AssetFacade
getRelative
in interface AssetFacade
asset
- the assetlocale
- the interested localepublic String makeLink(LinkInfo linkInfo) throws AssetAccessException
AssetFacade
makeLink
in interface AssetFacade
linkInfo
- the link informationAssetAccessException
- an AssetAccessExceptionpublic String makeBlobLink(BlobLinkInfo linkInfo) throws AssetAccessException
AssetFacade
makeBlobLink
in interface AssetFacade
linkInfo
- the blob link informationAssetAccessException
- an AssetAccessExceptionpublic List<AssetId> getSegments(String alias, String profileName, Map<String,Object> profile, String sitename)
AssetFacade
getSegments
in interface AssetFacade
alias
- the visitor aliasprofileName
- the name of the visitor profile.profile
- the visitor's profile (which is a map containing the attributes).sitename
- the site namepublic List<AssetId> retainSegments(String alias, String profileName, Map<String,Object> profile, String segments, String sitename)
AssetFacade
retainSegments
in interface AssetFacade
alias
- the visitor aliasprofileName
- the name of the visitor profile.profile
- the visitor's profile (which is a map containing the attributes).segments
- the list of segment names separated by ","sitename
- the site namepublic List<RecommendedAssetId> getRecommendations(String recommendationName, String visitorId, String profileName, Map<String,Object> profile, String segments, String sitename, boolean keepSegments) throws AssetAccessException
AssetFacade
getRecommendations
in interface AssetFacade
recommendationName
- the recommendation asset name to retrieve assets fromvisitorId
- the visitor aliasprofileName
- the name of the visitor profile.profile
- the visitor's profile (which is a map containing the attributes).segments
- the list of segment names separated by "," if knownsitename
- the site nameAssetAccessException
- an AssetAccessExceptionprotected void populateScalarDataFromProfile(com.openmarket.gator.interfaces.IVisitorDataManager vdm, String profileName, Map<String,Object> profileData, Long siteId, Map<String,String> scalarAttributesSet) throws com.openmarket.basic.interfaces.AssetException, NoSuchFieldException
vdm
- an IVisitorDataManagerprofileName
- a StringprofileData
- a MapsiteId
- a LongscalarAttributesSet
- a MapNoSuchFieldException
- a NoSuchFieldExceptioncom.openmarket.basic.interfaces.AssetException
protected String getExpressionForProfileName(String valueSource, String profileName)
valueSource
- The valuesource field value defined in the VMSCALARATTRIBUTEDEF table.profileName
- The profile name whose expression should be retrieved.protected Object evaluateProfileExpression(String profileName, Map<String,Object> profileValues, String pattern)
profileName
- The name of the profile, perhaps "PROF2"profileValues
- The profile map of valuespattern
- The pattern expression to extract, perhaps PROF2.userData[2].customer.ageprotected void restoreVisitorAttributes(com.openmarket.gator.interfaces.IVisitorDataManager vdm, Map<String,String> scalarAttributesSet)
public boolean isAttributeExist(AssetData assetData, String attribute)
AssetFacade
isAttributeExist
in interface AssetFacade
assetData
- the AssetDataattribute
- the attribute name to checkpublic AssetId filterSingleAsset(AssetId asset, String desiredLocale, String dimensionSetName) throws com.fatwire.mda.DimensionException
AssetFacade
filterSingleAsset
in interface AssetFacade
asset
- the asset to filterdesiredLocale
- the preferred localedimensionSetName
- name of the DimensionSet to be usedcom.fatwire.mda.DimensionException
- an DimensionExceptionpublic Collection<AssetId> getRelatives(AssetId assetId)
AssetFacade
getRelatives
in interface AssetFacade
assetId
- the asset id of interested assetpublic List<AssetId> getImmediateChildren(String siteName, AssetId assetId)
AssetFacade
getImmediateChildren
in interface AssetFacade
siteName
- the site name of the site children are interested inassetId
- the asset idpublic AssetId getAssetByName(String siteName, String assetType, String assetName)
AssetFacade
getAssetByName
in interface AssetFacade
siteName
- the site nameassetType
- the asset typeassetName
- the asset namepublic String processEmbeddedLink(String data)
AssetFacade
processEmbeddedLink
in interface AssetFacade
data
- the attribute value that needs to be processedpublic String processEmbeddedLink(InputStream data)
AssetFacade
processEmbeddedLink
in interface AssetFacade
data
- the attribute value that needs to be processedpublic List<AssetResultRow> executeContentQuery(String siteName, Long assetId, String assetName, int limit, String sortingField, boolean ascending) throws AssetAccessException
AssetFacade
executeContentQuery
in interface AssetFacade
siteName
- the site nameassetId
- the ContentQuery idassetName
- the ContentQuery name, one of the id or name needs to present for this method to worklimit
- the limit of how many assets will be returnedsortingField
- the sorting field to sort the resultsascending
- whether sort in ascending or descending orderAssetAccessException
public Long getPublicationId(String assetName)
AssetFacade
getPublicationId
in interface AssetFacade
assetName
- the publication namepublic boolean isAssetInSite(AssetId asset, String site)
isAssetInSite
in interface AssetFacade