Author: tv
Date: Tue Jul 15 12:58:14 2008
New Revision: 677019
URL: http://svn.apache.org/viewvc?rev=677019&view=rev
Log:
Updated documentation.
Modified:
turbine/fulcrum/trunk/cache/xdocs/index.xml
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeService.java
turbine/fulcrum/trunk/intake/xdocs/howto.xml
turbine/fulcrum/trunk/intake/xdocs/index.xml
turbine/fulcrum/trunk/localization/xdocs/index.xml
Modified: turbine/fulcrum/trunk/cache/xdocs/index.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/cache/xdocs/index.xml?rev=677019&r1=677018&r2=677019&view=diff
==============================================================================
--- turbine/fulcrum/trunk/cache/xdocs/index.xml (original)
+++ turbine/fulcrum/trunk/cache/xdocs/index.xml Tue Jul 15 12:58:14 2008
@@ -55,45 +55,67 @@
</p>
</section>
<section name="GlobalCacheService" id="GlobalCacheService">
- <p>
- First, here is the role configuration.
- </p>
-
- <source><![CDATA[
+ <subsection name="Role Configuration">
+ <source><![CDATA[
<role
name="org.apache.fulcrum.cache.GlobalCacheService"
shorthand="cache"
default-class="org.apache.fulcrum.cache.DefaultGlobalCacheService"/>
- ]]></source>
+ ]]></source>
+ </subsection>
- <p>
- And here is the configuration:
- </p>
- <source><![CDATA[
+ <subsection name="Component Configuration">
+ <table>
+ <tr>
+ <th>Item</th>
+ <th>Datatype</th>
+ <th>Cardinality</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>@cacheInitialSize</td>
+ <td>int</td>
+ <td>[0|1]</td>
+ <td>
+ The initial size of the cache. The default is 20.
+ </td>
+ </tr>
+ <tr>
+ <td>@cacheCheckFrequency</td>
+ <td>int</td>
+ <td>[0|1]</td>
+ <td>
+ The cache uses a background thread to check for expired objects.
+ This defines the time between two checks in seconds. The default
+ is 5.
+ </td>
+ </tr>
+ </table>
+ </subsection>
+
+ <subsection name="Component Configuration Example">
+ <source><![CDATA[
<cache cacheInitialSize="20" cacheCheckFrequency="5"/>
- ]]></source>
+ ]]></source>
+ </subsection>
</section>
<section name="EHCacheService" id="EHCacheService">
- <p>
- The role configuration looks very similar.
- </p>
-
- <source><![CDATA[
+ <subsection name="Role Configuration">
+ <source><![CDATA[
<role
name="org.apache.fulcrum.cache.EHCacheService"
shorthand="ehcache"
default-class="org.apache.fulcrum.cache.impl.DefaultEHCacheService"/>
- ]]></source>
-
- <p>
- There is nothing to configure for the component.
- </p>
- <source><![CDATA[
- <ehcache />
- ]]></source>
+ ]]></source>
+ </subsection>
+ <subsection name="Component Configuration">
+ <p>
+ There is nothing to configure for the component.
+ </p>
+ </subsection>
</section>
<section name="JCSCacheService" id="JCSCacheService">
@@ -101,40 +123,74 @@
<p>
The JCS cache service implements the interface
<code>GlobalCacheService</code> and thus can
serve as a drop-in replacement for
<code>DefaultGlobalCacheService</code>. However it is
- possible to configure the cache behaviour in much more detail to
provide disk caches or lateral TCP
+ possible to configure the cache behavior in much more detail to
provide disk caches or lateral TCP
caches for example.
</p>
- <p>
- The role configuration only differs from the
<code>GlobalCacheService</code> in the
- <code>default-class</code>.
- </p>
- <source><![CDATA[
+ <subsection name="Role Configuration">
+ <source><![CDATA[
<role
name="org.apache.fulcrum.cache.GlobalCacheService"
shorthand="jcscache"
default-class="org.apache.fulcrum.cache.impl.JCSCacheService"/>
- ]]></source>
+ ]]></source>
+ </subsection>
- <p>
- And here is the configuration:
- </p>
- <source><![CDATA[
+ <subsection name="Component Configuration">
+ <table>
+ <tr>
+ <th>Item</th>
+ <th>Datatype</th>
+ <th>Cardinality</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>cacheCheckFrequency</td>
+ <td>int</td>
+ <td>[0|1]</td>
+ <td>
+ The cache uses a background thread to check for expired objects.
+ This defines the time between two checks in milliseconds. The
+ default is 5000.
+ </td>
+ </tr>
+ <tr>
+ <td>region</td>
+ <td>String</td>
+ <td>[0|1]</td>
+ <td>
+ The JCS cache region name to use for the cache The default is
+ <code>fulcrum</code>.
+ JCS will store the objects in a group named
<code>default_group</code>
+ in the given region.
+ </td>
+ </tr>
+ <tr>
+ <td>configurationFile</td>
+ <td>String</td>
+ <td>[0|1]</td>
+ <td>
+ The the location of the JCS configuration file. Please note that
+ JCS uses a class loader to read this file, so make sure this path
+ is part of your classpath. The default is <code>/cache.ccf</code>.
+ </td>
+ </tr>
+ </table>
+ <p>
+ See <a href="http://jakarta.apache.org/jcs/">the JCS site</a> for more
+ information about configuring JCS.
+ </p>
+ </subsection>
+
+ <subsection name="Component Configuration Example">
+ <source><![CDATA[
<jcscache>
<cacheCheckFrequency>5000</cacheCheckFrequency>
<region>fulcrum</region>
<configurationFile>/cache.ccf</configurationFile>
</jcscache>
- ]]></source>
- <p>
- The region parameter is the name of the cache region to use when caching
objects. It defaults to
- <code>fulcrum</code>. JCS will store the objects in a group named
<code>default_group</code> in that
- region. The configuration file parameter gives the location of the JCS
configuration file. Please
- note that JCS uses a class loader to read this file, so make sure this
path is part of your classpath.
- The default values of all configuration settings are shown in the
example.
- See <a href="http://jakarta.apache.org/jcs/">the JCS site</a> for more
information about configuring
- JCS.
- </p>
+ ]]></source>
+ </subsection>
</section>
<section name="Usage">
@@ -181,7 +237,7 @@
The cache also supports <code>RefreshableCachedObject</code>s. These
objects must implement
a <code>refresh()</code>-method which will be called every time the
cache detects that the
object is expired. This way, you can keep objects in the cache that
"auto-refresh"
- asynchronuously.
+ asynchronously.
</p>
</section>
Modified:
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeService.java
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeService.java?rev=677019&r1=677018&r2=677019&view=diff
==============================================================================
---
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeService.java
(original)
+++
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeService.java
Tue Jul 15 12:58:14 2008
@@ -47,15 +47,11 @@
/** Avalon role - used to id the component within the manager */
String ROLE = IntakeService.class.getName();
-
-
/**
* The default location of the xml specification.
*/
String XML_PATH_DEFAULT = "WEB-INF/conf/intake.xml";
-
-
/**
* The default location where a serialized version of
* the xml specification can be written for faster restarts..
Modified: turbine/fulcrum/trunk/intake/xdocs/howto.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/intake/xdocs/howto.xml?rev=677019&r1=677018&r2=677019&view=diff
==============================================================================
--- turbine/fulcrum/trunk/intake/xdocs/howto.xml (original)
+++ turbine/fulcrum/trunk/intake/xdocs/howto.xml Tue Jul 15 12:58:14 2008
@@ -78,36 +78,6 @@
</section>
-<section name="Configuration">
-
- <p>
- First, here is the role configuration.
- </p>
-
-<source><![CDATA[
- <role
- name="org.apache.fulcrum.intake.IntakeService"
- shorthand="intake"
- default-class="org.apache.fulcrum.intake.IntakeServiceImpl"/>
-
-]]></source>
-
- <p>
- Now comes the basic configuration of the component. Here will will
- configure the various bundles.
- </p>
-<source><![CDATA[
- <intake>
- <serialDataPath>./target/appData.ser</serialDataPath>
- <xmlPaths>
- <xmlPath>src/test/xmlConf.xml</xmlPath>
- <xmlPath>src/test/xmlConf2.xml</xmlPath>
- </xmlPaths>
- </intake>
-]]></source>
-
- </section>
-
<section name="Usage">
<p>
Intake is implemented as a Avalon component. Access to it is provided by
Modified: turbine/fulcrum/trunk/intake/xdocs/index.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/intake/xdocs/index.xml?rev=677019&r1=677018&r2=677019&view=diff
==============================================================================
--- turbine/fulcrum/trunk/intake/xdocs/index.xml (original)
+++ turbine/fulcrum/trunk/intake/xdocs/index.xml Tue Jul 15 12:58:14 2008
@@ -29,48 +29,69 @@
<section name="Overview">
<p>
- This service provides access to input processing objects based on an XML
specification.
+ This service provides access to input processing objects based on an XML
+ specification.
</p>
</section>
-<section name="Configuration">
-
- <p>
- First, here is the role configuration.
- </p>
-
-<source>
-<![CDATA[
- <role
- name="org.apache.fulcrum.intake.IntakeService"
- shorthand="intake"
- default-class="org.apache.fulcrum.intake.IntakeServiceImpl"/>
-
-]]>
-</source>
-
- <p>
- Now comes the basic configuration of the component. Here will will
- configure the various bundles.
- </p>
-<source>
-
-<![CDATA[
- <intake>
+ <section name="Configuration">
+ <subsection name="Role Configuration">
+ <source><![CDATA[
+ <role
+ name="org.apache.fulcrum.intake.IntakeService"
+ shorthand="intake"
+ default-class="org.apache.fulcrum.intake.IntakeServiceImpl"/>
+ ]]></source>
+ </subsection>
+
+ <subsection name="Component Configuration">
+ <table>
+ <tr>
+ <th>Item</th>
+ <th>Datatype</th>
+ <th>Cardinality</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>serialDataPath</td>
+ <td>String</td>
+ <td>[0|1]</td>
+ <td>
+ The file where the serialized XML files will be stored. The
+ default is <code>WEB-INF/appData.ser</code>.
+ </td>
+ </tr>
+ <tr>
+ <td>xmlPaths</td>
+ <td>Complex</td>
+ <td>[0|1]</td>
+ <td>
+ The list of XML files that contain rules for Intake. The
+ default is <code>WEB-INF/conf/intake.xml</code>
+ </td>
+ </tr>
+ <tr>
+ <td>xmlPaths/xmlPath</td>
+ <td>String</td>
+ <td>[1..n]</td>
+ <td>
+ A name of an XML file that contains rules for Intake.
+ </td>
+ </tr>
+ </table>
+ </subsection>
+
+ <subsection name="Component Configuration Example">
+ <source><![CDATA[
+ <intake>
<serialDataPath>./target/appData.ser</serialDataPath>
<xmlPaths>
<xmlPath>src/test/xmlConf.xml</xmlPath>
<xmlPath>src/test/xmlConf2.xml</xmlPath>
</xmlPaths>
</intake>
-]]>
-</source>
-
- </section>
-
- <section name="Usage">
- <p>
- </p>
+ ]]></source>
+ </subsection>
</section>
</body>
Modified: turbine/fulcrum/trunk/localization/xdocs/index.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/localization/xdocs/index.xml?rev=677019&r1=677018&r2=677019&view=diff
==============================================================================
--- turbine/fulcrum/trunk/localization/xdocs/index.xml (original)
+++ turbine/fulcrum/trunk/localization/xdocs/index.xml Tue Jul 15 12:58:14 2008
@@ -22,98 +22,152 @@
<properties>
<title>Localization Component</title>
- <author email="[EMAIL PROTECTED]">Eric PUgh</author>
+ <author email="[EMAIL PROTECTED]">Eric Pugh</author>
+ <author email="[EMAIL PROTECTED]">Thomas Vandahl</author>
</properties>
<body>
<section name="Overview">
<p>
- This component wraps provides Localization of strings. It is written
+ This component provides Localization of strings. It is written
for use in Turbine but it can be used in any container compatible
with Avalon's ECM container.
</p>
</section>
-<section name="Configuration">
-
- <p>
- First, here is the role configuration.
- </p>
-
-<source>
-<![CDATA[
+ <section name="Configuration">
+ <subsection name="Role Configuration">
+ <source><![CDATA[
<role
name="org.apache.fulcrum.localization.LocalizationService"
shorthand="localization"
default-class="org.apache.fulcrum.localization.DefaultLocalizationService"/>
-]]>
-</source>
+ ]]></source>
+ </subsection>
- <p>
- Now comes the basic configuration of the component. Here will will
- configure the various bundles.
- </p>
-<source>
+ <subsection name="Component Configuration">
+ <table>
+ <tr>
+ <th>Item</th>
+ <th>Datatype</th>
+ <th>Cardinality</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>bundles</td>
+ <td>Complex</td>
+ <td>[1]</td>
+ <td>
+ The list of configured bundles.
+ </td>
+ </tr>
+ <tr>
+ <td>bundles/bundle</td>
+ <td>String</td>
+ <td>[1..n]</td>
+ <td>
+ The name of the bundle
+ </td>
+ </tr>
+ </table>
+ </subsection>
-<![CDATA[
+ <subsection name="Component Configuration Example">
+ <source><![CDATA[
<localization>
<bundles>
<bundle>org.apache.fulcrum.localization.BarBundle</bundle>
<bundle>org.apache.fulcrum.localization.FooBundle</bundle>
</bundles>
</localization>
-]]>
-</source>
-
+ ]]></source>
+ </subsection>
</section>
- <section name="Usage">
-
-<source><![CDATA[
-
-TurbineServices.getInstance().getService(LocalizationService.LOCALIZATION)
- .getString("DISPLAYPROJECTS_TITLE");
+ <section name="Resource Bundles">
+ <p>
+ Resource bundles are basically property files. You might have one for
+ the "en" locale thus:
+ </p>
-]]></source>
+ <source><![CDATA[
+ LABEL_ORGANIZATION = organisation
+ CURRENT_RECORD = Record {0} of {1}
+ ]]></source>
-<p>
-Wow. That is a lot of typing. That could be easily shortened to this:
-</p>
+ <p>
+ and another for the "en_US" locale thus:
+ </p>
-<source><![CDATA[
+ <source><![CDATA[
+ LABEL_ORGANIZATION = organization
+ ]]></source>
-Localization.getString("DISPLAYPROJECTS_TITLE");
+ <p>
+ Please see the <em>java.util.ListResourceBundle</em> and
+ <em>java.util.ResourceBundle</em> classes for more information.
+ </p>
+ </section>
-]]></source>
+ <section name="Usage">
+ <source><![CDATA[
+ TurbineServices.getInstance().getService(LocalizationService.LOCALIZATION)
+ .getString("DISPLAYPROJECTS_TITLE");
+ ]]></source>
-<p>
-The hard example above was given as an example of using Services. The easy
-example is the one that you really should be using. Another cool feature
-of the Localization class is that you can pass in a RunData object like
-this:
-</p>
+ <p>
+ Wow. That is a lot of typing. That could be easily shortened to this:
+ </p>
-<source><![CDATA[
+ <source><![CDATA[
+ Localization.getString("DISPLAYPROJECTS_TITLE");
+ ]]></source>
-Localization.getString(data, "DISPLAYPROJECTS_TITLE");
+ <p>
+ The hard example above was given as an example of using Services. The
easy
+ example is the one that you really should be using. Another cool feature
+ of the Localization class is that you can pass in a RunData object like
+ this:
+ </p>
-]]></source>
+ <source><![CDATA[
+ Localization.getString(data, "DISPLAYPROJECTS_TITLE");
+ ]]></source>
-<p>
-This has the added effect of using the Accept-Language HTTP header to determine
-which language to display based on what setting the user has defined in
-the browser. Can you say Dynamic Localization? ;-)
-</p>
+ <p>
+ This has the added effect of using the Accept-Language HTTP header to
determine
+ which language to display based on what setting the user has defined in
+ the browser. Can you say Dynamic Localization? ;-)
+ </p>
-<p>
-For creating the file where you get the value of the String, please
-see the <em>java.util.ListResourceBundle</em> and
-<em>java.util.ResourceBundle</em> classes for more information.
-<a href="http://java.apache.org/jyve/">Jyve</a> also contains example usage
-of this code because that was the first place where this code was originally
-developed.
-</p>
+ <p>
+ The Localization class also supports the formatting of localized strings
containing
+ parameters, such as in
+ </p>
+
+ <source><![CDATA[
+ Localization.format(Localization.getDefaultBundle(),
+ Localization.getLocale(data.getRequest()),
+ "CURRENT_RECORD",
+ recno, all);
+ ]]></source>
+
+ <p>
+ This actually doesn't look too nice, however the call using the
LocalizationTool
+ from a <a href="http://velocity.apache.org/">Velocity</a> template just
deflates to
+ </p>
+
+ <source><![CDATA[
+ $l10n.format("CURRENT_RECORD", $recno, $all);
+ ## Other examples
+ ## No arguments
+ $l10n.LABEL_ORGANIZATION
+ ## One argument
+ $l10n.format("STRING_KEY_ONE_ARG" "arg1")
+ ## Three or more arguments
+ $l10n.format("STRING_KEY_3_OR_MORE_ARGS" ["arg1", "arg2", "arg3"])
+ ]]></source>
</section>
</body>