Additional Options Redirecting Template Page for Response Output

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

In addition to urlTemplate, you can also use the parameters docTemplateName, docTemplateID, or RedirectUrl to change the result page. These all have different behavior, as follows: ■ urlTemplate : Set to the full relative URL of the hcst page you want to use. For example: IdcService=DOC_INFOurlTemplate=idc1groupspublicdocumentsadaccttest_ result.hcst Because RedirectURL doesnt work with all service calls, and pre-6.0 versions of Oracle Content Server software have minor data pollution bugs with docTemplateName and docTemplateID, it is usually safest to use urlTemplate. However, if you change the Content Type or the Security Group of your template, then the URL will no longer be valid and will need to be updated. Also, this parameter is not recommended for overriding the template used for a POST service. ■ docTemplateName : Set to a dDocName of a template for example, test_result. This parameter behaves like urlTemplate, but finds the location of the latest released web-viewable for a document with dDocName of docTemplateName. ■ docTemplateID : Set to a dID of a specific revision of a template for example, 100. Like docTemplateName, but finds the Web-viewable of a specific dID revision. ■ RedirectUrl : Set to the last part of a CGI URL back into the Oracle Content Server for example, IdcService=DOC_INFOdID=dID. This is only for the few dozen POST services that execute the action prepareRedirect, such as CHECKIN_ NEW and SUBMIT_HTML_FORM. ■ By using a redirect after each HTML POST, the response page can be safely refreshed by the end user without reissuing the post. In the definition of each of these services there is a 3:prepareRedirect:….:0:null line. The RedirectUrl overrides the results of the prepareRedirect method and allows a different URL to be used as the location for redirects. The RedirectUrl can have Idoc Script in it that Using Services 2-17 will be executed just before the redirect is issued. This can create complex Idoc Script nesting, because the RediretUrl assignment will typically occur in a resource includes. For example: … Standard Idoc form beginning … input type=edit name=myparam value= input type=hidden name=RedirectUrl value=HttpCgiPath?xmlIdcService=MY_RESPONSE_TEMPLATEdID=dID myparam=myparam … Standard Idoc form closure … Much of the Idoc Script is nested inside an Idoc literal string. This delays the execution of the script until the redirect URL is being computed. That allows the RedirectUrl to pick up the value of myparam even though the user has still to select its value. A single quote is used on the outside and a double quote on the inside. This reduces confusion and because both HTML and Idoc Script support both single and double quotes for quoting, it is sometimes a good idea to switch between the two for nesting constructs. Note the usage of the xml function. This guarantees that the input fields value is a well-formed HTML literal string construct. In this particular case, it is not needed. But for more complex constructs it can be helpful. 2-18 Oracle Fusion Middleware Services Reference Guide for Oracle Universal Content Management 3 Customizing Services 3-1 3 Customizing Services This chapter discusses the basic structure of services and covers the following topics: ■ Section 3.1, Service Structure Overview