Return-Path: Delivered-To: apmail-cocoon-docs-archive@www.apache.org Received: (qmail 8243 invoked from network); 15 Aug 2005 13:25:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2005 13:25:58 -0000 Received: (qmail 72707 invoked by uid 500); 15 Aug 2005 13:25:57 -0000 Delivered-To: apmail-cocoon-docs-archive@cocoon.apache.org Received: (qmail 72547 invoked by uid 500); 15 Aug 2005 13:25:57 -0000 Mailing-List: contact docs-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: docs@cocoon.apache.org List-Id: Delivered-To: mailing list docs@cocoon.apache.org Received: (qmail 72534 invoked by uid 99); 15 Aug 2005 13:25:57 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [207.7.158.203] (HELO cocoon.zones.apache.org) (207.7.158.203) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 06:25:56 -0700 Message-ID: <3066696.1124112214602.JavaMail.daisy@cocoon.zones.apache.org> Date: Mon, 15 Aug 2005 13:23:34 +0000 (GMT+00:00) From: daisy@cocoon.zones.apache.org To: docs@cocoon.apache.org Subject: [DAISY] Updated: Configuring Coplets Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/602.html Document ID: 602 Branch: main Language: default Name: Configuring Coplets (unchanged) Document Type: Document (unchanged) Updated on: 8/15/05 1:23:20 PM Updated by: Helma A new version has been created, state: publish Parts ===== Content ------- This part has been updated. Mime type: text/xml (unchanged) File name: (unchanged) Size: 10584 bytes (previous version: 16015 bytes) Content diff: (184 equal lines skipped) set a timeout, the content is automatically buffered and the buffer configuration is ignored.

---

The URICoplet

--- ---

This section describes the URICoplet and the different possibilities to --- configure it. For general configuration see the previous section.

--- ---

The Content Location and Parameter Handling

--- ---

A URICoplet uses a uri to fetch the coplet. This configuration is obviously a --- configuration of the coplet class (and not of the coplet type) as each coplet --- uses a different location.

--- ---

The attribute uri takes the complete uri (as a string) to fetch the --- content from:

--- ---
...
---    <coplet-data id="CZ Weblog" name="standard">
---       <title>CZ's Weblog</title>
---       <coplet-base-data>URICoplet</coplet-base-data>
---       <attribute>
---       	<name>uri</name>
---       	<value xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
---       	  cocoon:/news/liverss?feed=http://radio.weblogs.com/0107211/rss.xml
---       	</value>
---       </attribute>
---    </coplet-data>
--- ...
---    
--- ---

If you're using the cocoon protocol to call internal pipelines, you can also --- configure the boolean attribute handleParameters (default is false), --- that defines if the coplet handles request parameters itself. This should be --- used for coplets that process request parameters (have forms for example). In --- that case, the parameters from the request are only forwarded to the coplet, if --- they are meant for this coplet. All other coplets that use request parameters --- don't get them in this request-response-cycle.

--- ---

Error Handling

--- ---

Usually, in the case of an error during rendering the content of a coplet, a --- message is included in the coplet window instead of the coplet content. If you --- want to customize this, you can specifiy the attribute error-uri that --- should contain a valid uri that deliveres the content for a better error --- message.

--- ---

The CachingURICoplet

--- ---

The CachingURICoplet is an extension of the URICoplet (see previous chapter) --- providing caching of the coplet content. Usually the user of a portal only --- interacts with one single coplet at a time. As the interaction redraws the whole --- portal page with several coplets, all coplets are asked to give their content. --- In many situations this is not wanted. For example if the coplet contains a form --- or has a state, asking the coplet to give its content although the user has not --- submitted the form, might result in unwanted responses.

--- ---

Therefore the CachingURICoplet caches the content of a coplet in the session --- of the user. All further requests are served from the cache until the user --- interacts with exactly this coplet. In this case the cache is cleared, the --- coplet is invoked again and the new content is cached for further requests.

--- ---

If you want to disable the caching, you can specify the boolean attribute --- cache-enabled with the value false in the coplet data --- configuration.

--- ---

You can also programmatically turn off caching for a coplet for a single --- request by setting the attribute doNotCache with any value on the --- coplet instance data. For example if you want to set this from flow:

--- ---
     ...
---        var coplet = GET_THE_COPLET_INSTANCE_DATA;
---        coplet.setAttribute("doNotCache", "1");
---      ...
---      
--- ---

By default the caching uri adapter ignores sizing events for clearing the --- cache. This ensures that minimizing a coplet does not clear the cache. However, --- if you want to disable the cache on a sizing event you can turn this on in the --- configuration for a coplet data:

--- ---
...
--- <coplet-data id="Portal-Demo" name="standard">
---    <title>Introduction</title>
---    <coplet-base-data>CachingURICoplet</coplet-base-data>
---    <attribute>
---       <name>uri</name>
---       <value xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
---          cocoon:/coplets/docs/portal-demo.html
---       </value>
---    </attribute>
---    <attribute>
---       <name>ignore-sizing-events</name>
---       <value xsi:type="java:java.lang.Boolean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">false</value>
---    </attribute>
--- </coplet-data>
--- ...
---    
--- ---

Global Caching

--- ---

The default caching mechanism caches the contents in the user session. If you --- want to use a global cache across all users, you can turn this on with an --- attribute on the coplet data configuration:

--- ---
...
--- <coplet-data id="Portal-Demo" name="standard">
---    <title>Introduction</title>
---    <coplet-base-data>CachingURICoplet</coplet-base-data>
---    <attribute>
---      <name>uri</name>
---      <value xsi:type="java:java.lang.String" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
---          cocoon:/coplets/docs/portal-demo.html
---      </value>
---    </attribute>
---    <attribute>
---      <name>cache-global</name>
---      <value xsi:type="java:java.lang.Boolean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">true</value>
---    </attribute>
--- </coplet-data>
--- ...
---      
--- ---

By using the boolean cache-global attribute with the value --- true the contents of the coplet is cached in the usual Cocoon cache --- making it available to all users.

--- ---

The global cache is useful for static content that is the same for all users. ---

---

Coplet Rendering

Each coplet can be configured for supporting different features, like (69 equal lines skipped) Fields ====== no changes Links ===== no changes Custom Fields ============= no changes Collections =========== no changes