public class StoreConfigurationHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
ADDITIONAL_BUSINESS_CONTEXT_PARAMS
Additional parameters that are supported in business context.
|
static java.lang.String |
AUTHORING
Authoring.
|
static java.lang.String |
BUSINESS_CONTEXT
The business context.
|
static java.lang.String |
CATALOG_ID
The catalog Id.
|
static java.lang.String |
CONTENT_PERSONALIZATION
The content personalization Id.
|
static java.lang.String |
CURRENCY
The currency.
|
static java.lang.String |
DEFAULT_ACCESS_PROFILE
The default access profile, used when an access profile is not specified
using the
accessProfile query parameter. |
static java.lang.String |
DEFAULT_CATALOG_CONFIG_GROUP_NAME
The name of the configuration groups in wc-component.xml which contains
the mapping of store id and default catalog id for REST services.
|
static java.lang.String |
FIND_BY_ALL_XPATH
The XPATH expression, used to retrieve the Configuration by All
|
static java.lang.String |
FIND_BY_IDENTIFIER_XPATH
The XPATH expression, used to retrieve the Configuration by Identifier.
|
static java.lang.String |
FIND_BY_STORE_ID_XPATH
The XPATH expression, used to retrieve the OnlineStore by store ID.
|
static java.lang.String |
FORMAT_ATOM
The response format value for Atom feeds.
|
static java.lang.String |
FORMAT_JSON
The response format value for JSON.
|
static java.lang.String |
IS_SECURE_KEY
The key used to store is request in Secure mode or not.
|
static java.lang.String |
LANGUAGE_ID
The language Id.
|
static java.lang.String |
LOCALE
The locale.
|
static java.lang.String |
PARTIAL_AUTHENTICATION
Business context flag indicating if partial authentication is used.
|
static java.lang.String |
PREVIEW
Preview.
|
static java.lang.String |
PREVIEW_TOKEN
The preview token
|
static java.lang.String |
PREVIEW_TOKEN_GEN_REQUEST
The preview token generation request
|
static java.lang.String |
STORE_ID
The store Id.
|
static java.lang.String |
STORE_NAME
The store name.
|
static java.lang.String |
WORKSPACE_NAME
The workspace name.
|
Modifier and Type | Method and Description |
---|---|
static BusinessContextType |
buildBusinessContext(java.util.Map<java.lang.String,java.lang.String> businessContextNVP)
This method builds a
BusinessContextType< from the provided
map. |
static java.lang.String |
getCatalogId(java.lang.String storeId)
This method returns the master catalogId of the specified store Id.
|
static commonj.sdo.DataObject |
getConfiguration(BusinessContextType businessContext,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.lang.String expression,
java.lang.String accessProfile)
This method retrieves the infrastructure details for the specified
expression.
|
static java.lang.String |
getDefaultCatalogId(java.lang.String storeId)
This method returns the default catalogId of the specified store Id.
|
static java.lang.String |
getDefaultCurrency(java.util.ArrayList<java.lang.String> configuration)
This method gets the default store currency.
|
static java.lang.String |
getDefaultLanguageId(java.util.ArrayList<java.lang.String[]> configuration)
This method gets the default store languageId.
|
static java.lang.String |
getDefaultLocale(java.util.ArrayList<java.lang.String[]> configuration)
This method gets the default store locale.
|
static java.lang.String |
getLanguageForLocale(java.lang.String locale,
java.util.ArrayList<java.lang.String[]> configuration)
This method gets the languageId that corresponds to the give locale.
|
static java.lang.String |
getLocaleForLanguage(java.lang.String languageId,
java.util.ArrayList<java.lang.String[]> configuration)
This method gets the locale that corresponds to the give languageId.
|
static java.util.List<java.lang.Integer> |
getRelatedStoreIds(java.lang.Integer storeId)
This method gets the related stores'Id for the store with the provided
id.
|
static java.lang.String |
getRequestLocale(javax.ws.rs.core.HttpHeaders headers)
This method gets the request locale from the HTTP headers.
|
static javax.ws.rs.core.MediaType |
getResponseFormat(java.lang.String responseFormat,
javax.ws.rs.core.HttpHeaders headers)
This method gets the response format for the request.
|
static java.util.Map<java.lang.String,java.lang.String> |
getStoreConfiguration(java.lang.String storeId)
This method populates common store information for the specified store.
|
static java.util.ArrayList<java.lang.String> |
getStoreCurrencyConfiguration(java.lang.String storeId)
This method populates the store currency configuration for the specified
store.
|
static java.util.ArrayList<java.lang.String[]> |
getStoreLanguageConfiguration(java.lang.String storeId)
This method populates the store language configuration for the specified
store.
|
static java.lang.String |
getStoreName(java.lang.Integer storeId)
This method gets the store name by store id.
|
static boolean |
isCurrencySupported(java.lang.String currency,
java.util.ArrayList<java.lang.String> configuration)
This method returns if the currency given is supported or not.
|
static boolean |
isLanguageSupported(java.lang.String languageId,
java.util.ArrayList<java.lang.String[]> configuration)
This method returns if the language given is supported or not.
|
static boolean |
isLocaleSupported(java.lang.String locale,
java.util.ArrayList<java.lang.String[]> configuration)
This method returns if the locale given is supported or not.
|
public static final java.lang.String STORE_ID
public static final java.lang.String STORE_NAME
public static final java.lang.String LOCALE
public static final java.lang.String LANGUAGE_ID
public static final java.lang.String CURRENCY
public static final java.lang.String CATALOG_ID
public static final java.lang.String PREVIEW_TOKEN
public static final java.lang.String PREVIEW_TOKEN_GEN_REQUEST
public static final java.lang.String BUSINESS_CONTEXT
public static final java.lang.String CONTENT_PERSONALIZATION
public static final java.lang.String WORKSPACE_NAME
public static final java.lang.String AUTHORING
public static final java.lang.String PREVIEW
public static final java.lang.String PARTIAL_AUTHENTICATION
public static final java.lang.String FORMAT_ATOM
public static final java.lang.String IS_SECURE_KEY
public static final java.lang.String FORMAT_JSON
public static final java.lang.String DEFAULT_CATALOG_CONFIG_GROUP_NAME
public static final java.lang.String[] ADDITIONAL_BUSINESS_CONTEXT_PARAMS
public static final java.lang.String DEFAULT_ACCESS_PROFILE
accessProfile
query parameter.public static final java.lang.String FIND_BY_IDENTIFIER_XPATH
public static final java.lang.String FIND_BY_STORE_ID_XPATH
public static final java.lang.String FIND_BY_ALL_XPATH
public static java.util.Map<java.lang.String,java.lang.String> getStoreConfiguration(java.lang.String storeId) throws AbstractBusinessObjectDocumentException
storeId
- the storeId to load configuration information for.AbstractBusinessObjectDocumentException
- Raised when there is an exception.public static java.lang.String getStoreName(java.lang.Integer storeId)
storeId
- the store id.public static java.util.ArrayList<java.lang.String[]> getStoreLanguageConfiguration(java.lang.String storeId) throws AbstractBusinessObjectDocumentException
storeId
- the storeId to load configuration information for.AbstractBusinessObjectDocumentException
- Raised when there is an exception.public static java.util.ArrayList<java.lang.String> getStoreCurrencyConfiguration(java.lang.String storeId) throws AbstractBusinessObjectDocumentException
storeId
- the storeId to load configuration information for.AbstractBusinessObjectDocumentException
- Raised when there is an exception.public static BusinessContextType buildBusinessContext(java.util.Map<java.lang.String,java.lang.String> businessContextNVP)
BusinessContextType<
from the provided
map.businessContextNVP
- a map of data to add to the business context.BusinessContextType
populated with the provided
map.public static java.lang.String getCatalogId(java.lang.String storeId) throws AbstractBusinessObjectDocumentException
storeId
- the storeIdAbstractBusinessObjectDocumentException
- Raised when there is an exception.public static java.lang.String getDefaultCatalogId(java.lang.String storeId) throws java.lang.Exception
storeId
- the store idjava.lang.Exception
- Exception is thrown when there is problem to get the default
catalog id.public static javax.ws.rs.core.MediaType getResponseFormat(java.lang.String responseFormat, javax.ws.rs.core.HttpHeaders headers)
responseFormat
parameter is null, the response format from
the HTTP headers is used. If the HTTP headers do not contain a response
format, a default of xml is used.responseFormat
- The response format from the URL.headers
- The request HTTP headers.public static boolean isLocaleSupported(java.lang.String locale, java.util.ArrayList<java.lang.String[]> configuration)
locale
- the localeconfiguration
- the store language configurationpublic static java.lang.String getDefaultLocale(java.util.ArrayList<java.lang.String[]> configuration)
configuration
- the store language configurationpublic static java.lang.String getLocaleForLanguage(java.lang.String languageId, java.util.ArrayList<java.lang.String[]> configuration)
languageId
- the languageIdconfiguration
- the store language configurationpublic static java.lang.String getLanguageForLocale(java.lang.String locale, java.util.ArrayList<java.lang.String[]> configuration)
locale
- the localeconfiguration
- the store language configurationpublic static boolean isLanguageSupported(java.lang.String languageId, java.util.ArrayList<java.lang.String[]> configuration)
languageId
- the languageIdconfiguration
- the store language configurationpublic static java.lang.String getDefaultLanguageId(java.util.ArrayList<java.lang.String[]> configuration)
configuration
- the store language configurationpublic static boolean isCurrencySupported(java.lang.String currency, java.util.ArrayList<java.lang.String> configuration)
currency
- the currencyconfiguration
- the store currency configurationpublic static java.lang.String getDefaultCurrency(java.util.ArrayList<java.lang.String> configuration)
configuration
- the store currency configurationpublic static java.lang.String getRequestLocale(javax.ws.rs.core.HttpHeaders headers)
headers
- the request HTTP headers.public static java.util.List<java.lang.Integer> getRelatedStoreIds(java.lang.Integer storeId)
storeId
- the ID of the online store.public static commonj.sdo.DataObject getConfiguration(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler, java.lang.String expression, java.lang.String accessProfile) throws ConfigurationException
businessContext
- the business context.callbackHandler
- the callback handler.expression
- the XPath expression.accessProfile
- the specified access profile.ConfigurationException
- the infrastructure exception