Basic Concepts Creating a HCST Page Reformatting the Search Results Page

Using Services 2-15

2.3 Redirecting Template Page for Response Output

Sometimes it is desirable to display a page other than the default change the delivery mechanism for the response template after executing a CGI request either a GET or a POST. For example, you might want to redirect the page after a login or after executing a search. One way to do this is by modifying the service call through the component architecture, and specifying a different template page. Another more flexible way to do this as needed is to specify the urlTemplate parameter, to redirect the response page to a HCSP or HCST, and reformat the results in any way you want. This section covers the following topics: ■ Section 2.3.1, Basic Concepts ■ Section 2.3.2, Creating a HCST Page ■ Section 2.3.3, Reformatting the Search Results Page ■ Section 2.3.4, Additional Options

2.3.1 Basic Concepts

You should be somewhat familiar with Idoc Script and with Dynamic Server Pages HCST, HCSP, HCSF before attempting this exercise. You should also be somewhat familiar with Oracle Content Server component architecture. It would also be helpful to be familiar with HTML FORM objects.

2.3.2 Creating a HCST Page

As an example, we will create a HCST page that can be used as a URL template to reformat the search results. We could also create a HCSP, but for simplicity, we will use a HCST. We will name the file test_result.hcst, and have it contain the following text: html table width=300 tr bgcolor=000000 style=color: ffffff; tdbNamebtd tdbTitle Authorbtd tr loop SearchResults tr if doShadebgcolor=E5E7D4endif tda href=URLdDocNameatd tddDocTitle dDocAuthortd tr if doShadedoShade=elsedoShade=1endif endloop table html Next, we should check this file into the Oracle Content Server instance. For simplicity, we will check it into the Public security group, with a content type of ADACCT, and the Content ID test_result. Its URL will then be something like this: http:myhost oraclegroupspublicdocumentsdocumenttest_ result.hcst 2-16 Oracle Fusion Middleware Services Reference Guide for Oracle Universal Content Management

2.3.3 Reformatting the Search Results Page

To test our new template, we will start by going to a search page. Enter in any search criteria and click Search. You should see the standard search page with your results contained in it. Now, add this text to the end of the URL that brought you to the search results page: urlTemplate=oraclegroupspublicdocumentsadaccttest_result.hcst You should now see the same search results formatted in a minimalist HTML page. Note how the full URL is not used, but just the URL relative to your host computer. If you would like the default search page to always format pages with this template, you can change the HTML FORM object on the search page to also have this field: input type=hidden name=urlTemplate value=oraclegroupspublicdocumentsdocumenttest_result.hcst This can be done by creating a component that modifies the include query_results_ options to contain the sample HTML. Alternatively, the value for urlTemplate can be calculated dynamically on the search page with JavaScript, to redirect to different pages based on the metadata entered by the user.

2.3.4 Additional Options