public class DefaultLocaleService extends Object implements LocaleService
| Constructor and Description |
|---|
DefaultLocaleService(COM.FutureTense.Interfaces.ICS ics)
Constructor with "lang" and "locale" as variable names for langVar and
localeVar.
|
DefaultLocaleService(COM.FutureTense.Interfaces.ICS ics,
String langVar,
String localeVar)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.mda.DimensionableAssetManager |
getDAM()
Shorthand function for returning the DimensionableAssetManager.
|
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)
Return a dimension filter instance corresponding to the dimension set
specified by the user (or discovered by the tag).
|
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.
|
protected com.fatwire.mda.DimensionManager |
getDM()
Shorthand function for returning the DimensionManager.
|
protected com.fatwire.assetapi.data.AssetId |
getExplicitlySpecifiedLocale()
Get the locale that the user explicitly specified.
|
com.fatwire.mda.Dimension |
getLocaleForAsset(com.fatwire.assetapi.data.AssetId id)
Return the dimension of the input asset that corresponds to its locale.
|
protected <T> T |
getManager(Class<T> c) |
String |
getNameForDimensionId(long dimensionid)
Shorthand function to get the name given a dimension ID specified.
|
protected Collection<com.fatwire.assetapi.data.AssetId> |
getPreferredLocales()
Get the ordered list of preferred locales that the user wants.
|
protected com.fatwire.system.Session |
getSession() |
long |
locateDimensionSetForSite(String site)
Locates a single dimension set in a site.
|
com.fatwire.mda.DimensionSetInstance |
locateDimensionSetInstanceForSite(String site)
Returns the DimensionSetInstance.
|
public DefaultLocaleService(COM.FutureTense.Interfaces.ICS ics)
ics - Content Server context objectpublic DefaultLocaleService(COM.FutureTense.Interfaces.ICS ics,
String langVar,
String localeVar)
ics - Content Server context objectlangVar - the name of the ics variable for the current 'language',
as in en_US.localeVar - the name of the ics variable for the current dimension
id.public com.fatwire.assetapi.data.AssetId findTranslation(String c, String cid, String site, String preferredLocaleDimensionId)
LocaleServiceIf 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.
findTranslation in interface LocaleServicec - asset type of asset to look upcid - asset id of asset to look upsite - name of sitepreferredLocaleDimensionId - id of locale desiredpublic com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
String site,
long preferredDimension)
LocaleServiceIf 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.
findTranslation in interface LocaleServiceid - id of asset to look upsite - name of sitepreferredDimension - id of locale desiredpublic com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
long preferredDimension,
long dimensionSetId)
LocaleServiceIf 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.
findTranslation in interface LocaleServiceid - id of asset to look uppreferredDimension - id of locale desireddimensionSetId - dimension set to use to find the translationpublic com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
long preferredDimension,
String dimensionSetName)
LocaleServiceIf 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.
findTranslation in interface LocaleServiceid - id of asset to look uppreferredDimension - id of locale desireddimensionSetName - the name of the dimension set to use to find the
translationpublic com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
long preferredDimension,
com.fatwire.mda.DimensionSetInstance dimset)
LocaleServicefindTranslation in interface LocaleServiceid - asset idpreferredDimension - id of preferred localedimset - dimension set instancepublic long locateDimensionSetForSite(String site)
site - site containing a dimension setpublic com.fatwire.mda.DimensionSetInstance getDimensionSet(String name)
LocaleServicegetDimensionSet in interface LocaleServicename - dimension namepublic com.fatwire.mda.DimensionableAssetManager getDAM()
protected com.fatwire.mda.DimensionManager getDM()
public com.fatwire.mda.Dimension getLocaleForAsset(com.fatwire.assetapi.data.AssetId id)
LocaleServicegetLocaleForAsset in interface LocaleServiceid - assetpublic long getDimensionIdForName(String name)
LocaleServicegetDimensionIdForName in interface LocaleServicename - dimension name, or locale like en_USpublic com.fatwire.assetapi.data.AssetId getDimensionAssetIdForName(String name)
LocaleServicegetDimensionAssetIdForName in interface LocaleServicename - dimension name, or locale like en_USpublic com.fatwire.mda.Dimension getDimensionForName(String name)
LocaleServicegetDimensionForName in interface LocaleServicename - dimension name, or locale like en_USpublic String getNameForDimensionId(long dimensionid)
LocaleServicegetNameForDimensionId in interface LocaleServicedimensionid - ID of a locale. Note the dimension group is not
verifiedprotected com.fatwire.system.Session getSession()
protected <T> T getManager(Class<T> c)
public com.fatwire.assetapi.data.AssetId findTranslation(com.fatwire.assetapi.data.AssetId id,
com.fatwire.mda.DimensionFilterInstance filter)
LocaleServicefindTranslation in interface LocaleServiceid - asset id of asset to look upfilter - the dimensionset to usepublic com.fatwire.mda.DimensionFilterInstance getDimensionFilter(String site)
The preferred locales are identified by checking the following locations, in the order specified:
getDimensionFilter in interface LocaleServicesite - name of the siteprotected final com.fatwire.assetapi.data.AssetId getExplicitlySpecifiedLocale()
protected final Collection<com.fatwire.assetapi.data.AssetId> getPreferredLocales()
public final com.fatwire.mda.DimensionSetInstance locateDimensionSetInstanceForSite(String site)
locateDimensionSetInstanceForSite in interface LocaleServicesite - current siteCopyright © 2010–2017. All rights reserved.