@Encoded public class PriceHandler extends AbstractResourceHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice.
|
static java.lang.String | FORMAT_GROUP_NAME
The constant FORMAT_GROUP_NAME
|
static java.lang.String | QUERY_FIND_BY_CATENTRYID
The query name to find prices by catentry ID.
|
static java.lang.String | QUERY_FIND_BY_PARTNUMBER
The query name to find prices by part number.
|
static java.lang.String | RESOURCE_MAPPING_KEY
The Constant RESOURCE_MAPPING_KEY.
|
static java.lang.String | RESOURCE_NAME
The Constant RESOURCE_NAME.
|
static java.lang.String | URL_PARAMETER_GROUP_NAME_PRICE
The URL parameter group name for price (defined in rest-price-clientobjects.xml).
|
Constructor and Description |
---|
PriceHandler() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response | byCatalogEntryIds(java.lang.String storeId)
Finds entitled and range prices by catalog entry ids.
|
javax.ws.rs.core.Response | byPartNumbers(java.lang.String storeId)
Finds entitled and range prices by part numbers.
|
protected java.lang.String | convertRequestToXPath(java.util.Map<java.lang.String,java.lang.Object> requestMap)
Converts the given request map to an XPath expression which can be used to call the entitled price web service.
|
javax.ws.rs.core.Response | findByQuery(java.lang.String storeId, java.lang.String queryName, java.lang.String responseFormat)
Finds entitled and range prices by a query.
|
javax.ws.rs.core.Response | findPricesByQuery(java.lang.String storeId, java.lang.String currency, java.lang.String profile, java.lang.String responseFormat)
This method returns the prices requested by the following parameters and the request body.
|
protected java.lang.String | getDefaultContract(java.lang.String storeID)
Returns the default contract, which is the store default contract.
|
protected java.lang.String | getDefaultCurrency()
Returns the default currency, which is the store default currency.
|
protected java.lang.String | getDefaultDate()
Returns the default date, which is the current date and time on the server where the REST service is being executed.
|
protected QuantityAmount | getDefaultQuantity(java.lang.String productID)
Returns the default quantity, which consists of a quantity of 1.0 and unit of measure of C62.
|
java.lang.String | getFormattingGroupName()
Returns the formatting group name for resolving the struts action of the formatting JSP.
|
PriceHelper | getHelper()
This method returns the BOD helper associated with the price resource.
|
java.lang.String | getResourceName()
This method returns the name of the resource used primarily to determine the representation of the resource.
|
protected java.util.List<java.lang.String> | getValidContractIDs(java.lang.String storeID)
Finds the valid contract IDs for the current user.
|
void | initializeQueryRegistry(OperationRegistry registry)
Initialize the query registry.
|
protected javax.ws.rs.core.Response | renderGetPrice(java.lang.String expression, java.lang.String accessProfile, java.lang.String responseFormat)
This method builds the response in appropriate format.
|
protected void | validateContractIDs(java.lang.String storeID, org.apache.commons.json.JSONArray contractIDs, java.util.List<java.lang.String> validContractIDs)
Validates the given contract IDs, to ensure that only valid contracts are given to the web service.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String RESOURCE_NAME
public static final java.lang.String RESOURCE_MAPPING_KEY
public static final java.lang.String FORMAT_GROUP_NAME
public static final java.lang.String QUERY_FIND_BY_CATENTRYID
public static final java.lang.String QUERY_FIND_BY_PARTNUMBER
public static final java.lang.String URL_PARAMETER_GROUP_NAME_PRICE
public java.lang.String getResourceName()
public void initializeQueryRegistry(OperationRegistry registry)
public java.lang.String getFormattingGroupName()
public PriceHelper getHelper()
public javax.ws.rs.core.Response findByQuery(java.lang.String storeId, java.lang.String queryName, java.lang.String responseFormat)
public javax.ws.rs.core.Response byCatalogEntryIds(java.lang.String storeId)
public javax.ws.rs.core.Response byPartNumbers(java.lang.String storeId)
public javax.ws.rs.core.Response findPricesByQuery(java.lang.String storeId, java.lang.String currency, java.lang.String profile, java.lang.String responseFormat)
protected javax.ws.rs.core.Response renderGetPrice(java.lang.String expression, java.lang.String accessProfile, java.lang.String responseFormat)
protected java.lang.String convertRequestToXPath(java.util.Map<java.lang.String,java.lang.Object> requestMap) throws RestException
protected void validateContractIDs(java.lang.String storeID, org.apache.commons.json.JSONArray contractIDs, java.util.List<java.lang.String> validContractIDs) throws RestException
protected java.util.List<java.lang.String> getValidContractIDs(java.lang.String storeID) throws RestException
protected QuantityAmount getDefaultQuantity(java.lang.String productID)
protected java.lang.String getDefaultContract(java.lang.String storeID) throws RestException
protected java.lang.String getDefaultCurrency()
protected java.lang.String getDefaultDate()