[jboss-cvs] JBossAS SVN: r105624 - projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 3 03:18:13 EDT 2010
Author: misty at redhat.com
Date: 2010-06-03 03:18:13 -0400 (Thu, 03 Jun 2010)
New Revision: 105624
Modified:
projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Xml.xml
Log:
JBPAPP-4387
Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Xml.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Xml.xml 2010-06-03 07:10:32 UTC (rev 105623)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Xml.xml 2010-06-03 07:18:13 UTC (rev 105624)
@@ -94,7 +94,7 @@
For example, the following <filename>components.xml</filename> file installs jBPM:
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpm="http://jboss.com/products/seam/bpm">
<bpm:jbpm/>
@@ -104,7 +104,7 @@
The following example also installs jBPM:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<component class="org.jboss.seam.bpm.Jbpm"/>
</components>]]>
</programlisting>
@@ -112,7 +112,7 @@
This example installs and configures two different Seam-managed persistence contexts:
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context name="customerDatabase"
@@ -127,7 +127,7 @@
This example also installs and configures two different Seam-managed persistence contexts:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<component name="customerDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">
@@ -147,7 +147,7 @@
The following examples create a session-scoped Seam-managed persistence context. (This is not recommended in practice.)
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context
@@ -157,7 +157,7 @@
</components>]]>
</programlisting>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<component name="productDatabase" scope="session"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
@@ -172,7 +172,7 @@
The <literal>auto-create</literal> option is commonly used for infrastructural objects such as persistence contexts, removing the need to specify <literal>create=true</literal> explicitly when using the <literal>@In</literal> annotation.
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context
@@ -182,7 +182,7 @@
</components>]]>
</programlisting>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<component name="productDatabase"
auto-create="true"
@@ -198,7 +198,7 @@
The <literal><![CDATA[<factory>]]></literal> declaration specifies a value- or method-binding expression that will initialize the value of a context variable when it is first referenced.
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<factory name="contact" method="#{contactManager.loadContact}"
scope="CONVERSATION"/>
</components>]]>
@@ -207,7 +207,7 @@
You can create an <emphasis>alias</emphasis> (a second name) for a Seam component like so:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<factory name="user" value="#{actor}" scope="STATELESS"/>
</components>]]>
</programlisting>
@@ -215,7 +215,7 @@
You can even create an alias for a commonly used expression:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<factory name="contact" value="#{contactManager.contact}"
scope="STATELESS"/>
</components>]]>
@@ -224,7 +224,7 @@
<literal>auto-create="true"</literal> is often used with the <literal><![CDATA[<factory>]]></literal> declaration:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<factory name="session" value="#{entityManager.delegate}"
scope="STATELESS" auto-create="true"/>
</components>]]>
@@ -243,7 +243,7 @@
<literal><![CDATA[<components>]]></literal> lets you define multiple components in the file:
</para>
-<programlisting role="XML"><![CDATA[<components>
+<programlisting language="XML" role="XML"><![CDATA[<components>
<component class="com.helloworld.Hello" name="hello">
<property name="name">#{user.name}</property>
@@ -256,7 +256,7 @@
<literal><![CDATA[<component>]]></literal> only lets you configure one component, but is less verbose:
</para>
-<programlisting role="XML"><![CDATA[<component name="hello">
+<programlisting language="XML" role="XML"><![CDATA[<component name="hello">
<property name="name">#{user.name}</property>
</component>]]>
</programlisting>
@@ -273,25 +273,26 @@
<para>
Properties of string, primitive or primitive wrapper type are configured as follows:
</para>
-
-<programlisting><![CDATA[org.jboss.seam.core.manager.conversationTimeout 60000]]></programlisting>
-
-<programlisting role="XML"><![CDATA[<core:manager conversation-timeout="60000"/>]]></programlisting>
-<programlisting role="XML"><![CDATA[<component name="org.jboss.seam.core.manager">
- <property name="conversationTimeout">60000</property>
-</component>]]>
-</programlisting>
+ <itemizedlist>
+ <listitem><para><property>org.jboss.seam.core.manager.conversationTimeout 60000</property></para></listitem>
+ <listitem><para><property><core:manager conversation-timeout="60000"/></property></para></listitem>
+ </itemizedlist>
+ <programlisting language="XML" role="XML">
+ <component name="org.jboss.seam.core.manager">
+ <property name="conversationTimeout">60000</property>
+ </component>
+ </programlisting>
<para>
Arrays, sets, and lists of strings or primitives are also supported:
</para>
-<programlisting><![CDATA[org.jboss.seam.bpm.jbpm.processDefinitions
+<programlisting language="Java" role="JAVA">org.jboss.seam.bpm.jbpm.processDefinitions
order.jpdl.xml,
return.jpdl.xml,
-inventory.jpdl.xml]]>
+inventory.jpdl.xml
</programlisting>
-<programlisting role="XML"><![CDATA[<bpm:jbpm>
+<programlisting language="XML" role="XML"><![CDATA[<bpm:jbpm>
<bpm:process-definitions>
<value>order.jpdl.xml</value>
<value>return.jpdl.xml</value>
@@ -300,7 +301,7 @@
</bpm:jbpm>]]>
</programlisting>
-<programlisting role="XML"><![CDATA[<component name="org.jboss.seam.bpm.jbpm">
+<programlisting language="XML" role="XML"><![CDATA[<component name="org.jboss.seam.bpm.jbpm">
<property name="processDefinitions">
<value>order.jpdl.xml</value>
@@ -314,7 +315,7 @@
Even maps with String-valued keys and string or primitive values are supported:
</para>
-<programlisting role="XML"><![CDATA[<component name="issueEditor">
+<programlisting language="XML" role="XML"><![CDATA[<component name="issueEditor">
<property name="issueStatuses">
<key>open</key> <value>open issue</value>
@@ -331,7 +332,7 @@
You can also override the type by specifying a fully qualified class name:
</para>
-<programlisting role="XML"><![CDATA[<component name="issueEditor">
+<programlisting language="XML" role="XML"><![CDATA[<component name="issueEditor">
<property name="issueStatusOptions" type="java.util.LinkedHashMap">
<key>open</key> <value>open issue</value>
@@ -345,11 +346,11 @@
Finally, you can link components with a value-binding expression. Note that since this occurs upon component instantiation, not invocation, this is quite different to injection with <literal>@In</literal>. It is more similar to the dependency injection facilities offered by traditional Inversion of Control containers such as JavaServer Faces (JSF) or Spring.
</para>
-<programlisting role="XML"><![CDATA[<drools:managed-working-memory name="policyPricingWorkingMemory"
+<programlisting language="XML" role="XML"><![CDATA[<drools:managed-working-memory name="policyPricingWorkingMemory"
rule-base="#{policyPricingRules}"/>]]>
</programlisting>
-<programlisting role="XML"><![CDATA[<component name="policyPricingWorkingMemory"
+<programlisting language="XML" role="XML"><![CDATA[<component name="policyPricingWorkingMemory"
class="org.jboss.seam.drools.ManagedWorkingMemory">
<property name="ruleBase">#{policyPricingRules}</property>
</component>]]>
@@ -358,7 +359,7 @@
Seam also resolves EL expression strings prior to assigning the initial value to the bean property of the component, so some contextual data can be injected into components:
</para>
-<programlisting role="XML"><![CDATA[<component name="greeter" class="com.example.action.Greeter">
+<programlisting language="XML" role="XML"><![CDATA[<component name="greeter" class="com.example.action.Greeter">
<property name="message">
Nice to see you, #{identity.username}!
</property>
@@ -368,7 +369,7 @@
However, there is one important exception: if the initial value is assigned to either a Seam <literal>ValueExpression</literal> or <literal>MethodExpression</literal>, then the evaluation of the EL is deferred, and the appropriate expression wrapper is created and assigned to the property. The message templates on the <literal>Home</literal> component of the Seam Application Framework are a good example of this:
</para>
-<programlisting role="XML"><![CDATA[<framework:entity-home name="myEntityHome"
+<programlisting language="XML" role="XML"><![CDATA[<framework:entity-home name="myEntityHome"
class="com.example.action.MyEntityHome"
entity-class="com.example.model.MyEntity"
created-message="'#{myEntityHome.instance.name}'
@@ -385,7 +386,7 @@
Previous examples have alternated between two component declaration methods: with and without using XML namespaces. The following shows a typical <filename>components.xml</filename> file that does not use namespaces:
</para>
-<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<programlisting language="XML" role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xsi:schemaLocation=
"http://jboss.com/products/seam/components
@@ -405,7 +406,7 @@
Using namespaces gives us:
</para>
-<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<programlisting language="XML" role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -429,13 +430,13 @@
Any Java package can be associated with an XML namespace by annotating the package with <literal>@Namespace</literal>. (Package-level annotations are declared in a file named <literal>package-info.java</literal> in the package directory.) An example of this from the seampay demo is:
</para>
-<programlisting role="JAVA">@Namespace(value="http://jboss.com/products/seam/examples/ seampay") package org.jboss.seam.example.seampay; import org.jboss.seam.annotations.Namespace;
+<programlisting language="Java" role="JAVA">@Namespace(value="http://jboss.com/products/seam/examples/ seampay") package org.jboss.seam.example.seampay; import org.jboss.seam.annotations.Namespace;
</programlisting>
<para>
Using the namespaced style in <filename>components.xml</filename> is that simple. Now we can write:
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
@@ -454,7 +455,7 @@
Or:
</para>
-<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
+<programlisting language="XML" role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
@@ -478,12 +479,12 @@
The previous examples illustrate the two usage models of a namespaced element. In the first declaration, <literal><![CDATA[<pay:payment-home>]]></literal> references the <literal>paymentHome</literal> component:
</para>
-<programlisting role="JAVA"><![CDATA[package org.jboss.seam.example.seampay;
+<programlisting language="Java" role="JAVA">package org.jboss.seam.example.seampay;
...
@Name("paymentHome")
-public class PaymentController extends EntityHome<Payment> {
+public class PaymentController extends EntityHome<Payment> {
...
-}]]>
+}
</programlisting>
<para>
The element name is the hyphenated form of the component name. The attributes of the element are the hyphenated forms of the property names.
@@ -492,12 +493,12 @@
In the second declaration, the <literal><![CDATA[<pay:payment>]]></literal> element refers to the <literal>Payment</literal> class in the <literal>org.jboss.seam.example.seampay</literal> package. In this case, <literal>Payment</literal> is an entity that is being declared as a Seam component:
</para>
-<programlisting role="JAVA"><![CDATA[package org.jboss.seam.example.seampay;
+<programlisting language="Java" role="JAVA">package org.jboss.seam.example.seampay;
...
@Entity
public class Payment implements Serializable {
...
-}]]>
+}
</programlisting>
<para>
A schema is required for validation and auto-completion to work for user-defined components. Seam cannot yet generate a schema for a set of components automatically, so schema must be manually created. You can use schema definitions for standard Seam packages for guidance.
More information about the jboss-cvs-commits
mailing list