com.fatwire.gst.foundation.facade.mda
Interface LocaleService

All Known Implementing Classes:
DefaultLocaleService

public interface LocaleService

Service to find translated assets and work with Dimensions, DimensionSets and DimensionFilters.

Since:
Apr 19, 2011
Author:
Dolf Dijkstra

Method Summary
 com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, com.fatwire.mda.DimensionFilterInstance filter)
          Look up the translation for the asset specified, with the dimension filter.
 com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, long preferredDimension, com.fatwire.mda.DimensionSetInstance dimset)
          Finds the translation for the preferred dimension and dimensionset.
 com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, long preferredDimension, long dimensionSetId)
          Look up the translation for the asset specified, in the locale specified.
 com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, long preferredDimension, String dimensionSetName)
          Look up the translation for the asset specified, in the locale specified.
 com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, String site, long preferredDimension)
          Look up the translation for the asset specified, in the locale specified.
 com.fatwire.assetapi.data.AssetId findTranslation(String c, String cid, String site, String preferredLocaleDimensionId)
          Look up the translation for the asset specified, in the locale specified.
 com.fatwire.assetapi.data.AssetId getDimensionAssetIdForName(String name)
          Get the AssetId of the dimension asset for the name specified
 com.fatwire.mda.DimensionFilterInstance getDimensionFilter(String site)
          Looks up the DimensionFilter based on the current browser settings and site configuration, as well as request parameters.
 com.fatwire.mda.Dimension getDimensionForName(String name)
          Get the AssetId of the dimension asset for the name specified
 long getDimensionIdForName(String name)
          Get the id of the dimension asset for the name specified
 com.fatwire.mda.DimensionSetInstance getDimensionSet(String name)
          Looksup the DimensionSetInstance for the given name.
 com.fatwire.mda.Dimension getLocaleForAsset(com.fatwire.assetapi.data.AssetId id)
          Return the dimension of the input asset that corresponds to its locale.
 String getNameForDimensionId(long dimensionid)
          Shorthand function to get the name given a dimension ID specified.
 com.fatwire.mda.DimensionSetInstance locateDimensionSetInstanceForSite(String site)
          Returns the DimensionSetInstance for the site
 

Method Detail

locateDimensionSetInstanceForSite

com.fatwire.mda.DimensionSetInstance locateDimensionSetInstanceForSite(String site)
Returns the DimensionSetInstance for the site

Parameters:
site - the name of the site
Returns:
the DimensionSetInstance for the site

getDimensionFilter

com.fatwire.mda.DimensionFilterInstance getDimensionFilter(String site)
Looks up the DimensionFilter based on the current browser settings and site configuration, as well as request parameters.

Parameters:
site -
Returns:
the DimensionFilterInstance

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                  com.fatwire.mda.DimensionFilterInstance filter)
Look up the translation for the asset specified, with the dimension filter.

Parameters:
id - asset id of asset to look up
filter - the dimensionset to use
Returns:
AssetId of translation asset.

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(String c,
                                                  String cid,
                                                  String site,
                                                  String preferredLocaleDimensionId)
Look up the translation for the asset specified, in the locale specified.

If the desired translation is not available, null will be returned.

If a dimension set for the site has been configured that returns the asset other than the preferred locale, that is considered to be fine and not really the problem of the end user. In other words, a dimension set may dictate that a "backup" language can be returned to the user.

Null, however, is a valid option.

Parameters:
c - asset type of asset to look up
cid - asset id of asset to look up
site - name of site
preferredLocaleDimensionId - id of locale desired
Returns:
AssetId of translation asset.

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                  String site,
                                                  long preferredDimension)
Look up the translation for the asset specified, in the locale specified.

If the desired translation is not available, null will be returned.

If a dimension set for the site has been configured that returns the asset other than the preferred locale, that is considered to be fine and not really the problem of the end user. In other words, a dimension set may dictate that a "backup" language can be returned to the user.

Null, however, is a valid option.

Parameters:
id - id of asset to look up
site - name of site
preferredDimension - id of locale desired
Returns:
AssetId of translation asset, or null if none is returned by the dimension set filter.

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                  long preferredDimension,
                                                  long dimensionSetId)
Look up the translation for the asset specified, in the locale specified.

If the desired translation is not available, null will be returned.

If a dimension set for the site has been configured that returns the asset other than the preferred locale, that is considered to be fine and not really the problem of the end user. In other words, a dimension set may dictate that a "backup" language can be returned to the user.

Null, however, is a valid option.

Parameters:
id - id of asset to look up
preferredDimension - id of locale desired
dimensionSetId - dimension set to use to find the translation
Returns:
AssetId of translation asset, or null if none is returned by the dimension set filter.

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                  long preferredDimension,
                                                  String dimensionSetName)
Look up the translation for the asset specified, in the locale specified.

If the desired translation is not available, null will be returned.

If a dimension set has been configured that returns the asset other than the preferred locale, that is considered to be fine and not really the problem of the end user. In other words, a dimension set may dictate that a "backup" language can be returned to the user.

Null, however, is a valid option.

Parameters:
id - id of asset to look up
preferredDimension - id of locale desired
dimensionSetName - the name of the dimension set to use to find the translation
Returns:
AssetId of translation asset, or null if none is returned by the dimension set filter. The id parameters is returned if the asset does not have a locale or if the locale is already of the preferredDimension

findTranslation

com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                  long preferredDimension,
                                                  com.fatwire.mda.DimensionSetInstance dimset)
Finds the translation for the preferred dimension and dimensionset.

Parameters:
id -
preferredDimension -
dimset -
Returns:
assetid of translated asset.
Throws:
IllegalStateException

getDimensionSet

com.fatwire.mda.DimensionSetInstance getDimensionSet(String name)
Looksup the DimensionSetInstance for the given name.

Parameters:
name -
Returns:
the DimensionSetInstance by the provided name

getLocaleForAsset

com.fatwire.mda.Dimension getLocaleForAsset(com.fatwire.assetapi.data.AssetId id)
Return the dimension of the input asset that corresponds to its locale. If the asset does not have a locale set, returns null

Parameters:
id - asset
Returns:
locale dimension or null

getDimensionIdForName

long getDimensionIdForName(String name)
Get the id of the dimension asset for the name specified

Parameters:
name - dimension name, or locale like en_US
Returns:
dimension id, -1 is not found.

getDimensionAssetIdForName

com.fatwire.assetapi.data.AssetId getDimensionAssetIdForName(String name)
Get the AssetId of the dimension asset for the name specified

Parameters:
name - dimension name, or locale like en_US
Returns:
dimension id, null if not found

getDimensionForName

com.fatwire.mda.Dimension getDimensionForName(String name)
Get the AssetId of the dimension asset for the name specified

Parameters:
name - dimension name, or locale like en_US
Returns:
dimension id, null if not found

getNameForDimensionId

String getNameForDimensionId(long dimensionid)
Shorthand function to get the name given a dimension ID specified.

Parameters:
dimensionid - ID of a locale. Note the dimension group is not verified
Returns:
dimension name, or locale name, like en_CA, null if not found


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.