com.fatwire.gst.foundation.facade.mda
Class LocaleUtils

java.lang.Object
  extended by com.fatwire.gst.foundation.facade.mda.LocaleUtils

public final class LocaleUtils
extends Object

Handles Locale-specific functions efficiently in Java.

Since:
May 8, 2009
Author:
Tony Field

Method Summary
static com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id, String preferredLocaleDimensionIdString, String site)
          Deprecated. Use #findTranslation(ICS,AssetId,String,String) instead. This version is unable to correctly record compositional dependencies on the DimensionSet asset for the site, which can result in the translation function not flushing pages when the dimension set is altered (for example, to change the filter, or change enabled dimensions).
static Collection<com.fatwire.assetapi.data.AssetId> findTranslation(com.fatwire.mda.DimensionManager dimensionManager, List<com.fatwire.assetapi.data.AssetId> toFilterList, Collection<com.fatwire.assetapi.data.AssetId> preferredDimensionIds, com.fatwire.mda.DimensionSetInstance dimSet)
          Main translation lookup method.
static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics, com.fatwire.assetapi.data.AssetId id, long preferredDimension, com.fatwire.mda.DimensionSetInstance dimset)
           
static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics, com.fatwire.assetapi.data.AssetId id, long preferredDimension, long dimensionSetId)
          Look up the translation for the asset specified, in the locale specified.
static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics, com.fatwire.assetapi.data.AssetId id, long preferredDimension, String dimensionSetName)
          Look up the translation for the asset specified, in the locale specified.
static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics, com.fatwire.assetapi.data.AssetId id, String preferredLocaleDimensionIdString, String site)
          Look up the translation for the asset specified, in the locale specified.
static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics, String c, String cid, String preferredLocaleDimensionId, String site)
          Look up the translation for the asset specified, in the locale specified.
static com.fatwire.assetapi.data.AssetId findTranslation(String c, String cid, String preferredLocaleDimensionId, String site)
          Deprecated. Use #findTranslation(ICS,String,String,String,String) instead. This version is unable to correctly record compositional dependencies on the DimensionSet asset for the site, which can result in the translation function not flushing pages when the dimension set is altered (for example, to change the filter, or change enabled dimensions).
static com.fatwire.mda.DimensionSetInstance getDimensionSet(COM.FutureTense.Interfaces.ICS ics, long theDimSetId)
           
static com.fatwire.mda.DimensionSetInstance getDimensionSet(COM.FutureTense.Interfaces.ICS ics, String name)
           
static long locateDimensionSetForSite(COM.FutureTense.Interfaces.ICS ics, String site)
          Locates a single dimension set in a site.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findTranslation

public static com.fatwire.assetapi.data.AssetId findTranslation(String c,
                                                                String cid,
                                                                String preferredLocaleDimensionId,
                                                                String site)
Deprecated. Use #findTranslation(ICS,String,String,String,String) instead. This version is unable to correctly record compositional dependencies on the DimensionSet asset for the site, which can result in the translation function not flushing pages when the dimension set is altered (for example, to change the filter, or change enabled dimensions).

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
preferredLocaleDimensionId - id of locale desired
site - name of site
Returns:
AssetId of translation asset.

findTranslation

public static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics,
                                                                String c,
                                                                String cid,
                                                                String preferredLocaleDimensionId,
                                                                String site)
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
preferredLocaleDimensionId - id of locale desired
site - name of site
ics - ics context
Returns:
AssetId of translation asset.

findTranslation

public static com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
                                                                String preferredLocaleDimensionIdString,
                                                                String site)
Deprecated. Use #findTranslation(ICS,AssetId,String,String) instead. This version is unable to correctly record compositional dependencies on the DimensionSet asset for the site, which can result in the translation function not flushing pages when the dimension set is altered (for example, to change the filter, or change enabled dimensions).

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
preferredLocaleDimensionIdString - id of locale desired
site - name of site
Returns:
AssetId of translation asset, or null if none is returned by the dimension set filter.

findTranslation

public static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics,
                                                                com.fatwire.assetapi.data.AssetId id,
                                                                String preferredLocaleDimensionIdString,
                                                                String site)
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:
ics - context
id - id of asset to look up
preferredLocaleDimensionIdString - id of locale desired
site - name of site
Returns:
AssetId of translation asset, or null if none is returned by the dimension set filter.

findTranslation

public static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics,
                                                                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

public static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics,
                                                                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

public static com.fatwire.assetapi.data.AssetId findTranslation(COM.FutureTense.Interfaces.ICS ics,
                                                                com.fatwire.assetapi.data.AssetId id,
                                                                long preferredDimension,
                                                                com.fatwire.mda.DimensionSetInstance dimset)
                                                         throws IllegalStateException
Parameters:
ics -
id -
preferredDimension -
dimset -
Returns:
assetid of translated asset.
Throws:
IllegalStateException

findTranslation

public static Collection<com.fatwire.assetapi.data.AssetId> findTranslation(com.fatwire.mda.DimensionManager dimensionManager,
                                                                            List<com.fatwire.assetapi.data.AssetId> toFilterList,
                                                                            Collection<com.fatwire.assetapi.data.AssetId> preferredDimensionIds,
                                                                            com.fatwire.mda.DimensionSetInstance dimSet)
Main translation lookup method. Accesses the filter in the dimension set, configures it with the preferred dimension IDs, then filters the input assets.

Parameters:
dimensionManager - manager class for Dimension lookups
toFilterList - list of input assets that need to be translated. Often it's just one, but a list is perfectly valid.
preferredDimensionIds - preferred dimensions to be investigated for a result. Priority preference depends on the configured filter
dimSet - DimensionSet to use for filtering.
Returns:
list of assets based on the translation rules in the dimension filter from the specified dimension set.

locateDimensionSetForSite

public static long locateDimensionSetForSite(COM.FutureTense.Interfaces.ICS ics,
                                             String site)
Locates a single dimension set in a site. If no match is found, an exception is thrown. If more than one match is found, an exception is thrown.

Parameters:
ics - context
site - site containing a dimension set
Returns:
DimensionSet ID

getDimensionSet

public static com.fatwire.mda.DimensionSetInstance getDimensionSet(COM.FutureTense.Interfaces.ICS ics,
                                                                   long theDimSetId)

getDimensionSet

public static com.fatwire.mda.DimensionSetInstance getDimensionSet(COM.FutureTense.Interfaces.ICS ics,
                                                                   String name)


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