Вы находитесь на странице: 1из 25

Customizing Simple Search and Advanced Search in Webtop

Joe Swenson Staff Development Consultant, Support Services

-1-

Table of Contents
Title How can I customize the query used in simple search component in Webtop? How do I configure the behavior of the advanced search page in Webtop? How do I control the visibility of attributes displayed on the Search and Advanced Search results page? How can I display my custom attributes in the search results page in Webtop 5.2.5? Page 2 4 11 12

-2-

I.

How can I customize the query used in simple search component in Webtop? (Support Note 23390) The Simple Search that is seen in the top-left corner of the Webtop screen performs a full-text search using the text typed in the search box. The text that the user types in is used as the "Search Topic" of the DQL query for performing a full-text search. Below is a query example where "testing" is in the textbox.
SELECT ALL owner_name,r_object_id,a_content_type,r_object_type,r_modify_date,i_is_reference,r_link _cnt,score,i_vstamp,r_is_virtual_doc,r_content_size,r_lock_owner,r_version_label,object _name FROM dm_document SEARCH TOPIC ' ("*testing*")'

To change this query, customize the titlebar component and edit the onClickSearch JavaScript function. In this example, I want to pass in the strValue into a custom DQL query and only search on the object_name for dm_documents in my search. The titlebar component definition is found under:
../webtop/config/titlebar_component.xml

and the corresponding JSP page is found in:


../webtop/titlebar/titlebar.jsp

Create a custom version of these files:


../custom/config/titlebar_component.xml

and the JSP page:


../custom/titlebar/titlebar.jsp

And in the custom titlebar_component.xml edit the start page to be the custom JSP page.
<pages> <start>/custom/titlebar/titlebar.jsp</start> </pages>

Edit the custom titlebar.jsp page and locate the onClickSearch function JavaScript function:
function onClickSearch() { var contentPage = eval(getAbsoluteFramePath("content")); if (contentPage != null) { var text = document.getElementById("txtSearch"); var strValue = text.value; if (strValue != "") { postComponentJumpEvent(null, "search", "content", "queryType", "string", "query", strValue); } } }

-3-

I edited this code section to pass in the queryType = "dql" instead of "string" and built the query using the text from the textbox value as the case insensitive object_name to search on:
function onClickSearch() { var contentPage = eval(getAbsoluteFramePath("content")); if (contentPage != null) { var text = document.getElementById("txtSearch"); var strValue = text.value; if (strValue != "") { var strQry = "select * from zzz_type where upper(object_name) like upper('%" + strValue + "%')"; postComponentJumpEvent(null, "search", "content", "queryType", "dql", "query", strQry); } } }

-4-

II.

How do I configure the behavior of the advanced search page in Webtop? (Support Note 21067) The Advanced Search component may be configured to display custom object types and their attributes as well as which default view is shown when first loading the component. You can also configure the range of dates over which you can search a datetime attribute. Also, as of Webtop 5.2 the Advanced Search Component can be scoped to a Docbase so searches can be configured on a per Docbase level.
<scope Docbase="DevNT817O">

To modify these features, make a copy of the file:


\webcomponent\config\library\search\advsearch_component.xml

and place it in the directory:


\custom\config\

You can either edit a copy of the existing advsearch_component.xml which you placed in the custom/config directory or extend the existing advsearch_component.xml and include only the sections you wish to override. We will extend the existing component. To do so you would edit the line:
<component id="advsearch">

and change it to read:


<component id="advsearch" extends="advsearch:webcomponent/ config/library/search/advsearch_component.xml">

You can remove any section you are not overriding such as <desc> and <pages>, <params>, <attribute_conditions>, <date_options>, etc. 1) To add a custom object type named "my_type" to the list of available types to be searched on in the Advanced Search page copy the entire <search_types> section and copy the dm_document (assuming your custom type descends from dm_document) and paste it after the existing list of types, after the last </type> tag. Edit the copied tag:
<type id='dm_document'> <name><nlsid>MSG_DOCUMENT</nlsid></name>

to
<type id='my_type'> <name>My Type</name>

And keep whatever dm_document attributes in this section and add any custom attributes you wish to search on: -5-

===================================================================
<attributes> <attribute> <name><nlsid>MSG_NAME</nlsid></name> <docbase_attribute>object_name</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TYPE</nlsid></name> <docbase_attribute>r_object_type</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TITLE</nlsid></name> <docbase_attribute>title</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_SUBJECT</nlsid></name> <docbase_attribute>subject</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_AUTHORS</nlsid></name> <docbase_attribute>authors</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_KEYWORDS</nlsid></name> <docbase_attribute>keywords</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_CREATED</nlsid></name> <docbase_attribute>r_creation_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name><nlsid>MSG_MODIFIED</nlsid></name> <docbase_attribute>r_modify_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name>First Custom Attribute</name> <docbase_attribute>attribute1</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Second Custom Attribute</name> <docbase_attribute>attribute2</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Third Custom Attribute</name> <docbase_attribute>attribute3</docbase_attribute> <attribute_type>string</attribute_type> </attribute>

-6-

</attributes> </type>

====================================================================== The list of attributes you include in the above section will be the ones which appear in the attribute datadropdownlist on the properties pane. Note that value assistance lists are not displayed for attributes in the advanced search page. This has been logged as bug 59804. 2) To customize what panels are displayed upon initial opening of the advanced search page include the <panel_visibililty> section from the default component and change the <expanded> option to "true" in the panel you wish to display and "false" to those you wish to hide initially. ======================================================================
<panel_visibility> <panel> <name>fulltext</name> <expanded>true</expanded> </panel> <panel> <name>properties</name> <expanded>false</expanded> </panel> <panel> <name>dateoptions</name> <expanded>false</expanded> </panel> <panel> <name>sizeoptions</name> <expanded>false</expanded> </panel> <panel> <name>advoptions</name> <expanded>false</expanded> </panel> </panel_visibility>

====================================================================== 3) You can also configure the year range displayed in date time attributes. To do so include the section: ======================================================================
<!-- Date control options configuration --> <date_controls> <!-- the year from which there will be a year item in the year dropdown --> <fromyear>1980</fromyear> <!-- the minimum years from the current year which there will be a year item in the year dropdown --> <minyearsfromnow>37</minyearsfromnow> </date_controls>

====================================================================== Here is an example of a custom advsearch_component.xml with two custom types added and the panel visibility for properties set to true by default. It is scoped to the Docbase DevNT817O where these custom object types are defined. ====================================================================== -7-

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <!-<!-<!-<!-<!-<!-<!-<!-<!-Confidential Property of Documentum, Inc. (c) Copyright Documentum, Inc. 2001. All Rights reserved. May not be used without prior written agreement signed by a Documentum corporate officer. Component: advancedSearch Scope: None Created by: Bill Wessel (william.wesselt@documentum.com) --> --> --> --> --> --> --> --> -->

<!-- Revision $revision$ --> <!-- Modified on $date$ --> <config version='1.0'> <!--scoping to Docbase where custom types exist --> <scope Docbase="DevNT817O"> <!-- the browser tree component definition --> <component id="advsearch" extends="advsearch:webcomponent/config/library/search/advsearch_component.xml">

<!-- Description (not NLS'd) --> <desc> Advanced search component. </desc> <!-- All the types to display in advanced search --> <search_types> <type id='zzz_type'> <name>ZZZ Type</name> <attributes> <attribute> <name><nlsid>MSG_NAME</nlsid></name> <docbase_attribute>object_name</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TYPE</nlsid></name> <docbase_attribute>r_object_type</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TITLE</nlsid></name> <docbase_attribute>title</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_SUBJECT</nlsid></name> <docbase_attribute>subject</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_AUTHORS</nlsid></name> <docbase_attribute>authors</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_KEYWORDS</nlsid></name>

-8-

<docbase_attribute>keywords</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_CREATED</nlsid></name> <docbase_attribute>r_creation_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name><nlsid>MSG_MODIFIED</nlsid></name> <docbase_attribute>r_modify_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name>First Custom Attribute</name> <docbase_attribute>attribute1</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Second Custom Attribute</name> <docbase_attribute>attribute2</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Third Custom Attribute</name> <docbase_attribute>attribute3</docbase_attribute> <attribute_type>string</attribute_type> </attribute> </attributes> </type> <type id='time_type1'> <name>TimeType1</name> <attributes> <attribute> <name><nlsid>MSG_NAME</nlsid></name> <docbase_attribute>object_name</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TYPE</nlsid></name> <docbase_attribute>r_object_type</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TITLE</nlsid></name> <docbase_attribute>title</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_SUBJECT</nlsid></name> <docbase_attribute>subject</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_AUTHORS</nlsid></name> <docbase_attribute>authors</docbase_attribute> <attribute_type>string</attribute_type>

-9-

</attribute> <attribute> <name><nlsid>MSG_KEYWORDS</nlsid></name> <docbase_attribute>keywords</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_CREATED</nlsid></name> <docbase_attribute>r_creation_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name><nlsid>MSG_MODIFIED</nlsid></name> <docbase_attribute>r_modify_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name>Time1</name> <docbase_attribute>time1</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name>Time2</name> <docbase_attribute>time2</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name>Time3</name> <docbase_attribute>time3</docbase_attribute> <attribute_type>time</attribute_type> </attribute> </attributes> </type> </search_types> <panel_visibility> <panel> <name>fulltext</name> <expanded>false</expanded> </panel> <panel> <name>properties</name> <expanded>true</expanded> </panel> <panel> <name>dateoptions</name> <expanded>false</expanded> </panel> <panel> <name>sizeoptions</name> <expanded>false</expanded> </panel> <panel> <name>advoptions</name> <expanded>false</expanded> </panel> </panel_visibility> </component> </scope>

- 10 -

</config>

- 11 -

III.

How do I control the visibility of attributes displayed on the Search and Advanced Search results page? (Support Note 29131) Webtop advanced search component is used to build a query which is passed to the search component for processing. The results of the search are displayed in one of two search results pages. In Webtop, advanced search is defined in the /webtop/config/advsearch_component.xml and search is defined in /webtop/config/search_component.xml. Each of these components extend their corresponding webcomponent layer implementation. Webtop defines two views, Classic and Streamline view, each having its own search results JSP page defined in the /webtop/config/search_component.xml.
<pages> <classic>/webtop/classic/resultlist/resultlist.jsp</classic> <streamline>/webcomponent/library/searchresultslist/searchresultslist.jsp</streamline> </pages>

The classic view uses:


/webtop/classic/resultlist/resultlist.jsp

and streamline view uses:


/webcomponent/library/searchresultslist/searchresultslist.jsp

Each view has its own separate list of attributes that are parsed and displayed by each of these two pages. This display is controlled by the <columns_list> XML tag for Classic view and <colums_drilldown> tag for Streamline view. Webtop search_component.xml (webtop/config/search_component.xml) defines the <columns_list> attributes and their visibility. This XML extends the webcomponent layer search_component.xml (/webcomponent/config/library/search/search_component.xml), which defines the <columns_drilldown> attribute list. Customizing the visibility for attributes in the Search or Advanced Search will be made in the custom layer. To do this, copy the webtop/config/search_component.xml to the /custom/config directory. For Classic view make your changes to the visibility of the attribute in the <columns_list> section of the custom search_component.xml. These attributes will be displayed by the resultlist.jsp page. If you wish to customize the Streamline view, copy the <columns_drilldown> section from the /webcomponent/config/library/search/search_component.xml into the custom search_component and make your changes to the visibility of the attributes there. These attributes will be displayed by the searchresultslist.jsp page. To display your custom attributes for a custom type you wish to search on see the next section of this paper.

- 12 -

IV.

How can I display my custom attributes in the search results page in Webtop 5.2.5? (Support Note 25867) To get a custom search results page to display based upon object type, there are three files which need to be customized to implement this functionality. 1) advsearch_component.xml This defines the object types you can search on with Advanced Search and the attributes which will define the "search for" parameters (where clause attributes). 2) /webtop/config/search_component.xml which extends
/webcomponent/config/library/search/search_component.xml

This defines the visible attributes which are part of the select clause of the advanced search query. This XML also defines the results page which is displayed based upon whether you are in classic or streamline view.
<columns_list> attributes get displayed in Classic view <columns_drilldown> attributes get displayed in Streamline view

*Note* Streamline view <columns_drilldown> list is defined in:


/webcomponent/config/library/search/search_component.xml

so /webtop/config/search_component.xml only serves to define the Classic view list of columns. To customize both the Classic and Streamline view columns list for default object types (dm_document, dm_folder, dm_category, and dm_sysobject) you need to copy the <columns_drilldown> section into your customized /webtop/config/search_component.xml file. See Support Note: 29131 for details. 3) Search.java This file determines the current View (Classic or Streamline) and sets up the DQL query to be run by parsing the <columns_list> or <columns_drilldown> for column visibility. It then calls the appropriate results JSP page to display the returned set of documents. Please see Support note 24419 for how the customization was done prior to Webtop 5.2.5: Customization: First step is to add your custom type to the advsearch_component.xml file. This file should be copied to the custom/config directory and changes made there. Here I add my custom type "test_type1". Placing it first on the XML makes this the default type to be search on: I have copied the dm_document section and changed the type id to "test_type1" and added my custom attribute "attribtute1" to the list of attributes which can be searched on.

From "custom/config/advsearch_component.xml" - 13 -

<!-- All the types to display in advanced search --> <search_types> <type id='test_type1'> <name>Test Type</name> <attributes> <attribute> <name><nlsid>MSG_NAME</nlsid></name> <docbase_attribute>object_name</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_TYPE</nlsid></name> <docbase_attribute>r_object_type</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_PROP_TITLE</nlsid></name> <docbase_attribute>title</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_SUBJECT</nlsid></name> <docbase_attribute>subject</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_AUTHORS</nlsid></name> <docbase_attribute>authors</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name><nlsid>MSG_KEYWORDS</nlsid></name> <docbase_attribute>keywords</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Attribute1</name> <docbase_attribute>attribute1</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Attribute2</name> <docbase_attribute>attribute2</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Attribute3</name> <docbase_attribute>attribute3</docbase_attribute> <attribute_type>string</attribute_type> </attribute> <attribute> <name>Attribute4</name> <docbase_attribute>attribute4</docbase_attribute> <attribute_type>string</attribute_type> </attribute>

- 14 -

<attribute> <name><nlsid>MSG_CREATED</nlsid></name> <docbase_attribute>r_creation_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> <attribute> <name><nlsid>MSG_MODIFIED</nlsid></name> <docbase_attribute>r_modify_date</docbase_attribute> <attribute_type>time</attribute_type> </attribute> </attributes> </type> <ETC...>

The key to this customization is that to get custom attributes to display in the search results page they must be "visible" attributes. For dm_sysobject attributes, this is simply accomplished by the <visible> tag on the appropriate list of attributes - <columns_list> or <columns drilldown> for Classic or Streamline views respectively. If you try adding the custom attribute1 to this list and search on dm_document for example you will get an error stating that attribute1 is not defined for this object type. And the search query will fail. The key to implement this customization is to get the search component to parse the appropriate attribute list from the search_compoennt.xml based upon the object type you are searching on. So if you want to search on the custom type "test_type1" where "attribute1" is defined to be visible, then Search.java must have the ability, through knowledge of the object type, to parse an appropriate column list for visible attributes. In the following example for the custom Search.java this is done:
/* * search.java * * Created on July 26, 2004, 11:58 AM */ package com.documentum.custom.search; import com.documentum.web.common.ArgumentList; import com.documentum.web.form.Control; import com.documentum.webtop.app.AppSessionContext; import javax.servlet.http.HttpSession; /* * @author jswenson */ public class Search extends com.documentum.webtop.webcomponent.search.Search { /** Creates a new instance of search */ public void onInit(ArgumentList args) { //Determine if search is on a custom type HttpSession sess = (HttpSession)this.getPageContext().getSession(); strView = AppSessionContext.getView(); Object sessionAttrib = sess.getAttribute("_advsearch_typelist"); if(sessionAttrib!=null) { strDocbaseType = sessionAttrib.toString();

- 15 -

} if (strDocbaseType != "dm_document" && strDocbaseType != "dm_folder" && strDocbaseType != "dm_category" && strDocbaseType != "dm_sysobject") isCustomType = true; else isCustomType = false; //call super class to set up query super.onInit(args); //just to display the visible attributes and the corresponding query int iVisiSize = super.getVisibleAttrs().size(); for (int i=0; i<iVisiSize; i++) { System.out.println("Visible Attrs[" + i + "]: " + super.getVisibleAttrs().get(i)); } System.out.println("strQuery=" + super.getStrQuery()); } public void onRunSearch(Control control, ArgumentList args) { if (strView != null && strView.length() != 0) { if(isCustomType) { System.out.println("Displaying Custom type: " + strDocbaseType + " results page"); setComponentPage(strDocbaseType + "_" + strView); } else setComponentPage(strView); } else { super.onRunSearch(control, args); } } protected String getColumnConfigElementName() { //need to enable reading columns_list/_drilldown for custom types which can contain custom attributes //this gets called from super.onInit() !! if (AppSessionContext.getView() != null && AppSessionContext.getView().equals(AppSessionContext.VIEW_CLASSIC)) { if (isCustomType) { System.out.println("Reading custom type columns list"); return strDocbaseType + "_columns_list"; } else return "columns_list"; } else { if (isCustomType) { System.out.println("Reading custom type columns drilldown"); return strDocbaseType + "_columns_drilldown"; } else return "columns_drilldown"; } } private String strDocbaseType = null;

- 16 -

private String strView = null; private boolean isCustomType = false;

====================================================================== The first part of the customization is to determine whether a custom type is being searched upon. This is done in the onInit() method section of the code: ======================================================================
public void onInit(ArgumentList args) { //Determine if search is on a custom type HttpSession sess = (HttpSession)this.getPageContext().getSession(); strView = AppSessionContext.getView(); Object sessionAttrib = sess.getAttribute("_advsearch_typelist"); if(sessionAttrib!=null) { strDocbaseType = sessionAttrib.toString(); } if (strDocbaseType != "dm_document" && strDocbaseType != "dm_folder" && strDocbaseType != "dm_category" && strDocbaseType != "dm_sysobject") isCustomType = true; else isCustomType = false; //call super class to set up query super.onInit(args); //just to display the visible attributes and the corresponding query int iVisiSize = super.getVisibleAttrs().size(); for (int i=0; i<iVisiSize; i++) { System.out.println("Visible Attrs[" + i + "]: " + super.getVisibleAttrs().get(i)); } System.out.println("strQuery=" + super.getStrQuery()); }

======================================================================

The section of code which determines which list of attributes to parse is in the getColumnConfigElement() method:
======================================================================
protected String getColumnConfigElementName() { //need to enable reading columns_list/_drilldown for custom types which can contain custom attributes //this gets called from super.onInit() !! if (AppSessionContext.getView() != null && AppSessionContext.getView().equals(AppSessionContext.VIEW_CLASSIC)) { if (isCustomType) { System.out.println("Reading custom type columns list"); return strDocbaseType + "_columns_list"; } else return "columns_list"; } else {

- 17 -

if (isCustomType) { System.out.println("Reading custom type columns drilldown"); return strDocbaseType + "_columns_drilldown"; } else return "columns_drilldown"; } }

====================================================================== For the case of a custom object type, we prepend the type name onto the <columns_list> and <columns_drilldown> tags for the custom attributes lists. So in this case for Classic and Streamline views the "custom type" <column_list> and <column_drilldown> list of attributes that the above Search.class will look for for the object type "test_type1" will be: <test_type1_column_list> (Classic View) and <test_type1_columns_drilldown> (Streamline View). Here is the sample /custom/config/search_component.xml which implements this functionality: ======================================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-<!-<!-<!-<!-<!-<!-<!-<!-Confidential Property of Documentum, Inc. (c) Copyright Documentum, Inc. 2001. All Rights reserved. May not be used without prior written agreement signed by a Documentum corporate officer. Component: search Scope: None Created by: Bill Wessel (william.wessel@documentum.com) --> --> --> --> --> --> --> --> -->

<!-- Revision $revision$ --> <!-- Modified on $date$ --> <config version='1.0'> <!-- this component has unqualified scope --> <scope> <!-- the simple search component definition --> <component id="search" extends="search:webcomponent/config/library/search/search_component.xml"> <!-- Component Layout --> <pages> <classic>/webtop/classic/resultlist/resultlist.jsp</classic> <streamline>/webcomponent/library/searchresultslist/searchresultslist.jsp</streamline> <test_type1_classic>/custom/resultlist/resultlist.jsp</test_type1_classic> <test_type1_streamline>/custom/searchresultslist/searchresultslist.jsp</test_type1_stre amline> </pages> <!-- Component Behavior --> <class>com.documentum.custom.search.Search</class> <!-- Component specific Configuration --> <!-- Classic View visibility and order of attribute columns --> <test_type1_columns_list> <column>

- 18 -

<attribute>object_name</attribute> <label><nlsid>MSG_OBJECT_NAME</nlsid></label> <visible>true</visible> </column> <column> <attribute>authors</attribute> <label><nlsid>MSG_AUTHORS</nlsid></label> <visible>true</visible> </column> <column> <attribute>title</attribute> <label>Title</label> <visible>true</visible> </column> <column> <attribute>attribute1</attribute> <label>Attribute1</label> <visible>true</visible> </column> <column> <attribute>attribute5</attribute> <label>Attribute5</label> <visible>true</visible> </column> <column> <attribute>owner_name</attribute> <label><nlsid>MSG_OWNER_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>group_name</attribute> <label><nlsid>MSG_GROUP_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creator_name</attribute> <label><nlsid>MSG_CREATOR_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_lock_owner</attribute> <label><nlsid>MSG_LOCK_OWNER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_object_type</attribute> <label><nlsid>MSG_OBJECT_TYPE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_version_label</attribute> <label><nlsid>MSG_VERSION_LABEL</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_content_size</attribute> <label><nlsid>MSG_SIZE</nlsid></label> <visible>true</visible> </column> <column> <attribute>a_content_type</attribute> <label><nlsid>MSG_FORMAT</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creation_date</attribute> <label><nlsid>MSG_CREATION_DATE</nlsid></label> <visible>false</visible>

- 19 -

</column> <column> <attribute>r_modify_date</attribute> <label><nlsid>MSG_MODIFIED_DATE</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_modifier</attribute> <label><nlsid>MSG_MODIFIER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_access_date</attribute> <label><nlsid>MSG_ACCESS_DATE</nlsid></label> <visible>false</visible> </column> </test_type1_columns_list> <columns_list> <column> <attribute>object_name</attribute> <label><nlsid>MSG_OBJECT_NAME</nlsid></label> <visible>true</visible> </column> <column> <attribute>authors</attribute> <label><nlsid>MSG_AUTHORS</nlsid></label> <visible>true</visible> </column> <column> <attribute>title</attribute> <label>Title</label> <visible>true</visible> </column> <column> <attribute>owner_name</attribute> <label><nlsid>MSG_OWNER_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>group_name</attribute> <label><nlsid>MSG_GROUP_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creator_name</attribute> <label><nlsid>MSG_CREATOR_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_lock_owner</attribute> <label><nlsid>MSG_LOCK_OWNER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_object_type</attribute> <label><nlsid>MSG_OBJECT_TYPE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_version_label</attribute> <label><nlsid>MSG_VERSION_LABEL</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_content_size</attribute> <label><nlsid>MSG_SIZE</nlsid></label> <visible>true</visible>

- 20 -

</column> <column> <attribute>a_content_type</attribute> <label><nlsid>MSG_FORMAT</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creation_date</attribute> <label><nlsid>MSG_CREATION_DATE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_modify_date</attribute> <label><nlsid>MSG_MODIFIED_DATE</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_modifier</attribute> <label><nlsid>MSG_MODIFIER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_access_date</attribute> <label><nlsid>MSG_ACCESS_DATE</nlsid></label> <visible>false</visible> </column> </columns_list> <!-- Streamlin View visibility and order of attribute columns --> <test_type1_columns_drilldown> <column> <attribute>object_name</attribute> <label><nlsid>MSG_OBJECT_NAME</nlsid></label> <visible>true</visible> </column> <column> <attribute>authors</attribute> <label><nlsid>MSG_AUTHORS</nlsid></label> <visible>true</visible> </column> <column> <attribute>title</attribute> <label>Title</label> <visible>true</visible> </column> <column> <attribute>attribute1</attribute> <label>Attribute1</label> <visible>true</visible> </column> <column> <attribute>attribute5</attribute> <label>Attribute5</label> <visible>true</visible> </column> <column> <attribute>owner_name</attribute> <label><nlsid>MSG_OWNER_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>group_name</attribute> <label><nlsid>MSG_GROUP_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creator_name</attribute> <label><nlsid>MSG_CREATOR_NAME</nlsid></label>

- 21 -

<visible>false</visible> </column> <column> <attribute>r_lock_owner</attribute> <label><nlsid>MSG_LOCK_OWNER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_object_type</attribute> <label><nlsid>MSG_OBJECT_TYPE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_version_label</attribute> <label><nlsid>MSG_VERSION_LABEL</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_content_size</attribute> <label><nlsid>MSG_SIZE</nlsid></label> <visible>true</visible> </column> <column> <attribute>a_content_type</attribute> <label><nlsid>MSG_FORMAT</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creation_date</attribute> <label><nlsid>MSG_CREATION_DATE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_modify_date</attribute> <label><nlsid>MSG_MODIFIED_DATE</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_modifier</attribute> <label><nlsid>MSG_MODIFIER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_access_date</attribute> <label><nlsid>MSG_ACCESS_DATE</nlsid></label> <visible>false</visible> </column> </test_type1_columns_drilldown> <columns_drilldown> <column> <attribute>object_name</attribute> <label><nlsid>MSG_OBJECT_NAME</nlsid></label> <visible>true</visible> </column> <column> <attribute>title</attribute> <label>Title</label> <visible>true</visible> </column> <column> <attribute>authors</attribute> <label><nlsid>MSG_AUTHORS</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_content_size</attribute> <label><nlsid>MSG_SIZE</nlsid></label>

- 22 -

<visible>true</visible> </column> <column> <attribute>a_content_type</attribute> <label><nlsid>MSG_FORMAT</nlsid></label> <visible>false</visible> </column> <column> <attribute>owner_name</attribute> <label><nlsid>MSG_OWNER_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>group_name</attribute> <label><nlsid>MSG_GROUP_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_creator_name</attribute> <label><nlsid>MSG_CREATOR_NAME</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_object_type</attribute> <label><nlsid>MSG_OBJECT_TYPE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_version_label</attribute> <label><nlsid>MSG_VERSION_LABEL</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_creation_date</attribute> <label><nlsid>MSG_CREATION_DATE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_modify_date</attribute> <label><nlsid>MSG_MODIFIED_DATE</nlsid></label> <visible>true</visible> </column> <column> <attribute>r_modifier</attribute> <label><nlsid>MSG_MODIFIER</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_access_date</attribute> <label><nlsid>MSG_ACCESS_DATE</nlsid></label> <visible>false</visible> </column> <column> <attribute>r_lock_owner</attribute> <label><nlsid>MSG_LOCK_OWNER</nlsid></label> <visible>true</visible> </column> </columns_drilldown> </component> </scope> </config>

======================================================================

- 23 -

Finally, if you also wish to provide a custom resultlist.jsp or searchresultslist.jsp, you can similarly add tags to the <pages> section of search_component.xml file and supporting code in the Search.class to call a different "view" for a custom object type. ======================================================================
<pages> <classic>/webtop/classic/resultlist/resultlist.jsp</classic> <streamline>/webcomponent/library/searchresultslist/searchresultslist.jsp</streamline> <test_type1_classic>/custom/resultlist/resultlist.jsp</test_type1_classic> <test_type1_streamline>/custom/searchresultslist/searchresultslist.jsp</test_type1_stre amline> </pages>

====================================================================== If you are searching on a custom type and then you can call the appropriate page based upon the object type being searched upon. In the example again we prepend the object_type name onto the strView being passed into the setComponentPage call. From the Search.class code example above: =====================================================================
public void onRunSearch(Control control, ArgumentList args) { if (strView != null && strView.length() != 0) { if(isCustomType) { System.out.println("Displaying Custom type: " + strDocbaseType + " results page"); setComponentPage(strDocbaseType + "_" + strView); } else setComponentPage(strView); } else { super.onRunSearch(control, args); } }

- 24 -

- 25 -

Вам также может понравиться