com.ibm.ccd.portal
Class PortalRequestUtil

java.lang.Object
  extended by com.ibm.ccd.portal.PortalRequestUtil
All Implemented Interfaces:
WPCPortalRequestUtil

public class PortalRequestUtil
extends java.lang.Object
implements WPCPortalRequestUtil


Constructor Summary
PortalRequestUtil()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalRequestUtil

public PortalRequestUtil()
Method Detail

getRequestHeader

public java.util.HashMap<java.lang.String,java.lang.Object> getRequestHeader(org.w3c.dom.Document doc)
                                                                      throws com.ibm.pim.common.exceptions.PIMInternalException
Description copied from interface: WPCPortalRequestUtil
Gets the header information from the request and stores it in the hashmap

Specified by:
getRequestHeader in interface WPCPortalRequestUtil
Parameters:
doc - A xml document containing the request .
Returns:
Hashmap containing the header information.
Throws:
com.ibm.pim.common.exceptions.PIMInternalException

transformOperator

public 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,
                                          com.ibm.pim.common.exceptions.PIMInternalException,
                                          java.lang.IllegalArgumentException
Description copied from interface: WPCPortalRequestUtil
Changes the value of the operator required for wpc query depending on the operator passed

Specified by:
transformOperator in interface WPCPortalRequestUtil
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
value - the value which is being searched for
specNodeType - String cotaining the type of the spec node
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

public 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,
                                         com.ibm.pim.common.exceptions.PIMInternalException,
                                         java.lang.IllegalArgumentException
Description copied from interface: WPCPortalRequestUtil
Creates an expression depending on the operator and the predicate value.

Specified by:
createExpression in interface WPCPortalRequestUtil
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

public 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,
                                      com.ibm.pim.common.exceptions.PIMInternalException,
                                      java.lang.IllegalArgumentException
Description copied from interface: WPCPortalRequestUtil
gets the query for performing a search

Specified by:
getExpression in interface WPCPortalRequestUtil
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

public com.ibm.pim.search.SearchResultSet getSearchCatalogResult(java.lang.String exp,
                                                                 java.lang.String catalogName,
                                                                 java.util.HashMap infoMap)
                                                          throws com.ibm.pim.common.exceptions.PIMAuthorizationException,
                                                                 com.ibm.pim.common.exceptions.PIMInternalException
Description copied from interface: WPCPortalRequestUtil
Performs the search operation with the given expression and returns the result

Specified by:
getSearchCatalogResult in interface WPCPortalRequestUtil
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

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

Specified by:
createSearchQueryWithSupplierId in interface WPCPortalRequestUtil
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

public java.lang.String[] processAttributeSection(org.w3c.dom.Document doc,
                                                  java.lang.String currNodeElementPath)
Description copied from interface: WPCPortalRequestUtil
Fetches the list of attribute names passed with the request

Specified by:
processAttributeSection in interface WPCPortalRequestUtil
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

public java.lang.String processRequest(java.lang.String request)
                                throws com.ibm.pim.common.exceptions.PIMException,
                                       com.ibm.pim.common.exceptions.PIMInternalException,
                                       java.lang.IllegalArgumentException
Description copied from interface: WPCPortalRequestUtil
processes the request according to the command passed to generated the response

Specified by:
processRequest in interface WPCPortalRequestUtil
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