com.sapportals.wcm.control.util.search

Class SearchQueryBuilder

java.lang.Object
  extended by com.sapportals.wcm.control.util.search.SearchQueryBuilder

Deprecated. As of NetWeaver 7.1

public class SearchQueryBuilder
extends Object

The SearchQueryBuilder provides helping functions for building a search query on a central creation point

Copyright 2004 SAP AG


Constructor Summary
SearchQueryBuilder()
          Deprecated. As of NetWeaver 7.1
SearchQueryBuilder(Hashtable searchParameters)
          Deprecated. As of NetWeaver 7.1
 
Method Summary
 IQueryEntryList buildAddOnQueryEntries()
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList buildDidYouMeanQueryEntries(IQueryEntryList oldQuery, String oldSearchTerm, String didYouMeanTerm)
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList buildGuidedNavQueryEntries(IQueryEntryList oldQuery, IPropertyName propertyName, String condition)
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList buildItemsSelection(IQueryEntryList queryEntryList, String itemsSelection)
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList buildNotOlderQuery(IQueryEntryList oldQuery)
          Deprecated. As of NetWeaver 7.1
 IQueryEntry buildQueryEntryConnector(String value)
          Deprecated. As of NetWeaver 7.1
 IQueryEntry buildQueryEntryDate(IPropertyName propertyName, Date date, byte operator)
          Deprecated. As of NetWeaver 7.1
 IQueryEntry buildQueryEntryTimeWindow(IPropertyName propertyName, Date startDate, Date endDate)
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList buildSearchQueryEntries()
          Deprecated. As of NetWeaver 7.1
static String checkIndexGroupName(String name)
          Deprecated. As of NetWeaver 7.1
 IQueryEntryList convertToFuzzy(IQueryEntryList queryEntryList)
          Deprecated. As of NetWeaver 7.1
static String generateMultipleValuesString(List valuesList, String seperator)
          Deprecated. As of NetWeaver 7.1
static byte getBestSearchAction(String text)
          Deprecated. As of NetWeaver 7.1
static String getDidYouMeanTerm(IQueryEntryList queryEntryList, String oldPhrase)
          Deprecated. As of NetWeaver 7.1
 String getPersistentAuthors()
          Deprecated. As of NetWeaver 7.1
 String getPhrase(String term)
          Deprecated. As of NetWeaver 7.1
 String getSearchAddProps()
          Deprecated. As of NetWeaver 7.1
 String getSearchTerm()
          Deprecated. As of NetWeaver 7.1
 String getSelectedCustomProps()
          Deprecated. As of NetWeaver 7.1
 ArrayList getSelectedCustomPropsList()
          Deprecated. As of NetWeaver 7.1
 String getSelectedDescription()
          Deprecated. As of NetWeaver 7.1
 Date getSelectedEndDate()
          Deprecated. As of NetWeaver 7.1
 String getSelectedItems()
          Deprecated. As of NetWeaver 7.1
 String getSelectedNotOlderRange()
          Deprecated. As of NetWeaver 7.1
 String getSelectedSearchAction()
          Deprecated. As of NetWeaver 7.1
 String getSelectedSimilarTerms()
          Deprecated. As of NetWeaver 7.1
 Date getSelectedStartDate()
          Deprecated. As of NetWeaver 7.1
 String getSelectedTitle()
          Deprecated. As of NetWeaver 7.1
 String getTermConnection()
          Deprecated. As of NetWeaver 7.1
 boolean isDescriptionIncluded()
          Deprecated. As of NetWeaver 7.1
 boolean isDisplaynameIncluded()
          Deprecated. As of NetWeaver 7.1
 boolean isIncludeCreatorAuthor()
          Deprecated. As of NetWeaver 7.1
 boolean isIncludePhrase()
          Deprecated. Internal use only so far.
static boolean isValidSearch(Hashtable searchParameters)
          Deprecated. As of NetWeaver 7.1
static Map regenerateCheckedSearchIndices(String indices)
          Deprecated. As of NetWeaver 7.1
static List regenerateMultipleValuesList(String values, String seperator)
          Deprecated. As of NetWeaver 7.1
static Map regenerateMultipleValuesMap(String values, String seperator)
          Deprecated. As of NetWeaver 7.1
 void setDescriptionIncluded(boolean value)
          Deprecated. As of NetWeaver 7.1
 void setDisplaynameIncluded(boolean value)
          Deprecated. As of NetWeaver 7.1
 void setIncludeCreatorAuthor(boolean value)
          Deprecated. As of NetWeaver 7.1
 void setIncludePhrase(boolean value)
          Deprecated. Internal use only so far.
 void setPersistentAuthors(String value)
          Deprecated. As of NetWeaver 7.1
 void setSearchAddProps(String searchAddProps)
          Deprecated. As of NetWeaver 7.1
 void setSearchParameters(Hashtable searchParameters)
          Deprecated. As of NetWeaver 7.1
 void setSearchTerm(String searchTerm)
          Deprecated. As of NetWeaver 7.1
 void setSelectedCustomProps(String selectedCustomProps)
          Deprecated. As of NetWeaver 7.1
 void setSelectedCustomPropsList(ArrayList value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedDescription(String selectedDescription)
          Deprecated. As of NetWeaver 7.1
 void setSelectedEndDate(Date value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedItems(String value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedNotOlderRange(String selectedNotOlderRange)
          Deprecated. As of NetWeaver 7.1
 void setSelectedSearchAction(String value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedSimilarTerms(String value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedStartDate(Date value)
          Deprecated. As of NetWeaver 7.1
 void setSelectedTitle(String selectedTitle)
          Deprecated. As of NetWeaver 7.1
 void setTermConnection(String value)
          Deprecated. As of NetWeaver 7.1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchQueryBuilder

public SearchQueryBuilder()
Deprecated. As of NetWeaver 7.1

Constructor of SearchQueryBuilder


SearchQueryBuilder

public SearchQueryBuilder(Hashtable searchParameters)
Deprecated. As of NetWeaver 7.1

Constructor of SearchQueryBuilder with providing search parameters initially. (See method setSearchParameters)

Parameters:
searchParameters -
Method Detail

setSearchTerm

public void setSearchTerm(String searchTerm)
Deprecated. As of NetWeaver 7.1

Sets the SearchTerm attribute for the query entry list to be build. This SearchTerm will be used for searching in - content of documents - displayname (if enabled -> setDisplaynameIncluded(true/false)) - description (if enabled -> setDescriptionIncluded(true/false)) - via Set-Parameter (setSearchAddProps) additionally defined attributes

Parameters:
searchTerm - - the SearchTerm for the "standard" search request

getSearchTerm

public String getSearchTerm()
Deprecated. As of NetWeaver 7.1

Returns the current SearchTerm that will be recognized when building the query entry list.

Returns:
current SearchTerm

setSelectedItems

public void setSelectedItems(String value)
Deprecated. As of NetWeaver 7.1

Sets the item selection option which will be recognized when building the query entry list. All documents - SearchParamConst.ITEM_ALL Only Folders - SearchParamConst.ITEM_ONLY_FOLDERS Only Docs - SearchParamConst.ITEM_ONLY_DOCS No Folders - SearchParamConst.ITEM_NO_FOLDERS Further categories may be added in the future.

Parameters:
value - - new SelectedItems attribute

getSelectedItems

public String getSelectedItems()
Deprecated. As of NetWeaver 7.1

Returns the current SelectedItems attribute that will be recognized when building the query entry list. See Set-methode for detailed information.

Returns:
current SelectedItems attribute

setSelectedStartDate

public void setSelectedStartDate(Date value)
Deprecated. As of NetWeaver 7.1

Sets the SelectedStartDate attribute that will be recognized as starting date when building the query entry list for the date properties 'Modified' and 'Created' (OR connected). The attributes SelectedStartDate and SelectedEndDate need to be set both. For different properties use the method buildQueryEntryTimeWindow directly.

Parameters:
value - - new SelectedStartDate attribute

getSelectedStartDate

public Date getSelectedStartDate()
Deprecated. As of NetWeaver 7.1

Returns the current SelectedStartDate attribute that will be recognized when building the query entry list. See Set-methode for detailed information.

Returns:
current SelectedStartDate attribute

setSelectedEndDate

public void setSelectedEndDate(Date value)
Deprecated. As of NetWeaver 7.1

Sets the SelectedEndDate attribute that will be recognized as ending date when building the query entry list for the date properties 'Modified' and 'Created' (OR connected). The attributes SelectedStartDate and SelectedEndDate need to be set both. For different properties use the method buildQueryEntryTimeWindow directly.

Parameters:
value - - new SelectedStartDate attribute

getSelectedEndDate

public Date getSelectedEndDate()
Deprecated. As of NetWeaver 7.1

Returns the current SelectedEndDate attribute that will be recognized when building the query entry list. See Set-methode for detailed information.

Returns:
current SelectedEndDate attribute

setSelectedSearchAction

public void setSelectedSearchAction(String value)
Deprecated. As of NetWeaver 7.1

Sets the search method for the content search of the search term. Possible values are the ones defined on IQueryEntry (for example TERM_ACTION_LINGUSITIC, TERM_ACTION_FUZZY, etc). If no value is specified the 'best practice' value is taken (see methode getBestSearchAction).

Parameters:
value - - new SelectedSearchAction attribute

getSelectedSearchAction

public String getSelectedSearchAction()
Deprecated. As of NetWeaver 7.1

Returns the current search method for the content search.

Returns:
current SelectedSearchAction attribute

setSearchAddProps

public void setSearchAddProps(String searchAddProps)
Deprecated. As of NetWeaver 7.1

Sets the additional search properties. Within these properties the standard search term (see method setSearchTerm) will be searched for. By standard only content, description and the displayname are searched for. Specify multiple properties as a comma separated list of property ids. Example: createdby,modifiedby,embedded-keywords By aware that this causes additional search time.

Parameters:
searchAddProps - - new SearchAddProps attribute

getSearchAddProps

public String getSearchAddProps()
Deprecated. As of NetWeaver 7.1

Returns the current additional search properties.

Returns:
current SearchAddProps attribute

setSelectedCustomProps

public void setSelectedCustomProps(String selectedCustomProps)
Deprecated. As of NetWeaver 7.1

Sets a combination of property and value that will be recognized as query conditions. Logical operators are supported for some property types. It's possible to specify multiple properties. Different properties are connected by 'AND'. Identical properties are connected by OR. For supported operators, syntax and options please mind the current specification and documentation for the configuration of the search user interface (eg Predefined Properties).

Parameters:
selectedCustomProps - - new SelectedCustomProps attribute

getSelectedCustomProps

public String getSelectedCustomProps()
Deprecated. As of NetWeaver 7.1

Returns the current property and value setting for the query condition.

Returns:
current SelectedCustomProps attribute

setSelectedNotOlderRange

public void setSelectedNotOlderRange(String selectedNotOlderRange)
Deprecated. As of NetWeaver 7.1

Sets the document time range condition in which the document has been modified latest. Possible values are: No value - SearchParamConst.NOT_OLDER_NONE - no query is build Changed within this current day - SearchParamConst.NOT_OLDER_TODAY Changed within the last week - SearchParamConst.NOT_OLDER_WEEK Changed within the last month - SearchParamConst.NOT_OLDER_MONTH Changed within the last 3 months - SearchParamConst.NOT_OLDER_3_MONTHS

Parameters:
selectedNotOlderRange - - new SelectedNotOlderRange attribute

getSelectedNotOlderRange

public String getSelectedNotOlderRange()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the document time range (see also the corresponding Set-method).

Returns:
current SelectedNotOlderRange attribute

setPersistentAuthors

public void setPersistentAuthors(String value)
Deprecated. As of NetWeaver 7.1

So far only for internal use!

Parameters:
value - - new PersistentAuthors

getPersistentAuthors

public String getPersistentAuthors()
Deprecated. As of NetWeaver 7.1

So far only for internal use!

Returns:
current PersistentAuthors

setSelectedTitle

public void setSelectedTitle(String selectedTitle)
Deprecated. As of NetWeaver 7.1

Sets the parameter which will by used to search within the displayname. Multiple values may be specified separated by commas. The way of executing the search for the display name is dependend on the search string itself. As relevant properties are recognized: displayname (Text), displayname (String), access-Uri (String) The properties that are taken into account during search depend on the occurance of the generic symbol "*" and an extension symbol ".". Best practice is so far as follows: "*" and "." -> displayname (String) and access-uri "*" or "." -> all properties all other cases -> displayname (String) and displayname (Text) Queries are connected by OR. Search method for search on displayname (Text) is taken according to preset value. In case no method is specified 'best practice' is used. So this method does not (!) enable you to search only for documents the start with a certain letter (e.g. "a*"). Behavior might be optimized in following releases.

Parameters:
selectedTitle - - new SelectedTitle

getSelectedTitle

public String getSelectedTitle()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the selected displayname/title of a document (see also the corresponding Set-method).

Returns:
current SelectedTitle

setSelectedDescription

public void setSelectedDescription(String selectedDescription)
Deprecated. As of NetWeaver 7.1

Sets the parameter which will by used to search within the description. Search method for search on the description (type Text) is taken according to preset value. In case no method is specified 'best practice' is used.

Parameters:
selectedDescription - - new SelectedDescription

getSelectedDescription

public String getSelectedDescription()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the description condition of a document (see also the corresponding Set-method).

Returns:
current SelectedDescription

setSelectedSimilarTerms

public void setSelectedSimilarTerms(String value)
Deprecated. As of NetWeaver 7.1

Sets similar terms string. Should contain additional search words as comma separated list. Terms are added to the normal search term search.

Parameters:
value - - new SelectedSimilarTerms

getSelectedSimilarTerms

public String getSelectedSimilarTerms()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the similar terms condition (see also the corresponding Set-method).

Returns:
current SelectedDescription

setDisplaynameIncluded

public void setDisplaynameIncluded(boolean value)
Deprecated. As of NetWeaver 7.1

Sets flag for search on displayname during normal term search (default: true, see also method setSearchTerm).

Parameters:
value - - new DisplaynameIncluded

isDisplaynameIncluded

public boolean isDisplaynameIncluded()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the displayname included flag.

Returns:
current DisplaynameIncluded

setDescriptionIncluded

public void setDescriptionIncluded(boolean value)
Deprecated. As of NetWeaver 7.1

Sets flag for search on description during normal term search (default: true, see also method setSearchTerm).

Parameters:
value - - new DescriptionIncluded

isDescriptionIncluded

public boolean isDescriptionIncluded()
Deprecated. As of NetWeaver 7.1

Returns the current setting for the description included flag.

Returns:
current DescriptionIncluded

setIncludeCreatorAuthor

public void setIncludeCreatorAuthor(boolean value)
Deprecated. As of NetWeaver 7.1

Internal use only so far.

Parameters:
value - IncludeCreatorAuthor

isIncludeCreatorAuthor

public boolean isIncludeCreatorAuthor()
Deprecated. As of NetWeaver 7.1

Internal use only so far.

Returns:
current IncludeCreatorAuthor

setIncludePhrase

public void setIncludePhrase(boolean value)
Deprecated. 
Internal use only so far.

Parameters:
value - IncludePhrase

isIncludePhrase

public boolean isIncludePhrase()
Deprecated. 
Internal use only so far.

Returns:
current IncludePhrase

setSelectedCustomPropsList

public void setSelectedCustomPropsList(ArrayList value)
Deprecated. As of NetWeaver 7.1

Internal use only so far.


getSelectedCustomPropsList

public ArrayList getSelectedCustomPropsList()
Deprecated. As of NetWeaver 7.1

Internal use only so far.

Returns:
currentSelectedCustomPropsList

setTermConnection

public void setTermConnection(String value)
Deprecated. As of NetWeaver 7.1

Internal use only so far.


getTermConnection

public String getTermConnection()
Deprecated. As of NetWeaver 7.1

Internal use only so far.


setSearchParameters

public void setSearchParameters(Hashtable searchParameters)
Deprecated. As of NetWeaver 7.1

Sets the search parameters by a hashtable. In portal use this comes directly from URL parameters (eg quick search, save-as-iView-Search etc). This method can also be used instead of providing all relevant value via Set-methods. Supported are so far following parameters (see also correcponding Set-methods): SearchParamConst.PARAM_SEARCH_TERM (String) SearchParamConst.PARAM_SEARCH_ADD_PROPS (String) SearchParamConst.PARAM_CUSTOM_PROPS (String) SearchParamConst.PARAM_DESCRIPTION (String) SearchParamConst.PARAM_NOT_OLDER_RANGE (String) SearchParamConst.PARAM_TITLE (String) SearchParamConst.PARAM_DESCRIPTION (String) SearchParamConst.PARAM_SEARCH_ACTION (String) SearchParamConst.PARAM_SIMILAR_TERMS (String) SearchParamConst.PARAM_ITEMS_SELECTION (String)

Parameters:
searchParameters -

buildSearchQueryEntries

public IQueryEntryList buildSearchQueryEntries()
                                        throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Central method to build query entry list that takes all set conditions into account. The returned query entry list has complete syntax and can be used directly for search request against the indexmanagement API.

Returns:
IQueryEntryList
Throws:
com.sapportals.wcm.WcmException

buildAddOnQueryEntries

public IQueryEntryList buildAddOnQueryEntries()
                                       throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Internal use only. Method to build query entry list that takes all set "add on" conditions into account except the search term!! The returned query entry list has complete syntax and can be used directly for search request agains the indexmanagement API.

Returns:
IQueryEntryList
Throws:
com.sapportals.wcm.WcmException

buildNotOlderQuery

public IQueryEntryList buildNotOlderQuery(IQueryEntryList oldQuery)
                                   throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Provides a adapted new query entry list for filering on a modified time range search.

Parameters:
oldQuery - - old query entry list
Returns:
IQueryEntryList - new "Did you mean" query entry list
Throws:
com.sapportals.wcm.WcmException

buildDidYouMeanQueryEntries

public IQueryEntryList buildDidYouMeanQueryEntries(IQueryEntryList oldQuery,
                                                   String oldSearchTerm,
                                                   String didYouMeanTerm)
                                            throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Provides a adapted new query entry list for did you mean search. Should be used in combination with method getDidyouMeanTerm.

Parameters:
oldQuery - - old query entry list
Returns:
IQueryEntryList - new "Did you mean" query entry list
Throws:
com.sapportals.wcm.WcmException

buildGuidedNavQueryEntries

public IQueryEntryList buildGuidedNavQueryEntries(IQueryEntryList oldQuery,
                                                  IPropertyName propertyName,
                                                  String condition)
                                           throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Internal use only.

Throws:
com.sapportals.wcm.WcmException

buildItemsSelection

public IQueryEntryList buildItemsSelection(IQueryEntryList queryEntryList,
                                           String itemsSelection)
                                    throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Internal use only.

Throws:
com.sapportals.wcm.WcmException

buildQueryEntryTimeWindow

public IQueryEntry buildQueryEntryTimeWindow(IPropertyName propertyName,
                                             Date startDate,
                                             Date endDate)
                                      throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Simple method to build a time-window query entry list.

Parameters:
propertyName -
startDate -
endDate -
Returns:
IQueryEntryList
Throws:
com.sapportals.wcm.WcmException

buildQueryEntryDate

public IQueryEntry buildQueryEntryDate(IPropertyName propertyName,
                                       Date date,
                                       byte operator)
                                throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Simple method to build a 'Date' query entry list.

Parameters:
propertyName -
startDate -
endDate -
Returns:
IQueryEntryList
Throws:
com.sapportals.wcm.WcmException

convertToFuzzy

public IQueryEntryList convertToFuzzy(IQueryEntryList queryEntryList)
                               throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Internal use only.

Throws:
com.sapportals.wcm.WcmException

buildQueryEntryConnector

public IQueryEntry buildQueryEntryConnector(String value)
                                     throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Throws:
com.sapportals.wcm.WcmException

regenerateMultipleValuesList

public static List regenerateMultipleValuesList(String values,
                                                String seperator)
Deprecated. As of NetWeaver 7.1

Internal use only.


regenerateMultipleValuesMap

public static Map regenerateMultipleValuesMap(String values,
                                              String seperator)
Deprecated. As of NetWeaver 7.1

Internal use only.


generateMultipleValuesString

public static String generateMultipleValuesString(List valuesList,
                                                  String seperator)
Deprecated. As of NetWeaver 7.1

Internal use only.


regenerateCheckedSearchIndices

public static Map regenerateCheckedSearchIndices(String indices)
Deprecated. As of NetWeaver 7.1

Internal use only.


checkIndexGroupName

public static String checkIndexGroupName(String name)
Deprecated. As of NetWeaver 7.1

Internal use only.


getPhrase

public String getPhrase(String term)
Deprecated. As of NetWeaver 7.1

Internal use only.


getBestSearchAction

public static byte getBestSearchAction(String text)
Deprecated. As of NetWeaver 7.1

Algorithmus that returns the 'best practice' search method - EXACT for wildcards, only capital and non-lingustic chars (for example ABC$�&/()) - LINGUSITIC for at least one lingustic meaningfull char (for example abc)


getDidYouMeanTerm

public static String getDidYouMeanTerm(IQueryEntryList queryEntryList,
                                       String oldPhrase)
                                throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Method extracts the "Did you mean" search term. Search has to be already executed by means of this query entry list. To get a new corresponding query entry list use method buildDidYouMeanQueryEntries.

Parameters:
queryEntryList - - old query entry list
oldSearchTerm -
Returns:
did you mean search term
Throws:
com.sapportals.wcm.WcmException

isValidSearch

public static boolean isValidSearch(Hashtable searchParameters)
                             throws com.sapportals.wcm.WcmException
Deprecated. As of NetWeaver 7.1

Internal use only.

Throws:
com.sapportals.wcm.WcmException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/nonwduideprecated api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice