Skip Headers
Oracle® Fusion Middleware Development Guide for Oracle WebCenter WSRP Producer for .NET
11g Release 1 (11.1.1.6.0)

Part Number E14117-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

2 Understanding the Oracle WebCenter WSRP Producer for .NET Configuration File

This chapter describes contents of the Oracle WebCenter WSRP Producer for .NET configuration file, wsrp-producer.xml.

The set up of a Web Part or .NET application as a WSRP portlet is not complete until the wsrp-producer.xml configuration file is filled out properly. Understanding this file is critical.

Open the wsrp-producer.xml file installed in <installdir>\wsrpdefault for reference.

2.1 Portlet Nodes

Each Web Part or .NET web application you wish to expose as a portlet must have its own <portlet> node. Portlet nodes can include the following elements:

2.2 Portlet Content Transformation Rulesets

The Oracle WebCenter WSRP Producer for .NET utilizes regular expressions to transform relative URLs to absolute URLs and to URLs proxied through the WSRP consumer if necessary. Specific transformation rules are defined in the wsrp-producer.xml file in <RuleSet> elements and referenced in each portlet. Rulesets are a way of clustering a group of markup transformation rules.

By default, there is a single default ruleset that ensures that hrefs are transformed and proxied as WSRP resources, but "src" URL references (images and javascript) are transformed but not proxied. To use different transformation settings, create a new ruleset as described below. For an example of using rulesets in a portlet, see Section 5.5, "Using Markup Transformation."

Note:

It is strongly recommended that you not modify the default ruleset.

2.2.1 Creating Custom Rules

As noted in the previous section, custom rules can be defined within the portlet node or outside the portlet node in a <RuleSet> element. Rulesets can be very useful if you have a set of portlets that should use the same rules. Instead of copying the URL transformation rules for each portlet, you can create a single ruleset and reference the ID in each portlet. The syntax rules for the <RewriterConfig> element are the same for both locations. (If the rule is defined within an individual portlet node, the <RuleSet> element is omitted.)

The <RewriterConfig> element contains a <Rules> element that contains <RewriterRule> elements, which define transformation rules using the elements in the following table.

Table 2-2 Transformation Rule Elements

Element Value/Description

<LookFor>

Required. Defines the URL to search for using text and/or regular expressions. For example, <LookFor>(activeSrc\":\")([^\"]+)</LookFor> indicates that the transformer should look for URLs like "activeSrc":"./test/foo/bar.js" or "activeSrc":"test2/bas.html" for replacement.

<LookFor> must be the first element in the <RewriterRule> element.

<ChangeToAbsolute>

Required. If set to true, transforms any URL identified with the <LookFor> element into an absolute URL. (Typically, the transformation you wish to perform on an URL is to make it an absolute URL since a relative URL does not make sense when proxied through a WSRP consumer.)

<MakeResource>

Required. If set to true, ensures that the URL is proxied by the WSRP consumer. While this is important for resources that you wish to protect, applying this option liberally can have significant performance ramifications since the WSRP consumer must rewrite the URL and browser caching cannot be relied upon. Use the <ApplyTo> to ensure that only those URLs you wish to proxy are included.

<ApplyTo>

Limits the URLs that are transformed and proxied using a comma-delimited list of keywords. (All URLs returned by the <LookFor> element will be transformed to absolute URLs if <ChangeToAbsolute> is included in the rule.)

<ChangeTo>

Changes the text returned by the <LookFor> element to the provided text. (This is not used for URL transformation, but allows you to use the <RewriterRule> element to change any text within the portlet, and can include regular expressions.) For example, the entry below redirects traffic from myhost to myhost.mycompany.com instead:

<RewriterRule>
  <LookFor>myhost[\:]*[0-9]* </LookFor>
  <ChangeTo>myhost.mycompany.com</ChangeTo>
</RewriterRule>