com.ibm.interfaces.portal
Interface WPCPortalRequestUtil

All Known Implementing Classes:
PortalRequestUtil

public interface WPCPortalRequestUtil


Method Summary
 java.lang.String createExpression(org.w3c.dom.Document doc, java.lang.String operator, java.lang.String catalogName, java.lang.String path, java.lang.String value, java.lang.String notPredicate, java.util.HashMap infoMap)
          Creates an expression depending on the operator and the predicate value.
 java.lang.String createSearchQueryWithSupplierId(org.w3c.dom.Document doc, java.lang.String searchCriteria, java.util.HashMap infoMap)
          Creates a new search query using the search criteria after filtering the search for a specific supplierId
 java.lang.String getExpression(org.w3c.dom.Document doc, java.lang.String currNodePath, java.lang.String catalogName, java.lang.String operator, java.util.HashMap infoMap)
          gets the query for performing a search
 java.util.HashMap<java.lang.String,java.lang.Object> getRequestHeader(org.w3c.dom.Document doc)
          Gets the header information from the request and stores it in the hashmap
 com.ibm.pim.search.SearchResultSet getSearchCatalogResult(java.lang.String exp, java.lang.String catalogName, java.util.HashMap infoMap)
          Performs the search operation with the given expression and returns the result
 java.lang.String[] processAttributeSection(org.w3c.dom.Document doc, java.lang.String currNodeElementPath)
          Fetches the list of attribute names passed with the request
 java.lang.String processRequest(java.lang.String request)
          processes the request according to the command passed to generated the response
 java.lang.String transformOperator(org.w3c.dom.Document doc, java.lang.String opt, boolean notPredicate, java.lang.String value, com.ibm.pim.attribute.AttributeDefinition.Type specNodeType, java.util.HashMap infoMap)
          Changes the value of the operator required for wpc query depending on the operator passed
 

Method Detail

getRequestHeader

java.util.HashMap<java.lang.String,java.lang.Object> getRequestHeader(org.w3c.dom.Document doc)
Gets the header information from the request and stores it in the hashmap

Parameters:
doc - A xml document containing the request .
Returns:
Hashmap containing the header information.
Throws:
PIMInternalEXception

transformOperator

java.lang.String transformOperator(org.w3c.dom.Document doc,
                                   java.lang.String opt,
                                   boolean notPredicate,
                                   java.lang.String value,
                                   com.ibm.pim.attribute.AttributeDefinition.Type specNodeType,
                                   java.util.HashMap infoMap)
                                   throws com.ibm.pim.common.exceptions.PIMException
Changes the value of the operator required for wpc query depending on the operator passed

Parameters:
doc - A dom object containing the xml request
opt - A string that holds the operator
notPredicate - Contains boolean value to check if the predicate is set
specNodeType - String cotaining the type of the spec node
value - the value which is being searched for
infoMap - HashMap containing the necessary header information
Returns:
the transformed operator required to generate the query
Throws:
com.ibm.pim.common.exceptions.PIMException
com.ibm.pim.common.exceptions.PIMInternalException
java.lang.IllegalArgumentException

createExpression

java.lang.String createExpression(org.w3c.dom.Document doc,
                                  java.lang.String operator,
                                  java.lang.String catalogName,
                                  java.lang.String path,
                                  java.lang.String value,
                                  java.lang.String notPredicate,
                                  java.util.HashMap infoMap)
                                  throws com.ibm.pim.common.exceptions.PIMException
Creates an expression depending on the operator and the predicate value.

Parameters:
doc - A dom object containing the xml request
operator - A string containing the operator.
catalogName - A string used to retrieve the catalog with the catalogName.
path - A string containing the path in spec to obtain the spec node
value - the value being searched for
notPredicate - A string indicating if the predicate value is set.
infoMap - A hashMap containing the header information.
Returns:
new string after transforming the operator
Throws:
com.ibm.pim.common.exceptions.PIMException
com.ibm.pim.common.exceptions.PIMInternalException
java.lang.IllegalArgumentException

getExpression

java.lang.String getExpression(org.w3c.dom.Document doc,
                               java.lang.String currNodePath,
                               java.lang.String catalogName,
                               java.lang.String operator,
                               java.util.HashMap infoMap)
                               throws com.ibm.pim.common.exceptions.PIMException
gets the query for performing a search

Parameters:
currNodePath - contains the path for current node element.
catalogName - contains the catalog Name .
infoMap - contains the header information
Returns:
the expression with the searchcriteria required to perform the query
Throws:
com.ibm.pim.common.exceptions.PIMException
com.ibm.pim.common.exceptions.PIMInternalException
java.lang.IllegalArgumentException

getSearchCatalogResult

com.ibm.pim.search.SearchResultSet getSearchCatalogResult(java.lang.String exp,
                                                          java.lang.String catalogName,
                                                          java.util.HashMap infoMap)
Performs the search operation with the given expression and returns the result

Parameters:
exp - The expression containing the search query.
catalogName - the catalog on which the user is currently working
Returns:
the result of the search operation
Throws:
PIMAuthorizationException
com.ibm.pim.common.exceptions.PIMInternalException

createSearchQueryWithSupplierId

java.lang.String createSearchQueryWithSupplierId(org.w3c.dom.Document doc,
                                                 java.lang.String searchCriteria,
                                                 java.util.HashMap infoMap)
                                                 throws com.ibm.pim.common.exceptions.PIMException
Creates a new search query using the search criteria after filtering the search for a specific supplierId

Parameters:
doc - A xml document containing the request information
searchCriteria - String containing the search criteria
Returns:
filtered search criteria
Throws:
com.ibm.pim.common.exceptions.PIMException
com.ibm.pim.common.exceptions.PIMInternalException
java.lang.IllegalArgumentException

processAttributeSection

java.lang.String[] processAttributeSection(org.w3c.dom.Document doc,
                                           java.lang.String currNodeElementPath)
Fetches the list of attribute names passed with the request

Parameters:
doc - the request xml document
currNodeElementPath - the current xml node which contains the attribute names
Returns:
the string array containing the list of attributes

processRequest

java.lang.String processRequest(java.lang.String request)
                                throws com.ibm.pim.common.exceptions.PIMException,
                                       com.ibm.pim.common.exceptions.PIMInternalException,
                                       java.lang.IllegalArgumentException
processes the request according to the command passed to generated the response

Parameters:
request - the request string passed
Returns:
result after processing the request
Throws:
com.ibm.pim.common.exceptions.PIMException
com.ibm.pim.common.exceptions.PIMInternalException
java.lang.IllegalArgumentException