Author: pete.muir(a)jboss.org
Date: 2008-03-25 18:36:31 -0400 (Tue, 25 Mar 2008)
New Revision: 7693
Modified:
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Annotations.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Cache.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Components.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Concepts.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Controls.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Conversations.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Dependencies.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Drools.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Elenhancements.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Events.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Framework.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gettingstarted.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Groovy.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gwt.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Hsearch.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/I18n.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Itext.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jbpm.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jms.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Mail.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Oc4j.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Remoting.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Security.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Spring.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Testing.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Text.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Tutorial.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Validation.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Weblogic.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Webservices.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Websphere.xml
branches/Seam_2_0/doc/Seam_Reference_Guide/en/Xml.xml
Log:
Many clean ups
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Annotations.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Annotations.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Annotations.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -2,1219 +2,1560 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<chapter id="annotations">
- <title>Seam annotations</title>
+ <title>Seam annotations</title>
- <para> When you write a Seam application, you'll use a lot of annotations.
Seam lets you use annotations to achieve
- a declarative style of programming. Most of the annotations you'll use are
defined by the EJB 3.0 specification.
- The annotations for data validation are defined by the Hibernate Validator
package. Finally, Seam defines its
- own set of annotations, which we'll describe in this chapter. </para>
+ <para>
+ When you write a Seam application, you'll use a lot of annotations. Seam
+ lets you use annotations to achieve a declarative style of programming.
+ Most of the annotations you'll use are defined by the EJB 3.0
+ specification. The annotations for data validation are defined by the
+ Hibernate Validator package. Finally, Seam defines its own set of
+ annotations, which we'll describe in this chapter.
+ </para>
- <para> All of these annotations are defined in the package
<literal>org.jboss.seam.annotations</literal>. </para>
+ <para>
+ All of these annotations are defined in the package
+ <literal>org.jboss.seam.annotations</literal>.
+ </para>
- <section>
- <title>Annotations for component definition</title>
- <para> The first group of annotations lets you define a Seam component.
These annotations appear on the
- component class. </para>
+ <section>
+ <title>Annotations for component definition</title>
+ <para>
+ The first group of annotations lets you define a Seam component. These
+ annotations appear on the component class.
+ </para>
- <variablelist>
- <varlistentry id="name-annotation">
- <term>
- <literal>@Name</literal>
- </term>
- <listitem>
- <programlisting
role="JAVA"><![CDATA[@Name("componentName")]]></programlisting>
- <para> Defines the Seam component name for a class. This
annotation is required for all Seam
- components. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="scope-annotation">
- <term>
- <literal>@Scope</literal>
- </term>
- <listitem>
- <programlisting
role="JAVA"><![CDATA[(a)Scope(ScopeType.CONVERSATION)]]></programlisting>
- <para> Defines the default context of the component. The
possible values are defined by the
- <literal>ScopeType</literal> enumeration:
<literal>EVENT, PAGE, CONVERSATION, SESSION,
- BUSINESS_PROCESS, APPLICATION, STATELESS</literal>.
</para>
- <para> When no scope is explicitly specified, the default
depends upon the component type. For
- stateless session beans, the default is
<literal>STATELESS</literal>. For entity beans and
- stateful session beans, the default is
<literal>CONVERSATION</literal>. For JavaBeans, the
- default is <literal>EVENT</literal>. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="role-annotation">
- <term>
- <literal>@Role</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@Role(name="roleName",
scope=ScopeType.SESSION)]]></programlisting>
- <para> Allows a Seam component to be bound to multiple contexts
variables. The
-
<literal>@Name</literal>/<literal>@Scope</literal> annotations
define a "default role". Each
- <literal>@Role</literal> annotation defines an
additional role. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>name</literal> — the
context variable name. </para>
- </listitem>
- <listitem>
- <para>
- <literal>scope</literal> — the
context variable scope. When no scope is
- explicitly specified, the default depends upon the
component type, as above. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="roles-annotation">
- <term>
- <literal>@Roles</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@Roles({
+ <variablelist>
+ <varlistentry id="name-annotation">
+ <term>
+ <literal>@Name</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Name("componentName")]]></programlisting>
+ <para>
+ Defines the Seam component name for a class. This annotation
+ is required for all Seam components.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="scope-annotation">
+ <term>
+ <literal>@Scope</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[(a)Scope(ScopeType.CONVERSATION)]]></programlisting>
+ <para>
+ Defines the default context of the component. The possible
+ values are defined by the <literal>ScopeType</literal>
+ enumeration: <literal>EVENT, PAGE, CONVERSATION, SESSION,
BUSINESS_PROCESS, APPLICATION, STATELESS</literal>.
+ </para>
+ <para>
+ When no scope is explicitly specified, the default depends
+ upon the component type. For stateless session beans, the
+ default is <literal>STATELESS</literal>. For entity beans
and
+ stateful session beans, the default is
+ <literal>CONVERSATION</literal>. For JavaBeans, the default
is
+ <literal>EVENT</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="role-annotation">
+ <term>
+ <literal>@Role</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Role(name="roleName",
scope=ScopeType.SESSION)]]></programlisting>
+ <para>
+ Allows a Seam component to be bound to multiple contexts
+ variables. The
<literal>@Name</literal>/<literal>@Scope</literal>
+ annotations define a "default role". Each
<literal>@Role</literal>
+ annotation defines an additional role.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>name</literal> — the context
variable
+ name.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>scope</literal> — the context
variable
+ scope. When no scope is explicitly specified, the
+ default depends upon the component type, as above.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="roles-annotation">
+ <term>
+ <literal>@Roles</literal>
+ </term>
+ <listitem>
+ <programlisting role="JAVA"><![CDATA[@Roles({
@Role(name="user", scope=ScopeType.CONVERSATION),
@Role(name="currentUser", scope=ScopeType.SESSION)
- })]]></programlisting>
- <para> Allows specification of multiple additional roles.
</para>
- </listitem>
- </varlistentry>
- <varlistentry id="intercept-annotation">
- <term>
- <literal>@BypassInterceptors</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@BypassInterceptors]]></programlisting>
- <para>Disables Seam all interceptors on a particular component
- or method of a component.</para>
- </listitem>
- </varlistentry>
- <varlistentry id="jndiname-annotation">
- <term>
- <literal>@JndiName</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@JndiName("my/jndi/name")]]></programlisting>
- <para> Specifies the JNDI name that Seam will use to look up
the EJB component. If no JNDI name is
- explicitly specified, Seam will use the JNDI pattern specified
by
-
<literal>org.jboss.seam.core.init.jndiPattern</literal>. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="conversational-annotation">
- <term>
- <literal>@Conversational</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Conversational]]></programlisting>
- <para> Specifies that a conversation scope component is
conversational, meaning that no method of
- the component may be called unless a long-running conversation is
active. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="pernestedconversation-annotation">
- <term>
- <literal>@PerNestedConversation</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@PerNestedConversation]]></programlisting>
- <para>Limits the scope of a CONVERSATION-scoped component to
just the parent conversation in which
- it was instantiated. The component instance will not be visible
to nested child conversations,
- which will get their own instance.</para>
- <para>Warning: this is ill-defined, since it implies that a
component will be visible for some
- part of a request cycle, and invisible after that. It is not
recommended that applications
- use this feature!</para>
- </listitem>
- </varlistentry>
- <varlistentry id="startup-annotation">
- <term>
- <literal>@Startup</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@Scope(APPLICATION)
@Startup(depends="org.jboss.seam.bpm.jbpm")]]></programlisting>
- <para> Specifies that an application scope component is started
immediately at initialization time.
- This is mainly used for certain built-in components that
bootstrap critical infrastructure such
- as JNDI, datasources, etc. </para>
- <programlisting><![CDATA[@Scope(SESSION)
@Startup]]></programlisting>
- <para> Specifies that a session scope component is started
immediately at session creation time. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>depends</literal> —
specifies that the named components must be
- started first, if they are installed. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="install-annotation">
- <term>
- <literal>@Install</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Install(false)]]></programlisting>
- <para>
- Specifies whether or not a component should be installed by
default. The lack of an @Install
- annotation indicates a component should be installed.
- </para>
-
<programlisting><![CDATA[(a)Install(dependencies="org.jboss.seam.bpm.jbpm")]]></programlisting>
- <para>
- Specifies that a component should only be stalled if the
components listed as dependencies
- are also installed.
- </para>
-
<programlisting><![CDATA[(a)Install(genericDependencies=ManagedQueueSender.class)]]></programlisting>
- <para>
- Specifies that a component should only be installed if a
component that is implemented by a
- certain class is installed. This is useful when the dependency
doesn't have a single well-known
- name.
- </para>
-
<programlisting><![CDATA[(a)Install(classDependencies="org.hibernate.Session")]]></programlisting>
- <para>
- Specifies that a component should only be installed if the named
class is in the classpath.
- </para>
-
<programlisting><![CDATA[@Install(precedence=BUILT_IN)]]></programlisting>
- <para>
- Specifies the precedence of the component. If multiple components
with the same name exist,
- the one with the higher precedence will be installed. The defined
precendence values are
- (in ascending order):
- </para>
+ })]]></programlisting>
+ <para>
+ Allows specification of multiple additional roles.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="intercept-annotation">
+ <term>
+ <literal>@BypassInterceptors</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@BypassInterceptors]]></programlisting>
+ <para>
+ Disables Seam all interceptors on a particular component or
+ method of a component.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="jndiname-annotation">
+ <term>
+ <literal>@JndiName</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@JndiName("my/jndi/name")]]></programlisting>
+ <para>
+ Specifies the JNDI name that Seam will use to look up the EJB
+ component. If no JNDI name is explicitly specified, Seam will
+ use the JNDI pattern specified by
+ <literal>org.jboss.seam.core.init.jndiPattern</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="conversational-annotation">
+ <term>
+ <literal>@Conversational</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Conversational]]></programlisting>
+ <para>
+ Specifies that a conversation scope component is
+ conversational, meaning that no method of the component may be
+ called unless a long-running conversation is active.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="pernestedconversation-annotation">
+ <term>
+ <literal>@PerNestedConversation</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@PerNestedConversation]]></programlisting>
+ <para>
+ Limits the scope of a CONVERSATION-scoped component to just
+ the parent conversation in which it was instantiated. The
+ component instance will not be visible to nested child
+ conversations, which will get their own instance.
+ </para>
+ <para>
+ Warning: this is ill-defined, since it implies that a
+ component will be visible for some part of a request cycle,
+ and invisible after that. It is not recommended that
+ applications use this feature!
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="startup-annotation">
+ <term>
+ <literal>@Startup</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Scope(APPLICATION)
@Startup(depends="org.jboss.seam.bpm.jbpm")]]></programlisting>
+ <para>
+ Specifies that an application scope component is started
+ immediately at initialization time. This is mainly used for
+ certain built-in components that bootstrap critical
+ infrastructure such as JNDI, datasources, etc.
+ </para>
+ <programlisting role="JAVA"><![CDATA[@Scope(SESSION)
@Startup]]></programlisting>
+ <para>
+ Specifies that a session scope component is started
+ immediately at session creation time.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>depends</literal> — specifies that
the
+ named components must be started first, if they are
+ installed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="install-annotation">
+ <term>
+ <literal>@Install</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Install(false)]]></programlisting>
+ <para>
+ Specifies whether or not a component should be installed by
+ default. The lack of an <literal>@Install</literal>
annotation
+ indicates a component should be installed.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Install(dependencies="org.jboss.seam.bpm.jbpm")]]></programlisting>
+ <para>
+ Specifies that a component should only be stalled if the
+ components listed as dependencies are also installed.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Install(genericDependencies=ManagedQueueSender.class)]]></programlisting>
+ <para>
+ Specifies that a component should only be installed if a
+ component that is implemented by a certain class is installed.
+ This is useful when the dependency doesn't have a single
+ well-known name.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Install(classDependencies="org.hibernate.Session")]]></programlisting>
+ <para>
+ Specifies that a component should only be installed if the
+ named class is in the classpath.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Install(precedence=BUILT_IN)]]></programlisting>
+ <para>
+ Specifies the precedence of the component. If multiple
+ components with the same name exist, the one with the higher
+ precedence will be installed. The defined precendence values
+ are (in ascending order):
+ </para>
- <itemizedlist>
- <listitem>
- <para><literal>BUILT_IN</literal>
— Precedence of all built-in Seam
- components</para>
- </listitem>
- <listitem>
- <para><literal>FRAMEWORK</literal>
— Precedence to use for components of
- frameworks which extend Seam</para>
- </listitem>
- <listitem>
- <para><literal>APPLICATION</literal>
— Predence of application components (the
- default precedence)</para>
- </listitem>
- <listitem>
- <para><literal>DEPLOYMENT</literal>
— Precedence to use for components which
- override application components in a particular
deployment</para>
- </listitem>
- <listitem>
- <para><literal>MOCK</literal> —
Precedence for mock objects used in testing</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>BUILT_IN</literal> — Precedence of
all
+ built-in Seam components
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>FRAMEWORK</literal> — Precedence
to use
+ for components of frameworks which extend Seam
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>APPLICATION</literal> — Predence
of
+ application components (the default precedence)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>DEPLOYMENT</literal> — Precedence
to use
+ for components which override application components in
+ a particular deployment
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>MOCK</literal> — Precedence for
mock
+ objects used in testing
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
- <varlistentry id="synchronized-annotation">
- <term>
- <literal>@Synchronized</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Synchronized(timeout=1000)]]></programlisting>
- <para> Specifies that a component is accessed concurrently by
multiple clients, and that Seam should
- serialize requests. If a request is not able to obtain its lock
on the component in the given
- timeout period, an exception will be raised. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="readonly-annotation">
- <term>
- <literal>@ReadOnly</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@ReadOnly]]></programlisting>
- <para> Specifies that a JavaBean component or component method
does not require state replication at
- the end of the invocation. </para>
- </listitem>
- </varlistentry>
- <varlistentry id="autocreate-annotation">
- <term>
- <literal>@AutoCreate</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@AutoCreate]]></programlisting>
- <para> Specifies that a component will be automatically
created, even if the client does not
- specify <literal>create=true</literal>. </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <varlistentry id="synchronized-annotation">
+ <term>
+ <literal>@Synchronized</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Synchronized(timeout=1000)]]></programlisting>
+ <para>
+ Specifies that a component is accessed concurrently by
+ multiple clients, and that Seam should serialize requests. If
+ a request is not able to obtain its lock on the component in
+ the given timeout period, an exception will be raised.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="readonly-annotation">
+ <term>
+ <literal>@ReadOnly</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@ReadOnly]]></programlisting>
+ <para>
+ Specifies that a JavaBean component or component method does
+ not require state replication at the end of the invocation.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="autocreate-annotation">
+ <term>
+ <literal>@AutoCreate</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@AutoCreate]]></programlisting>
+ <para>
+ Specifies that a component will be automatically created, even
+ if the client does not specify
<literal>create=true</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <section>
- <title>Annotations for bijection</title>
- <para> The next two annotations control bijection. These attributes occur
on component instance variables or
- property accessor methods. </para>
+ <section>
+ <title>Annotations for bijection</title>
+ <para>
+ The next two annotations control bijection. These attributes occur on
+ component instance variables or property accessor methods.
+ </para>
- <variablelist >
- <varlistentry id="in-annotation">
- <term>
- <literal>@In</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@In]]></programlisting>
- <para> Specifies that a component attribute is to be injected
from a context variable at the
- beginning of each component invocation. If the context variable
is null, an exception will be
- thrown. </para>
-
<programlisting><![CDATA[@In(required=false)]]></programlisting>
- <para> Specifies that a component attribute is to be injected
from a context variable at the
- beginning of each component invocation. The context variable may
be null. </para>
-
<programlisting><![CDATA[@In(create=true)]]></programlisting>
- <para> Specifies that a component attribute is to be injected
from a context variable at the
- beginning of each component invocation. If the context variable
is null, an instance of the
- component is instantiated by Seam. </para>
-
<programlisting><![CDATA[@In(value="contextVariableName")]]></programlisting>
- <para> Specifies the name of the context variable explicitly,
instead of using the annotated
- instance variable name. </para>
-
<programlisting><![CDATA[@In(value="#{customer.addresses['shipping']}")]]></programlisting>
- <para> Specifies that a component attribute is to be injected
by evaluating a JSF EL expression at
- the beginning of each component invocation. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> —
specifies the name of the context variable. Default
- to the name of the component attribute. Alternatively,
specifies a JSF EL expression,
- surrounded by <literal>#{...}</literal>.
</para>
- </listitem>
- <listitem>
- <para>
- <literal>create</literal> —
specifies that Seam should instantiate the
- component with the same name as the context variable if
the context variable is
- undefined (null) in all contexts. Default to false.
</para>
- </listitem>
- <listitem>
- <para>
- <literal>required</literal> —
specifies Seam should throw an exception if the
- context variable is undefined in all contexts.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="out-annotation">
- <term>
- <literal>@Out</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@Out]]></programlisting>
- <para> Specifies that a component attribute that is a Seam
component is to be outjected to its
- context variable at the end of the invocation. If the attribute
is null, an exception is thrown. </para>
-
<programlisting><![CDATA[@Out(required=false)]]></programlisting>
- <para> Specifies that a component attribute that is a Seam
component is to be outjected to its
- context variable at the end of the invocation. The attribute may
be null. </para>
-
<programlisting><![CDATA[(a)Out(scope=ScopeType.SESSION)]]></programlisting>
- <para> Specifies that a component attribute that is
<emphasis>not</emphasis> a Seam component type
- is to be outjected to a specific scope at the end of the
invocation. </para>
- <para> Alternatively, if no scope is explicitly specified, the
scope of the component with the
- <literal>@Out</literal> attribute is used (or the
<literal>EVENT</literal> scope if the
- component is stateless). </para>
-
<programlisting><![CDATA[@Out(value="contextVariableName")]]></programlisting>
- <para> Specifies the name of the context variable explicitly,
instead of using the annotated
- instance variable name. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> —
specifies the name of the context variable. Default
- to the name of the component attribute. </para>
- </listitem>
- <listitem>
- <para>
- <literal>required</literal> —
specifies Seam should throw an exception if the
- component attribute is null during outjection.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="in-annotation">
+ <term>
+ <literal>@In</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@In]]></programlisting>
+ <para>
+ Specifies that a component attribute is to be injected from a
+ context variable at the beginning of each component
+ invocation. If the context variable is null, an exception
+ will be thrown.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@In(required=false)]]></programlisting>
+ <para>
+ Specifies that a component attribute is to be injected from a
+ context variable at the beginning of each component
+ invocation. The context variable may be null.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@In(create=true)]]></programlisting>
+ <para>
+ Specifies that a component attribute is to be injected from a
+ context variable at the beginning of each component
+ invocation. If the context variable is null, an instance of
+ the component is instantiated by Seam.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@In(value="contextVariableName")]]></programlisting>
+ <para>
+ Specifies the name of the context variable explicitly, instead
+ of using the annotated instance variable name.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@In(value="#{customer.addresses['shipping']}")]]></programlisting>
+ <para>
+ Specifies that a component attribute is to be injected by
+ evaluating a JSF EL expression at the beginning of each
+ component invocation.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — specifies the
name of
+ the context variable. Default to the name of the
+ component attribute. Alternatively, specifies a JSF EL
+ expression, surrounded by <literal>#{...}</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>create</literal> — specifies that
Seam
+ should instantiate the component with the same name as
+ the context variable if the context variable is
+ undefined (null) in all contexts. Default to false.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>required</literal> — specifies
Seam
+ should throw an exception if the context variable is
+ undefined in all contexts.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="out-annotation">
+ <term>
+ <literal>@Out</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Out]]></programlisting>
+ <para>
+ Specifies that a component attribute that is a Seam component
+ is to be outjected to its context variable at the end of the
+ invocation. If the attribute is null, an exception is thrown.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Out(required=false)]]></programlisting>
+ <para>
+ Specifies that a component attribute that is a Seam component
+ is to be outjected to its context variable at the end of the
+ invocation. The attribute may be null.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Out(scope=ScopeType.SESSION)]]></programlisting>
+ <para>
+ Specifies that a component attribute that is
+ <emphasis>not</emphasis> a Seam component type is to be
+ outjected to a specific scope at the end of the invocation.
+ </para>
+ <para>
+ Alternatively, if no scope is explicitly specified, the scope
+ of the component with the <literal>@Out</literal> attribute
is
+ used (or the <literal>EVENT</literal> scope if the
component
+ is stateless).
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Out(value="contextVariableName")]]></programlisting>
+ <para>
+ Specifies the name of the context variable explicitly, instead
+ of using the annotated instance variable name.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — specifies the
name of
+ the context variable. Default to the name of the
+ component attribute.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>required</literal> — specifies
Seam
+ should throw an exception if the component attribute is
+ null during outjection.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para> Note that it is quite common for these annotations to occur
together, for example: </para>
+ <para>
+ Note that it is quite common for these annotations to occur together,
+ for example:
+ </para>
- <programlisting><![CDATA[@In(create=true) @Out private User
currentUser;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@In(create=true) @Out
private User currentUser;]]></programlisting>
- <para> The next annotation supports the <emphasis>manager
component</emphasis> pattern, where a Seam component
- that manages the lifecycle of an instance of some other class that is to be
injected. It appears on a
- component getter method. </para>
+ <para>
+ The next annotation supports the <emphasis>manager
component</emphasis>
+ pattern, where a Seam component that manages the lifecycle of an
+ instance of some other class that is to be injected. It appears on a
+ component getter method.
+ </para>
- <variablelist >
- <varlistentry id="unwrap-annotation">
- <term>
- <literal>@Unwrap</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Unwrap]]></programlisting>
- <para> Specifies that the object returned by the annotated
getter method is the thing that is
- injected instead of the component instance itself. </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="unwrap-annotation">
+ <term>
+ <literal>@Unwrap</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Unwrap]]></programlisting>
+ <para>
+ Specifies that the object returned by the annotated getter
+ method is the thing that is injected instead of the component
+ instance itself.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para> The next annotation supports the <emphasis>factory
component</emphasis> pattern, where a Seam component
- is responsible for initializing the value of a context variable. This is
especially useful for initializing
- any state needed for rendering the response to a non-faces request. It
appears on a component method. </para>
+ <para>
+ The next annotation supports the <emphasis>factory
component</emphasis>
+ pattern, where a Seam component is responsible for initializing the
+ value of a context variable. This is especially useful for initializing
+ any state needed for rendering the response to a non-faces request. It
+ appears on a component method.
+ </para>
- <variablelist >
- <varlistentry id="factory-annotation">
- <term>
- <literal>@Factory</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Factory("processInstance") public void
createProcessInstance() { ... }]]></programlisting>
- <para> Specifies that the method of the component is used to
initialize the value of the named
- context variable, when the context variable has no value. This
style is used with methods that
- return <literal>void</literal>. </para>
-
<programlisting><![CDATA[@Factory("processInstance",
scope=CONVERSATION) public ProcessInstance createProcessInstance() { ...
}]]></programlisting>
- <para> Specifies that the method returns a value that Seam
should use to initialize the value of the
- named context variable, when the context variable has no value.
This style is used with methods
- that return a value. If no scope is explicitly specified, the
scope of the component with the
- <literal>@Factory</literal> method is used
(unless the component is stateless, in which case
- the <literal>EVENT</literal> context is used).
</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> —
specifies the name of the context variable. If the
- method is a getter method, default to the JavaBeans
property name. </para>
- </listitem>
- <listitem>
- <para>
- <literal>scope</literal> —
specifies the scope that Seam should bind the
- returned value to. Only meaningful for factory methods
which return a value. </para>
- </listitem>
- <listitem>
- <para>
- <literal>autoCreate</literal> — specifies
that this factory method should be
- automatically called whenever the variable is asked for, even
if @In does not specify
- create=true.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist >
+ <varlistentry id="factory-annotation">
+ <term>
+ <literal>@Factory</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Factory("processInstance") public void
createProcessInstance() { ... }]]></programlisting>
+ <para>
+ Specifies that the method of the component is used to
+ initialize the value of the named context variable, when the
+ context variable has no value. This style is used with methods
+ that return <literal>void</literal>.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Factory("processInstance",
scope=CONVERSATION) public ProcessInstance createProcessInstance() { ...
}]]></programlisting>
+ <para>
+ Specifies that the method returns a value that Seam should use
+ to initialize the value of the named context variable, when
+ the context variable has no value. This style is used with
+ methods that return a value. If no scope is explicitly
+ specified, the scope of the component with the
+ <literal>@Factory</literal> method is used (unless the
+ component is stateless, in which case the
<literal>EVENT</literal>
+ context is used).
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — specifies the
name of
+ the context variable. If the method is a getter method,
+ default to the JavaBeans property name.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>scope</literal> — specifies the
scope
+ that Seam should bind the returned value to. Only
+ meaningful for factory methods which return a value.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>autoCreate</literal> — specifies
that
+ this factory method should be automatically called
+ whenever the variable is asked for, even if
+ <literal>@In</literal> does not specify
+ <literal>create=true</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para> This annotation lets you inject a
<literal>Log</literal>: </para>
+ <para>
+ This annotation lets you inject a <literal>Log</literal>:
+ </para>
- <variablelist >
- <varlistentry id="logger-annotation">
- <term>
- <literal>@Logger</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Logger("categoryName")]]></programlisting>
- <para> Specifies that a component field is to be injected with
an instance of
- <literal>org.jboss.seam.log.Log</literal>. For
entity beans, the
- field must be declared as static.</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> —
specifies the name of the log category. Default to
- the name of the component class. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="logger-annotation">
+ <term>
+ <literal>@Logger</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Logger("categoryName")]]></programlisting>
+ <para>
+ Specifies that a component field is to be injected with an
+ instance of <literal>org.jboss.seam.log.Log</literal>. For
+ entity beans, the field must be declared as static.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — specifies the
name of
+ the log category. Default to the name of the component
+ class.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para> The last annotation lets you inject a request parameter value:
</para>
+ <para>
+ The last annotation lets you inject a request parameter value:
+ </para>
- <variablelist >
- <varlistentry id="requestparameter-annotation">
- <term>
- <literal>@RequestParameter</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@RequestParameter("parameterName")]]></programlisting>
- <para> Specifies that a component attribute is to be injected
with the value of a request parameter.
- Basic type conversions are performed automatically.
</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> —
specifies the name of the request parameter.
- Default to the name of the component attribute.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="requestparameter-annotation">
+ <term>
+ <literal>@RequestParameter</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@RequestParameter("parameterName")]]></programlisting>
+ <para>
+ Specifies that a component attribute is to be injected with the
+ value of a request parameter. Basic type conversions are
+ performed automatically.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — specifies the
name of
+ the request parameter. Default to the name of the
+ component attribute.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </section>
+ </section>
- <section>
- <title>Annotations for component lifecycle methods</title>
- <para> These annotations allow a component to react to its own lifecycle
events. They occur on methods of the
- component. There may be only one of each per component class. </para>
+ <section>
+ <title>Annotations for component lifecycle methods</title>
+ <para>
+ These annotations allow a component to react to its own lifecycle
+ events. They occur on methods of the component. There may be only one
+ of each per component class.
+ </para>
- <variablelist >
- <varlistentry id="create-annotation">
- <term>
- <literal>@Create</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Create]]></programlisting>
- <para> Specifies that the method should be called when an
instance of the component is instantiated
- by Seam. Note that create methods are only supported for
JavaBeans and stateful session beans.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry id="destroy-annotation">
- <term>
- <literal>@Destroy</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Destroy]]></programlisting>
- <para> Specifies that the method should be called when the
context ends and its context variables
- are destroyed. Note that destroy methods are only supported for
JavaBeans and stateful session
- beans. </para>
- <para> Destroy methods should be used only for cleanup.
<emphasis>Seam catches, logs and swallows
- any exception that propagates out of a destroy
method.</emphasis>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry id="observer-annotation">
- <term>
- <literal>@Observer</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Observer("somethingChanged")]]></programlisting>
- <para> Specifies that the method should be called when a
component-driven event of the specified
- type occurs. </para>
-
<programlisting><![CDATA[@Observer(value="somethingChanged",create=false)]]></programlisting>
- <para>Specifies that the method should be called when an event
of the specified type occurs but
- that an instance should not be created if one doesn't exist.
If an instance does not exist
- and create is false, the event will not be observed. The default
value for create is true.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="create-annotation">
+ <term>
+ <literal>@Create</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Create]]></programlisting>
+ <para>
+ Specifies that the method should be called when an instance of
+ the component is instantiated by Seam. Note that create
+ methods are only supported for JavaBeans and stateful session
+ beans.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="destroy-annotation">
+ <term>
+ <literal>@Destroy</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Destroy]]></programlisting>
+ <para>
+ Specifies that the method should be called when the context
+ ends and its context variables are destroyed. Note that
+ destroy methods are only supported for JavaBeans and stateful session
+ beans.
+ </para>
+ <para>
+ Destroy methods should be used only for cleanup.
+ <emphasis>Seam catches, logs and swallows any exception that
+ propagates out of a destroy method.</emphasis>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="observer-annotation">
+ <term>
+ <literal>@Observer</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Observer("somethingChanged")]]></programlisting>
+ <para>
+ Specifies that the method should be called when a
+ component-driven event of the specified type occurs.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Observer(value="somethingChanged",create=false)]]></programlisting>
+ <para>
+ Specifies that the method should be called when an event of
+ the specified type occurs but that an instance should not be
+ created if one doesn't exist. If an instance does not exist
+ and create is false, the event will not be observed. The
+ default value for create is true.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </section>
+ </section>
- <section>
- <title>Annotations for context demarcation</title>
- <para> These annotations provide declarative conversation demarcation. They
appear on methods of Seam
- components, usually action listener methods. </para>
+ <section>
+ <title>Annotations for context demarcation</title>
+ <para>
+ These annotations provide declarative conversation demarcation. They
+ appear on methods of Seam components, usually action listener methods.
+ </para>
- <para> Every web request has a conversation context associated with it.
Most of these conversations end at the
- end of the request. If you want a conversation that span multiple requests,
you must "promote" the current
- conversation to a <emphasis>long-running conversation</emphasis>
by calling a method marked with
- <literal>@Begin</literal>. </para>
+ <para>
+ Every web request has a conversation context associated with it. Most
+ of these conversations end at the end of the request. If you want a
+ conversation that span multiple requests, you must "promote" the
+ current conversation to a <emphasis>long-running
conversation</emphasis>
+ by calling a method marked with <literal>@Begin</literal>.
+ </para>
-<para>
- <orderedlist id="begin-annotation">
- <listitem>
- <para><literal>@Begin</literal></para>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[@Begin]]></programlisting>
- Specifies that a long-running conversation begins when this method
returns a non-null outcome without exception.
- </para>
- </listitem>
-
- <listitem>
- <para>
-
<programlisting><![CDATA[@Begin(join=true)]]></programlisting>
- Specifies that if a long-running conversation is already in
progress, the conversation context is simply propagated.
- </para>
- </listitem>
- <listitem>
-<para><programlisting><![CDATA[@Begin(nested=true)]]></programlisting>
- Specifies that if a long-running conversation is already in
progress, a new
- <emphasis>nested</emphasis> conversation context
begins. The nested conversation will end when the next <literal>@End</literal>
is encountered, and the outer conversation will resume. It is perfectly legal for multiple
nested conversations to exist concurrently in the same outer conversation. </para>
- </listitem>
- <listitem>
-<para><programlisting><![CDATA[@Begin(pageflow="process definition
name")]]></programlisting>
- Specifies a jBPM process definition name that defines the pageflow
for this conversation.
- </para>
- </listitem>
- <listitem>
-<para><programlisting><![CDATA[(a)Begin(flushMode=FlushModeType.MANUAL)]]></programlisting>
- Specify the flush mode of any Seam-managed persistence contexts.
<literal>flushMode=FlushModeType.MANUAL</literal> supports the use of
<emphasis>atomic conversations</emphasis> where all write operations are
queued in the conversation context until an explicit call to
<literal>flush()</literal> (which usually occurs at the end of the
- conversation).
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
-</orderedlist>
+ <variablelist id="begin-annotation">
+ <varlistentry>
+ <term>
+ <literal>@Begin</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Begin]]></programlisting>
+ <para>
+ Specifies that a long-running conversation begins when this
+ method returns a non-null outcome without exception.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Begin(join=true)]]></programlisting>
+ <para>
+ Specifies that if a long-running conversation is already in
+ progress, the conversation context is simply propagated.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Begin(nested=true)]]></programlisting>
+ <para>
+ Specifies that if a long-running conversation is already in
+ progress, a new <emphasis>nested</emphasis> conversation
+ context begins. The nested conversation will end when the next
+ <literal>@End</literal> is encountered, and the outer
+ conversation will resume. It is perfectly legal for multiple
+ nested conversations to exist concurrently in the same outer
+ conversation.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Begin(pageflow="process definition
name")]]></programlisting>
+ <para>
+ Specifies a jBPM process definition name that defines the
+ pageflow for this conversation.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Begin(flushMode=FlushModeType.MANUAL)]]></programlisting>
+ <para>
+ Specify the flush mode of any Seam-managed persistence
+ contexts. <literal>flushMode=FlushModeType.MANUAL</literal>
+ supports the use of <emphasis>atomic
conversations</emphasis>
+ where all write operations are queued in the conversation
+ context until an explicit call to
<literal>flush()</literal>
+ (which usually occurs at the end of the conversation).
+ </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>join</literal> —
determines the behavior when a long-running
- conversation is already in progress. If
<literal>true</literal>, the context is
- propagated. If <literal>false</literal>, an
exception is thrown. Default to
- <literal>false</literal>. This setting is
ignored when
- <literal>nested=true</literal> is specified
</para>
- </listitem>
- <listitem>
- <para>
- <literal>nested</literal> —
specifies that a nested conversation should be
- started if a long-running conversation is already in
progress. </para>
- </listitem>
- <listitem>
- <para>
- <literal>flushMode</literal> — set
the flush mode of any Seam-managed
- Hibernate sessions or JPA persistence contexts that are
created during this
- conversation. </para>
- </listitem>
- <listitem>
- <para>
- <literal>pageflow</literal> — a
process definition name of a jBPM process
- definition deployed via
<literal>org.jboss.seam.bpm.jbpm.pageflowDefinitions.</literal>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- <variablelist>
- <varlistentry id="end-annotation">
- <term>
- <literal>@End</literal>
- </term>
- <listitem>
- <para>
-<programlisting><![CDATA[@End]]></programlisting>
- Specifies that a long-running conversation ends when this method
returns a non-null outcome without exception.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>beforeRedirect</literal> —
by default, the conversation will not
- actually be destroyed until after any redirect has
occurred. Setting
- <literal>beforeRedirect=true</literal>
specifies that the conversation should be
- destroyed at the end of the current request, and that the
redirect will be processed in
- a new temporary conversation context. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="starttask-annotation">
- <term>
- <literal>@StartTask</literal>
- </term>
- <listitem>
- <para>
- <programlisting><![CDATA[@StartTask]]></programlisting>
- "Starts" a jBPM task. Specifies that a long-running
conversation begins when this method
- returns a non-null outcome without exception. This conversation
is associated with the jBPM task
- specified in the named request parameter. Within the context of
this conversation, a business
- process context is also defined, for the business process
instance of the task instance. </para>
- <itemizedlist>
- <listitem>
- <para> The jBPM <literal>TaskInstance</literal> will be available in
a request context variable
- named <literal>taskInstance</literal>. The jPBM
<literal>ProcessInstance</literal> will be
- available in a request context variable named
<literal>processInstance</literal>. (Of course,
- these objects are available for injection via
<literal>@In</literal>.) </para>
- </listitem>
- <listitem>
- <para>
- <literal>taskIdParameter</literal>
— the name of a request parameter which
- holds the id of the task. Default to
<literal>"taskId"</literal>, which is also the
- default used by the Seam
<literal>taskList</literal> JSF component. </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>join</literal> — determines the
behavior
+ when a long-running conversation is already in progress.
+ If <literal>true</literal>, the context is
propagated.
+ If <literal>false</literal>, an exception is thrown.
+ Default to <literal>false</literal>. This setting is
+ ignored when <literal>nested=true</literal> is
+ specified.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>nested</literal> — specifies that
a
+ nested conversation should be started if a long-running
+ conversation is already in progress.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>flushMode</literal> — set the
flush mode
+ of any Seam-managed Hibernate sessions or JPA
+ persistence contexts that are created during this
+ conversation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>pageflow</literal> — a process
definition
+ name of a jBPM process definition deployed via
+
<literal>org.jboss.seam.bpm.jbpm.pageflowDefinitions.</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="end-annotation">
+ <term>
+ <literal>@End</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@End]]></programlisting>
+ <para>
+ Specifies that a long-running conversation ends when this
+ method returns a non-null outcome without exception.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>beforeRedirect</literal> — by
default,
+ the conversation will not actually be destroyed until
+ after any redirect has occurred. Setting
+ <literal>beforeRedirect=true</literal> specifies
that
+ the conversation should be destroyed at the end of
+ the current request, and that the redirect will be
+ processed in a new temporary conversation context.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="starttask-annotation">
+ <term>
+ <literal>@StartTask</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@StartTask]]></programlisting>
+ <para>
+ "Starts" a jBPM task. Specifies that a long-running
+ conversation begins when this method returns a non-null
+ outcome without exception. This conversation is associated
+ with the jBPM task specified in the named request
+ parameter. Within the context of this conversation, a
+ business process context is also defined, for the business
+ process instance of the task instance.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The jBPM <literal>TaskInstance</literal> will be
+ available in a request context variable named
+ <literal>taskInstance</literal>. The jPBM
+ <literal>ProcessInstance</literal> will be available
+ in a request context variable named
+ <literal>processInstance</literal>. (Of course, these
+ objects are available for injection via
+ <literal>@In</literal>.)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>taskIdParameter</literal> — the
name
+ of a request parameter which holds the id of the
+ task. Default to
<literal>"taskId"</literal>, which
+ is also the default used by the Seam
+ <literal>taskList</literal> JSF component.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>flushMode</literal> — set the
flush
+ mode of any Seam-managed Hibernate sessions or JPA
+ persistence contexts that are created during this
+ conversation.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="begintask-annotation">
+ <term>
+ <literal>@BeginTask</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@BeginTask]]></programlisting>
+ <para>
+ Resumes work on an incomplete jBPM task. Specifies that a
+ long-running conversation begins when this method returns a
+ non-null outcome without exception. This conversation is
+ associated with the jBPM task specified in the named
+ request parameter. Within the context of this conversation,
+ a business process context is also defined, for the
+ business process instance of the task instance.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The jBPM
<literal>org.jbpm.taskmgmt.exe.TaskInstance</literal>
+ will be available in a request context variable named
+ <literal>taskInstance</literal>. The jPBM
+ <literal>org.jbpm.graph.exe.ProcessInstance</literal>
+ will be available in a request context variable named
+ <literal>processInstance</literal>.
+ </para>
</listitem>
<listitem>
- <para>
- <literal>flushMode</literal> — set
the flush mode of any Seam-managed
- Hibernate sessions or JPA persistence contexts that are
created during this conversation.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
+ <para>
+ <literal>taskIdParameter</literal> — the
name
+ of a request parameter which holds the id of the
+ task. Default to
<literal>"taskId"</literal>, which
+ is also the default used by the Seam
+ <literal>taskList</literal> JSF component.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>flushMode</literal> — set the
flush
+ mode of any Seam-managed Hibernate sessions or JPA
+ persistence contexts that are created during this
+ conversation.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="endtask-annotation">
+ <term>
+ <literal>@EndTask</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@EndTask]]></programlisting>
+ <para>
+ "Ends" a jBPM task. Specifies that a long-running
+ conversation ends when this method returns a non-null
+ outcome, and that the current task is complete. Triggers a
+ jBPM transition. The actual transition triggered will be
+ the default transition unless the application has called
+ <literal>Transition.setName()</literal> on the built-in
+ component named <literal>transition</literal>.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@EndTask(transition="transitionName")]]></programlisting>
+ <para>
+ Triggers the given jBPM transition.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>transition</literal> — the name of
the
+ jBPM transition to be triggered when ending the task.
+ Defaults to the default transition.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>beforeRedirect</literal> — by
default,
+ the conversation will not actually be destroyed until
+ after any redirect has occurred. Setting
+ <literal>beforeRedirect=true</literal> specifies
that
+ the conversation should be destroyed at the end of
+ the current request, and that the redirect will be
+ processed in a new temporary conversation context.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="createprocess-annotation">
+ <term>
+ <literal>@CreateProcess</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@CreateProcess(definition="process definition
name")]]></programlisting>
+ <para>
+ Creates a new jBPM process instance when the method returns
+ a non-null outcome without exception. The
+ <literal>ProcessInstance</literal> object will be
available
+ in a context variable named
+ <literal>processInstance</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>definition</literal> — the name
of the
+ jBPM process definition deployed via
+
<literal>org.jboss.seam.bpm.jbpm.processDefinitions</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="resumeprocess-annotation">
+ <term>
+ <literal>@ResumeProcess</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@ResumeProcess(processIdParameter="processId")]]></programlisting>
+ <para>
+ Re-enters the scope of an existing jBPM process instance
+ when the method returns a non-null outcome without
+ exception. The <literal>ProcessInstance</literal> object
+ will be available in a context variable named
+ <literal>processInstance</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>processIdParameter</literal> — the
name
+ a request parameter holding the process id. Default to
+ <literal>"processId"</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
- <varlistentry id="begintask-annotation">
- <term>
- <literal>@BeginTask</literal>
- </term>
- <listitem>
- <para>
- <programlisting><![CDATA[@BeginTask]]></programlisting>
- Resumes work on an incomplete jBPM task. Specifies that a
long-running conversation begins
- when this method returns a non-null outcome without exception.
This conversation is associated
- with the jBPM task specified in the named request parameter.
Within the context of this
- conversation, a business process context is also defined, for the
business process instance of
- the task instance. </para>
- <itemizedlist>
- <listitem>
- <para> The jBPM
<literal>org.jbpm.taskmgmt.exe.TaskInstance</literal> will be available in a
request
- context variable named
<literal>taskInstance</literal>. The jPBM
- <literal>org.jbpm.graph.exe.ProcessInstance</literal>
will be available in a request context
- variable named <literal>processInstance</literal>.
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>taskIdParameter</literal>
— the name of a request parameter which
- holds the id of the task. Default to
<literal>"taskId"</literal>, which is also the
- default used by the Seam
<literal>taskList</literal> JSF component. </para>
- </listitem>
- <listitem>
- <para>
- <literal>flushMode</literal> — set
the flush mode of any Seam-managed
- Hibernate sessions or JPA persistence contexts that are
created during this
- conversation. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="endtask-annotation">
- <term>
- <literal>@EndTask</literal>
- </term>
- <listitem>
-<para> <programlisting><![CDATA[@EndTask]]></programlisting>
- "Ends" a jBPM task. Specifies that a long-running
conversation ends when this method returns
- a non-null outcome, and that the current task is complete.
Triggers a jBPM transition. The
- actual transition triggered will be the default transition unless
the application has called
- <literal>Transition.setName()</literal> on the
built-in component named
- <literal>transition</literal>. </para>
-
- <itemizedlist>
- <listitem>
- <para>
-<programlisting><![CDATA[@EndTask(transition="transitionName")]]></programlisting>
- Triggers the given jBPM transition. </para>
- </listitem>
- <listitem>
- <para>
- <literal>transition</literal> — the
name of the jBPM transition to be
- triggered when ending the task. Defaults to the default
transition. </para>
- </listitem>
- <listitem>
- <para>
- <literal>beforeRedirect</literal> —
by default, the conversation will not
- actually be destroyed until after any redirect has
occurred. Setting
- <literal>beforeRedirect=true</literal>
specifies that the conversation should be
- destroyed at the end of the current request, and that the
redirect will be processed in
- a new temporary conversation context. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="createprocess-annotation">
- <term>
- <literal>@CreateProcess</literal>
- </term>
- <listitem>
-<para><programlisting><![CDATA[@CreateProcess(definition="process
definition name")]]></programlisting>
- Creates a new jBPM process instance when the method returns a
non-null outcome without
- exception. The <literal>ProcessInstance</literal>
object will be available in a context variable
- named <literal>processInstance</literal>.
</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>definition</literal> — the
name of the jBPM process definition
- deployed via
<literal>org.jboss.seam.bpm.jbpm.processDefinitions</literal>. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="resumeprocess-annotation">
- <term>
- <literal>@ResumeProcess</literal>
- </term>
- <listitem>
-<para><programlisting><![CDATA[@ResumeProcess(processIdParameter="processId")]]></programlisting>
- Re-enters the scope of an existing jBPM process instance when the
method returns a non-null
- outcome without exception. The
<literal>ProcessInstance</literal> object will be available in a
- context variable named
<literal>processInstance</literal>. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>processIdParameter</literal>
— the name a request parameter holding
- the process id. Default to
<literal>"processId"</literal>. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
-
- <varlistentry id="transition-annotation">
- <term><literal>@Transition</literal></term>
- <listitem>
-
<para><programlisting><![CDATA[@Transition("cancel")]]></programlisting>
-
- Marks a method as signalling a transition in the current jBPM
process instance
- whenever the method returns a non-null result.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-</para>
- </section>
+ <varlistentry id="transition-annotation">
+ <term>
+ <literal>@Transition</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Transition("cancel")]]></programlisting>
+ <para>
+ Marks a method as signalling a transition in the current jBPM
+ process instance whenever the method returns a non-null
+ result.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <section>
- <title>Annotations for use with Seam JavaBean components in a J2EE
environment</title>
- <para> Seam provides an annotation that lets you force a rollback of the
JTA transaction for certain action
- listener outcomes. </para>
+ <section>
+ <title>Annotations for use with Seam JavaBean components in a J2EE
environment</title>
+ <para>
+ Seam provides an annotation that lets you force a rollback of the JTA
+ transaction for certain action listener outcomes.
+ </para>
- <variablelist>
- <varlistentry id="transactional-annotation">
- <term>
- <literal>@Transactional</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Transactional]]></programlisting>
- <para> Specifies that a JavaBean component should have a
similar transactional behavior to the
- default behavior of a session bean component. ie. method
invocations should take place in a
- transaction, and if no transaction exists when the method is
called, a transaction will be
- started just for that method. This annotation may be applied at
either class or method level.
- </para>
- <para>
- <emphasis>Do not use this annotation on EJB 3.0 components,
use <literal>@TransactionAttribute</literal>!</emphasis>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>@ApplicationException</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@ApplicationException]]></programlisting>
- <para>
- Synonym for javax.ejb.ApplicationException, for use in a
- pre Java EE 5 environment. Applied to an exception to
- denote that it is an application exception and should be
- reported to the client directly(i.e., unwrapped).
- </para>
- <para>
- <emphasis>Do not use this
- annotation on EJB 3.0 components, use
- <literal>(a)javax.ejb.ApplicationException</literal>
instead</emphasis>.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>rollback</literal> — by
default
- <literal>false</literal>, if
<literal>true</literal>
- this exception should set the transaction to
- rollback only
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>end</literal> — by default
- <literal>false</literal>, if
<literal>true</literal>
- this exception should end the current
- long-running conversation
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>@Interceptors</literal>
- </term>
- <listitem>
- <programlisting><![CDATA[@Interceptors({DVDInterceptor,
CDInterceptor})]]></programlisting>
- <para>
- Synonym for javax.interceptors.Interceptors, for use in
- a pre Java EE 5 environment. Note that this may only be
- used as a meta-annotation. Declares an ordered list of
- interceptors for a class or method.
- </para>
- <para>
- <emphasis>Do not use this
- annotations on EJB 3.0 components, use
- <literal>(a)javax.interceptor.Interceptors</literal>
instead</emphasis>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="transactional-annotation">
+ <term>
+ <literal>@Transactional</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Transactional]]></programlisting>
+ <para>
+ Specifies that a JavaBean component should have a similar
+ transactional behavior to the default behavior of a session
+ bean component. ie. method invocations should take place in a
+ transaction, and if no transaction exists when the method is
+ called, a transaction will be started just for that method.
+ This annotation may be applied at either class or method level.
+ </para>
+ <para>
+ <emphasis>Do not use this annotation on EJB 3.0 components,
+ use
<literal>@TransactionAttribute</literal>!</emphasis>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>@ApplicationException</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@ApplicationException]]></programlisting>
+ <para>
+ Synonym for javax.ejb.ApplicationException, for use in a pre
+ Java EE 5 environment. Applied to an exception to denote that
+ it is an application exception and should be reported to the
+ client directly(i.e., unwrapped).
+ </para>
+ <para>
+ <emphasis>Do not use this annotation on EJB 3.0 components,
+ use <literal>(a)javax.ejb.ApplicationException</literal>
+ instead</emphasis>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>rollback</literal> — by default
+ <literal>false</literal>, if
<literal>true</literal>
+ this exception should set the transaction to rollback
+ only
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>end</literal> — by default
+ <literal>false</literal>, if
<literal>true</literal> this
+ exception should end the current long-running
+ conversation
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>@Interceptors</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Interceptors({DVDInterceptor,
CDInterceptor})]]></programlisting>
+ <para>
+ Synonym for javax.interceptors.Interceptors, for use in a pre
+ Java EE 5 environment. Note that this may only be used as a
+ meta-annotation. Declares an ordered list of interceptors for
+ a class or method.
+ </para>
+ <para>
+ <emphasis>Do not use this annotations on EJB 3.0 components,
+ use <literal>(a)javax.interceptor.Interceptors</literal>
+ instead</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- <para>
- These annotations are mostly useful for JavaBean Seam components. If you use
EJB 3.0 components, you
- should use the standard Java EE5 annotation.
- </para>
- </section>
+ <para>
+ These annotations are mostly useful for JavaBean Seam components. If
+ you use EJB 3.0 components, you should use the standard Java EE5
+ annotation.
+ </para>
+ </section>
- <section>
- <title>Annotations for exceptions</title>
+ <section>
+ <title>Annotations for exceptions</title>
- <para> These annotations let you specify how Seam should handle an
exception that propagates out of a Seam
- component. </para>
+ <para>
+ These annotations let you specify how Seam should handle an exception
+ that propagates out of a Seam component.
+ </para>
- <variablelist>
- <varlistentry id="redirect-annotation">
- <term>
- <literal>@Redirect</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[(a)Redirect(viewId="error.jsp")]]></programlisting>
- <para> Specifies that the annotated exception causes a browser
redirect to a specified view id. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>viewId</literal> —
specifies the JSF view id to redirect to. You can use
- EL here. </para>
- </listitem>
- <listitem>
- <para>
- <literal>message</literal> — a
message to be displayed, default to the
- exception message. </para>
- </listitem>
- <listitem>
- <para>
- <literal>end</literal> — specifies
that the long-running conversation should
- end, default to <literal>false</literal>.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="httperror-annotation">
- <term>
- <literal>@HttpError</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@HttpError(errorCode=404)]]></programlisting>
- <para> Specifies that the annotated exception causes a HTTP
error to be sent. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>errorCode</literal> — the
HTTP error code, default to
- <literal>500</literal>. </para>
- </listitem>
- <listitem>
- <para>
- <literal>message</literal> — a
message to be sent with the HTTP error, default
- to the exception message. </para>
- </listitem>
- <listitem>
- <para>
- <literal>end</literal> — specifies
that the long-running conversation should
- end, default to <literal>false</literal>.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <varlistentry id="redirect-annotation">
+ <term>
+ <literal>@Redirect</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[(a)Redirect(viewId="error.jsp")]]></programlisting>
+ <para>
+ Specifies that the annotated exception causes a browser
+ redirect to a specified view id.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>viewId</literal> — specifies the
JSF view
+ id to redirect to. You can use EL here.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>message</literal> — a message to
be
+ displayed, default to the exception message.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>end</literal> — specifies that the
+ long-running conversation should end, default to
+ <literal>false</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="httperror-annotation">
+ <term>
+ <literal>@HttpError</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@HttpError(errorCode=404)]]></programlisting>
+ <para>
+ Specifies that the annotated exception causes a HTTP error to
+ be sent.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>errorCode</literal> — the HTTP
error
+ code, default to <literal>500</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>message</literal> — a message to
be sent
+ with the HTTP error, default to the exception message.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>end</literal> — specifies that the
+ long-running conversation should end, default to
+ <literal>false</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <section>
- <title>Annotations for Seam Remoting</title>
- <para> Seam Remoting requires that the local interface of a session bean be
annotated with the following
- annotation: </para>
+ <section>
+ <title>Annotations for Seam Remoting</title>
+ <para>
+ Seam Remoting requires that the local interface of a session bean be
+ annotated with the following annotation:
+ </para>
- <variablelist>
- <varlistentry id="webremote-annotation">
- <term>
- <literal>@WebRemote</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[(a)WebRemote(exclude="path.to.exclude")]]></programlisting>
- <para> Indicates that the annotated method may be called from
client-side JavaScript. The
- <literal>exclude</literal> property is optional
and allows objects to be excluded from the
- result's object graph (see the Remoting chapter for more
details). </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="webremote-annotation">
+ <term>
+ <literal>@WebRemote</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[(a)WebRemote(exclude="path.to.exclude")]]></programlisting>
+ <para>
+ Indicates that the annotated method may be called from
+ client-side JavaScript. The <literal>exclude</literal>
+ property is optional and allows objects to be excluded from
+ the result's object graph (see the Remoting chapter for more
+ details).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </section>
+ </section>
- <section>
- <title>Annotations for Seam interceptors</title>
- <para> The following annotations appear on Seam interceptor classes.
</para>
- <para> Please refer to the documentation for the EJB 3.0 specification for
information about the annotations
- required for EJB interceptor definition. </para>
+ <section>
+ <title>Annotations for Seam interceptors</title>
+ <para>
+ The following annotations appear on Seam interceptor classes.
+ </para>
+ <para>
+ Please refer to the documentation for the EJB 3.0 specification for
+ information about the annotations required for EJB interceptor definition.
+ </para>
- <variablelist>
- <varlistentry id="interceptor-annotation">
- <term>
- <literal>@Interceptor</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Interceptor(stateless=true)]]></programlisting>
- <para> Specifies that this interceptor is stateless and Seam
may optimize replication. </para>
- <itemizedlist>
- <listitem>
-
<programlisting><![CDATA[@Interceptor(type=CLIENT)]]></programlisting>
- <para> Specifies that this interceptor is a
"client-side" interceptor that is called before the EJB
- container. </para>
- </listitem>
- <listitem>
-
<programlisting><![CDATA[(a)Interceptor(around={SomeInterceptor.class,
OtherInterceptor.class})]]></programlisting>
- <para> Specifies that this interceptor is positioned higher in
the stack than the given
- interceptors. </para>
- </listitem>
- <listitem>
-
<programlisting><![CDATA[(a)Interceptor(within={SomeInterceptor.class,
OtherInterceptor.class})]]></programlisting>
- <para> Specifies that this interceptor is positioned deeper in
the stack than the given
- interceptors. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ <variablelist>
+ <varlistentry id="interceptor-annotation">
+ <term>
+ <literal>@Interceptor</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Interceptor(stateless=true)]]></programlisting>
+ <para>
+ Specifies that this interceptor is stateless and Seam may
+ optimize replication.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Interceptor(type=CLIENT)]]></programlisting>
+ <para>
+ Specifies that this interceptor is a "client-side"
+ interceptor that is called before the EJB container.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Interceptor(around={SomeInterceptor.class,
OtherInterceptor.class})]]></programlisting>
+ <para>
+ Specifies that this interceptor is positioned higher in
+ the stack than the given interceptors.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[(a)Interceptor(within={SomeInterceptor.class,
OtherInterceptor.class})]]></programlisting>
+ <para>
+ Specifies that this interceptor is positioned deeper in
+ the stack than the given interceptors.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </section>
+ </section>
- <section>
- <title>Annotations for asynchronicity</title>
- <para> The following annotations are used to declare an asynchronous
method, for example: </para>
+ <section>
+ <title>Annotations for asynchronicity</title>
+ <para>
+ The following annotations are used to declare an asynchronous method,
+ for example:
+ </para>
- <programlisting><![CDATA[@Asynchronous public void scheduleAlert(Alert
alert, @Expiration Date date) { ... }]]></programlisting>
- <programlisting><![CDATA[@Asynchronous public Timer scheduleAlerts(Alert
alert,
- @Expiration Date date,
- @IntervalDuration long interval) { ...
}]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@Asynchronous public void
scheduleAlert(Alert alert, @Expiration Date date) { ... }]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@Asynchronous public Timer
scheduleAlerts(Alert alert,
+ @Expiration Date date,
+ @IntervalDuration long interval) { ... }]]></programlisting>
- <variablelist>
- <varlistentry id="asynchronous-annotation">
- <term>
- <literal>@Asynchronous</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Asynchronous]]></programlisting>
- <para> Specifies that the method call is processed
asynchronously. </para>
- </listitem>
+ <variablelist>
+ <varlistentry id="asynchronous-annotation">
+ <term>
+ <literal>@Asynchronous</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Asynchronous]]></programlisting>
+ <para>
+ Specifies that the method call is processed asynchronously.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="duration-annotation">
+ <term>
+ <literal>@Duration</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Duration]]></programlisting>
+ <para>
+ Specifies that a parameter of the asynchronous call is the
+ duration before the call is processed (or first processed for
+ recurring calls).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="expiration-annotation">
+ <term>
+ <literal>@Expiration</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Expiration]]></programlisting>
+ <para>
+ Specifies that a parameter of the asynchronous call is the
+ datetime at which the call is processed (or first processed
+ for recurring calls).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="intervalduration-annotation">
+ <term>
+ <literal>@IntervalDuration</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@IntervalDuration]]></programlisting>
+ <para>
+ Specifies that an asynchronous method call recurs, and that
+ the annotationed parameter is duration between recurrences.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+
+ <section>
+ <title>Annotations for use with JSF</title>
+ <para>
+ The following annotations make working with JSF easier.
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ <literal>@Converter</literal>
+ </term>
+ <listitem>
+ <para>
+ Allows a Seam component to act as a JSF converter. The
+ annotated class must be a Seam component, and must
+ implement
<literal>javax.faces.convert.Converter</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>id</literal> — the JSF
converter id.
+ Defaults to the component name.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>forClass</literal> — if
specified,
+ register this component as the default converter for
+ a type.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
</varlistentry>
- <varlistentry id="duration-annotation">
- <term>
- <literal>@Duration</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Duration]]></programlisting>
- <para> Specifies that a parameter of the asynchronous call is
the duration before the call is
- processed (or first processed for recurring calls).
</para>
- </listitem>
+ <varlistentry>
+ <term>
+ <literal>@Validator</literal>
+ </term>
+ <listitem>
+ <para>
+ Allows a Seam component to act as a JSF validator. The
+ annotated class must be a Seam component, and must
+ implement
<literal>javax.faces.validator.Validator</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>id</literal> — the JSF
validator id.
+ Defaults to the component name.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
</varlistentry>
- <varlistentry id="expiration-annotation">
- <term>
- <literal>@Expiration</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Expiration]]></programlisting>
- <para> Specifies that a parameter of the asynchronous call is
the datetime at which the call is
- processed (or first processed for recurring calls).
</para>
- </listitem>
- </varlistentry>
- <varlistentry id="intervalduration-annotation">
- <term>
- <literal>@IntervalDuration</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@IntervalDuration]]></programlisting>
- <para> Specifies that an asynchronous method call recurs, and
that the annotationed parameter is
- duration between recurrences. </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
-
- <section>
- <title>Annotations for use with JSF</title>
- <para>
- The following annotations make working with JSF easier.
- </para>
-
- <variablelist>
- <varlistentry>
- <term>
- <literal>@Converter</literal>
- </term>
- <listitem>
- <para>
- Allows a Seam component to act as a JSF converter. The annotated
class must be a Seam
- component, and must implement
<literal>javax.faces.convert.Converter</literal>.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>id</literal> — the JSF
converter id. Defaults to the component name.
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>forClass</literal> — if
specified, register this component as the default converter for a type.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>@Validator</literal>
- </term>
- <listitem>
- <para>
- Allows a Seam component to act as a JSF validator. The annotated
class must be a Seam
- component, and must implement
<literal>javax.faces.validator.Validator</literal>.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>id</literal> — the JSF
validator id. Defaults to the component name.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
+ </variablelist>
- <section>
+ <section>
<title>Annotations for use with
<literal>dataTable</literal></title>
- <para> The following annotations make it easy to implement clickable lists
backed by a stateful session bean.
- They appear on attributes. </para>
+ <para>
+ The following annotations make it easy to implement clickable
+ lists backed by a stateful session bean. They appear on
+ attributes.
+ </para>
- <variablelist >
- <varlistentry id="datamodel-annotation">
- <term>
- <literal>@DataModel</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@DataModel("variableName")]]></programlisting>
- <para> Outjects a property of type
<literal>List</literal>, <literal>Map</literal>,
- <literal>Set</literal> or
<literal>Object[]</literal> as a JSF <literal>DataModel</literal>
into
- the scope of the owning component (or the
<literal>EVENT</literal> scope if the owning component
- is <literal>STATELESS</literal>). In the case of
<literal>Map</literal>, each row of the
- <literal>DataModel</literal> is a
<literal>Map.Entry</literal>. </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> — name of
the conversation context variable. Default
- to the attribute name. </para>
- </listitem>
- <listitem>
- <para>
- <literal>scope</literal> — if
<literal>scope=ScopeType.PAGE</literal> is
- explicitly specified, the
<literal>DataModel</literal> will be kept in the
- <literal>PAGE</literal> context.
</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="datamodelselection-annotation">
- <term>
- <literal>@DataModelSelection</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@DataModelSelection]]></programlisting>
- <para>
- Injects the selected value from the JSF
<literal>DataModel</literal> (this is the element of
- the underlying collection, or the map value). If only one
<literal>@DataModel</literal> attribute
- is defined for a component, the selected value from that
<literal>DataModel</literal> will be
- injected. Otherwise, the component name of each
<literal>@DataModel</literal> must be specified
- in the value attribute for each
<literal>@DataModelSelection</literal>.
+ <variablelist>
+ <varlistentry id="datamodel-annotation">
+ <term>
+ <literal>@DataModel</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@DataModel("variableName")]]></programlisting>
+ <para>
+ Outjects a property of type <literal>List</literal>,
+ <literal>Map</literal>,
<literal>Set</literal> or
+ <literal>Object[]</literal> as a JSF
+ <literal>DataModel</literal> into the scope of the
owning
+ component (or the <literal>EVENT</literal> scope if the
+ owning component is <literal>STATELESS</literal>). In
the
+ case of <literal>Map</literal>, each row of the
+ <literal>DataModel</literal> is a
+ <literal>Map.Entry</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — name of the
+ conversation context variable. Default to the
+ attribute name.
</para>
- <para> If <literal>PAGE</literal> scope is
specified on the associated <literal>@DataModel</literal>,
- then, in addition to the DataModel Selection being injected,
the associated DataModel will
- also be injected. In this case, if the property annotated
with <literal>@DataModel</literal> is
- a getter method, then a setter method for the property must
also be part of the Business API of
- the containing Seam Component.</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> — name of
the conversation context variable. Not
- needed if there is exactly one
<literal>@DataModel</literal> in the component. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry id="datamodelselectionindex-annotation">
- <term>
- <literal>@DataModelSelectionIndex</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@DataModelSelectionIndex]]></programlisting>
- <para>
- Exposes the selection index of the JSF
<literal>DataModel</literal> as an attribute of the
- component (this is the row number of the underlying collection, or
the map key). If only one
- <literal>@DataModel</literal> attribute is defined
for a component, the selected value from
- that <literal>DataModel</literal> will be injected.
Otherwise, the component name of each
- <literal>@DataModel</literal> must be specified in
the value attribute for each
- <literal>@DataModelSelectionIndex</literal>.
+ </listitem>
+ <listitem>
+ <para>
+ <literal>scope</literal> — if
+ <literal>scope=ScopeType.PAGE</literal> is
explicitly
+ specified, the <literal>DataModel</literal> will
be
+ kept in the <literal>PAGE</literal> context.
</para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>value</literal> — name of
the conversation context variable. Not
- needed if there is exactly one
<literal>@DataModel</literal> in the component. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
-
- </section>
- </section>
-
- <section>
- <title>Meta-annotations for databinding</title>
- <para> These meta-annotations make it possible to implement similar
functionality to
- <literal>@DataModel</literal> and
<literal>@DataModelSelection</literal> for other datastructures apart from
- lists. </para>
-
- <variablelist >
- <varlistentry id="databinderclass-annotation">
- <term>
- <literal>@DataBinderClass</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[(a)DataBinderClass(DataModelBinder.class)]]></programlisting>
- <para> Specifies that an annotation is a databinding
annotation. </para>
- </listitem>
+ </listitem>
+ </itemizedlist>
+ </listitem>
</varlistentry>
- <varlistentry id="dataselectorclass-annotation">
- <term>
- <literal>@DataSelectorClass</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[(a)DataSelectorClass(DataModelSelector.class)]]></programlisting>
- <para> Specifies that an annotation is a dataselection
annotation. </para>
- </listitem>
+ <varlistentry id="datamodelselection-annotation">
+ <term>
+ <literal>@DataModelSelection</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@DataModelSelection]]></programlisting>
+ <para>
+ Injects the selected value from the JSF
+ <literal>DataModel</literal> (this is the element of the
+ underlying collection, or the map value). If only one
+ <literal>@DataModel</literal> attribute is defined for a
+ component, the selected value from that
+ <literal>DataModel</literal> will be injected.
Otherwise,
+ the component name of each
+ <literal>@DataModel</literal> must be specified in the
+ value attribute for each
+ <literal>@DataModelSelection</literal>.
+ </para>
+ <para>
+ If <literal>PAGE</literal> scope is specified on the
+ associated <literal>@DataModel</literal>, then, in
addition
+ to the DataModel Selection being injected, the associated
+ DataModel will also be injected. In this case, if the
+ property annotated with <literal>@DataModel</literal>
is
+ a getter method, then a setter method for the property must
+ also be part of the Business API of the containing Seam
+ Component.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — name of the
+ conversation context variable. Not needed if there is
+ exactly one <literal>@DataModel</literal> in the
+ component.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
</varlistentry>
- </variablelist>
- </section>
+ <varlistentry id="datamodelselectionindex-annotation">
+ <term>
+ <literal>@DataModelSelectionIndex</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@DataModelSelectionIndex]]></programlisting>
+ <para>
+ Exposes the selection index of the JSF
+ <literal>DataModel</literal> as an attribute of the
+ component (this is the row number of the underlying
+ collection, or the map key). If only one
+ <literal>@DataModel</literal> attribute is defined for a
+ component, the selected value from that
+ <literal>DataModel</literal> will be injected.
Otherwise,
+ the component name of each <literal>@DataModel</literal>
+ must be specified in the value attribute for each
+ <literal>@DataModelSelectionIndex</literal>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>value</literal> — name of the
+ conversation context variable. Not needed if there
+ is exactly one <literal>@DataModel</literal> in
the
+ component.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ </section>
- <section>
- <title>Annotations for packaging</title>
- <para> This annotation provides a mechanism for declaring information about
a set of components that are
- packaged together. It can be applied to any Java package.</para>
+ <section>
+ <title>Meta-annotations for databinding</title>
+ <para>
+ These meta-annotations make it possible to implement similar
+ functionality to <literal>@DataModel</literal> and
+ <literal>@DataModelSelection</literal> for other datastructures
apart
+ from lists.
+ </para>
+ <variablelist >
+ <varlistentry id="databinderclass-annotation">
+ <term>
+ <literal>@DataBinderClass</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[(a)DataBinderClass(DataModelBinder.class)]]></programlisting>
+ <para>
+ Specifies that an annotation is a databinding annotation.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry id="dataselectorclass-annotation">
+ <term>
+ <literal>@DataSelectorClass</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[(a)DataSelectorClass(DataModelSelector.class)]]></programlisting>
+ <para>
+ Specifies that an annotation is a dataselection annotation.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <variablelist >
- <varlistentry id="namespace-annotation">
- <term>
- <literal>@Namespace</literal>
- </term>
- <listitem>
-
<programlisting><![CDATA[@Namespace(value="http://jboss.com/products/seam/example/seampay")]]></programlisting>
- <para> Specifies that components in the current package are
associated with the given namespace. The
- declared namespace can be used as an XML namespace in a
<literal>components.xml</literal> file
- to simplify application configuration.</para>
-
<programlisting><![CDATA[@Namespace(value="http://jboss.com/products/seam/core",
prefix="org.jboss.seam.core")]]></programlisting>
- <para>Specifies a namespace to associate with a given package.
Additionally, it specifies a
- component name prefix to be applied to component names specified
in the XML file. For example,
- an XML element named <literal>init</literal> that is
associated with this namespace
- would be understood to actually refere to a component named
- <literal>org.jboss.seam.core.init</literal>.
</para>
- </listitem>
- </varlistentry>
+ <section>
+ <title>Annotations for packaging</title>
+ <para>
+ This annotation provides a mechanism for declaring information about a
+ set of components that are packaged together. It can be applied to any
+ Java package.
+ </para>
- </variablelist>
- </section>
+ <variablelist>
+ <varlistentry id="namespace-annotation">
+ <term>
+ <literal>@Namespace</literal>
+ </term>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Namespace(value="http://jboss.com/products/seam/example/seampay")]]></programlisting>
+ <para>
+ Specifies that components in the current package are associated
+ with the given namespace. The declared namespace can be used as
+ an XML namespace in a <literal>components.xml</literal>
file to
+ simplify application configuration.
+ </para>
+ <programlisting
role="JAVA"><![CDATA[@Namespace(value="http://jboss.com/products/seam/core",
prefix="org.jboss.seam.core")]]></programlisting>
+ <para>
+ Specifies a namespace to associate with a given package.
+ Additionally, it specifies a component name prefix to be
+ applied to component names specified in the XML file. For
+ example, an XML element named <literal>init</literal> that
is
+ associated with this namespace would be understood to actually
+ refer to a component named
+ <literal>org.jboss.seam.core.init</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
- <section>
- <title>Annotations for integrating with the servlet
container</title>
- <para>These annotations allow you to integrate your Seam components with
the servlet container.</para>
+ <section>
+ <title>Annotations for integrating with the servlet container</title>
+ <para>
+ These annotations allow you to integrate your Seam components with the
+ servlet container.
+ </para>
- <variablelist >
- <varlistentry>
- <term>
- <literal>@Filter</literal>
- </term>
- <listitem>
- <para>
- Use the Seam component (which implements
<literal>javax.servlet.Filter</literal>) annotated with
<literal>@Filter</literal> as a servlet filter. It
- will be executed by Seam's master filter.
- </para>
- <itemizedlist>
- <listitem>
-
<programlisting><![CDATA[@Filter(around={"seamComponent",
"otherSeamComponent"})]]></programlisting>
- <para> Specifies that this filter is positioned higher in the
stack than the given
- filters. </para>
- </listitem>
- <listitem>
-
<programlisting><![CDATA[@Filter(within={"seamComponent",
"otherSeamComponent"})]]></programlisting>
- <para> Specifies that this filter is positioned deeper in the
stack than the given
- filters. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
+ <variablelist >
+ <varlistentry>
+ <term>
+ <literal>@Filter</literal>
+ </term>
+ <listitem>
+ <para>
+ Use the Seam component (which implements
+ <literal>javax.servlet.Filter</literal>) annotated with
+ <literal>@Filter</literal> as a servlet filter. It will
be
+ executed by Seam's master filter.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Filter(around={"seamComponent",
"otherSeamComponent"})]]></programlisting>
+ <para>
+ Specifies that this filter is positioned higher in the
+ stack than the given filters.
+ </para>
+ </listitem>
+ <listitem>
+ <programlisting
role="JAVA"><![CDATA[@Filter(within={"seamComponent",
"otherSeamComponent"})]]></programlisting>
+ <para>
+ Specifies that this filter is positioned deeper in the
+ stack than the given filters.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </variablelist>
+ </section>
- </section>
-
</chapter>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Cache.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Cache.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Cache.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -146,7 +146,7 @@
Now you can inject the cache into any Seam component:
</para>
- <programlisting><![CDATA[@Name("chatroom")
+ <programlisting
role="JAVA"><![CDATA[@Name("chatroom")
public class Chatroom {
@In PojoCache pojoCache;
@@ -173,7 +173,7 @@
use <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<core:pojo-cache name="myCache"
cfg-resource-name="myown/cache.xml"/>]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[<core:pojo-cache
name="myCache"
cfg-resource-name="myown/cache.xml"/>]]></programlisting>
</section>
@@ -194,7 +194,7 @@
blog entries:
</para>
- <programlisting><![CDATA[<s:cache
key="recentEntries-#{blog.id}" region="welcomePageFragments">
+ <programlisting role="XHTML"><![CDATA[<s:cache
key="recentEntries-#{blog.id}" region="welcomePageFragments">
<h:dataTable value="#{blog.recentEntries}" var="blogEntry">
<h:column>
<h3>#{blogEntry.title}</h3>
@@ -219,7 +219,7 @@
blogger posts a new entry). So you need to evict the cached fragment
manually:
</para>
- <programlisting><![CDATA[public void post() {
+ <programlisting role="JAVA"><![CDATA[public void post() {
...
entityManager.persist(blogEntry);
pojoCache.remove("welcomePageFragments", "recentEntries-" +
blog.getId() );
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Components.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Components.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Components.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -35,7 +35,7 @@
session context object injected:
</para>
- <programlisting><![CDATA[@In private Context
sessionContext;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@In private Context
sessionContext;]]></programlisting>
<variablelist >
<varlistentry>
@@ -1343,7 +1343,7 @@
<literal>components.xml</literal> install and configure two Seam
components:
</para>
- <programlisting><![CDATA[<component name="bookingDatabase"
+ <programlisting role="XML"><![CDATA[<component
name="bookingDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property
name="persistenceUnitJndiName">java:/comp/emf/bookingPersistence</property>
</component>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Concepts.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Concepts.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Concepts.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -195,13 +195,13 @@
access to several thread-bound instances of the
<literal>Context</literal> interface:
</para>
- <programlisting><![CDATA[User user = (User)
Contexts.getSessionContext().get("user");]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[User user = (User)
Contexts.getSessionContext().get("user");]]></programlisting>
<para>
You may also set or change the value associated with a name:
</para>
-
<programlisting><![CDATA[Contexts.getSessionContext().set("user",
user);]]></programlisting>
+ <programlisting
role="JAVA"><![CDATA[Contexts.getSessionContext().set("user",
user);]]></programlisting>
<para>
Usually, however, we obtain components from a context via injection, and
put component instances into
@@ -453,7 +453,7 @@
session bean component. We could use an annotation, as follows:
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Interceptors(SeamInterceptor.class)
public class LoginAction implements Login {
...
@@ -463,7 +463,7 @@
But a much better way is to define the interceptor in
<literal>ejb-jar.xml</literal>.
</para>
- <programlisting><![CDATA[<interceptors>
+ <programlisting role="XML"><![CDATA[<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
@@ -485,7 +485,7 @@
<literal>@Name</literal> annotation:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
...
@@ -520,7 +520,7 @@
For very large applications, and for built-in seam components, qualified
names are often used.
</para>
-
<programlisting><![CDATA[(a)Name("com.jboss.myapp.loginAction")
+ <programlisting
role="JAVA"><![CDATA[(a)Name("com.jboss.myapp.loginAction")
@Stateless
public class LoginAction implements Login {
...
@@ -530,7 +530,7 @@
We may use the qualified component name both in Java code and in
JSF's expression language:
</para>
- <programlisting><![CDATA[<h:commandButton type="submit"
value="Login"
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
type="submit" value="Login"
action="#{com.jboss.myapp.loginAction.login}"/>]]></programlisting>
<para>
@@ -538,7 +538,7 @@
line like this to the <literal>components.xml</literal> file:
</para>
- <programlisting><![CDATA[<factory name="loginAction"
scope="STATELESS"
value="#{com.jboss.myapp.loginAction}"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<factory
name="loginAction" scope="STATELESS"
value="#{com.jboss.myapp.loginAction}"/>]]></programlisting>
<para>
All of the built-in Seam components have qualified names, but most of
them are aliased to a simple
@@ -555,7 +555,7 @@
by Seam.
</para>
- <programlisting><![CDATA[@Name("user")
+ <programlisting
role="JAVA"><![CDATA[@Name("user")
@Entity
@Scope(SESSION)
public class User {
@@ -580,7 +580,7 @@
us do it at the class level, and take advantage of auto-instantiation.)
</para>
- <programlisting><![CDATA[@Name("user")
+ <programlisting
role="JAVA"><![CDATA[@Name("user")
@Entity
@Scope(CONVERSATION)
@Role(name="currentUser", scope=SESSION)
@@ -592,7 +592,7 @@
The <literal>@Roles</literal> annotation lets us specify as
many additional roles as we like.
</para>
- <programlisting><![CDATA[@Name("user")
+ <programlisting
role="JAVA"><![CDATA[@Name("user")
@Entity
@Scope(CONVERSATION)
@Roles({@Role(name="currentUser", scope=SESSION),
@@ -616,7 +616,7 @@
The built-in components may be injected, just like any Seam components,
but they also provide
convenient static <literal>instance()</literal> methods:
</para>
- <programlisting><![CDATA[FacesMessages.instance().add("Welcome
back, #{user.name}!");]]></programlisting>
+ <programlisting
role="JAVA"><![CDATA[FacesMessages.instance().add("Welcome back,
#{user.name}!");]]></programlisting>
</sect2>
</sect1>
@@ -670,7 +670,7 @@
variable:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@In User user;
@@ -681,7 +681,7 @@
or into a setter method:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
User user;
@@ -717,7 +717,7 @@
You can even inject the value of an expression:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@In("#{user.username}") String username;
@@ -738,7 +738,7 @@
instance variable:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@Out User user;
@@ -749,7 +749,7 @@
or from a getter method:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
User user;
@@ -766,7 +766,7 @@
An attribute may be both injected and outjected:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@In @Out User user;
@@ -777,7 +777,7 @@
or:
</para>
- <programlisting><![CDATA[@Name("loginAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("loginAction")
@Stateless
public class LoginAction implements Login {
User user;
@@ -911,7 +911,7 @@
a JMS queue.
</para>
- <programlisting><![CDATA[@Name("messageSender")
+ <programlisting
role="JAVA"><![CDATA[@Name("messageSender")
public class MessageSender {
public void sendMessage() {
//do something with JMS
@@ -925,7 +925,7 @@
application:
</para>
- <programlisting><![CDATA[@Name("messageSender")
+ <programlisting
role="JAVA"><![CDATA[@Name("messageSender")
@Install(precedence=MOCK)
public class MockMessageSender extends MessageSender {
public void sendMessage() {
@@ -958,7 +958,7 @@
Who is not totally fed up with seeing noisy code like this?
</para>
- <programlisting><![CDATA[private static final Log log =
LogFactory.getLog(CreateOrderAction.class);
+ <programlisting role="JAVA"><![CDATA[private static final Log
log = LogFactory.getLog(CreateOrderAction.class);
public Order createOrder(User user, Product product, int quantity) {
if ( log.isDebugEnabled() ) {
@@ -979,7 +979,7 @@
Seam provides a logging API that simplifies this code significantly:
</para>
- <programlisting><![CDATA[@Logger private Log log;
+ <programlisting role="JAVA"><![CDATA[@Logger private Log log;
public Order createOrder(User user, Product product, int quantity) {
log.debug("Creating new order for user: #0 product: #1 quantity: #2",
user.username(), product.name(), quantity);
@@ -1004,7 +1004,7 @@
You can use <literal>java.text.MessageFormat</literal> formatted
strings:
</para>
- <programlisting><![CDATA[log.debug("The time is {0,time}", new
Date());]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[log.debug("The time
is {0,time}", new Date());]]></programlisting>
-->
<para>
@@ -1012,7 +1012,7 @@
contexts, it gets even better:
</para>
- <programlisting><![CDATA[@Logger private Log log;
+ <programlisting role="JAVA"><![CDATA[@Logger private Log log;
public Order createOrder(User user, Product product, int quantity) {
log.debug("Creating new order for user: #{user.username} product:
#{product.name} quantity: #0", quantity);
@@ -1054,7 +1054,7 @@
the component. For example,
</para>
- <programlisting><![CDATA[@Name("account")
+ <programlisting
role="JAVA"><![CDATA[@Name("account")
public class Account extends AbstractMutable
{
private BigDecimal balance;
@@ -1078,7 +1078,7 @@
Or, you can use the <literal>@ReadOnly</literal> annotation to
achieve a similar effect:
</para>
- <programlisting><![CDATA[@Name("account")
+ <programlisting
role="JAVA"><![CDATA[@Name("account")
public class Account
{
private BigDecimal balance;
@@ -1107,7 +1107,7 @@
entity bean instance. For example,
</para>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("account")
public class AccountManager extends AbstractMutable
{
@@ -1149,7 +1149,7 @@
context by Seam:
</para>
- <programlisting><![CDATA[@Factory(scope=CONVERSATION)
+ <programlisting
role="JAVA"><![CDATA[@Factory(scope=CONVERSATION)
public List<Customer> getCustomerList() {
return ... ;
} ]]></programlisting>
@@ -1159,7 +1159,7 @@
variable itself:
</para>
- <programlisting><![CDATA[@DataModel List<Customer> customerList;
+ <programlisting role="JAVA"><![CDATA[@DataModel
List<Customer> customerList;
@Factory("customerList")
public void initCustomerList() {
@@ -1182,7 +1182,7 @@
- <programlisting><![CDATA[@Name("customerList")
+ <programlisting
role="JAVA"><![CDATA[@Name("customerList")
@Scope(CONVERSATION)
public class CustomerListManager
{
@@ -1201,7 +1201,7 @@
<literal>@Destroy</literal> method of the manager component.
</para>
- <programlisting><![CDATA[@Name("hens")
+ <programlisting role="JAVA"><![CDATA[@Name("hens")
@Scope(APPLICATION)
public class HenHouse {
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml 2008-03-25 22:33:50
UTC (rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml 2008-03-25 22:36:31
UTC (rev 7693)
@@ -18,7 +18,7 @@
<para> Of course, you need a faces servlet! </para>
- <programlisting><![CDATA[<servlet>
+ <programlisting role="XML"><![CDATA[<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
@@ -33,7 +33,7 @@
<para> In addition, Seam requires the following entry in your
<literal>web.xml</literal> file: </para>
- <programlisting><![CDATA[<listener>
+ <programlisting role="XML"><![CDATA[<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>]]></programlisting>
@@ -44,7 +44,7 @@
with Seam's conversation propagation. If you have problems with
conversation propagation during form
submissions, try switching to client-side state saving. You'll need
this in <literal>web.xml</literal>: </para>
- <programlisting><![CDATA[<context-param>
+ <programlisting role="XML"><![CDATA[<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>]]></programlisting>
@@ -57,13 +57,13 @@
<para> If you want follow our advice and use facelets instead of JSP,
add the following lines to
<literal>faces-config.xml</literal>: </para>
- <programlisting><![CDATA[<application>
+ <programlisting role="XML"><![CDATA[<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>]]></programlisting>
<para> And the following lines to
<literal>web.xml</literal>: </para>
- <programlisting><![CDATA[<context-param>
+ <programlisting role="XML"><![CDATA[<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>]]></programlisting>
@@ -77,7 +77,7 @@
chapter) and some JSF UI controls. Configuring the Seam Resource Servlet
requires the following entry in
<literal>web.xml</literal>: </para>
- <programlisting><![CDATA[<servlet>
+ <programlisting role="XML"><![CDATA[<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
@@ -96,7 +96,7 @@
servlet filters just like you would configure other built-in Seam
components. To take advantage of this
feature, we must first install a master filter in
<literal>web.xml</literal>: </para>
- <programlisting><![CDATA[<filter>
+ <programlisting role="XML"><![CDATA[<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
@@ -152,7 +152,7 @@
adjusted by adding a
<literal><web:exception-filter></literal> entry to
<literal>components.xml</literal>, as shown in this
example: </para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:web="http://jboss.com/products/seam/web">
<web:exception-filter url-pattern="*.seam"/>
@@ -171,7 +171,7 @@
<para> The redirect filter will process all requests by default,
but this behavior can also be adjusted
in <literal>components.xml</literal>: </para>
- <programlisting><![CDATA[<web:redirect-filter
url-pattern="*.seam"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<web:redirect-filter
url-pattern="*.seam"/>]]></programlisting>
</sect3>
<sect3>
@@ -180,7 +180,7 @@
requests and processes them according to the multipart/form-data
specification (RFC-2388). To
override the default settings, add the following entry to
<literal>components.xml</literal>: </para>
- <programlisting><![CDATA[<web:multipart-filter
create-temp-files="true"
+ <programlisting
role="XML"><![CDATA[<web:multipart-filter
create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>]]></programlisting>
@@ -208,7 +208,7 @@
<para> This filter is not installed by default and requires an
entry in
<literal>components.xml</literal> to enable it:
</para>
- <programlisting><![CDATA[<web:character-encoding-filter
encoding="UTF-16"
+ <programlisting
role="XML"><![CDATA[<web:character-encoding-filter
encoding="UTF-16"
override-client="true"
url-pattern="*.seam"/>]]></programlisting>
@@ -247,7 +247,7 @@
<para> To override the default settings, add the following entry to
<literal>components.xml</literal>.
The options are the same as those specified in the RichFaces
Developer Guide: </para>
- <programlisting><![CDATA[<web:ajax4jsf-filter
force-parser="true"
+ <programlisting
role="XML"><![CDATA[<web:ajax4jsf-filter force-parser="true"
enable-cache="true"
log4j-init-file="custom-log4j.xml"
url-pattern="*.seam"/>]]></programlisting>
@@ -289,7 +289,7 @@
adjusted by adding a
<literal><web:logging-filter></literal> entry to
<literal>components.xml</literal>, as shown in this
example: </para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:web="http://jboss.com/products/seam/web">
<web:logging-filter url-pattern="*.seam"/>
</components>]]></programlisting>
@@ -311,7 +311,7 @@
<para> This filter is not installed by default and requires an
entry in
<literal>components.xml</literal> to enable it:
</para>
- <programlisting><![CDATA[<web:context-filter
url-pattern="/media/*"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<web:context-filter
url-pattern="/media/*"/>]]></programlisting>
<para> The context filter expects to find the conversation id of
any conversation context in a request
parameter named <literal>conversationId</literal>. You
are responsible for ensuring that it gets
@@ -330,7 +330,7 @@
specify your filters in a <literal>web.xml</literal>).
Just add the <literal>@Filter</literal>
annotation to your Seam component (which must implement
<literal>javax.servlet.Filter</literal>): </para>
- <programlisting><![CDATA[@Startup
+ <programlisting role="JAVA"><![CDATA[@Startup
@Scope(APPLICATION)
@Name("org.jboss.seam.web.multipartFilter")
@BypassInterceptors
@@ -352,7 +352,7 @@
do this across an entire application is to add the following interceptor
configuration in
<literal>ejb-jar.xml</literal>: </para>
- <programlisting><![CDATA[<interceptors>
+ <programlisting role="XML"><![CDATA[<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
@@ -374,14 +374,14 @@
<para> For JBoss AS, the following pattern is correct: </para>
- <programlisting><![CDATA[<core:init
jndi-name="myEarName/#{ejbName}/local" />]]></programlisting>
+ <programlisting role="XML"><![CDATA[<core:init
jndi-name="myEarName/#{ejbName}/local" />]]></programlisting>
<para> Where <literal>myEarName</literal> is the name of
the EAR in which the bean is deployed. </para>
<para> Outside the context of an EAR (when using the JBoss Embeddable
EJB3 container), the following pattern
is the one to use: </para>
- <programlisting><![CDATA[<core:init
jndi-name="#{ejbName}/local" />]]></programlisting>
+ <programlisting role="XML"><![CDATA[<core:init
jndi-name="#{ejbName}/local" />]]></programlisting>
<para> You'll have to experiment to find the right setting for
other application servers. Note that some
servers (such as GlassFish) require you to specify JNDI names for all EJB
components explicitly (and
@@ -394,7 +394,7 @@
<literal>components.xml</literal> file, Seam won't know
when container-managed transactions end:
</para>
-
<programlisting><![CDATA[<transaction:ejb-transaction/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:ejb-transaction/>]]></programlisting>
</sect2>
@@ -540,12 +540,12 @@
<para> Seam will bootstrap a Hibernate
<literal>SessionFactory</literal> from your
<literal>hibernate.cfg.xml</literal> file if you install
a built-in component: </para>
- <programlisting><![CDATA[<persistence:hibernate-session-factory
name="hibernateSessionFactory"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<persistence:hibernate-session-factory
name="hibernateSessionFactory"/>]]></programlisting>
<para> You will also need to configure a <emphasis>managed
session</emphasis> if you want a Seam managed
Hibernate <literal>Session</literal> to be available via
injection. </para>
- <programlisting><![CDATA[<persistence:managed-hibernate-session
name="hibernateSessionFactory"
+ <programlisting
role="XML"><![CDATA[<persistence:managed-hibernate-session
name="hibernateSessionFactory"
session-factory="#{hibernateSessionFactory}"/>]]></programlisting>
</sect2>
@@ -556,12 +556,12 @@
<para> Seam will bootstrap a JPA
<literal>EntityManagerFactory</literal> from your
<literal>persistence.xml</literal> file if you install this
built-in component: </para>
- <programlisting><![CDATA[<persistence:entity-manager-factory
name="entityManagerFactory"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<persistence:entity-manager-factory
name="entityManagerFactory"/>]]></programlisting>
<para> You will also need to configure a <emphasis>managed
persistence context</emphasis> if you want a
Seam managed JPA <literal>EntityManager</literal> to be
available via injection. </para>
- <programlisting><![CDATA[<persistence:managed-persistence-context
name="entityManager"
+ <programlisting
role="XML"><![CDATA[<persistence:managed-persistence-context
name="entityManager"
entity-manager-factory="#{entityManagerFactory}"/>]]></programlisting>
</sect2>
@@ -616,11 +616,11 @@
how to manage transactions, since there will be no JTA available. If
you're using JPA, you can tell
Seam to use JPA resource-local transactions, ie.
<literal>EntityTransaction</literal>, like so: </para>
- <programlisting><![CDATA[<transaction:entity-transaction
entity-manager="#{entityManager}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:entity-transaction
entity-manager="#{entityManager}"/>]]></programlisting>
<para> If you're using Hibernate, you can tell Seam to use the
Hibernate transaction API like this: </para>
- <programlisting><![CDATA[<transaction:hibernate-transaction
session="#{session}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:hibernate-transaction
session="#{session}"/>]]></programlisting>
<para> Of course, you'll also need to define a
datasource.</para>
@@ -696,14 +696,14 @@
<para> Add the Embedded JBoss listener to
<literal>conf/server.xml</literal>. It should appear after
all other listeners in the file.</para>
- <programlisting><Listener
className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener"
/></programlisting>
+ <programlisting role="XML"><![CDATA[<Listener
className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener"
/>]]></programlisting>
</listitem>
<listitem>
<para>WAR file scanning should be enabled by adding a listener
to
<literal>conf/context.xml</literal>.
</para>
- <programlisting><Listener
className="org.jboss.embedded.tomcat.WebinfScanner"
/></programlisting>
+ <programlisting role="XML"><![CDATA[<Listener
className="org.jboss.embedded.tomcat.WebinfScanner">]]></programlisting>
</listitem>
</itemizedlist>
@@ -764,7 +764,7 @@
built-in component. You'll also need to explicitly list your process and
pageflow definitions. In
<literal>components.xml</literal>: </para>
- <programlisting><![CDATA[<bpm:jbpm>
+ <programlisting role="XML"><![CDATA[<bpm:jbpm>
<bpm:pageflow-definitions>
<value>createDocument.jpdl.xml</value>
<value>editDocument.jpdl.xml</value>
@@ -780,7 +780,7 @@
Store demo includes example <literal>jbpm.cfg.xml</literal> and
<literal>hibernate.cfg.xml</literal> files
that will work with Seam: </para>
- <programlisting><![CDATA[<jbpm-configuration>
+ <programlisting
role="XML"><![CDATA[<jbpm-configuration>
<jbpm-context>
<service name="persistence">
@@ -869,7 +869,7 @@
<para> The default SFSB timeout can be adjusted by modifying the value of
<literal>max-bean-life</literal> in
the <literal>LRUStatefulContextCachePolicy</literal> cache
configuration: </para>
- <programlisting><![CDATA[<container-cache-conf>
+ <programlisting
role="XML"><![CDATA[<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>50</min-capacity>
@@ -893,7 +893,7 @@
<literal>server/default/deploy/jboss-web.deployer/conf/web.xml</literal> for
JBoss 4.2.x. The following
entry in this file controls the default session timeout for all web
applications: </para>
- <programlisting><![CDATA[<session-config>
+ <programlisting role="XML"><![CDATA[<session-config>
<!-- HTTP Session timeout, in minutes -->
<session-timeout>30</session-timeout>
</session-config>]]></programlisting>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Controls.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Controls.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Controls.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -19,7 +19,7 @@
as follows (facelets only):
</para>
- <programlisting><![CDATA[<html
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML"><![CDATA[<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib">]]></p...
<para>
@@ -91,7 +91,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:button id="cancel"
value="Cancel"
+ <programlisting role="XHTML"><![CDATA[<s:button
id="cancel" value="Cancel"
action="#{hotelBooking.cancel}"/>]]></programlisting>
<para>
You can specify both <literal>view</literal> and
<literal>action</literal>
@@ -140,7 +140,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:cache
key="entry-#{blogEntry.id}" region="pageFragments">
+ <programlisting role="XHTML"><![CDATA[<s:cache
key="entry-#{blogEntry.id}" region="pageFragments">
<div class="blogEntry">
<h3>#{blogEntry.title}</h3>
<div>
@@ -206,7 +206,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:commandButton
value="Apply" action="#{personHome.update}">
+ <programlisting
role="XHTML"><![CDATA[<h:commandButton value="Apply"
action="#{personHome.update}">
<s:conversationPropagation type="join" />
</h:commandButton>]]></programlisting>
</entry>
@@ -226,7 +226,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:outputText
value="#{item.orderDate}">
+ <programlisting role="XHTML"><![CDATA[<h:outputText
value="#{item.orderDate}">
<s:convertDateTime type="both" dateStyle="full"/>
</h:outputText>]]></programlisting>
</entry>
@@ -264,7 +264,7 @@
If your <emphasis>Managed Persistence Context</emphasis>
isn't called
<literal>entityManager</literal>, then you need to set it in
components.xml:
</para>
- <programlisting><![CDATA[<component
name="org.jboss.seam.ui.EntityConverter">
+ <programlisting role="XML"><![CDATA[<component
name="org.jboss.seam.ui.EntityConverter">
<property name="entityManager">#{em}</property>
</component>]]></programlisting>
@@ -272,7 +272,7 @@
If you are using a <emphasis>Managed Hibernate
Session</emphasis>
then you need to set it in components.xml:
</para>
- <programlisting><![CDATA[<component
name="org.jboss.seam.ui.EntityConverter">
+ <programlisting role="XML"><![CDATA[<component
name="org.jboss.seam.ui.EntityConverter">
<property name="session">#{hibernateSession}</property>
</component>]]></programlisting>
@@ -282,18 +282,18 @@
entity manager in components.xml:
</para>
- <programlisting><![CDATA[<component
name="myEntityConverter"
class="org.jboss.seam.ui.converter.EntityConverter">
+ <programlisting role="XML"><![CDATA[<component
name="myEntityConverter"
class="org.jboss.seam.ui.converter.EntityConverter">
<property name="entityManager">#{em}</property>
</component>]]></programlisting>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{person.continent}">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{person.continent}">
<s:selectItems value="#{continents.resultList}" var="continent"
label="#{continent.name}" />
<f:converter converterId="myEntityConverter" />
</h:selectOneMenu>]]></programlisting>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{person.continent}" required="true">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{person.continent}" required="true">
<s:selectItems value="#{continents.resultList}" var="continent"
label="#{continent.name}"
noSelectionLabel="Please Select..."/>
@@ -318,7 +318,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{person.honorific}">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{person.honorific}">
<s:selectItems value="#{honorifics}" var="honorific"
label="#{honorific.label}"
noSelectionLabel="Please select" />
@@ -356,11 +356,11 @@
to <literal>true</literal> if a validation error occurs.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:decorate
template="edit.xhtml">
+ <programlisting role="XHTML"><![CDATA[<s:decorate
template="edit.xhtml">
<ui:define name="label">Country:</ui:define>
<h:inputText value="#{location.country}" required="true"/>
</s:decorate>]]></programlisting>
- <programlisting><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML"><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
@@ -414,7 +414,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:commandButton id="foo"
value="Foo" action="#{manager.foo}">
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
id="foo" value="Foo" action="#{manager.foo}">
<s:defaultAction />
</h:commandButton>]]></programlisting>
</entry>
@@ -436,7 +436,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:div rendered="#{selectedMember
== null}">
+ <programlisting role="XHTML"><![CDATA[<s:div
rendered="#{selectedMember == null}">
Sorry, but this member does not exist.
</s:div>]]></programlisting>
</entry>
@@ -468,7 +468,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:selectOneRadio
id="radioList"
+ <programlisting
role="XHTML"><![CDATA[<h:selectOneRadio id="radioList"
layout="lineDirection"
value="#{newPayment.paymentFrequency}">
<s:convertEnum />
@@ -494,14 +494,14 @@
an encoding type of <literal>multipart/form-data</literal>,
i.e:
</para>
- <programlisting><![CDATA[<h:form
enctype="multipart/form-data">]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:form
enctype="multipart/form-data">]]></programlisting>
<para>
For multipart requests, the Seam Multipart servlet filter must also be
configured
in <literal>web.xml</literal>:
</para>
- <programlisting><![CDATA[<filter>
+ <programlisting role="XML"><![CDATA[<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
@@ -535,7 +535,7 @@
Here's an example:
</para>
- <programlisting><![CDATA[<component
class="org.jboss.seam.web.MultipartFilter">
+ <programlisting role="XML"><![CDATA[<component
class="org.jboss.seam.web.MultipartFilter">
<property name="createTempFiles">true</property>
<property name="maxRequestSize">1000000</property>
</component>]]></programlisting>
@@ -583,7 +583,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:fileUpload id="picture"
data="#{register.picture}"
+ <programlisting role="XHTML"><![CDATA[<s:fileUpload
id="picture" data="#{register.picture}"
accept="image/png"
contentType="#{register.pictureContentType}"
/>]]></programlisting>
</entry>
@@ -608,7 +608,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:formattedText
value="#{blog.text}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:formattedText
value="#{blog.text}"/>]]></programlisting>
<para><emphasis>Example</emphasis></para>
<mediaobject>
<imageobject role="fo">
@@ -637,7 +637,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:fragment
rendered="#{auction.highBidder ne null}">
+ <programlisting role="XHTML"><![CDATA[<s:fragment
rendered="#{auction.highBidder ne null}">
Current bid:
</s:fragment>]]></programlisting>
</entry>
@@ -743,7 +743,7 @@
to set your transformed image. Transforms are applied in the order
specified in the view.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:graphicImage
rendered="#{auction.image ne null}"
+ <programlisting role="XHTML"><![CDATA[<s:graphicImage
rendered="#{auction.image ne null}"
value="#{auction.image.data}">
<s:transformImageSize width="200" maintainRatio="true"/>
</s:graphicImage>]]></programlisting>
@@ -777,7 +777,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:label
styleClass="label">
+ <programlisting role="XHTML"><![CDATA[<s:label
styleClass="label">
Country:
</s:label>
<h:inputText value="#{location.country}"
required="true"/>]]></programlisting>
@@ -840,7 +840,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:link id="register"
view="/register.xhtml"
+ <programlisting role="XHTML"><![CDATA[<s:link
id="register" view="/register.xhtml"
value="Register New User"/>]]></programlisting>
<para>
You can specify both <literal>view</literal> and
<literal>action</literal>
@@ -867,7 +867,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<f:facet
name="afterInvalidField">
+ <programlisting role="XHTML"><![CDATA[<f:facet
name="afterInvalidField">
<s:span>
 Error: 
<s:message/>
@@ -897,7 +897,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:remote
include="customerAction,accountAction,com.acme.MyBean"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:remote
include="customerAction,accountAction,com.acme.MyBean"/>]]></programlisting>
</entry>
</row>
@@ -955,8 +955,8 @@
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <para>
- <programlisting><![CDATA[<div class="row">
+
+ <programlisting role="XHTML"><![CDATA[<div
class="row">
<h:outputLabel for="dob">Date of
birth<em>*</em></h:outputLabel>
<h:inputText id="dob" value="#{user.dob}"
required="true">
<s:convertDateTime pattern="MM/dd/yyyy"/>
@@ -966,7 +966,7 @@
</s:selectDate>
<div class="validationError"><h:message
for="dob"/></div>
</div>]]></programlisting>
- </para>
+
<para><emphasis>Example</emphasis></para>
<mediaobject>
@@ -1152,7 +1152,7 @@
</listitem>
</itemizedlist>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{person.age}"
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{person.age}"
converter="ageConverter">
<s:selectItems value="#{ages}" var="age"
label="#{age}" />
</h:selectOneMenu>]]></programlisting>
@@ -1175,7 +1175,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:span styleClass="required"
rendered="#{required}">*</s:span>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:span
styleClass="required"
rendered="#{required}">*</s:span>]]></programlisting>
</entry>
</row>
@@ -1215,7 +1215,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<h:inputText id="userName"
required="true"
+ <programlisting role="XHTML"><![CDATA[<h:inputText
id="userName" required="true"
value="#{customer.userName}">
<s:validate />
</h:inputText>
@@ -1238,7 +1238,7 @@
None.
</para>
<para><emphasis>Usage</emphasis></para>
- <programlisting><![CDATA[<s:validateAll>
+ <programlisting
role="XHTML"><![CDATA[<s:validateAll>
<div class="entry">
<h:outputLabel for="username">Username:</h:outputLabel>
<h:inputText id="username" value="#{user.username}"
@@ -1297,7 +1297,7 @@
<literal>@Converter</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Name("itemConverter")
+ <programlisting
role="JAVA"><![CDATA[@Name("itemConverter")
@BypassInterceptors
@Converter
public class ItemConverter implements Converter {
@@ -1315,7 +1315,7 @@
}]]></programlisting>
- <programlisting><![CDATA[<h:inputText
value="#{shop.item}" converter="itemConverter"
/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:inputText
value="#{shop.item}" converter="itemConverter"
/>]]></programlisting>
<para>
Registers the Seam component as a JSF converter. Shown here is a
@@ -1330,7 +1330,7 @@
<literal>@Validator</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Name("itemValidator")
+ <programlisting
role="JAVA"><![CDATA[@Name("itemValidator")
@BypassInterceptors
@Validator
public class ItemValidator implements Validator {
@@ -1343,7 +1343,7 @@
}]]></programlisting>
- <programlisting><![CDATA[<h:inputText value="#{shop.item}"
validator="itemValidator" />]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:inputText
value="#{shop.item}" validator="itemValidator"
/>]]></programlisting>
<para>
Registers the Seam component as a JSF validator. Shown here is a
validator which injects another Seam component; the injected
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Conversations.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Conversations.xml 2008-03-25 22:33:50
UTC (rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Conversations.xml 2008-03-25 22:36:31
UTC (rev 7693)
@@ -132,13 +132,13 @@
request parameter:
</para>
- <programlisting><![CDATA[<a
href="main.jsf?conversationId=#{conversation.id}">Continue</a>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<a
href="main.jsf?conversationId=#{conversation.id}">Continue</a>]]></programlisting>
<para>
Or, the more JSF-ish:
</para>
- <programlisting><![CDATA[<h:outputLink
value="main.jsf">
+ <programlisting role="XHTML"><![CDATA[<h:outputLink
value="main.jsf">
<f:param name="conversationId"
value="#{conversation.id}"/>
<h:outputText value="Continue"/>
</h:outputLink>]]></programlisting>
@@ -147,7 +147,7 @@
If you use the Seam tag library, this is equivalent:
</para>
- <programlisting><![CDATA[<h:outputLink
value="main.jsf">
+ <programlisting role="XHTML"><![CDATA[<h:outputLink
value="main.jsf">
<s:conversationId/>
<h:outputText value="Continue"/>
</h:outputLink>]]></programlisting>
@@ -157,7 +157,7 @@
postback, a similar trick is used:
</para>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Exit">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Exit">
<f:param name="conversationPropagation" value="none"/>
</h:commandLink>]]></programlisting>
@@ -165,7 +165,7 @@
If you use the Seam tag library, this is equivalent:
</para>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Exit">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Exit">
<s:conversationPropagation type="none"/>
</h:commandLink>]]></programlisting>
@@ -181,19 +181,19 @@
conversation.
</para>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Exit">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Exit">
<s:conversationPropagation type="end"/>
</h:commandLink>]]></programlisting>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Select Child">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Select Child">
<s:conversationPropagation type="nested"/>
</h:commandLink>]]></programlisting>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Select Hotel">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Select Hotel">
<s:conversationPropagation type="begin"/>
</h:commandLink>]]></programlisting>
- <programlisting><![CDATA[<h:commandLink action="main"
value="Select Hotel">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="main" value="Select Hotel">
<s:conversationPropagation type="join"/>
</h:commandLink>]]></programlisting>
@@ -305,7 +305,7 @@
file.
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/messageList.jsp"
action="#{messageManager.list}"/>
...
</pages>]]></programlisting>
@@ -324,7 +324,7 @@
does just that:
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/messageList.jsp"
action="#{conversation.begin}"/>
...
</pages>]]></programlisting>
@@ -342,7 +342,7 @@
<literal><begin-conversation></literal> element.
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/messageList.jsp">
<begin-conversation nested="true" pageflow="AddItem"/>
<page>
@@ -354,7 +354,7 @@
element.
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/home.jsp">
<end-conversation/>
<page>
@@ -449,14 +449,14 @@
The link may specify just the JSF view id:
</para>
- <programlisting><![CDATA[<s:link view="/login.xhtml"
value="Login"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
view="/login.xhtml" value="Login"/>]]></programlisting>
<para>
Or, it may specify an action method (in which case the action outcome
determines
the page that results):
</para>
- <programlisting><![CDATA[<s:link action="#{login.logout}"
value="Logout"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
action="#{login.logout}"
value="Logout"/>]]></programlisting>
<para>
If you specify <emphasis>both</emphasis> a JSF view id and an
action method, the
@@ -464,39 +464,39 @@
non-null outcome:
</para>
- <programlisting><![CDATA[<s:link view="/loggedOut.xhtml"
action="#{login.logout}"
value="Logout"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
view="/loggedOut.xhtml" action="#{login.logout}"
value="Logout"/>]]></programlisting>
<para>
The link automatically propagates the selected row of a
<literal>DataModel</literal>
using inside <literal><h:dataTable></literal>:
</para>
- <programlisting><![CDATA[<s:link view="/hotel.xhtml"
action="#{hotelSearch.selectHotel}"
value="#{hotel.name}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
view="/hotel.xhtml" action="#{hotelSearch.selectHotel}"
value="#{hotel.name}"/>]]></programlisting>
<para>
You can leave the scope of an existing conversation:
</para>
- <programlisting><![CDATA[<s:link view="/main.xhtml"
propagation="none"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
view="/main.xhtml"
propagation="none"/>]]></programlisting>
<para>
You can begin, end, or nest conversations:
</para>
- <programlisting><![CDATA[<s:link
action="#{issueEditor.viewComment}"
propagation="nest"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
action="#{issueEditor.viewComment}"
propagation="nest"/>]]></programlisting>
<para>
If the link begins a conversation, you can even specify a pageflow to be
used:
</para>
- <programlisting><![CDATA[<s:link
action="#{documentEditor.getDocument}" propagation="begin"
+ <programlisting role="XHTML"><![CDATA[<s:link
action="#{documentEditor.getDocument}" propagation="begin"
pageflow="EditDocument"/>]]></programlisting>
<para>
The <literal>taskInstance</literal> attribute if for use in jBPM
task lists:
</para>
- <programlisting><![CDATA[<s:link
action="#{documentApproval.approveOrReject}"
taskInstance="#{task}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
action="#{documentApproval.approveOrReject}"
taskInstance="#{task}"/>]]></programlisting>
<para>
(See the DVD Store demo application for examples of this.)
@@ -506,7 +506,7 @@
Finally, if you need the "link" to be rendered as a button, use
<literal><s:button></literal>:
</para>
- <programlisting><![CDATA[<s:button action="#{login.logout}"
value="Logout"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:button
action="#{login.logout}"
value="Logout"/>]]></programlisting>
</section>
@@ -527,7 +527,7 @@
(You must have the Seam redirect filter installed.)
</para>
- <programlisting><![CDATA[@Name("editDocumentAction")
+ <programlisting
role="JAVA"><![CDATA[@Name("editDocumentAction")
@Stateless
public class EditDocumentBean implements EditDocument {
@In EntityManager em;
@@ -552,13 +552,13 @@
You can even include JSF EL expressions in a faces message summary:
</para>
- <programlisting><![CDATA[facesMessages.add("Document
#{document.title} was updated");]]></programlisting>
+ <programlisting
role="JAVA"><![CDATA[facesMessages.add("Document #{document.title}
was updated");]]></programlisting>
<para>
You may display the messages in the usual way, for example:
</para>
- <programlisting><![CDATA[<h:messages
globalOnly="true"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:messages
globalOnly="true"/>]]></programlisting>
</section>
@@ -627,7 +627,7 @@
Natural conversations are defined in
<literal>pages.xml</literal>:
</para>
- <programlisting><![CDATA[ <conversation
name="PlaceBid"
+ <programlisting role="XML"><![CDATA[ <conversation
name="PlaceBid"
parameter-name="auctionId"
parameter-value="#{auction.auctionId}"/>]]></programlisting>
@@ -661,7 +661,7 @@
<literal>page</literal> definition:
</para>
- <programlisting><![CDATA[ <page view-id="/bid.xhtml"
conversation="PlaceBid" login-required="true">
+ <programlisting role="XML"><![CDATA[ <page
view-id="/bid.xhtml" conversation="PlaceBid"
login-required="true">
<navigation from-action="#{bidAction.confirmBid}">
<rule if-outcome="success">
<redirect view-id="/auction.xhtml">
@@ -682,7 +682,7 @@
the following page definition:
</para>
- <programlisting><![CDATA[ <page
view-id="/auction.xhtml">
+ <programlisting role="XML"><![CDATA[ <page
view-id="/auction.xhtml">
<param name="id"
value="#{auctionDetail.selectedAuctionId}"/>
<navigation from-action="#{bidAction.placeBid}">
@@ -698,7 +698,7 @@
our action method looks like this:
</para>
- <programlisting><![CDATA[ @Begin(join = true)
+ <programlisting role="JAVA"><![CDATA[ @Begin(join =
true)
public void placeBid()]]></programlisting>
<para>
@@ -711,7 +711,7 @@
tag:
</para>
- <programlisting><![CDATA[ <h:commandButton
id="placeBidWithAmount" styleClass="placeBid"
action="#{bidAction.placeBid}">
+ <programlisting role="XHTML"><![CDATA[
<h:commandButton id="placeBidWithAmount" styleClass="placeBid"
action="#{bidAction.placeBid}">
<s:conversationName value="PlaceBid"/>
</h:commandButton>]]></programlisting>
@@ -720,7 +720,7 @@
using either <literal>s:link</literal> or
<literal>s:button</literal>:
</para>
- <programlisting><![CDATA[ <s:link value="Place Bid"
action="#{bidAction.placeBid}"
conversationName="PlaceBid"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[ <s:link
value="Place Bid" action="#{bidAction.placeBid}"
conversationName="PlaceBid"/>]]></programlisting>
</section>
@@ -765,7 +765,7 @@
directory, right next to
<literal>faces-config.xml</literal>:
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/main.xhtml">
<description>Search hotels:
#{hotelBooking.searchString}</description>
</page>
@@ -801,7 +801,7 @@
node:
</para>
-<programlisting><![CDATA[<pageflow-definition name="shopping">
+<programlisting role="XML"><![CDATA[<pageflow-definition
name="shopping">
<start-state name="start">
<transition to="browse"/>
@@ -836,7 +836,7 @@
current conversation, or to any other page of the application:
</para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{switcher.conversationIdOrOutcome}">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{switcher.conversationIdOrOutcome}">
<f:selectItem itemLabel="Find Issues"
itemValue="findIssue"/>
<f:selectItem itemLabel="Create Issue"
itemValue="editIssue"/>
<f:selectItems value="#{switcher.selectItems}"/>
@@ -874,7 +874,7 @@
except that it is displayed as a table:
</para>
- <programlisting><![CDATA[<h:dataTable
value="#{conversationList}" var="entry"
+ <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{conversationList}" var="entry"
rendered="#{not empty conversationList}">
<h:column>
<f:facet name="header">Workspace</f:facet>
@@ -931,7 +931,7 @@
current conversation stack:
</para>
- <programlisting><![CDATA[<ui:repeat
value="#{conversationStack}" var="entry">
+ <programlisting role="XHTML"><![CDATA[<ui:repeat
value="#{conversationStack}" var="entry">
<h:outputText value=" | "/>
<h:commandLink value="#{entry.description}"
action="#{entry.select}"/>
</ui:repeat]]></programlisting>
@@ -964,7 +964,7 @@
it into the conversation scoped component that requires it.
</para>
- <programlisting><![CDATA[@Name("grid")
+ <programlisting role="JAVA"><![CDATA[@Name("grid")
@Scope(ScopeType.EVENT)
public class Grid
{
@@ -975,7 +975,7 @@
}]]></programlisting>
- <programlisting><![CDATA[@Name("gridEditor")
+ <programlisting
role="JAVA"><![CDATA[@Name("gridEditor")
@Scope(ScopeType.CONVERSATION)
public class GridEditor
{
@@ -998,7 +998,7 @@
the current row number:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XHTML"><![CDATA[
<h:dataTable id="lineItemTable" var="lineItem"
value="#{orderHome.lineItems}">
<h:column>
Row: #{uiComponent['lineItemTable'].rowIndex}
@@ -1050,13 +1050,13 @@
ms) in components.xml:
</para>
- <programlisting><![CDATA[<core:manager
concurrent-request-timeout="500" />]]></programlisting>
+ <programlisting role="XML"><![CDATA[<core:manager
concurrent-request-timeout="500" />]]></programlisting>
<!-- TODO -->
<!-- <para>
We can also fine tune the concurrent request timeout for a request:
</para>
- <programlisting><![CDATA[public void getTotal() {
+ <programlisting role="JAVA"><![CDATA[public void getTotal() {
Manager.instance().setConcurrentRequestTimeout(1000);
return someReallyComplicatedCalculation();
}]]></programlisting>-->
@@ -1114,7 +1114,7 @@
interval:
</para>
- <programlisting><![CDATA[int total;
+ <programlisting role="JAVA"><![CDATA[int total;
// This method is called when an event occurs on the client
// It takes a really long time to execute
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Dependencies.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Dependencies.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Dependencies.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -908,32 +908,32 @@
All the Seam artifacts are available in Maven:
</para>
- <programlisting><![CDATA[<dependency>
+ <programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
</dependency>]]></programlisting>
-<programlisting><![CDATA[<dependency>
+<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
</dependency>]]></programlisting>
-<programlisting><![CDATA[<dependency>
+<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-pdf</artifactId>
</dependency>]]></programlisting>
-<programlisting><![CDATA[<dependency>
+<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
</dependency>]]></programlisting>
-<programlisting><![CDATA[<dependency>
+<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ioc</artifactId>
</dependency>]]></programlisting>
-<programlisting><![CDATA[<dependency>
+<programlisting role="XML"><![CDATA[<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ioc</artifactId>
</dependency>]]></programlisting>
@@ -943,7 +943,7 @@
Hibernate Validator:
</para>
-<programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
+<programlisting role="XML"><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Drools.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Drools.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Drools.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -19,7 +19,7 @@
this component via <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<drools:rule-base
name="policyPricingRules">
+ <programlisting role="XML"><![CDATA[<drools:rule-base
name="policyPricingRules">
<drools:rule-files>
<value>policyPricingRules.drl</value>
</drools:rule-files>
@@ -38,7 +38,7 @@
definition:
</para>
- <programlisting><![CDATA[<drools:rule-base
name="policyPricingRules" dsl-file="policyPricing.dsl">
+ <programlisting role="XML"><![CDATA[<drools:rule-base
name="policyPricingRules" dsl-file="policyPricing.dsl">
<drools:rule-files>
<value>policyPricingRules.drl</value>
</drools:rule-files>
@@ -52,7 +52,7 @@
also configurable in <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<drools:rule-agent
name="insuranceRules"
+ <programlisting
role="XML"><![CDATA[<drools:rule-agent name="insuranceRules"
configurationFile="/WEB-INF/deployedrules.properties"
/>]]></programlisting>
<para>The properties file contains properties specific to the RulesAgent.
Here is an example configuration file from the
@@ -67,11 +67,11 @@
<para>It is also possible to configure the options on the component
directly, bypassing the configuration file.</para>
- <programlisting><drools:rule-agent
name="insuranceRules"
-
url="http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/fmeyer"
-
local-cache-dir="/Users/fernandomeyer/projects/jbossrules/drools-examples/drools-examples-brms/cache"
- poll="30"
- configuration-name="insuranceconfig"
/></programlisting>
+ <programlisting role="XML"><![CDATA[<drools:rule-agent
name="insuranceRules"
+
url="http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/fmeyer"
+
local-cache-dir="/Users/fernandomeyer/projects/jbossrules/drools-examples/drools-examples-brms/cache"
+ poll="30"
+ configuration-name="insuranceconfig" />]]></programlisting>
<para>
Next, we need to make an instance of
<literal>org.drools.WorkingMemory</literal>
@@ -79,7 +79,7 @@
accumulates facts relating to the current conversation.)
</para>
- <programlisting><![CDATA[<drools:managed-working-memory
name="policyPricingWorkingMemory" auto-create="true"
rule-base="#{policyPricingRules}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<drools:managed-working-memory
name="policyPricingWorkingMemory" auto-create="true"
rule-base="#{policyPricingRules}"/>]]></programlisting>
<para>
Notice that we gave the
<literal>policyPricingWorkingMemory</literal> a
@@ -97,7 +97,7 @@
assert facts, and fire rules:
</para>
- <programlisting><![CDATA[@In WorkingMemory policyPricingWorkingMemory;
+ <programlisting role="JAVA"><![CDATA[@In WorkingMemory
policyPricingWorkingMemory;
@In Policy policy;
@In Customer customer;
@@ -120,7 +120,7 @@
process definition.
</para>
- <programlisting><![CDATA[<decision name="approval">
+ <programlisting role="XML"><![CDATA[<decision
name="approval">
<handler class="org.jboss.seam.drools.DroolsDecisionHandler">
<workingMemoryName>orderApprovalRulesWorkingMemory</workingMemoryName>
@@ -156,7 +156,7 @@
There is also support for using Drools for jBPM task assignments:
</para>
- <programlisting><![CDATA[<task-node name="review">
+ <programlisting role="XML"><![CDATA[<task-node
name="review">
<task name="review" description="Review Order">
<assignment
handler="org.jboss.seam.drools.DroolsAssignmentHandler">
<workingMemoryName>orderApprovalRulesWorkingMemory</workingMemoryName>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Elenhancements.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Elenhancements.xml 2008-03-25 22:33:50
UTC (rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Elenhancements.xml 2008-03-25 22:36:31
UTC (rev 7693)
@@ -23,9 +23,9 @@
JBoss EL removes this restriction. For example:
</para>
- <programlisting><![CDATA[<h:commandButton
action="#{hotelBooking.bookHotel(hotel)}" value="Book
Hotel"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
action="#{hotelBooking.bookHotel(hotel)}" value="Book
Hotel"/>]]></programlisting>
- <programlisting><![CDATA[@Name("hotelBooking")
+ <programlisting
role="JAVA"><![CDATA[@Name("hotelBooking")
public class HotelBooking {
public String bookHotel(Hotel hotel) {
@@ -41,7 +41,7 @@
parentheses, and separated by commas:
</para>
- <programlisting><![CDATA[<h:commandButton
action="#{hotelBooking.bookHotel(hotel, user)}" value="Book
Hotel"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
action="#{hotelBooking.bookHotel(hotel, user)}" value="Book
Hotel"/>]]></programlisting>
<para>
The parameters <literal>hotel</literal> and
<literal>user</literal>
@@ -52,7 +52,7 @@
Any value expression may be used as a parameter:
</para>
- <programlisting><![CDATA[<h:commandButton
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
action="#{hotelBooking.bookHotel(hotel.id, user.username)}"
value="Book Hotel"/>]]></programlisting>
@@ -76,7 +76,7 @@
You can also pass literal strings using single quotes:
</para>
- <programlisting><![CDATA[<h:commandLink
action="#{printer.println('Hello world!')}"
value="Hello"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="#{printer.println('Hello world!')}"
value="Hello"/>]]></programlisting>
<para>
Unified EL also supports value expressions, used to bind a field to
@@ -92,7 +92,7 @@
using the method syntax. For example:
</para>
- <programlisting><![CDATA[<h:outputText
value="#{person.name}" rendered="#{person.name.length() > 5}"
/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:outputText
value="#{person.name}" rendered="#{person.name.length() > 5}"
/>]]></programlisting>
<para>
You can access the size of a collection in a similar manner:
@@ -141,11 +141,11 @@
<literal><h:commandButton /></literal> or
<literal><h:commandLink /></literal>:
</para>
- <programlisting><![CDATA[@Factory("items")
+ <programlisting
role="JAVA"><![CDATA[@Factory("items")
public List<Item> getItems() {
return entityManager.createQuery("select ...").getResultList();
}]]></programlisting>
- <programlisting><![CDATA[<h:dataTable
value="#{items}" var="item">
+ <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{items}" var="item">
<h:column>
<h:commandLink value="Select #{item.name}"
action="#{itemSelector.select(item})" />
</h:column>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Events.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Events.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Events.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -44,22 +44,23 @@
<para>
All of these various kinds of events are mapped to Seam components via JSF
EL
method binding expressions. For a JSF event, this is defined in the JSF
template:
+ </para>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
value="Click me!"
action="#{helloWorld.sayHello}"/>]]></programlisting>
- <programlisting><![CDATA[<h:commandButton value="Click me!"
action="#{helloWorld.sayHello}"/>]]></programlisting>
-
-</para>
+
<para>
For a jBPM transition event, it is specified in the jBPM process definition
or
pageflow definition:
-
- <programlisting><![CDATA[<start-page name="hello"
view-id="/hello.jsp">
+ </para>
+
+ <programlisting role="XML"><![CDATA[<start-page
name="hello" view-id="/hello.jsp">
<transition to="hello">
<action expression="#{helloWorld.sayHello}"/>
</transition>
</start-page>]]></programlisting>
-</para>
+
<para>
You can find out more information about JSF events and jBPM events elsewhere.
Let's concentrate for now upon the two additional kinds of events defined
by Seam.
@@ -73,20 +74,22 @@
A Seam page action is an event that occurs just before we render a page.
We declare page actions in <literal>WEB-INF/pages.xml</literal>.
We
can define a page action for either a particular JSF view id:
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/hello.jsp"
action="#{helloWorld.sayHello}"/>
</pages>]]></programlisting>
-</para>
+
<para>
Or we can use a <literal>*</literal> wildcard as a suffix to the
<literal>view-id</literal> to specify an action that applies to
all
view ids that match the pattern:
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/hello/*" action="#{helloWorld.sayHello}"/>
</pages>]]></programlisting>
-</para>
+
<para>
If multiple wildcarded page actions match the current view-id, Seam
will call all the actions, in order of least-specific to most-specific.
@@ -102,10 +105,11 @@
element need not correspond to a real JSP or Facelets page! So, we can
reproduce the functionality of a traditional action-oriented framework
like Struts or WebWork using page actions. For example:
+ </para>
<programlisting><![CDATA[TODO: translate struts action into page
action]]></programlisting>
-</para>
+
<para>
This is quite useful if you want to do complex things in response to
non-faces
requests (for example, HTTP GET requests).
@@ -114,15 +118,16 @@
<para>
Multiple or conditional page actions my be specified using the
<literal><action></literal>
tag:
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/hello.jsp">
<action execute="#{helloWorld.sayHello}" if="#{not
validation.failed}"/>
<action execute="#{hitCount.increment}"/>
</page>
</pages>]]></programlisting>
-</para>
+
</section>
<section>
@@ -150,17 +155,19 @@
<para>
Seam lets us provide a value binding that maps a named request
parameter
to an attribute of a model object.
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/hello.jsp"
action="#{helloWorld.sayHello}">
<param name="firstName"
value="#{person.firstName}"/>
<param name="lastName" value="#{person.lastName}"/>
</page>
</pages>]]></programlisting>
-</para>
+
<para>
The <literal><param></literal> declaration is
bidirectional, just
like a value binding for a JSF input:
+ </para>
<itemizedlist>
<listitem>
@@ -195,7 +202,7 @@
</para>
</listitem>
</itemizedlist>
- </para>
+
<para>
The essential idea behind all this is that
<emphasis>however</emphasis>
we get from any other page to <literal>/hello.jsp</literal>
(or from
@@ -215,39 +222,38 @@
If just the <literal>name</literal> attribute is
specified then the
request parameter is propagated using the
<literal>PAGE</literal> context
(it isn't mapped to model property).
-
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/hello.jsp"
action="#{helloWorld.sayHello}">
<param name="firstName" />
<param name="lastName" />
</page>
</pages>]]></programlisting>
-</para>
+
<para>
Propagation of page parameters is especially useful if you want to
build multi-layer
master-detail CRUD pages. You can use it to "remember" which
view you were previously
on (e.g. when pressing the Save button), and which entity you were
editing.
-
- <itemizedlist>
- <listitem>
- <para>
- Any <literal><s:link></literal> or
<literal><s:button></literal>
- transparently propagates the request parameter if that
parameter is listed
- as a page parameter for the view.
- </para>
- </listitem>
- <listitem>
- <para>
- The value is transparently propagated with any JSF form
submission
- for the page with the given view id. (This means that view
parameters
- behave like <literal>PAGE</literal>-scoped context
variables for
- faces requests.
- </para>
- </listitem>
- </itemizedlist>
- </para>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Any <literal><s:link></literal> or
<literal><s:button></literal>
+ transparently propagates the request parameter if that parameter is
listed
+ as a page parameter for the view.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The value is transparently propagated with any JSF form submission
+ for the page with the given view id. (This means that view parameters
+ behave like <literal>PAGE</literal>-scoped context variables
for
+ faces requests.
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
This all sounds pretty complex, and you're probably wondering if such an
@@ -262,41 +268,42 @@
much easier to code.
</para>
- </section>
+ </section>
- <section>
- <title>Conversion and Validation</title>
+ <section>
+ <title>Conversion and Validation</title>
- <para>
- You can specify a JSF converter for complex model propreties:
-
- <programlisting><![CDATA[<pages>
- <page view-id="/calculator.jsp"
action="#{calculator.calculate}">
- <param name="x" value="#{calculator.lhs}"/>
- <param name="y" value="#{calculator.rhs}"/>
- <param name="op"
converterId="com.my.calculator.OperatorConverter"
value="#{calculator.op}"/>
- </page>
+ <para>
+ You can specify a JSF converter for complex model propreties:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<pages>
+ <page view-id="/calculator.jsp"
action="#{calculator.calculate}">
+ <param name="x" value="#{calculator.lhs}"/>
+ <param name="y" value="#{calculator.rhs}"/>
+ <param name="op"
converterId="com.my.calculator.OperatorConverter"
value="#{calculator.op}"/>
+ </page>
</pages>]]></programlisting>
-</para>
- <para>
- Alternatively:
-
- <programlisting><![CDATA[<pages>
- <page view-id="/calculator.jsp"
action="#{calculator.calculate}">
- <param name="x" value="#{calculator.lhs}"/>
- <param name="y" value="#{calculator.rhs}"/>
- <param name="op" converter="#{operatorConverter}"
value="#{calculator.op}"/>
- </page>
+ <para>
+ Alternatively:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<pages>
+ <page view-id="/calculator.jsp"
action="#{calculator.calculate}">
+ <param name="x" value="#{calculator.lhs}"/>
+ <param name="y" value="#{calculator.rhs}"/>
+ <param name="op" converter="#{operatorConverter}"
value="#{calculator.op}"/>
+ </page>
</pages>]]></programlisting>
-</para>
- <para>
- JSF validators, and
<literal>required="true"</literal> may
- also be used:
-
- <programlisting><![CDATA[<pages>
+
+ <para>
+ JSF validators, and <literal>required="true"</literal>
may
+ also be used:
+ </para>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/blog.xhtml">
<param name="date"
value="#{blog.date}"
@@ -305,11 +312,11 @@
</page>
</pages>]]></programlisting>
-</para>
- <para>
- Alternatively:
+ <para>
+ Alternatively:
+ </para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/blog.xhtml">
<param name="date"
value="#{blog.date}"
@@ -318,73 +325,72 @@
</page>
</pages>]]></programlisting>
-</para>
- <para>
- Even better, model-based Hibernate validator annotations are
automatically
- recognized and validated.
- </para>
+ <para>
+ Even better, model-based Hibernate validator annotations are automatically
+ recognized and validated.
+ </para>
- <para>
- When type conversion or validation fails, a global
<literal>FacesMessage</literal>
- is added to the <literal>FacesContext</literal>.
- </para>
+ <para>
+ When type conversion or validation fails, a global
<literal>FacesMessage</literal>
+ is added to the <literal>FacesContext</literal>.
+ </para>
- </section>
+ </section>
- <section id="events.pageaction.navigation">
- <title>Navigation</title>
+ <section id="events.pageaction.navigation">
+ <title>Navigation</title>
- <para>
- You can use standard JSF navigation rules defined in
<literal>faces-config.xml</literal>
- in a Seam application. However, JSF navigation rules have a number of
annoying
- limitations:
- </para>
+ <para>
+ You can use standard JSF navigation rules defined in
<literal>faces-config.xml</literal>
+ in a Seam application. However, JSF navigation rules have a number of
annoying
+ limitations:
+ </para>
- <itemizedlist>
- <listitem>
- <para>
- It is not possible to specify request parameters to be used when
redirecting.
- </para>
- </listitem>
- <listitem>
- <para>
- It is not possible to begin or end conversations from a rule.
- </para>
- </listitem>
- <listitem>
- <para>
- Rules work by evaluating the return value of the action method;
it is not
- possible to evaluate an arbitrary EL expression.
- </para>
- </listitem>
- </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ It is not possible to specify request parameters to be used when
redirecting.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ It is not possible to begin or end conversations from a rule.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Rules work by evaluating the return value of the action method; it is
not
+ possible to evaluate an arbitrary EL expression.
+ </para>
+ </listitem>
+ </itemizedlist>
- <para>
- A further problem is that "orchestration" logic gets scattered
between <literal>pages.xml</literal>
- and <literal>faces-config.xml</literal>. It's better to
unify this logic into <literal>pages.xml</literal>.
- </para>
+ <para>
+ A further problem is that "orchestration" logic gets scattered
between <literal>pages.xml</literal>
+ and <literal>faces-config.xml</literal>. It's better to unify
this logic into <literal>pages.xml</literal>.
+ </para>
- <para>
- This JSF navigation rule:
- </para>
+ <para>
+ This JSF navigation rule:
+ </para>
- <programlisting><![CDATA[<navigation-rule>
- <from-view-id>/editDocument.xhtml</from-view-id>
+ <programlisting role="XML"><![CDATA[<navigation-rule>
+ <from-view-id>/editDocument.xhtml</from-view-id>
- <navigation-case>
- <from-action>#{documentEditor.update}</from-action>
- <from-outcome>success</from-outcome>
- <to-view-id>/viewDocument.xhtml</to-view-id>
- <redirect/>
- </navigation-case>
+ <navigation-case>
+ <from-action>#{documentEditor.update}</from-action>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/viewDocument.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
</navigation-rule>]]></programlisting>
- <para>
- Can be rewritten as follows:
- </para>
+ <para>
+ Can be rewritten as follows:
+ </para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if-outcome="success">
@@ -399,7 +405,7 @@
component with string-valued return values (the JSF outcomes). So Seam
lets us write:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}"
evaluate="#{documentEditor.errors.size}">
@@ -414,7 +420,7 @@
Or even:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
@@ -436,7 +442,7 @@
conversation. We can do that like this:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
@@ -453,7 +459,7 @@
id as a request parameter which also makes the view bookmarkable:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
@@ -472,7 +478,7 @@
outcome, but <emphasis>not</emphasis> the null outcome:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule>
@@ -487,7 +493,7 @@
following form instead:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<render view-id="/viewDocument.xhtml"/>
@@ -499,7 +505,7 @@
The view-id may be given as a JSF EL expression:
</para>
- <programlisting><![CDATA[<page
view-id="/editDocument.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/editDocument.xhtml">
<navigation>
<rule if-outcome="success">
@@ -525,7 +531,7 @@
element, and the view id is implied:
</para>
- <programlisting><![CDATA[<page
action="#{calculator.calculate}">
+ <programlisting role="XML"><![CDATA[<page
action="#{calculator.calculate}">
<param name="x" value="#{calculator.lhs}"/>
<param name="y" value="#{calculator.rhs}"/>
<param name="op" converter="#{operatorConverter}"
value="#{calculator.op}"/>
@@ -550,7 +556,7 @@
We specify event listeners (observers) in
<literal>components.xml</literal>.
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<event type="hello">
<action execute="#{helloListener.sayHelloBack}"/>
<action execute="#{logger.logHello}"/>
@@ -567,7 +573,7 @@
component raise an event? Seam provides a built-in component for this.
</para>
- <programlisting><![CDATA[@Name("helloWorld")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloWorld")
public class HelloWorld {
public void sayHello() {
FacesMessages.instance().add("Hello World!");
@@ -579,7 +585,7 @@
Or you can use an annotation.
</para>
- <programlisting><![CDATA[@Name("helloWorld")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloWorld")
public class HelloWorld {
@RaiseEvent("hello")
public void sayHello() {
@@ -593,7 +599,7 @@
upon the producer:
</para>
- <programlisting><![CDATA[@Name("helloListener")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloListener")
public class HelloListener {
public void sayHelloBack() {
FacesMessages.instance().add("Hello to you too!");
@@ -607,7 +613,7 @@
file, you can use an annotation instead:
</para>
- <programlisting><![CDATA[@Name("helloListener")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloListener")
public class HelloListener {
@Observer("hello")
public void sayHelloBack() {
@@ -623,7 +629,7 @@
to pass an event object, you can:
</para>
- <programlisting><![CDATA[@Name("helloWorld")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloWorld")
public class HelloWorld {
private String name;
public void sayHello() {
@@ -632,7 +638,7 @@
}
}]]></programlisting>
- <programlisting><![CDATA[@Name("helloListener")
+ <programlisting
role="JAVA"><![CDATA[@Name("helloListener")
public class HelloListener {
@Observer("hello")
public void sayHelloBack(String name) {
@@ -705,7 +711,7 @@
allowing invoking an action listener method:
</para>
- <programlisting><![CDATA[public class LoggedInInterceptor {
+ <programlisting role="JAVA"><![CDATA[public class
LoggedInInterceptor {
@AroundInvoke
public Object checkLoggedIn(InvocationContext invocation) throws Exception {
@@ -732,7 +738,7 @@
our example, we would create an <literal>@LoggedIn</literal>
annotation, as follows:
</para>
- <programlisting><![CDATA[@Target(TYPE)
+ <programlisting role="JAVA"><![CDATA[@Target(TYPE)
@Retention(RUNTIME)
@Interceptors(LoggedInInterceptor.class)
public @interface LoggedIn {}]]></programlisting>
@@ -742,7 +748,7 @@
to apply the interceptor.
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Name("changePasswordAction")
@LoggedIn
@Interceptors(SeamInterceptor.class)
@@ -760,7 +766,7 @@
classes to specify a partial order of interceptors.
</para>
-<programlisting><![CDATA[(a)Interceptor(around={BijectionInterceptor.class,
+<programlisting
role="JAVA"><![CDATA[(a)Interceptor(around={BijectionInterceptor.class,
ValidationInterceptor.class,
ConversationInterceptor.class},
within=RemoveInterceptor.class)
@@ -774,7 +780,7 @@
functionality of EJB3:
</para>
-<programlisting><![CDATA[@Interceptor(type=CLIENT)
+<programlisting role="JAVA"><![CDATA[@Interceptor(type=CLIENT)
public class LoggedInInterceptor
{
...
@@ -866,7 +872,7 @@
filter declared in <literal>web.xml</literal>:
</para>
- <programlisting><![CDATA[<filter>
+ <programlisting role="XML"><![CDATA[<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
@@ -894,7 +900,7 @@
another Seam component.
</para>
- <programlisting><![CDATA[@HttpError(errorCode=404)
+ <programlisting
role="JAVA"><![CDATA[@HttpError(errorCode=404)
public class ApplicationException extends Exception { ... }]]></programlisting>
<para>
@@ -903,7 +909,7 @@
rollback of the current transaction.
</para>
- <programlisting><![CDATA[(a)Redirect(viewId="/failure.xhtml",
end=true)
+ <programlisting
role="JAVA"><![CDATA[(a)Redirect(viewId="/failure.xhtml",
end=true)
@ApplicationException(rollback=true)
public class UnrecoverableApplicationException extends RuntimeException { ...
}]]></programlisting>
@@ -922,7 +928,7 @@
current transaction.
</para>
- <programlisting><![CDATA[(a)Redirect(viewId="/error.xhtml",
message="Unexpected error")
+ <programlisting
role="JAVA"><![CDATA[(a)Redirect(viewId="/error.xhtml",
message="Unexpected error")
public class SystemException extends RuntimeException { ...
}]]></programlisting>
</section>
@@ -935,7 +941,7 @@
Seam also lets us specify this functionality in
<literal>pages.xml</literal>.
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<exception class="javax.persistence.EntityNotFoundException">
<http-error error-code="404"/>
@@ -972,7 +978,7 @@
conversation context, e.g. to access the message of the exception:
</para>
- <programlisting><![CDATA[...
+ <programlisting role="XML"><![CDATA[...
throw new AuthorizationException("You are not allowed to do this!");
<pages>
@@ -1004,7 +1010,7 @@
be generated when the specified exception occurs:
</para>
- <programlisting><![CDATA[ <exception
class="org.jboss.seam.security.NotLoggedInException" log="false">
+ <programlisting role="XML"><![CDATA[ <exception
class="org.jboss.seam.security.NotLoggedInException" log="false">
<redirect view-id="/register.xhtml">
<message severity="warn">You must be a member to use this
feature</message>
</redirect>
@@ -1016,7 +1022,7 @@
to control at which log level the exception will be logged:
</para>
- <programlisting><![CDATA[ <exception
class="org.jboss.seam.security.NotLoggedInException"
logLevel="info">
+ <programlisting role="XML"><![CDATA[ <exception
class="org.jboss.seam.security.NotLoggedInException"
logLevel="info">
<redirect view-id="/register.xhtml">
<message severity="warn">You must be a member to use this
feature</message>
</redirect>
@@ -1039,7 +1045,7 @@
If you are using JPA:
</para>
- <programlisting><![CDATA[<exception
class="javax.persistence.EntityNotFoundException">
+ <programlisting role="XML"><![CDATA[<exception
class="javax.persistence.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
</redirect>
@@ -1056,7 +1062,7 @@
If you are using the Seam Application Framework:
</para>
- <programlisting><![CDATA[<exception
class="org.jboss.seam.framework.EntityNotFoundException">
+ <programlisting role="XML"><![CDATA[<exception
class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
</redirect>
@@ -1066,7 +1072,7 @@
If you are using Seam Security:
</para>
- <programlisting><![CDATA[<exception
class="org.jboss.seam.security.AuthorizationException">
+ <programlisting role="XML"><![CDATA[<exception
class="org.jboss.seam.security.AuthorizationException">
<redirect>
<message>You don't have permission to do this</message>
</redirect>
@@ -1082,7 +1088,7 @@
And, for JSF:
</para>
- <programlisting><![CDATA[<exception
class="javax.faces.application.ViewExpiredException">
+ <programlisting role="XML"><![CDATA[<exception
class="javax.faces.application.ViewExpiredException">
<redirect view-id="/error.xhtml">
<message>Your session has timed out, please try again</message>
</redirect>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Framework.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Framework.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Framework.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -44,7 +44,7 @@
<literal>Person</literal> entity:
</para>
- <programlisting><![CDATA[<framework:entity-home
name="personHome"
+ <programlisting role="XML"><![CDATA[<framework:entity-home
name="personHome"
entity-class="eg.Person"
entity-manager="#{personDatabase}">
<framework:id>#{param.personId}</framework:id>
@@ -55,7 +55,7 @@
your taste, you can use extension instead:
</para>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("personHome")
public class PersonHome extends EntityHome<Person> implements LocalPersonHome {
@RequestParameter String personId;
@@ -110,7 +110,7 @@
class. Suppose we have our trusty <literal>Person</literal>
class:
</para>
- <programlisting><![CDATA[@Entity
+ <programlisting role="JAVA"><![CDATA[@Entity
public class Person {
@Id private Long id;
private String firstName;
@@ -125,13 +125,13 @@
configuration:
</para>
- <programlisting><![CDATA[<framework:entity-home
name="personHome" entity-class="eg.Person"
/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<framework:entity-home
name="personHome" entity-class="eg.Person"
/>]]></programlisting>
<para>
Or via extension:
</para>
- <programlisting><![CDATA[@Name("personHome")
+ <programlisting
role="JAVA"><![CDATA[@Name("personHome")
public class PersonHome extends EntityHome<Person> {}]]></programlisting>
<para>
@@ -147,7 +147,7 @@
We can use a Home directly from a JSF page, for example:
</para>
- <programlisting><![CDATA[<h1>Create Person</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>Create
Person</h1>
<h:form>
<div>First name: <h:inputText
value="#{personHome.instance.firstName}"/></div>
<div>Last name: <h:inputText
value="#{personHome.instance.lastName}"/></div>
@@ -162,7 +162,7 @@
line to <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<factory name="person"
+ <programlisting role="XML"><![CDATA[<factory
name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
@@ -173,7 +173,7 @@
Or by adding a <literal>@Factory</literal> method to
<literal>PersonHome</literal>:
</para>
- <programlisting><![CDATA[@Name("personHome")
+ <programlisting
role="JAVA"><![CDATA[@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@Factory("person")
@@ -186,7 +186,7 @@
This change simplifies our JSF page to the following:
</para>
- <programlisting><![CDATA[<h1>Create Person</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>Create
Person</h1>
<h:form>
<div>First name: <h:inputText
value="#{person.firstName}"/></div>
<div>Last name: <h:inputText
value="#{person.lastName}"/></div>
@@ -204,7 +204,7 @@
are a great way to do that:
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/editPerson.jsp">
<param name="personId" value="#{personHome.id}"/>
</page>
@@ -214,7 +214,7 @@
Now we can add the extra operations to our JSF page:
</para>
- <programlisting><![CDATA[<h1>
+ <programlisting role="XHTML"><![CDATA[<h1>
<h:outputText rendered="#{!personHome.managed}" value="Create
Person"/>
<h:outputText rendered="#{personHome.managed}" value="Edit
Person"/>
</h1>
@@ -240,7 +240,7 @@
nationality initialized. We can do that easily, via configuration:
</para>
- <programlisting><![CDATA[<factory name="person"
+ <programlisting role="XML"><![CDATA[<factory
name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
@@ -256,7 +256,7 @@
Or by extension:
</para>
- <programlisting><![CDATA[@Name("personHome")
+ <programlisting
role="JAVA"><![CDATA[@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@@ -280,7 +280,7 @@
just add methods to <literal>PersonHome</literal>.
</para>
- <programlisting><![CDATA[@Name("personHome")
+ <programlisting
role="JAVA"><![CDATA[@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@@ -316,7 +316,7 @@
successful. To customize these messages we can, again, use configuration:
</para>
- <programlisting><![CDATA[<factory name="person"
+ <programlisting role="XML"><![CDATA[<factory
name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
@@ -336,7 +336,7 @@
Or extension:
</para>
- <programlisting><![CDATA[@Name("personHome")
+ <programlisting
role="JAVA"><![CDATA[@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@@ -385,14 +385,14 @@
can use a Query object. For example:
</para>
- <programlisting><![CDATA[<framework:entity-query
name="people"
+ <programlisting role="XML"><![CDATA[<framework:entity-query
name="people"
ejbql="select p from Person
p"/>]]></programlisting>
<para>
We can use it from a JSF page:
</para>
- <programlisting><![CDATA[<h1>List of people</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>List of
people</h1>
<h:dataTable value="#{people.resultList}" var="person">
<h:column>
<s:link view="/editPerson.jsp" value="#{person.firstName}
#{person.lastName}">
@@ -405,7 +405,7 @@
We probably need to support pagination:
</para>
- <programlisting><![CDATA[<framework:entity-query
name="people"
+ <programlisting role="XML"><![CDATA[<framework:entity-query
name="people"
ejbql="select p from Person p"
order="lastName"
max-results="20"/>]]></programlisting>
@@ -415,7 +415,7 @@
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
<page view-id="/searchPerson.jsp">
<param name="firstResult"
value="#{people.firstResult}"/>
</page>
@@ -425,7 +425,7 @@
The JSF code for a pagination control is a bit verbose, but manageable:
</para>
- <programlisting><![CDATA[<h1>Search for people</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>Search for
people</h1>
<h:dataTable value="#{people.resultList}" var="person">
<h:column>
<s:link view="/editPerson.jsp" value="#{person.firstName}
#{person.lastName}">
@@ -456,7 +456,7 @@
optional "restrictions" to support this important usecase:
</para>
- <programlisting><![CDATA[<component name="examplePerson"
class="Person"/>
+ <programlisting role="XML"><![CDATA[<component
name="examplePerson" class="Person"/>
<framework:entity-query name="people"
ejbql="select p from Person p"
@@ -472,7 +472,7 @@
Notice the use of an "example" object.
</para>
- <programlisting><![CDATA[<h1>Search for people</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>Search for
people</h1>
<h:form>
<div>First name: <h:inputText
value="#{examplePerson.firstName}"/></div>
<div>Last name: <h:inputText
value="#{examplePerson.lastName}"/></div>
@@ -492,7 +492,7 @@
<literal>org.jboss.seam.afterTransactionSuccess</literal> event:
</para>
- <programlisting><![CDATA[<event
type="org.jboss.seam.afterTransactionSuccess">
+ <programlisting role="XML"><![CDATA[<event
type="org.jboss.seam.afterTransactionSuccess">
<action execute="#{people.refresh}" />
</event>]]></programlisting>
@@ -501,7 +501,7 @@
removed through <literal>PersonHome</literal>:
</para>
- <programlisting><![CDATA[<event
type="org.jboss.seam.afterTransactionSuccess.Person">
+ <programlisting role="XML"><![CDATA[<event
type="org.jboss.seam.afterTransactionSuccess.Person">
<action execute="#{people.refresh}" />
</event>]]></programlisting>
@@ -539,7 +539,7 @@
Seam registration example would look like:
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Name("register")
public class RegisterAction extends EntityController implements Register
{
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gettingstarted.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gettingstarted.xml 2008-03-25 22:33:50
UTC (rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gettingstarted.xml 2008-03-25 22:36:31
UTC (rev 7693)
@@ -342,7 +342,7 @@
hot deployment at development time. You need to enable debug mode in both
Seam and Facelets, by adding this
line to <literal>components.xml</literal>:</para>
- <programlisting><core:init
debug="true"/></programlisting>
+ <programlisting role="XML"><![CDATA[<core:init
debug="true">]]></programlisting>
<para>Now, the following files may be redeployed without requiring a full
restart of the web application:</para>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Groovy.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Groovy.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Groovy.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -54,7 +54,7 @@
<section>
<title>Entity</title>
- <programlisting> @Entity
+ <programlisting role="JAVA"> @Entity
@Name("hotel")
class Hotel implements Serializable
{
@@ -109,7 +109,7 @@
<para>Writing Seam components in Groovy is in no way different than
in Java: annotations are used to
mark the class as a Seam component.</para>
- <programlisting>(a)Scope(ScopeType.SESSION)
+ <programlisting role="JAVA">(a)Scope(ScopeType.SESSION)
@Name("bookingList")
class BookingListAction implements Serializable
{
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gwt.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gwt.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Gwt.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -34,20 +34,18 @@
GWT interface
<literal>com.google.gwt.user.client.rpc.RemoteService</literal>:
</para>
- <programlisting><![CDATA[ public interface MyService extends RemoteService
- {
+ <programlisting role="JAVA"><![CDATA[public interface MyService
extends RemoteService {
public String askIt(String question);
- }]]></programlisting>
+ }]]></programlisting>
<para>
The asynchronous interface should be identical, except that it also contains an
additional
<literal>AsyncCallback</literal> parameter for each of the methods it
declares:
</para>
- <programlisting><![CDATA[ public interface MyServiceAsync extends
RemoteService
- {
- public void askIt(String question, AsyncCallback callback);
- }]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[public interface
MyServiceAsync extends RemoteService {
+ public void askIt(String question, AsyncCallback callback);
+}]]></programlisting>
<para>
The asynchronous interface, in this example
<literal>MyServiceAsync</literal>, will be implemented by GWT and
@@ -58,26 +56,24 @@
The next step, is to create a Seam component that implements the synchronous
interface:
</para>
- <programlisting><![CDATA[
@Name("org.jboss.seam.example.remoting.gwt.client.MyService")
- public class ServiceImpl implements MyService
- {
- @WebRemote
- public String askIt(String question)
- {
- if (!validate(question))
- {
- throw new IllegalStateException("Hey, this shouldn't happen, I checked
on the client, " +
- "but its always good to double check.");
+ <programlisting
role="JAVA"><![CDATA[(a)Name("org.jboss.seam.example.remoting.gwt.client.MyService")
+public class ServiceImpl implements MyService {
+
+ @WebRemote
+ public String askIt(String question) {
+
+ if (!validate(question)) {
+ throw new IllegalStateException("Hey, this shouldn't happen, I checked
on the client, " +
+ "but its always good to double check.");
}
return "42. Its the real question that you seek now.";
- }
+ }
- public boolean validate(String q)
- {
+ public boolean validate(String q) {
ValidationUtility util = new ValidationUtility();
return util.isValid(q);
- }
- }]]></programlisting>
+ }
+}]]></programlisting>
<para>
The methods that should be made accessible via GWT need to be annotated with the
@@ -94,44 +90,36 @@
asynchronous client stub:
</para>
- <programlisting><![CDATA[ private MyServiceAsync getService()
- {
- String endpointURL = GWT.getModuleBaseURL() + "seam/resource/gwt";
+ <programlisting role="JAVA"><![CDATA[private MyServiceAsync
getService() {
+ String endpointURL = GWT.getModuleBaseURL() + "seam/resource/gwt";
- MyServiceAsync svc = (MyServiceAsync) GWT.create(MyService.class);
- ((ServiceDefTarget) svc).setServiceEntryPoint(endpointURL);
- return svc;
- }]]></programlisting>
+ MyServiceAsync svc = (MyServiceAsync) GWT.create(MyService.class);
+ ((ServiceDefTarget) svc).setServiceEntryPoint(endpointURL);
+ return svc;
+}]]></programlisting>
<para>
The final step is to write the widget code that invokes the method on the client
stub. The following example
creates a simple user interface with a label, text input and a button:
</para>
- <programlisting><![CDATA[
-public class AskQuestionWidget extends Composite
-{
+ <programlisting role="JAVA"><![CDATA[
+public class AskQuestionWidget extends Composite {
private AbsolutePanel panel = new AbsolutePanel();
- public AskQuestionWidget()
- {
+ public AskQuestionWidget() {
Label lbl = new Label("OK, what do you want to know?");
panel.add(lbl);
final TextBox box = new TextBox();
box.setText("What is the meaning of life?");
panel.add(box);
Button ok = new Button("Ask");
- ok.addClickListener(new ClickListener()
- {
- public void onClick(Widget w)
- {
+ ok.addClickListener(new ClickListener() {
+ public void onClick(Widget w) {
ValidationUtility valid = new ValidationUtility();
- if (!valid.isValid(box.getText()))
- {
+ if (!valid.isValid(box.getText())) {
Window.alert("A question has to end with a '?'");
- }
- else
- {
+ } else {
askServer(box.getText());
}
}
@@ -141,24 +129,19 @@
initWidget(panel);
}
- private void askServer(String text)
- {
- getService().askIt(text, new AsyncCallback()
- {
- public void onFailure(Throwable t)
- {
+ private void askServer(String text) {
+ getService().askIt(text, new AsyncCallback() {
+ public void onFailure(Throwable t) {
Window.alert(t.getMessage());
}
- public void onSuccess(Object data)
- {
+ public void onSuccess(Object data) {
Window.alert((String) data);
}
});
}
- ...
- ]]></programlisting>
+ ...]]></programlisting>
<para>
@@ -197,11 +180,11 @@
Then, in your ant file, place (near the top of your ant file):
</para>
- <programlisting><![CDATA[ <taskdef
uri="antlib:de.samaflost.gwttasks"
- resource="de/samaflost/gwttasks/antlib.xml"
- classpath="./lib/gwttasks.jar"/>
+ <programlisting role="XML"><![CDATA[<taskdef
uri="antlib:de.samaflost.gwttasks"
+ resource="de/samaflost/gwttasks/antlib.xml"
+ classpath="./lib/gwttasks.jar"/>
- <property file="build.properties"/>]]></programlisting>
+ <property file="build.properties"/>]]></programlisting>
<para>
Create a <literal>build.properties</literal> file, which has the
contents:
@@ -213,22 +196,22 @@
This of course should point to the directory where GWT is installed. Then to use
it, create a target:
</para>
- <programlisting><![CDATA[ <!-- the following are are handy utilities for
doing GWT development.
- To use GWT, you will of course need to download GWT seperately -->
- <target name="gwt-compile">
+ <programlisting role="XML"><![CDATA[<!-- the following are are
handy utilities for doing GWT development.
+ To use GWT, you will of course need to download GWT seperately -->
+ <target name="gwt-compile">
<!-- in this case, we are "re homing" the gwt generated stuff, so in
this case
we can only have one GWT module - we are doing this deliberately to keep the URL
short -->
<delete>
- <fileset dir="view"/>
+ <fileset dir="view"/>
</delete>
<gwt:compile outDir="build/gwt"
- gwtHome="${gwt.home}"
- classBase="${gwt.module.name}"
- sourceclasspath="src"/>
+ gwtHome="${gwt.home}"
+ classBase="${gwt.module.name}"
+ sourceclasspath="src"/>
<copy todir="view">
- <fileset dir="build/gwt/${gwt.module.name}"/>
+ <fileset dir="build/gwt/${gwt.module.name}"/>
</copy>
- </target>]]></programlisting>
+ </target>]]></programlisting>
<para>
This target when called will compile the GWT application, and copy it to the
specified directory (which would be
@@ -245,6 +228,4 @@
</para>
</section>
-
-
</chapter>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Hsearch.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Hsearch.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Hsearch.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -40,46 +40,46 @@
configuration parameters. Here is a minimal persistence unit configuration
to get started.</para>
- <programlisting> <persistence-unit name="sample">
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <properties>
- [...]
- <emphasis role="bold"><!-- use a file system based index
-->
- <property name="hibernate.search.default.directory_provider"
-
value="org.hibernate.search.store.FSDirectoryProvider"/>
- <!-- directory where the indexes will be stored -->
- <property name="hibernate.search.default.indexBase"
-
value="/Users/prod/apps/dvdstore/dvdindexes"/></emphasis>
- </properties>
- </persistence-unit></programlisting>
+ <programlisting role="XML"><![CDATA[<persistence-unit
name="sample">
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ [...]
+ <!-- use a file system based index -->
+ <property name="hibernate.search.default.directory_provider"
+ value="org.hibernate.search.store.FSDirectoryProvider"/>
+ <!-- directory where the indexes will be stored -->
+ <property name="hibernate.search.default.indexBase"
+ value="/Users/prod/apps/dvdstore/dvdindexes"/>
+ </properties>
+</persistence-unit>]]></programlisting>
<para>If you plan to target Hibernate Annotations or EntityManager 3.2.x
(embedded into JBoss AS 4.2.GA), you also need to configure the
appropriate event listeners.</para>
- <programlisting> <persistence-unit name="sample">
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <properties>
- [...]
- <!-- use a file system based index -->
- <property name="hibernate.search.default.directory_provider"
-
value="org.hibernate.search.store.FSDirectoryProvider"/>
- <!-- directory where the indexes will be stored -->
- <property name="hibernate.search.default.indexBase"
- value="/Users/prod/apps/dvdstore/dvdindexes"/>
+ <programlisting role="XML"><![CDATA[<persistence-unit
name="sample">
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ [...]
+ <!-- use a file system based index -->
+ <property name="hibernate.search.default.directory_provider"
+ value="org.hibernate.search.store.FSDirectoryProvider"/>
+ <!-- directory where the indexes will be stored -->
+ <property name="hibernate.search.default.indexBase"
+ value="/Users/prod/apps/dvdstore/dvdindexes"/>
- <emphasis role="bold"><property
name="hibernate.ejb.event.post-insert"
-
value="org.hibernate.search.event.FullTextIndexEventListener"/>
- <property name="hibernate.ejb.event.post-update"
-
value="org.hibernate.search.event.FullTextIndexEventListener"/>
- <property name="hibernate.ejb.event.post-delete"
-
value="org.hibernate.search.event.FullTextIndexEventListener"/></emphasis>
+ <property name="hibernate.ejb.event.post-insert"
+
value="org.hibernate.search.event.FullTextIndexEventListener"/>
+ <property name="hibernate.ejb.event.post-update"
+
value="org.hibernate.search.event.FullTextIndexEventListener"/>
+ <property name="hibernate.ejb.event.post-delete"
+
value="org.hibernate.search.event.FullTextIndexEventListener"/>
- </properties>
- </persistence-unit></programlisting>
+ </properties>
+</persistence-unit>]]></programlisting>
<note>
- <para>This step is no longer useful if Hibernate Annotation or
+ <para>This step is no longer necessary if Hibernate Annotation or
EntityManager 3.3.x are used.</para>
</note>
@@ -123,13 +123,12 @@
<para>When Hibernate Search is present, JBoss Seam injects a
<classname>FullTextSession</classname>.</para>
- <programlisting>@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("search")
-public class FullTextSearchAction implements FullTextSearch, Serializable
-{
- @In
- <emphasis role="bold">FullTextSession session;</emphasis>
+public class FullTextSearchAction implements FullTextSearch, Serializable {
+ @In FullTextSession session;
+
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
org.hibernate.Query query session.createFullTextQuery(luceneQuery, Product.class);
@@ -139,10 +138,8 @@
.list();
}
[...]
-}
+}]]></programlisting>
-</programlisting>
-
<note>
<para><classname>FullTextSession</classname> extends
<classname>org.hibernate.Session</classname> so that it can be used as
a
@@ -152,12 +149,11 @@
<para>If the Java Persistence API is used, a smoother integration is
proposed.</para>
- <programlisting>@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("search")
-public class FullTextSearchAction implements FullTextSearch, Serializable
-{
- @In
- <emphasis role="bold">FullTextEntityManager em;</emphasis>
+public class FullTextSearchAction implements FullTextSearch, Serializable {
+
+ @In FullTextEntityManager em;
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
@@ -168,7 +164,7 @@
.getResultList();
}
[...]
-} </programlisting>
+}]]></programlisting>
<para>When Hibernate Search is present, a
<classname>FulltextEntityManager</classname> is injected.
@@ -185,16 +181,15 @@
<classname>FullTextEntityManager</classname> implementation: downcasting
is then possible.</para>
- <programlisting>@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("search")
-public class FullTextSearchAction implements FullTextSearch, Serializable
-{
- @PersistenceContext
- EntityManager em;
+public class FullTextSearchAction implements FullTextSearch, Serializable {
+
+ @PersistenceContext EntityManager em;
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
- <emphasis role="bold">FullTextEntityManager ftEm =
(FullTextEntityManager) em;</emphasis>
+ FullTextEntityManager ftEm = (FullTextEntityManager) em;
javax.persistence.Query query = ftEm.createFullTextQuery(luceneQuery,
Product.class);
searchResults = query
.setMaxResults(pageSize + 1)
@@ -202,7 +197,7 @@
.getResultList();
}
[...]
-} </programlisting>
+}]]></programlisting>
<para></para>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/I18n.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/I18n.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/I18n.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -56,7 +56,7 @@
form in your JSP or Facelets page:
</para>
-<programlisting><![CDATA[<h:selectOneMenu
value="#{localeSelector.language}">
+<programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{localeSelector.language}">
<f:selectItem itemLabel="English" itemValue="en"/>
<f:selectItem itemLabel="Deutsch" itemValue="de"/>
<f:selectItem itemLabel="Francais" itemValue="fr"/>
@@ -68,7 +68,7 @@
<literal>faces-config.xml</literal>, just use:
</para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{localeSelector.localeString}">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{localeSelector.localeString}">
<f:selectItems value="#{localeSelector.supportedLocales}"/>
</h:selectOneMenu>
<h:commandButton action="#{localeSelector.select}"
value="#{messages['ChangeLanguage']}"/>]]></programlisting>
@@ -126,7 +126,7 @@
messages.
</para>
- <programlisting><![CDATA[<core:resource-loader>
+ <programlisting
role="XML"><![CDATA[<core:resource-loader>
<core:bundle-names>
<value>mycompany_messages</value>
<value>standard_messages</value>
@@ -146,7 +146,7 @@
You can even specify an explicit bundle name in
<literal>pages.xml</literal>:
</para>
- <programlisting><![CDATA[<page view-id="/welcome/hello.jsp"
bundle="HelloMessages"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<page
view-id="/welcome/hello.jsp"
bundle="HelloMessages"/>]]></programlisting>
<para>
Then we could use messages defined in
<literal>HelloMessages.properties</literal>
@@ -163,13 +163,13 @@
on every page. Instead, you can simply type:
</para>
- <programlisting><![CDATA[<h:outputText
value="#{messages['Hello']}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:outputText
value="#{messages['Hello']}"/>]]></programlisting>
<para>
or:
</para>
- <programlisting><![CDATA[<h:outputText
value="#{messages.Hello}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:outputText
value="#{messages.Hello}"/>]]></programlisting>
<para>
Even better, the messages themselves may contain EL expressions:
@@ -182,8 +182,8 @@
You can even use the messages in your code:
</para>
- <programlisting><![CDATA[@In private Map<String, String>
messages;]]></programlisting>
- <programlisting><![CDATA[@In("#{messages['Hello']}")
private String helloMessage;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@In private
Map<String, String> messages;]]></programlisting>
+ <programlisting
role="JAVA"><![CDATA[@In("#{messages['Hello']}") private
String helloMessage;]]></programlisting>
</section>
@@ -195,7 +195,7 @@
we just described also works for faces messages:
</para>
- <programlisting><![CDATA[@Name("hello")
+ <programlisting role="JAVA"><![CDATA[@Name("hello")
@Stateless
public class HelloBean implements Hello {
@In FacesMessages facesMessages;
@@ -243,7 +243,7 @@
First, configure the set of supported themes:
</para>
- <programlisting><![CDATA[<theme:theme-selector
cookie-enabled="true">
+ <programlisting role="XML"><![CDATA[<theme:theme-selector
cookie-enabled="true">
<theme:available-themes>
<value>default</value>
<value>accessible</value>
@@ -276,18 +276,18 @@
to theme the stylesheet in a facelets page:
</para>
- <programlisting><![CDATA[<link href="#{theme.css}"
rel="stylesheet" type="text/css" />]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<link
href="#{theme.css}" rel="stylesheet" type="text/css"
/>]]></programlisting>
<para>Or, when the page definition resides in a subdirectory:</para>
- <programlisting><![CDATA[<link
href="#{facesContext.externalContext.requestContextPath}#{theme.css}"
+ <programlisting role="XHTML"><![CDATA[<link
href="#{facesContext.externalContext.requestContextPath}#{theme.css}"
rel="stylesheet" type="text/css"
/>]]></programlisting>
<para>
Most powerfully, facelets lets us theme the template used by a
<literal><ui:composition></literal>:
</para>
- <programlisting><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML"><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
@@ -298,7 +298,7 @@
the user to freely switch themes:
</para>
- <programlisting><![CDATA[<h:selectOneMenu
value="#{themeSelector.theme}">
+ <programlisting role="XHTML"><![CDATA[<h:selectOneMenu
value="#{themeSelector.theme}">
<f:selectItems value="#{themeSelector.themes}"/>
</h:selectOneMenu>
<h:commandButton action="#{themeSelector.select}" value="Select
Theme"/>]]></programlisting>
@@ -313,7 +313,7 @@
<literal>cookie-enabled</literal> property in
<literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<theme:theme-selector
cookie-enabled="true">
+ <programlisting role="XML"><![CDATA[<theme:theme-selector
cookie-enabled="true">
<theme:available-themes>
<value>default</value>
<value>accessible</value>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Itext.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Itext.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Itext.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -133,9 +133,9 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:document
xmlns:p="http://jboss.com/products/seam/pdf">
+ <programlisting
role="XHTML"><![CDATA[<p:document
xmlns:p="http://jboss.com/products/seam/pdf">
The document goes here.
-</p:document></programlisting>
+</p:document>]]></programlisting>
</entry>
@@ -234,24 +234,12 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:paragraph
alignment="justify">
+ <programlisting
role="XHTML"><![CDATA[<p:paragraph alignment="justify">
This is a simple document. It isn't very fancy.
-</p:paragraph></programlisting>
+</p:paragraph>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -283,25 +271,14 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:paragraph>
- The item costs <p:text value="#{product.price}">
- <f:convertNumber type="currency"
currencySymbol="$"/>
- </p:text>
-</p:paragraph></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:paragraph>
+ The item costs <p:text value="#{product.price}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </p:text>
+</p:paragraph>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -331,35 +308,24 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting>
-<p:html value="This is HTML with &lt;b&gt;some
markup&lt;/b&gt;." />
-<p:html>
- <h1>This is more complex HTML</h1>
- <ul>
- <li>one</li>
- <li>two</li>
- <li>three</li>
- </ul>
-</p:html>
+ <programlisting
role="XHTML"><![CDATA[
+<p:html value="This is HTML with <b>some markup</b>." />
+<p:html>
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+</p:html>
-<p:html>
- <s:formattedText value="*This* is |Seam Text| as HTML. It's
very^cool^." />
-</p:html>
-</programlisting>
+<p:html>
+ <s:formattedText value="*This* is |Seam Text| as HTML. It's
very^cool^." />
+</p:html>
+]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -406,24 +372,12 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:font
name="courier" style="bold"
size="24">
- <p:paragraph>My Title</p:paragraph>
-</p:font></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:font name="courier"
style="bold" size="24">
+ <p:paragraph>My Title</p:paragraph>
+</p:font>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -443,22 +397,10 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:newPage
/></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:newPage />]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -584,22 +526,12 @@
</para>
- <programlisting><p:image
value="/jboss.jpg" /></programlisting>
- <programlisting><p:image
value="#{images.chart}" /></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:image value="/jboss.jpg"
/>]]></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:image value="#{images.chart}"
/>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -640,12 +572,12 @@
<para>
<emphasis>Usage</emphasis>
</para>
-
<programlisting><p:listItem><p:anchor
reference="#reason1">Reason
1</p:anchor></p:listItem>
+ <programlisting
role="XHTML"><![CDATA[<p:listItem><p:anchor
reference="#reason1">Reason 1</p:anchor></p:listItem>
...
-<p:paragraph>
- <p:anchor name="reason1">It's the quickest
way to get "rich"</p:anchor>
+<p:paragraph>
+ <p:anchor name="reason1">It's the quickest way to get
"rich"</p:anchor>
...
-</p:paragraph></programlisting>
+</p:paragraph>]]></programlisting>
</entry>
</row>
@@ -729,29 +661,17 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:facet
name="header">
- <p:font size="12">
- <p:footer borderWidthTop="1"
borderColorTop="blue"
- borderWidthBottom="0"
alignment="center">
- Why Seam? [<p:pageNumber />]
- </p:footer>
- </p:font>
-</f:facet></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:facet name="header">
+ <p:font size="12">
+ <p:footer borderWidthTop="1" borderColorTop="blue"
+ borderWidthBottom="0" alignment="center">
+ Why Seam? [<p:pageNumber />]
+ </p:footer>
+ </p:font>
+</f:facet>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -768,7 +688,7 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:footer
borderWidthTop="1" borderColorTop="blue"
+ <programlisting
role="XHTML"><p:footer borderWidthTop="1"
borderColorTop="blue"
borderWidthBottom="0"
alignment="center">
Why Seam? [<p:pageNumber />]
</p:footer></programlisting>
@@ -845,35 +765,24 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:document
xmlns:p="http://jboss.com/products/seam/pdf"
- title="Hello">
+ <programlisting
role="XHTML"><![CDATA[<p:document
xmlns:p="http://jboss.com/products/seam/pdf"
+ title="Hello">
- <p:chapter number="1">
-
<p:title><p:paragraph>Hello</p:paragraph></p:title>
- <p:paragraph>Hello #{user.name}!</p:paragraph>
- </p:chapter>
+ <p:chapter number="1">
+ <p:title><p:paragraph>Hello</p:paragraph></p:title>
+ <p:paragraph>Hello #{user.name}!</p:paragraph>
+ </p:chapter>
- <p:chapter number="2">
-
<p:title><p:paragraph>Goodbye</p:paragraph></p:title>
- <p:paragraph>Goodbye #{user.name}.</p:paragraph>
- </p:chapter>
+ <p:chapter number="2">
+ <p:title><p:paragraph>Goodbye</p:paragraph></p:title>
+ <p:paragraph>Goodbye #{user.name}.</p:paragraph>
+ </p:chapter>
-</p:document> </programlisting>
+</p:document> ]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -905,15 +814,15 @@
following document uses the <literal>ui:repeat</literal> tag
to to display a list of values retrieved
from a Seam component. </para>
- <programlisting><p:document
xmlns:p="http://jboss.com/products/seam/pdf"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
- title="Hello">
- <p:list style="numbered">
- <ui:repeat value="#{documents}"
var="doc">
- <p:listItem>#{doc.name}</p:listItem>
- </ui:repeat>
- </p:list>
-</p:document></programlisting>
+ <programlisting role="XHTML"><![CDATA[<p:document
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ title="Hello">
+ <p:list style="numbered">
+ <ui:repeat value="#{documents}" var="doc">
+ <p:listItem>#{doc.name}</p:listItem>
+ </ui:repeat>
+ </p:list>
+</p:document>]]></programlisting>
@@ -981,25 +890,14 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:list
style="numbered">
- <ui:repeat value="#{documents}"
var="doc">
- <p:listItem>#{doc.name}</p:listItem>
- </ui:repeat>
-</p:list></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:list style="numbered">
+ <ui:repeat value="#{documents}" var="doc">
+ <p:listItem>#{doc.name}</p:listItem>
+ </ui:repeat>
+</p:list>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -1057,7 +955,7 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting>...</programlisting>
+ <programlisting
role="XHTML">...</programlisting>
</entry>
</row>
@@ -1223,30 +1121,20 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:table
columns="3" headerRows="1">
- <p:cell>name</p:cell>
- <p:cell>owner</p:cell>
- <p:cell>size</p:cell>
- <ui:repeat value="#{documents}"
var="doc">
- <p:cell>#{doc.name}</p:cell>
- <p:cell>#{doc.user.name}</p:cell>
- <p:cell>#{doc.size}</p:cell>
- </ui:repeat>
-</p:table></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:table columns="3"
headerRows="1">
+ <p:cell>name</p:cell>
+ <p:cell>owner</p:cell>
+ <p:cell>size</p:cell>
+ <ui:repeat value="#{documents}" var="doc">
+ <p:cell>#{doc.name}</p:cell>
+ <p:cell>#{doc.user.name}</p:cell>
+ <p:cell>#{doc.size}</p:cell>
+ </ui:repeat>
+</p:table>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <informaltable>
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -1418,7 +1306,7 @@
<para>
<emphasis>Usage</emphasis>
</para>
-
<programlisting><p:cell>...</p:cell></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:cell>...</p:cell>]]></programlisting>
</entry>
</row>
@@ -1467,30 +1355,29 @@
actual PDF name like <literal>/myDocument.pdf</literal>. This
capability requires some configuration. To
serve PDF files, all *.pdf resources should be mapped to the
DocumentStoreServlet:</para>
- <programlisting>
-<servlet>
- <servlet-name>Document Store Servlet</servlet-name>
-
<servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
-</servlet>
+ <programlisting role="XML"><![CDATA[<servlet>
+ <servlet-name>Document Store Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
+</servlet>
-<servlet-mapping>
- <servlet-name>Document Store Servlet</servlet-name>
- <url-pattern>*.pdf</url-pattern>
-</servlet-mapping></programlisting>
+<servlet-mapping>
+ <servlet-name>Document Store Servlet</servlet-name>
+ <url-pattern>*.pdf</url-pattern>
+</servlet-mapping>]]></programlisting>
<para> The <literal>use-extensions</literal> option on the
document store component completes the
functionality by instructing the document store to generate URLs with the
correct filename extension for
the document type being generated. </para>
- <programlisting><components
xmlns="http://jboss.com/products/seam/components"
-
xmlns:pdf="http://jboss.com/products/seam/pdf">
- <pdf:document-store use-extensions="true" />
-</components></programlisting>
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:pdf="http://jboss.com/products/seam/pdf">
+ <pdf:document-store use-extensions="true" />
+</components>]]></programlisting>
<para> Generated documents are stored in conversation scope and will
expire when the conversation ends. At
that point, references to the document will be invalid. To You can
specify a default view to be shown
when a document does not exist using the
<literal>error-page</literal> property of the documentStore. </para>
- <programlisting><pdf:document-store
use-extensions="true" error-page="/pdfMissing.seam"
/></programlisting>
+ <programlisting role="XML"><![CDATA[<pdf:document-store
use-extensions="true" error-page="/pdfMissing.seam"
/>]]></programlisting>
</section>
</section>
@@ -1696,32 +1583,19 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting>
-<p:barchart title="Bar Chart" legend="true"
- width="500" height="500">
- <p:series key="Last Year">
- <p:data columnKey="Joe" value="100"
/>
- <p:data columnKey="Bob" value="120"
/>
- </p:series> <p:series key="This
Year">
- <p:data columnKey="Joe" value="125"
/>
- <p:data columnKey="Bob" value="115"
/>
- </p:series>
-</p:barchart>
- </programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:barchart title="Bar Chart"
legend="true"
+ width="500" height="500">
+ <p:series key="Last Year">
+ <p:data columnKey="Joe" value="100" />
+ <p:data columnKey="Bob" value="120" />
+ </p:series> <p:series key="This Year">
+ <p:data columnKey="Joe" value="125" />
+ <p:data columnKey="Bob" value="115" />
+ </p:series>
+</p:barchart>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable id="itext.linechart">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -1908,29 +1782,19 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:linechart
title="Line Chart"
- width="500" height="500">
- <p:series key="Prices">
- <p:data columnKey="2003" value="7.36"
/>
- <p:data columnKey="2004" value="11.50"
/>
- <p:data columnKey="2005"
value="34.625" />
- <p:data columnKey="2006" value="76.30"
/>
- <p:data columnKey="2007" value="85.05"
/>
- </p:series>
-</p:linechart></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:linechart title="Line Chart"
+ width="500" height="500">
+ <p:series key="Prices">
+ <p:data columnKey="2003" value="7.36" />
+ <p:data columnKey="2004" value="11.50" />
+ <p:data columnKey="2005" value="34.625" />
+ <p:data columnKey="2006" value="76.30" />
+ <p:data columnKey="2007" value="85.05" />
+ </p:series>
+</p:linechart>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <informaltable id="itext.piechart">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -2070,34 +1934,19 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting>
-
-<p:piechart title="Pie Chart" circular="false"
direction="anticlockwise"
- startAngle="30" labelGap="0.1"
labelLinkPaint="red">
- <p:series key="Prices">
- <p:data key="2003" columnKey="2003"
value="7.36" />
- <p:data key="2004" columnKey="2004"
value="11.50" />
- <p:data key="2005" columnKey="2005"
value="34.625" />
- <p:data key="2006" columnKey="2006"
value="76.30" />
- <p:data key="2007" columnKey="2007"
value="85.05" />
- </p:series>
-</p:piechart>
-
- </programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:piechart title="Pie Chart"
circular="false" direction="anticlockwise"
+ startAngle="30" labelGap="0.1"
labelLinkPaint="red">
+ <p:series key="Prices">
+ <p:data key="2003" columnKey="2003" value="7.36"
/>
+ <p:data key="2004" columnKey="2004"
value="11.50" />
+ <p:data key="2005" columnKey="2005"
value="34.625" />
+ <p:data key="2006" columnKey="2006"
value="76.30" />
+ <p:data key="2007" columnKey="2007"
value="85.05" />
+ </p:series>
+</p:piechart>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable id="itext.series">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -2165,24 +2014,14 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:series
key="data1">
- <ui:repeat value="#{data.pieData1}"
var="item">
- <p:data columnKey="#{item.name}"
value="#{item.value}" />
- </ui:repeat>
-</p:series></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:series key="data1">
+ <ui:repeat value="#{data.pieData1}" var="item">
+ <p:data columnKey="#{item.name}" value="#{item.value}"
/>
+ </ui:repeat>
+</p:series>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <informaltable id="itext.chartdata">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -2240,26 +2079,14 @@
- <programlisting><p:data
key="foo" value="20"
sectionPaint="#111111"
- explodedPercent=".2" />
-<p:data key="bar" value="30"
sectionPaint="#333333" />
-<p:data key="baz" value="40"
sectionPaint="#555555"
- sectionOutlineStroke="my-dot-style"
/></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:data key="foo" value="20"
sectionPaint="#111111"
+ explodedPercent=".2" />
+<p:data key="bar" value="30" sectionPaint="#333333"
/>
+<p:data key="baz" value="40" sectionPaint="#555555"
+ sectionOutlineStroke="my-dot-style" />]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
-
- <informaltable id="itext.color">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -2303,23 +2130,12 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:color
id="foo" color="#0ff00f"/>
-<p:color id="bar" color="#ff00ff"
color2="#00ff00"
- point="50 50" point2="300
300"/> </programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:color id="foo"
color="#0ff00f"/>
+<p:color id="bar" color="#ff00ff" color2="#00ff00"
+ point="50 50" point2="300
300"/>]]></programlisting>
</entry>
</row>
- </tbody>
- </tgroup>
- </informaltable>
-
-
- <informaltable id="itext.stroke">
- <tgroup cols="2">
- <colspec colnum="1" colwidth="1*"/>
- <colspec colnum="2" colwidth="3*"/>
-
- <tbody>
<row>
<entry valign="top">
<para>
@@ -2376,7 +2192,7 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:stroke
id="dot2" width="2" cap="round"
join="bevel" dash="2 3" />
</programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:stroke id="dot2" width="2"
cap="round" join="bevel" dash="2 3"
/>]]></programlisting>
</entry>
</row>
@@ -2490,13 +2306,12 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting>
-<p:barCode type="code128"
- barHeight="80"
- textSize="20"
- code="(10)45566(17)040301"
- codeType="code128_ucc"
- altText="My BarCode" /></programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:barCode type="code128"
+ barHeight="80"
+ textSize="20"
+ code="(10)45566(17)040301"
+ codeType="code128_ucc"
+ altText="My BarCode" />]]></programlisting>
</entry>
</row>
@@ -2554,9 +2369,7 @@
<para>
<emphasis>Usage</emphasis>
</para>
- <programlisting>
-<p:swing width="310" height="120"
component="#{aButton}" />
- </programlisting>
+ <programlisting
role="XHTML"><![CDATA[<p:swing width="310"
height="120" component="#{aButton}"
/>]]></programlisting>
</entry>
</row>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jbpm.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jbpm.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jbpm.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -100,7 +100,7 @@
rules:
</para>
- <programlisting><![CDATA[<navigation-rule>
+ <programlisting role="XML"><![CDATA[<navigation-rule>
<from-view-id>/numberGuess.jsp</from-view-id>
<navigation-case>
@@ -128,7 +128,7 @@
rules:
</para>
- <programlisting><![CDATA[<page
view-id="/numberGuess.jsp">
+ <programlisting role="XML"><![CDATA[<page
view-id="/numberGuess.jsp">
<navigation>
<rule if-outcome="guess">
@@ -149,7 +149,7 @@
directly from your action listener methods:
</para>
- <programlisting><![CDATA[public String guess() {
+ <programlisting role="JAVA"><![CDATA[public String guess() {
if (guess==randomNumber) return "/win.jsp";
if (++guessCount==maxGuesses) return "/lose.jsp";
return null;
@@ -160,7 +160,7 @@
to be used in the redirect:
</para>
- <programlisting><![CDATA[public String search() {
+ <programlisting role="JAVA"><![CDATA[public String search() {
return "/searchResults.jsp?searchPattern=#{searchAction.searchPattern}";
}]]></programlisting>
@@ -176,7 +176,7 @@
Here is an example page flow definition using jPDL:
</para>
- <programlisting><![CDATA[<pageflow-definition
name="numberGuess">
+ <programlisting role="XML"><![CDATA[<pageflow-definition
name="numberGuess">
<start-page name="displayGuess" view-id="/numberGuess.jsp">
<redirect/>
@@ -294,7 +294,7 @@
no longer exists:
</para>
- <programlisting><![CDATA[<page view-id="/checkout.xhtml"
+ <programlisting role="XML"><![CDATA[<page
view-id="/checkout.xhtml"
no-conversation-view-id="/main.xhtml"/>]]></programlisting>
<para>
@@ -313,7 +313,7 @@
setting <literal>back="enabled"</literal>.
</para>
- <programlisting><![CDATA[<page name="checkout"
+ <programlisting role="XML"><![CDATA[<page
name="checkout"
view-id="/checkout.xhtml"
back="enabled">
<redirect/>
@@ -335,7 +335,7 @@
goes into the pageflow definition:
</para>
- <programlisting><![CDATA[<page name="checkout"
+ <programlisting role="XML"><![CDATA[<page
name="checkout"
view-id="/checkout.xhtml"
back="enabled"
no-conversation-view-id="/main.xhtml">
@@ -365,7 +365,7 @@
Seam configuration in <literal>components.xml</literal>.
</para>
- <programlisting><![CDATA[<bpm:jbpm>
+ <programlisting role="XML"><![CDATA[<bpm:jbpm>
<bpm:pageflow-definitions>
<value>pageflow.jpdl.xml</value>
</bpm:pageflow-definitions>
@@ -388,12 +388,12 @@
annotation:
</para>
- <programlisting><![CDATA[@Begin(pageflow="numberguess")
+ <programlisting
role="JAVA"><![CDATA[@Begin(pageflow="numberguess")
public void begin() { ... }]]></programlisting>
<para>Alternatively we can start a pageflow using pages.xml:</para>
- <programlisting><![CDATA[<page>
+ <programlisting role="XML"><![CDATA[<page>
<begin-conversation pageflow="numberguess"/>
</page>]]></programlisting>
@@ -413,7 +413,7 @@
outcome:
</para>
- <programlisting><![CDATA[<pageflow-definition
name="viewEditDocument">
+ <programlisting role="XML"><![CDATA[<pageflow-definition
name="viewEditDocument">
<start-state name="start">
<transition name="documentFound"
to="displayDocument"/>
@@ -443,7 +443,7 @@
the system is waiting for user input:
</para>
- <programlisting><![CDATA[<page name="displayGuess"
view-id="/numberGuess.jsp">
+ <programlisting role="XML"><![CDATA[<page
name="displayGuess" view-id="/numberGuess.jsp">
<redirect/>
<transition name="guess" to="evaluateGuess">
<action expression="#{numberGuess.guess}" />
@@ -464,7 +464,7 @@
a command button or command link in
<literal>numberGuess.jsp</literal>.
</para>
- <programlisting><![CDATA[<h:commandButton type="submit"
value="Guess" action="guess"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
type="submit" value="Guess"
action="guess"/>]]></programlisting>
<para>
When the transition is triggered by clicking this button, jBPM will activate
the
@@ -484,13 +484,13 @@
have names. So we could slightly simplify our example pageflow and this
button:
</para>
- <programlisting><![CDATA[<h:commandButton type="submit"
value="Guess"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
type="submit" value="Guess"/>]]></programlisting>
<para>
Would fire the following un-named transition:
</para>
- <programlisting><![CDATA[<page name="displayGuess"
view-id="/numberGuess.jsp">
+ <programlisting role="XML"><![CDATA[<page
name="displayGuess" view-id="/numberGuess.jsp">
<redirect/>
<transition to="evaluateGuess">
<action expression="#{numberGuess.guess}" />
@@ -502,9 +502,9 @@
action outcome will determine the transition to be taken:
</para>
- <programlisting><![CDATA[<h:commandButton type="submit"
value="Guess"
action="#{numberGuess.guess}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:commandButton
type="submit" value="Guess"
action="#{numberGuess.guess}"/>]]></programlisting>
-<programlisting><![CDATA[<page name="displayGuess"
view-id="/numberGuess.jsp">
+<programlisting role="XML"><![CDATA[<page
name="displayGuess" view-id="/numberGuess.jsp">
<transition name="correctGuess" to="win"/>
<transition name="incorrectGuess" to="evaluateGuess"/>
</page>]]></programlisting>
@@ -525,7 +525,7 @@
We do need the <literal><decision></literal> node,
however:
</para>
-<programlisting><![CDATA[<decision name="evaluateGuess"
expression="#{numberGuess.correctGuess}">
+<programlisting role="XML"><![CDATA[<decision
name="evaluateGuess" expression="#{numberGuess.correctGuess}">
<transition name="true" to="win"/>
<transition name="false" to="evaluateRemainingGuesses"/>
</decision>]]></programlisting>
@@ -545,7 +545,7 @@
<emphasis>both</emphasis> is encouraged.)
</para>
-<programlisting><![CDATA[<page name="win"
view-id="/win.jsp">
+<programlisting role="XML"><![CDATA[<page name="win"
view-id="/win.jsp">
<redirect/>
<end-conversation/>
</page>]]></programlisting>
@@ -556,7 +556,7 @@
overarching business process.
</para>
-<programlisting><![CDATA[<page name="win"
view-id="/win.jsp">
+<programlisting role="XML"><![CDATA[<page name="win"
view-id="/win.jsp">
<redirect/>
<end-task transition="success"/>
</page>]]></programlisting>
@@ -572,7 +572,7 @@
pageflow:
</para>
-<programlisting><![CDATA[<process-state name="cheat">
+<programlisting role="XML"><![CDATA[<process-state
name="cheat">
<sub-process name="cheat"/>
<transition to="displayGuess"/>
</process-state>]]></programlisting>
@@ -612,7 +612,7 @@
system is waiting for some user to log in and perform a task.
</para>
- <programlisting><![CDATA[<process-definition
name="todo">
+ <programlisting role="XML"><![CDATA[<process-definition
name="todo">
<start-state name="start">
<transition to="todo"/>
@@ -660,7 +660,7 @@
business process definitions:
</para>
- <programlisting><![CDATA[<bpm:jbpm>
+ <programlisting role="XML"><![CDATA[<bpm:jbpm>
<bpm:process-definitions>
<value>todo.jpdl.xml</value>
</bpm:process-definitions>
@@ -689,7 +689,7 @@
<literal>actor</literal>:
</para>
- <programlisting><![CDATA[@In Actor actor;
+ <programlisting role="JAVA"><![CDATA[@In Actor actor;
public String login() {
...
@@ -708,12 +708,12 @@
<literal>@CreateProcess</literal> annotation:
</para>
- <programlisting><![CDATA[@CreateProcess(definition="todo")
+ <programlisting
role="JAVA"><![CDATA[@CreateProcess(definition="todo")
public void createTodo() { ... }]]></programlisting>
<para>Alternatively we can initiate a business process using
pages.xml:</para>
- <programlisting><![CDATA[<page>
+ <programlisting role="XML"><![CDATA[<page>
<create-process definition="todo" />
</page>]]></programlisting>
@@ -728,7 +728,7 @@
delegate to a Seam component:
</para>
- <programlisting><![CDATA[<task name="todo"
description="#{todoList.description}">
+ <programlisting role="XML"><![CDATA[<task
name="todo" description="#{todoList.description}">
<assignment actor-id="#{actor.id}"/>
</task>]]></programlisting>
@@ -737,7 +737,7 @@
We can also assign tasks to a pool:
</para>
- <programlisting><![CDATA[<task name="todo"
description="#{todoList.description}">
+ <programlisting role="XML"><![CDATA[<task
name="todo" description="#{todoList.description}">
<assignment pooled-actors="employees"/>
</task>]]></programlisting>
@@ -752,7 +752,7 @@
that users may assign to themselves:
</para>
- <programlisting><![CDATA[<h:dataTable
value="#{pooledTaskInstanceList}" var="task">
+ <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{pooledTaskInstanceList}" var="task">
<h:column>
<f:facet name="header">Description</f:facet>
<h:outputText value="#{task.description}"/>
@@ -767,7 +767,7 @@
a plain JSF <literal><h:commandLink></literal>:
</para>
- <programlisting><![CDATA[<h:commandLink
action="#{pooledTask.assignToCurrentActor}">
+ <programlisting role="XHTML"><![CDATA[<h:commandLink
action="#{pooledTask.assignToCurrentActor}">
<f:param name="taskId" value="#{task.id}"/>
</h:commandLink>]]></programlisting>
@@ -781,7 +781,7 @@
a particular type that are assigned to the current user:
</para>
- <programlisting><![CDATA[<h:dataTable
value="#{taskInstanceListForType['todo']}" var="task">
+ <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{taskInstanceListForType['todo']}" var="task">
<h:column>
<f:facet name="header">Description</f:facet>
<h:outputText value="#{task.description}"/>
@@ -801,12 +801,12 @@
or <literal>@BeginTask</literal> on the listener method:
</para>
- <programlisting><![CDATA[@StartTask
+ <programlisting role="JAVA"><![CDATA[@StartTask
public String start() { ... }]]></programlisting>
<para>Alternatively we can begin work on a task using
pages.xml:</para>
- <programlisting><![CDATA[<page>
+ <programlisting role="XML"><![CDATA[<page>
<start-task />
</page>]]></programlisting>
@@ -822,12 +822,12 @@
will signal the completion of the task:
</para>
- <programlisting><![CDATA[@EndTask(transition="completed")
+ <programlisting
role="JAVA"><![CDATA[@EndTask(transition="completed")
public String completed() { ... }]]></programlisting>
<para>Alternatively we can use pages.xml:</para>
- <programlisting><![CDATA[<page>
+ <programlisting role="XML"><![CDATA[<page>
<end-task transition="completed" />
</page>]]></programlisting>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jms.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jms.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Jms.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -43,7 +43,7 @@
EJB 3.0, and add the following line to
<literal>components.xml</literal>:
</para>
-
<programlisting><![CDATA[<async:timer-service-dispatcher/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<async:timer-service-dispatcher/>]]></programlisting>
<para>
then your asynchronous tasks will be processed by the container's EJB
timer service. If
@@ -61,7 +61,7 @@
dispatcher.
</para>
-
<programlisting><![CDATA[<async:quartz-dispatcher/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<async:quartz-dispatcher/>]]></programlisting>
<para>
The Seam API for the default
<literal>ScheduledThreadPoolExecutor</literal>, the EJB3
@@ -85,7 +85,7 @@
asynchronously.
</para>
- <programlisting><![CDATA[@Local
+ <programlisting role="JAVA"><![CDATA[@Local
public interface PaymentHandler
{
@Asynchronous
@@ -100,7 +100,7 @@
The use of asynchronicity is transparent to the bean class:
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Name("paymentHandler")
public class PaymentHandlerBean implements PaymentHandler
{
@@ -114,7 +114,7 @@
And also transparent to the client:
</para>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@@ -140,7 +140,7 @@
<literal>@IntervalDuration</literal> annotations.
</para>
- <programlisting><![CDATA[@Local
+ <programlisting role="JAVA"><![CDATA[@Local
public interface PaymentHandler
{
@Asynchronous
@@ -152,7 +152,7 @@
@IntervalDuration Long interval)'
}]]></programlisting>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@@ -178,14 +178,14 @@
the invocation. The <literal>Timer</literal> object shown below
is the EJB3 timer when you use the EJB3 dispatcher. For the default
<literal>ScheduledThreadPoolExecutor</literal>, the returned object is
<literal>Future</literal> from the JDK. For the Quartz dispatcher, it returns
<literal>QuartzTriggerHandle</literal>, which we will discuss in the next
section.
</para>
- <programlisting><![CDATA[@Local
+ <programlisting role="JAVA"><![CDATA[@Local
public interface PaymentHandler
{
@Asynchronous
public Timer processScheduledPayment(Payment payment, @Expiration Date date);
}]]></programlisting>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Name("paymentHandler")
public class PaymentHandlerBean implements PaymentHandler
{
@@ -200,7 +200,7 @@
}]]></programlisting>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@@ -230,7 +230,7 @@
<para>The <literal>@FinalExpiration</literal> annotation
specifies an end date for the recurring task.</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
// Defines the method in the "processor" component
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
@@ -252,7 +252,7 @@
<para>Note that the method returns the
<literal>QuartzTriggerHandle</literal> object, which you can use later to
stop, pause, and resume the scheduler. The
<literal>QuartzTriggerHandle</literal> object is serializable, so you can save
it into the database if you need to keep it around for extended period of
time.</para>
- <programlisting><![CDATA[QuartzTriggerHandle handle =
+ <programlisting role="JAVA"><![CDATA[QuartzTriggerHandle
handle =
processor.schedulePayment(payment.getPaymentDate(),
payment.getPaymentCron(),
payment);
@@ -269,7 +269,7 @@
<para>The <literal>@IntervalCron</literal> annotation supports
Unix cron job syntax for task scheduling. For instance, the following asynchronous method
runs at 2:10pm and at 2:44pm every Wednesday in the month of March.
</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
// Define the method
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
@@ -289,7 +289,7 @@
<para>The <literal>@IntervalBusinessDay</literal> annotation
supports invocation on the "nth Business Day" scenario. For instance, the
following asynchronous method runs at 14:00 on the 2nd business day of each month. By
default, it excludes all weekends and US federal holidays until 2010 from the business
days.
</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
// Define the method
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
@@ -309,7 +309,7 @@
<para>The <literal>NthBusinessDay</literal> object contains the
configuration of the invocation trigger. You can specify more holidays (e.g., company
holidays, non-US holidays etc.) via the <literal>additionalHolidays</literal>
property.</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
public class NthBusinessDay implements Serializable
{
int n;
@@ -387,7 +387,7 @@
<literal>QueueSender</literal>s:
</para>
- <programlisting><![CDATA[<jms:managed-topic-publisher
name="stockTickerPublisher"
+ <programlisting
role="XML"><![CDATA[<jms:managed-topic-publisher
name="stockTickerPublisher"
auto-create="true"
topic-jndi-name="topic/stockTickerTopic"/>
@@ -404,7 +404,7 @@
<literal>TopicSession</literal> into any component:
</para>
- <programlisting><![CDATA[@In
+ <programlisting role="JAVA"><![CDATA[@In
private TopicPublisher stockTickerPublisher;
@In
private TopicSession topicSession;
@@ -422,7 +422,7 @@
<para>Or, for working with a queue:</para>
- <programlisting><![CDATA[@In
+ <programlisting role="JAVA"><![CDATA[@In
private QueueSender paymentQueueSender;
@In
private QueueSession queueSession;
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Mail.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Mail.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Mail.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -29,7 +29,7 @@
— an email is just facelet!
</para>
- <programlisting><![CDATA[<m:message
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML"><![CDATA[<m:message
xmlns="http://www.w3.org/1999/xhtml"
xmlns:m="http://jboss.com/products/seam/mail"
xmlns:h="http://java.sun.com/jsf/html">
@@ -68,7 +68,7 @@
have to do is ask Seam to render the view:
</para>
- <programlisting><![CDATA[@In(create=true)
+ <programlisting role="JAVA"><![CDATA[@In(create=true)
private Renderer renderer;
public void send() {
@@ -97,7 +97,7 @@
If you wanted to email the <literal>jboss-seam-mail.jar</literal>:
</para>
- <programlisting><![CDATA[<m:attachment
value="/WEB-INF/lib/jboss-seam-mail.jar"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<m:attachment
value="/WEB-INF/lib/jboss-seam-mail.jar"/>]]></programlisting>
<para>
Seam will load the file from the classpath, and attach it to the email.
@@ -105,19 +105,19 @@
if you wanted it to have another name you would just add the
<literal>fileName</literal> attribute:
</para>
- <programlisting><![CDATA[<m:attachment
value="/WEB-INF/lib/jboss-seam-mail.jar"
fileName="this-is-so-cool.jar"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<m:attachment
value="/WEB-INF/lib/jboss-seam-mail.jar"
fileName="this-is-so-cool.jar"/>]]></programlisting>
<para>
You could also attach a <literal>java.io.File</literal>, a
<literal>java.net.URL</literal>:
</para>
- <programlisting><![CDATA[<m:attachment
value="#{numbers}"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<m:attachment
value="#{numbers}"/>]]></programlisting>
<para>
Or a <literal>byte[]</literal> or a
<literal>java.io.InputStream</literal>:
</para>
- <programlisting><![CDATA[<m:attachment
value="#{person.photo}"
contentType="image/png"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<m:attachment
value="#{person.photo}"
contentType="image/png"/>]]></programlisting>
<para>
You'll notice that for a <literal>byte[]</literal> and a
<literal>java.io.InputStream</literal>
@@ -131,7 +131,7 @@
around the normal tags you would use:
</para>
- <programlisting><![CDATA[<m:attachment
fileName="tiny.pdf">
+ <programlisting role="XHTML"><![CDATA[<m:attachment
fileName="tiny.pdf">
<p:document>
A very tiny PDF
</p:document>
@@ -142,7 +142,7 @@
pictures loaded from a database) you can just use a
<literal><ui:repeat></literal>:
</para>
- <programlisting><![CDATA[<ui:repeat value="#{people}"
var="person">
+ <programlisting role="XHTML"><![CDATA[<ui:repeat
value="#{people}" var="person">
<m:attachment value="#{person.photo}" contentType="image/jpeg"
fileName="#{person.firstname}_#{person.lastname}.jpg"/>
</ui:repeat>]]></programlisting>
@@ -150,7 +150,7 @@
And if you want to display an attached image inline:
</para>
- <programlisting><![CDATA[<m:attachment
+ <programlisting role="XHTML"><![CDATA[<m:attachment
value="#{person.photo}"
contentType="image/jpeg"
fileName="#{person.firstname}_#{person.lastname}.jpg"
@@ -179,7 +179,7 @@
add a plain text alternative to your email body:
</para>
- <programlisting><![CDATA[<m:body>
+ <programlisting role="XHTML"><![CDATA[<m:body>
<f:facet name="alternative">Sorry, your email reader can't show
our fancy email,
please go to
http://labs.jboss.com/jbossseam to explore Seam.</f:facet>
</m:body>]]></programlisting>
@@ -195,7 +195,7 @@
inside a <literal><ui:repeat></literal>:
</para>
- <programlisting><![CDATA[<ui:repeat value="#{allUsers}
var="user">
+ <programlisting role="XHTML"><![CDATA[<ui:repeat
value="#{allUsers} var="user">
<m:to name="#{user.firstname} #{user.lastname}"
address="#{user.emailAddress}" />
</ui:repeat>]]></programlisting>
@@ -210,7 +210,7 @@
place the whole message inside a
<literal><ui:repeat></literal>:
</para>
- <programlisting><![CDATA[<ui:repeat value="#{people}"
var="p">
+ <programlisting role="XHTML"><![CDATA[<ui:repeat
value="#{people}" var="p">
<m:message>
<m:from name="#{person.firstname}
#{person.lastname}">#{person.address}</m:from>
<m:to name="#{p.firstname}">#{p.address}</m:to>
@@ -232,7 +232,7 @@
Our <literal>template.xhtml</literal> contains:
</para>
- <programlisting><![CDATA[<m:message>
+ <programlisting role="XHTML"><![CDATA[<m:message>
<m:from name="Seam" address="do-not-reply(a)jboss.com" />
<m:to name="#{person.firstname}
#{person.lastname}">#{person.address}</m:to>
<m:subject>#{subject}</m:subject>
@@ -249,7 +249,7 @@
Our <literal>templating.xhtml</literal> contains:
</para>
- <programlisting><![CDATA[<ui:param name="subject"
value="Templating with Seam Mail"/>
+ <programlisting role="XHTML"><![CDATA[<ui:param
name="subject" value="Templating with Seam Mail"/>
<ui:define name="body">
<p>This example demonstrates that you can easily use <i>facelets
templating</i> in email!</p>
</ui:define>]]></programlisting>
@@ -282,7 +282,7 @@
template:
</para>
- <programlisting><![CDATA[<m:message charset="UTF-8">
+ <programlisting role="XHTML"><![CDATA[<m:message
charset="UTF-8">
...
</m:message>]]></programlisting>
@@ -292,7 +292,7 @@
your pages by setting encoding of the template:
</para>
- <programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>]]></programlisting>
</section>
<section>
@@ -305,7 +305,7 @@
receipt:
</para>
- <programlisting><![CDATA[<m:message
xmlns:m="http://jboss.com/products/seam/mail"
+ <programlisting role="XHTML"><![CDATA[<m:message
xmlns:m="http://jboss.com/products/seam/mail"
importance="low"
requestReadReceipt="true"/>]]></programlisting>
@@ -314,7 +314,7 @@
<literal><m:header></literal> tag:
</para>
- <programlisting><![CDATA[<m:header name="X-Sent-From"
value="JBoss Seam"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<m:header
name="X-Sent-From" value="JBoss
Seam"/>]]></programlisting>
</section>
@@ -338,7 +338,7 @@
You can configure it like this:
</para>
- <programlisting><![CDATA[@MessageDriven(activationConfig={
+ <programlisting
role="JAVA"><![CDATA[@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="mailServer",
propertyValue="localhost"),
@ActivationConfigProperty(propertyName="mailFolder",
propertyValue="INBOX"),
@ActivationConfigProperty(propertyName="storeProtocol",
propertyValue="pop3"),
@@ -426,7 +426,7 @@
describes the service in more detail.
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
@@ -450,7 +450,7 @@
smtp server:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
@@ -486,7 +486,7 @@
<literal>meldware</literal> component:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XHTML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Oc4j.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Oc4j.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Oc4j.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -315,7 +315,7 @@
below is an example. </para>
- <programlisting><![CDATA[<ejb-local-ref>
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
<ejb-ref-name>
jboss-seam-jee5/AuthenticatorAction/local
</ejb-ref-name>
@@ -342,7 +342,7 @@
un-comment the OC4J properties. </para>
- <programlisting><![CDATA[<property
name="hibernate.dialect"
+ <programlisting role="XML"><![CDATA[<property
name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
@@ -370,7 +370,7 @@
<para>It should look like the following:</para>
- <programlisting><![CDATA[<!-- add libs for oc4j (eager
classloading) -->
+ <programlisting role="XML"><![CDATA[<!-- add
libs for oc4j (eager classloading) -->
<property name="jbpm.lib" value="true"/>
<property name="drools.lib" value="true"/>
<property name="quartz.lib" value="true" />
@@ -419,7 +419,7 @@
</para>
- <programlisting><![CDATA[<managed-data-source
+ <programlisting
role="XML"><![CDATA[<managed-data-source
connection-pool-name="jee5-connection-pool"
jndi-name="jdbc/__default"
name="jee5-managed-data-source" />
@@ -442,7 +442,7 @@
, add </para>
- <programlisting><![CDATA[<application
name="jboss-seam-jee5"
+ <programlisting role="XML"><![CDATA[<application
name="jboss-seam-jee5"
path="../../home/applications/jboss-seam-jee5.ear"
parent="default"
start="true" />]]></programlisting>
@@ -456,7 +456,7 @@
<literal><web-site></literal> , add
</para>
- <programlisting><![CDATA[<web-app
application="jboss-seam-jee5"
+ <programlisting role="XML"><![CDATA[<web-app
application="jboss-seam-jee5"
name="jboss-seam-jee5"
load-on-startup="true"
root="/seam-jee5" />]]></programlisting>
@@ -598,10 +598,8 @@
<para>Change the default target to archive (we
aren't going to cover automatic deployment to
OC4J).
-
-
- <programlisting><![CDATA[<project
name="oc4j_example" default="archive"
basedir=".">]]></programlisting>
- </para>
+ </para>
+ <programlisting
role="XML"><![CDATA[<project name="oc4j_example"
default="archive" basedir=".">]]></programlisting>
</listitem>
<listitem>
<para>OC4J looks for the drools file
@@ -616,13 +614,13 @@
depends="compile" description="Build the
distribution .war file"> </literal>
target.
+ </para>
-
- <programlisting><![CDATA[<copy
todir="${war.dir}">
+ <programlisting
role="XML"><![CDATA[<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
</fileset>
- </copy>]]></programlisting></para>
+ </copy>]]></programlisting>
</listitem>
</itemizedlist>
</listitem>
@@ -649,7 +647,7 @@
</para>
- <programlisting><![CDATA[<property
name="hibernate.query.factory_class"
+ <programlisting
role="XML"><![CDATA[<property
name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.OrionTransactionManagerLookup" />
@@ -663,7 +661,7 @@
exposing the EntityManagerFactory: </para>
- <programlisting><![CDATA[<property
+ <programlisting
role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/oc4j_exampleEntityManagerFactory">]]></programlisting>
</listitem>
@@ -728,7 +726,7 @@
entry: </para>
-
<programlisting><![CDATA[<persistence:entity-manager-factory
+ <programlisting
role="XML"><![CDATA[<persistence:entity-manager-factory
auto-create="true"
name="oc4jEntityManagerFactory"
persistence-unit-name="oc4j_example" />]]></programlisting>
@@ -739,7 +737,7 @@
existing element: </para>
-
<programlisting><![CDATA[<persistence:managed-persistence-context
+ <programlisting
role="XML"><![CDATA[<persistence:managed-persistence-context
name="entityManager"
auto-create="true"
entity-manager-factory="#{oc4jEntityManagerFactory}" />]]>
@@ -758,7 +756,7 @@
modify the application further. </para>
- <programlisting><![CDATA[<ejb-local-ref>
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
<ejb-ref-name>
oc4j_example/EjbSynchronizations/local
</ejb-ref-name>
@@ -783,7 +781,7 @@
force its own inherited URL settings. </para>
- <programlisting><![CDATA[<?xml version =
'1.0' encoding = 'utf-8'?>
+ <programlisting
role="XML"><![CDATA[<?xml version = '1.0' encoding =
'utf-8'?>
<orion-application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/
@@ -810,7 +808,7 @@
</para>
- <programlisting><![CDATA[<copy
todir="${ear.dir}/META-INF">
+ <programlisting
role="XML"><![CDATA[<copy todir="${ear.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
<include name="application.xml" />
<include name="orion-application.xml"/>
@@ -834,7 +832,7 @@
being imported. </para>
- <programlisting><![CDATA[<target name="ear"
description="Build the EAR">
+ <programlisting role="XML"><![CDATA[<target
name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
<include name="*jpdl.xml" />
@@ -867,7 +865,7 @@
<para>Hibernate:</para>
- <programlisting><![CDATA[<include
name="lib/hibernate.jar"/>
+ <programlisting role="XML"><![CDATA[<include
name="lib/hibernate.jar"/>
<include name="lib/hibernate-annotations.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
<include name="lib/hibernate-entitymanager.jar"/>
@@ -884,14 +882,14 @@
classloading): </para>
- <programlisting><![CDATA[<include
name="lib/core.jar"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<include
name="lib/core.jar"/>]]></programlisting>
</listitem>
<listitem>
<para> Third party jars — most of these are only
needed
because of OC4J's classloading: </para>
- <programlisting><![CDATA[<include
name="lib/javassist.jar"/>
+ <programlisting role="XML"><![CDATA[<include
name="lib/javassist.jar"/>
<include name="lib/quartz.jar"/>
<include name="lib/dbunit.jar"/>
<include name="lib/jboss-embedded-api.jar"/>
@@ -908,7 +906,7 @@
<para>You should end up with something like:</para>
- <programlisting><![CDATA[<fileset dir="${basedir}">
+ <programlisting role="XML"><![CDATA[<fileset
dir="${basedir}">
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
@@ -970,7 +968,7 @@
</literal> </para>
- <programlisting><![CDATA[<managed-data-source
+ <programlisting
role="XML"><![CDATA[<managed-data-source
connection-pool-name="oc4j-example-connection-pool"
jndi-name="jdbc/__oc4jexample"
name="oc4j-example-managed-data-source" />
@@ -989,7 +987,7 @@
</para>
- <programlisting><![CDATA[<application
name="oc4j_example"
+ <programlisting role="XML"><![CDATA[<application
name="oc4j_example"
path="../../home/applications/oc4j_example.ear"
parent="default"
start="true" />]]></programlisting>
@@ -1000,7 +998,7 @@
</literal> </para>
- <programlisting><![CDATA[<web-app
application="oc4j_example"
+ <programlisting role="XML"><![CDATA[<web-app
application="oc4j_example"
name="oc4j_example"
load-on-startup="true"
root="/oc4j_example" />]]></programlisting>
@@ -1081,11 +1079,11 @@
</itemizedlist>
- <programlisting><![CDATA[@Name("authenticator")
@Stateless public class
+ <programlisting
role="JAVA"><![CDATA[@Name("authenticator") @Stateless public
class
AuthenticatorAction implements Authenticator {]]></programlisting>
- <programlisting><![CDATA[@Local public interface Authenticator
{
+ <programlisting role="JAVA"><![CDATA[@Local public
interface Authenticator {
public boolean authenticate();
}]]></programlisting>
</listitem>
@@ -1096,13 +1094,13 @@
</para>
- <programlisting><![CDATA[@PersistenceContext private
EntityManager entityManager;]]></programlisting>
+ <programlisting
role="JAVA"><![CDATA[@PersistenceContext private EntityManager
entityManager;]]></programlisting>
</listitem>
<listitem>
<para>Implement authenticate:</para>
- <programlisting><![CDATA[public boolean authenticate() {
+ <programlisting role="JAVA"><![CDATA[public boolean
authenticate() {
List <User> users = entityManager .createQuery("select u from User u where
u.username = #{identity.username} and
u.password = #{identity.password}") .getResultList();
@@ -1119,7 +1117,7 @@
<literal>web.xml</literal> : </para>
- <programlisting><![CDATA[<ejb-local-ref>
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
<ejb-ref-name>
oc4j_example/AuthenticatorAction/local
</ejb-ref-name>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -178,7 +178,7 @@
in <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<core:init
transaction-management-enabled="false"/>
+ <programlisting role="XML"><![CDATA[<core:init
transaction-management-enabled="false"/>
<transaction:no-transaction />]]></programlisting>
@@ -194,7 +194,7 @@
should install the EJB synchronization component in
<literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<transaction:ejb-transaction
/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:ejb-transaction
/>]]></programlisting>
<para>
However, if you are working in a non EE 5 container, Seam will try auto detect the
transaction
@@ -243,7 +243,7 @@
<link
linkend="persistence.seam-managed-persistence-contexts">Seam-managed
persistence contexts</link>
)
</para>
- <programlisting><![CDATA[<transaction:entity-transaction
entity-manager="#{em}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:entity-transaction
entity-manager="#{em}"/>]]></programlisting>
<para>
To configure Hibernate managed transactions declare the following in your
components.xml where
<literal>#{hibernateSession}</literal>
@@ -254,11 +254,11 @@
<link
linkend="persistence.seam-managed-persistence-contexts">Seam-managed
persistence contexts</link>
)
</para>
- <programlisting><![CDATA[<transaction:hibernate-transaction
session="#{hibernateSession}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:hibernate-transaction
session="#{hibernateSession}"/>]]></programlisting>
<para>
To explicitly disable Seam managed transactions declare the following in
your components.xml:
</para>
- <programlisting><![CDATA[<transaction:no-transaction
/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:no-transaction
/>]]></programlisting>
<para>
For configuring Spring managed transactions see
<link linkend="spring-transactions">using Spring
PlatformTransactionManagement</link>
@@ -318,7 +318,7 @@
we can write:
</para>
- <programlisting><![CDATA[<persistence:managed-persistence-context
name="bookingDatabase"
+ <programlisting
role="XML"><![CDATA[<persistence:managed-persistence-context
name="bookingDatabase"
auto-create="true"
persistence-unit-jndi-name="java:/EntityManagerFactories/bookingData"/>]]></programlisting>
@@ -335,14 +335,14 @@
<literal>persistence.xml</literal>.
</para>
- <programlisting><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
+ <programlisting role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/EntityManagerFactories/bookingData"/>]]></programlisting>
<para>
Now we can have our <literal>EntityManager</literal> injected
using:
</para>
- <programlisting><![CDATA[@In EntityManager
bookingDatabase;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@In EntityManager
bookingDatabase;]]></programlisting>
<para>
If you are using EJB3 and mark your class or method
@@ -364,7 +364,7 @@
Seam-managed Hibernate sessions are similar. In
<literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<persistence:hibernate-session-factory
name="hibernateSessionFactory"/>
+ <programlisting
role="XML"><![CDATA[<persistence:hibernate-session-factory
name="hibernateSessionFactory"/>
<persistence:managed-hibernate-session name="bookingDatabase"
auto-create="true"
@@ -375,7 +375,7 @@
specified in <literal>hibernate.cfg.xml</literal>.
</para>
- <programlisting><![CDATA[<session-factory
name="java:/bookingSessionFactory">
+ <programlisting role="XML"><![CDATA[<session-factory
name="java:/bookingSessionFactory">
<property
name="transaction.flush_before_completion">true</property>
<property
name="connection.release_mode">after_statement</property>
<property
name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
@@ -396,7 +396,7 @@
JavaBean components using the following code:
</para>
- <programlisting><![CDATA[@In Session
bookingDatabase;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[@In Session
bookingDatabase;]]></programlisting>
</section>
@@ -438,7 +438,7 @@
persistence provider, but we plan to support other equivalent vendor
extensions.
</para>
- <programlisting><![CDATA[@In EntityManager em; //a Seam-managed
persistence context
+ <programlisting role="JAVA"><![CDATA[@In EntityManager em; //a
Seam-managed persistence context
@Begin(flushMode=MANUAL)
public void beginClaimWizard() {
@@ -450,7 +450,7 @@
for the rest ot the conversation. We can make changes to the claim:
</para>
- <programlisting><![CDATA[public void addPartyToClaim() {
+ <programlisting role="JAVA"><![CDATA[public void
addPartyToClaim() {
Party party = ....;
claim.addParty(party);
}]]></programlisting>
@@ -460,7 +460,7 @@
the flush to occur:
</para>
- <programlisting><![CDATA[@End
+ <programlisting role="JAVA"><![CDATA[@End
public void commitClaim() {
em.flush();
}]]></programlisting>
@@ -470,7 +470,7 @@
from pages.xml, for example in a navigation rule:
</para>
- <programlisting><![CDATA[<begin-conversation
flush-mode="MANUAL" />]]></programlisting>
+ <programlisting role="XML"><![CDATA[<begin-conversation
flush-mode="MANUAL" />]]></programlisting>
</section>
@@ -494,7 +494,7 @@
following:
</para>
- <programlisting><![CDATA[@In EntityManager entityManager;
+ <programlisting role="JAVA"><![CDATA[@In EntityManager
entityManager;
@Create
public void init() {
@@ -507,7 +507,7 @@
delegate. First, add the following line to
<literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<factory name="session"
+ <programlisting role="XML"><![CDATA[<factory
name="session"
scope="STATELESS"
auto-create="true"
value="#{entityManager.delegate}"/>]]></programlisting>
@@ -516,7 +516,7 @@
Now we can inject the session directly:
</para>
- <programlisting><![CDATA[@In Session session;
+ <programlisting role="JAVA"><![CDATA[@In Session session;
@Create
public void init() {
@@ -535,12 +535,12 @@
example, this:
</para>
- <programlisting><![CDATA[User user = em.createQuery("from User
where username=#{user.username}")
+ <programlisting role="JAVA"><![CDATA[User user =
em.createQuery("from User where username=#{user.username}")
.getSingleResult();]]></programlisting>
<para>is equivalent to:</para>
- <programlisting><![CDATA[User user = em.createQuery("from User
where username=:username")
+ <programlisting role="JAVA"><![CDATA[User user =
em.createQuery("from User where username=:username")
.setParameter("username", user.getUsername())
.getSingleResult();]]></programlisting>
@@ -548,7 +548,7 @@
Of course, you should never, ever write it like this:
</para>
- <programlisting><![CDATA[User user = em.createQuery("from User
where username=" + user.getUsername()) //BAD!
+ <programlisting role="JAVA"><![CDATA[User user =
em.createQuery("from User where username=" + user.getUsername()) //BAD!
.getSingleResult();]]></programlisting>
<para>
@@ -575,7 +575,7 @@
persistence provider.)
</para>
- <programlisting><![CDATA[<persistence:filter
name="regionFilter">
+ <programlisting role="XML"><![CDATA[<persistence:filter
name="regionFilter">
<persistence:name>region</persistence:name>
<persistence:parameters>
<key>regionCode</key>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Remoting.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Remoting.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Remoting.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -13,7 +13,7 @@
<title>Configuration</title>
<para> To use remoting, the Seam Resource servlet must first be configured in
your <literal>web.xml</literal> file: </para>
- <programlisting><![CDATA[<servlet>
+ <programlisting role="XML"><![CDATA[<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
@@ -27,7 +27,7 @@
that must be imported. The first one contains all the client-side framework code
that enables remoting
functionality: </para>
- <programlisting><![CDATA[<script type="text/javascript"
src="seam/resource/remoting/resource/remote.js"></script>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<script
type="text/javascript"
src="seam/resource/remoting/resource/remote.js"></script>]]></programlisting>
<para> The second script contains the stubs and type definitions for the
components you wish to call. It is
generated dynamically based on the local interface of your components, and includes
type definitions for all of
@@ -35,13 +35,13 @@
name of your component. For example, if you have a stateless session bean annotated
with
<literal>@Name("customerAction")</literal>, then your
script tag should look like this: </para>
- <programlisting><![CDATA[<script type="text/javascript"
+ <programlisting role="XHTML"><![CDATA[<script
type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction"></script>]]></programlisting>
<para> If you wish to access more than one component from the same page, then
include them all as parameters of your
script tag: </para>
- <programlisting><![CDATA[<script type="text/javascript"
+ <programlisting role="XHTML"><![CDATA[<script
type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction&accountAction"></script>]]></programlisting>
@@ -50,7 +50,7 @@
component or class name you wish to import with a comma:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XHTML"><![CDATA[
<s:remote include="customerAction,accountAction"/>
]]></programlisting>
@@ -71,7 +71,7 @@
<para> Let's step through a simple example to see how the
<literal>Seam</literal> object works. First of all,
let's create a new Seam component called
<literal>helloAction</literal>. </para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Name("helloAction")
public class HelloAction implements HelloLocal {
public String sayHello(String name) {
@@ -82,7 +82,7 @@
<para>You also need to create a local interface for our new component - take
special note of the
<literal>@WebRemote</literal> annotation, as it's required to
make our method accessible via remoting:</para>
- <programlisting><![CDATA[@Local
+ <programlisting role="JAVA"><![CDATA[@Local
public interface HelloLocal {
@WebRemote
public String sayHello(String name);
@@ -91,15 +91,15 @@
<para> That's all the server-side code we need to write. Now for our web
page - create a new page and import the
<literal>helloAction</literal> component: </para>
- <programlisting><![CDATA[<s:remote
include="helloAction"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:remote
include="helloAction"/>]]></programlisting>
<para> To make this a fully interactive user experience, let's add a
button to our page: </para>
- <programlisting><![CDATA[<button
onclick="javascript:sayHello()">Say
Hello</button>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<button
onclick="javascript:sayHello()">Say
Hello</button>]]></programlisting>
<para> We'll also need to add some more script to make our button
actually do something when it's clicked: </para>
- <programlisting><![CDATA[<script type="text/javascript">
+ <programlisting role="XHTML"><![CDATA[<script
type="text/javascript">
//<![CDATA[
function sayHello() {
@@ -124,7 +124,7 @@
responsible for prompting the user for their name and then making a remote
request. Take a look at the following
line: </para>
-
<programlisting>Seam.Component.getInstance("helloAction").sayHello(name,
sayHelloCallback);</programlisting>
+ <programlisting
role="XHTML">Seam.Component.getInstance("helloAction").sayHello(name,
sayHelloCallback);</programlisting>
<para> The first section of this line,
<literal>Seam.Component.getInstance("helloAction")</literal> returns
a
proxy, or "stub" for our <literal>helloAction</literal>
component. We can invoke the methods of our component
@@ -159,7 +159,7 @@
method will have the same getter/setter methods as its server-side counterpart,
or alternatively if you wish
you can access its fields directly. Take the following Seam entity component
for example: </para>
- <programlisting>@Name("customer")
+ <programlisting role="JAVA">@Name("customer")
@Entity
public class Customer implements Serializable
{
@@ -194,11 +194,11 @@
<para> To create a client-side Customer you would write the following code:
</para>
- <programlisting>var customer =
Seam.Component.newInstance("customer");</programlisting>
+ <programlisting role="XHTML">var customer =
Seam.Component.newInstance("customer");</programlisting>
<para> Then from here you can set the fields of the customer object:
</para>
- <programlisting>customer.setFirstName("John");
+ <programlisting
role="XHTML">customer.setFirstName("John");
// Or you can set the fields directly
customer.lastName = "Smith";</programlisting>
@@ -216,7 +216,7 @@
to save it, we would pass it to the
<literal>saveCustomer()</literal> method of our
<literal>customerAction</literal> component: </para>
-
<programlisting>Seam.Component.getInstance("customerAction").saveCustomer(customer);</programlisting>
+ <programlisting
role="XHTML">Seam.Component.getInstance("customerAction").saveCustomer(customer);</programlisting>
</section>
<section>
@@ -225,7 +225,7 @@
<para> Passing an object into this method will return its component name if
it is a component, or
<literal>null</literal> if it is not. </para>
- <programlisting>if (Seam.Component.getComponentName(instance) ==
"customer")
+ <programlisting role="XHTML">if
(Seam.Component.getComponentName(instance) == "customer")
alert("Customer");
else if (Seam.Component.getComponentName(instance) == "staff")
alert("Staff member");</programlisting>
@@ -248,7 +248,7 @@
<literal>createType()</literal> method to create an instance of
your type. Pass in the fully qualified Java
class name as a parameter: </para>
- <programlisting>var widget =
Seam.Remoting.createType("com.acme.widgets.MyWidget");</programlisting>
+ <programlisting role="XHTML">var widget =
Seam.Remoting.createType("com.acme.widgets.MyWidget");</programlisting>
</section>
<section>
@@ -272,7 +272,7 @@
value of the expression. Here's an example:
</para>
- <programlisting><![CDATA[ function customersCallback(customers) {
+ <programlisting role="XHTML"><![CDATA[ function
customersCallback(customers) {
for (var i = 0; i < customers.length; i++) {
alert("Got customer: " + customers[i].getName());
}
@@ -289,7 +289,7 @@
it is required to import the <literal>customer</literal> type:
</para>
- <programlisting><![CDATA[<s:remote
include="customer"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:remote
include="customer"/>]]></programlisting>
</section>
<section>
@@ -298,12 +298,13 @@
<para> In the configuration section above, the interface, or "stub"
for our component is imported into our page
either via <literal>seam/resource/remoting/interface.js</literal>: or
using the <literal>s:remote</literal>
tag:
+ </para>
- <programlisting><![CDATA[<script type="text/javascript"
+ <programlisting role="XHTML"><![CDATA[<script
type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction"></script>]]></programlisting>
- <programlisting><![CDATA[<s:remote
include="customerAction"/>]]></programlisting>
-</para>
+ <programlisting role="XHTML"><![CDATA[<s:remote
include="customerAction"/>]]></programlisting>
+
<para> By including this script in our page, the interface definitions for our
component, plus any other components
or types that are required to execute the methods of our component are generated
and made available for the
remoting framework to use. </para>
@@ -350,7 +351,7 @@
of the view before making the remote call. This small snippet of JavaScript will
set the
conversation ID that is used for remoting calls to the current view's
conversation ID: </para>
- <programlisting><![CDATA[Seam.Remoting.getContext().setConversationId(
#{conversation.id} );]]></programlisting>
+ <programlisting
role="XHTML"><![CDATA[Seam.Remoting.getContext().setConversationId(
#{conversation.id} );]]></programlisting>
</section>
</section>
@@ -420,7 +421,7 @@
section. In some situations you may have a component method where the exact
parameter type cannot be determined,
such as: </para>
- <programlisting>@Name("myAction")
+ <programlisting role="JAVA">@Name("myAction")
public class MyAction implements MyActionLocal {
public void doSomethingWithObject(Object obj) {
// code
@@ -432,7 +433,7 @@
referenced by any of its methods. To get around this,
<literal>MyWidget</literal> needs to be explicitly
imported: </para>
- <programlisting><![CDATA[<s:remote
include="myAction,myWidget"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:remote
include="myAction,myWidget"/>]]></programlisting>
<para> This will then allow a <literal>myWidget</literal> object
to be created with
<literal>Seam.Component.newInstance("myWidget")</literal>, which can
then be passed to
@@ -455,7 +456,7 @@
<para> On the client side, enums are treated the same as Strings. When
setting the value for an enum parameter,
simply use the String representation of the enum. Take the following component as
an example: </para>
- <programlisting>@Name("paintAction")
+ <programlisting role="JAVA">@Name("paintAction")
public class paintAction implements paintLocal {
public enum Color {red, green, blue, yellow, orange, purple};
@@ -467,7 +468,7 @@
<para> To call the <literal>paint()</literal> method with the
color <literal>red</literal>, pass the parameter
value as a String literal: </para>
-
<programlisting>Seam.Component.getInstance("paintAction").paint("red");</programlisting>
+ <programlisting
role="XHTML">Seam.Component.getInstance("paintAction").paint("red");</programlisting>
<para> The inverse is also true - that is, if a component method returns an
enum parameter (or contains an enum
field anywhere in the returned object graph) then on the client-side it will be
represented as a String. </para>
@@ -494,7 +495,7 @@
the Seam Remoting framework. To create a Map which can be used as a parameter
to a remote call, create a new
<literal>Seam.Remoting.Map</literal> object: </para>
- <programlisting>var map = new Seam.Remoting.Map();</programlisting>
+ <programlisting role="XHTML">var map = new
Seam.Remoting.Map();</programlisting>
<para> This Javascript implementation provides basic methods for working
with Maps: <literal>size()</literal>,
<literal>isEmpty()</literal>,
<literal>keySet()</literal>, <literal>values()</literal>,
@@ -513,11 +514,11 @@
the packets send back and forth between the client and server in a popup window. To
enable debug mode, either
execute the <literal>setDebug()</literal> method in Javascript:
</para>
- <programlisting>Seam.Remoting.setDebug(true);</programlisting>
+ <programlisting
role="XHTML">Seam.Remoting.setDebug(true);</programlisting>
<para> Or configure it via components.xml: </para>
- <programlisting><remoting:remoting
debug="true"/></programlisting>
+ <programlisting role="XML"><![CDATA[<remoting:remoting
debug="true"/>]]></programlisting>
<para> To turn off debugging, call
<literal>setDebug(false)</literal>. If you want to write your own messages to
the
debug log, call <literal>Seam.Remoting.log(message)</literal>.
</para>
@@ -535,7 +536,7 @@
<para> To change the message from the default "Please Wait..." to
something different, set the value of
<literal>Seam.Remoting.loadingMessage</literal>: </para>
- <programlisting>Seam.Remoting.loadingMessage = "Loading...";
</programlisting>
+ <programlisting role="XHTML">Seam.Remoting.loadingMessage =
"Loading..."; </programlisting>
</section>
<section>
@@ -545,7 +546,7 @@
<literal>displayLoadingMessage()</literal> and
<literal>hideLoadingMessage()</literal> with functions that
instead do nothing: </para>
- <programlisting>// don't display the loading indicator
+ <programlisting role="XHTML">// don't display the loading
indicator
Seam.Remoting.displayLoadingMessage = function() {};
Seam.Remoting.hideLoadingMessage = function() {};</programlisting>
</section>
@@ -557,7 +558,7 @@
you want. To do this override the
<literal>displayLoadingMessage()</literal> and
<literal>hideLoadingMessage()</literal> messages with your own
implementation: </para>
- <programlisting> Seam.Remoting.displayLoadingMessage = function() {
+ <programlisting role="XHTML"> Seam.Remoting.displayLoadingMessage
= function() {
// Write code here to display the indicator
};
@@ -585,7 +586,7 @@
<para> For all our examples, we'll use the following
<literal>Widget</literal> class: </para>
- <programlisting>@Name("widget")
+ <programlisting role="JAVA">@Name("widget")
public class Widget
{
private String value;
@@ -603,7 +604,7 @@
<para> If your remote method returns an instance of
<literal>Widget</literal>, but you don't want to expose the
<literal>secret</literal> field because it contains sensitive
information, you would constrain it like this: </para>
- <programlisting>@WebRemote(exclude = {"secret"})
+ <programlisting role="JAVA">@WebRemote(exclude =
{"secret"})
public Widget getWidget(); </programlisting>
<para> The value "secret" refers to the
<literal>secret</literal> field of the returned object. Now, suppose that
@@ -613,7 +614,7 @@
value instead? We can do this by using dot notation to specify this field's
path within the result's object
graph: </para>
- <programlisting>@WebRemote(exclude = {"child.secret"})
+ <programlisting role="JAVA">@WebRemote(exclude =
{"child.secret"})
public Widget getWidget();</programlisting>
</section>
@@ -628,8 +629,8 @@
<literal>secret</literal> field of the
<literal>Widget</literal>s in this list the annotation would look like
this: </para>
- <programlisting>@WebRemote(exclude = {"widgetList.secret"})
- public Widget getWidget();</programlisting>
+ <programlisting role="JAVA">@WebRemote(exclude =
{"widgetList.secret"})
+public Widget getWidget();</programlisting>
<para> To constrain a <literal>Map</literal>'s key or value,
the notation is slightly different. Appending
<literal>[key]</literal> after the
<literal>Map</literal>'s field name will constrain the
@@ -637,7 +638,7 @@
values. The following example demonstrates how the values of the
<literal>widgetMap</literal> field have their
<literal>secret</literal> field constrained: </para>
- <programlisting>@WebRemote(exclude = {"widgetMap[value].secret"})
+ <programlisting role="JAVA">@WebRemote(exclude =
{"widgetMap[value].secret"})
public Widget getWidget(); </programlisting>
</section>
@@ -649,7 +650,7 @@
Seam component) or the fully qualified class name (only if the object is not a
Seam component) and is expressed
using square brackets: </para>
- <programlisting>@WebRemote(exclude = {"[widget].secret"})
+ <programlisting role="JAVA">@WebRemote(exclude =
{"[widget].secret"})
public Widget getWidget(); </programlisting>
</section>
@@ -659,7 +660,7 @@
<para> Constraints can also be combined, to filter objects from multiple
paths within the object graph: </para>
- <programlisting>@WebRemote(exclude = {"widgetList.secret",
"widgetMap[value].secret"})
+ <programlisting role="JAVA">@WebRemote(exclude =
{"widgetList.secret", "widgetMap[value].secret"})
public Widget getWidget();</programlisting>
</section>
@@ -680,7 +681,7 @@
<literal>org.jboss.seam.remoting.messaging.subscriptionRegistry.allowedTopics</literal>
in
<literal>seam.properties</literal>,
<literal>web.xml</literal> or <literal>components.xml</literal>.
</para>
- <programlisting><![CDATA[<remoting:remoting poll-timeout="5"
poll-interval="1"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<remoting:remoting
poll-timeout="5" poll-interval="1"/>]]></programlisting>
</section>
@@ -689,7 +690,7 @@
<para> The following example demonstrates how to subscribe to a JMS Topic:
</para>
- <programlisting>function subscriptionCallback(message)
+ <programlisting role="XHTML">function
subscriptionCallback(message)
{
if (message instanceof Seam.Remoting.TextMessage)
alert("Received message: " + message.getText());
@@ -715,7 +716,7 @@
<para> To unsubscribe from a topic, call
<literal>Seam.Remoting.unsubscribe()</literal> and pass in the topic
name: </para>
-
<programlisting>Seam.Remoting.unsubscribe("topicName");</programlisting>
+ <programlisting
role="XHTML">Seam.Remoting.unsubscribe("topicName");</programlisting>
</section>
<section>
@@ -741,11 +742,11 @@
<para> Via components.xml: </para>
- <programlisting><![CDATA[<remoting:remoting poll-timeout="5"
poll-interval="1"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<remoting:remoting
poll-timeout="5" poll-interval="1"/>]]></programlisting>
<para> Via JavaScript: </para>
- <programlisting>// Only wait 1 second between receiving a poll response and
sending the next poll request.
+ <programlisting role="XHTML">// Only wait 1 second between
receiving a poll response and sending the next poll request.
Seam.Remoting.pollInterval = 1;
// Wait up to 5 seconds on the server for new messages
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Security.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Security.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Security.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -125,7 +125,7 @@
<literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -165,7 +165,7 @@
inside a JavaBean component:
</para>
- <programlisting><![CDATA[@Name("authenticator")
+ <programlisting
role="JAVA"><![CDATA[@Name("authenticator")
public class Authenticator {
@In EntityManager entityManager;
@@ -247,7 +247,7 @@
<literal>org.jboss.seam.security.loginSuccessful</literal> event,
like this:
</para>
- <programlisting><![CDATA[ @In UserStats userStats;
+ <programlisting role="JAVA"><![CDATA[ @In UserStats
userStats;
@Observer("org.jboss.seam.security.loginSuccessful")
public void updateUserStats()
@@ -270,7 +270,7 @@
Here's an example of a simple login form:
</para>
- <programlisting><![CDATA[<div>
+ <programlisting role="XHTML"><![CDATA[<div>
<h:outputLabel for="name" value="Username"/>
<h:inputText id="name" value="#{identity.username}"/>
</div>
@@ -349,7 +349,7 @@
file that redirects both of these security exceptions:
</para>
- <programlisting><![CDATA[<pages>
+ <programlisting role="XML"><![CDATA[<pages>
...
@@ -383,7 +383,7 @@
to access a particular view (or wildcarded view id) as follows:
</para>
- <programlisting><![CDATA[<pages
login-view-id="/login.xhtml">
+ <programlisting role="XML"><![CDATA[<pages
login-view-id="/login.xhtml">
<page view-id="/members/*" login-required="true"/>
@@ -405,7 +405,7 @@
request.
</para>
- <programlisting><![CDATA[<event
type="org.jboss.seam.security.notLoggedIn">
+ <programlisting role="XML"><![CDATA[<event
type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>
</event>
@@ -429,7 +429,7 @@
the <literal>authentication-filter</literal> component must be
enabled in components.xml:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<web:authentication-filter url-pattern="*.seam"
auth-type="basic"/>
]]></programlisting>
@@ -439,7 +439,7 @@
<literal>key</literal> and <literal>realm</literal> must
also be set:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<web:authentication-filter url-pattern="*.seam"
auth-type="digest" key="AA3JK34aSDlkj" realm="My App"/>
]]></programlisting>
@@ -458,7 +458,7 @@
against the digest request. Here is an example:
</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
public boolean authenticate()
{
try
@@ -499,7 +499,7 @@
provided by JBoss AS), then the entry in
<literal>components.xml</literal> would look like this:
</para>
- <programlisting><![CDATA[<security:identity
authenticate-method="#{authenticator.authenticate}"
+ <programlisting role="XML"><![CDATA[<security:identity
authenticate-method="#{authenticator.authenticate}"
jaas-config-name="other"/>]]></programlisting>
<para>
@@ -655,7 +655,7 @@
Take for example the following component method:
</para>
- <programlisting><![CDATA[@Name("account")
+ <programlisting
role="JAVA"><![CDATA[@Name("account")
public class AccountAction {
@Restrict public void delete() {
...
@@ -669,7 +669,7 @@
another example:
</para>
- <programlisting><![CDATA[@Restrict @Name("account")
+ <programlisting role="JAVA"><![CDATA[@Restrict
@Name("account")
public class AccountAction {
public void insert() {
...
@@ -701,7 +701,7 @@
object instance. Look at this example:
</para>
- <programlisting><![CDATA[@Name("account")
+ <programlisting
role="JAVA"><![CDATA[@Name("account")
public class AccountAction {
@In Account selectedAccount;
@Restrict("#{s:hasPermission('account','modify',selectedAccount)}")
@@ -727,7 +727,7 @@
<literal>Identity.checkRestriction()</literal> to evaluate a
security expression, like this:
</para>
- <programlisting><![CDATA[public void deleteCustomer() {
+ <programlisting role="JAVA"><![CDATA[public void
deleteCustomer() {
Identity.instance().checkRestriction("#{s:hasPermission('customer','delete',selectedCustomer)}");
}]]></programlisting>
@@ -755,7 +755,7 @@
methods directly from Java code:
</para>
- <programlisting><![CDATA[if
(!Identity.instance().hasRole("admin"))
+ <programlisting role="JAVA"><![CDATA[if
(!Identity.instance().hasRole("admin"))
throw new AuthorizationException("Must be admin to perform this action");
if (!Identity.instance().hasPermission("customer", "create", null))
@@ -780,7 +780,7 @@
<literal>identity.isLoggedIn()</literal> property, we can write
this:
</para>
- <programlisting><![CDATA[<h:form class="loginForm"
rendered="#{not identity.loggedIn}">]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<h:form
class="loginForm" rendered="#{not
identity.loggedIn}">]]></programlisting>
<para>
If the user isn't logged in, then the login form will be rendered - very
straight forward so far.
@@ -788,7 +788,7 @@
to users in the <literal>manager</literal> role. Here's one way
that these could be written:
</para>
- <programlisting><![CDATA[<h:outputLink
action="#{reports.listManagerReports}"
rendered="#{s:hasRole('manager')}">
+ <programlisting role="XHTML"><![CDATA[<h:outputLink
action="#{reports.listManagerReports}"
rendered="#{s:hasRole('manager')}">
Manager Reports
</h:outputLink>]]></programlisting>
@@ -807,7 +807,7 @@
for that object or not. Here's how a dataTable with secured links might
look:
</para>
- <programlisting><![CDATA[<h:dataTable value="#{clients}"
var="cl">
+ <programlisting role="XHTML"><![CDATA[<h:dataTable
value="#{clients}" var="cl">
<h:column>
<f:facet name="header">Name</f:facet>
#{cl.name}
@@ -840,7 +840,7 @@
Here's a couple of examples:
</para>
- <programlisting><![CDATA[<page view-id="/settings.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/settings.xhtml">
<restrict/>
</page>]]></programlisting>
@@ -849,7 +849,7 @@
requests and an implied permission of
<literal>/settings.xhtml:restore</literal> for faces requests.
</para>
- <programlisting><![CDATA[<page view-id="/reports.xhtml">
+ <programlisting role="XML"><![CDATA[<page
view-id="/reports.xhtml">
<restrict>#{s:hasRole('admin')}</restrict>
</page>]]></programlisting>
@@ -873,7 +873,7 @@
itself:
</para>
- <programlisting><![CDATA[@Entity
+ <programlisting role="JAVA"><![CDATA[@Entity
@Name("customer")
@Restrict
public class Customer {
@@ -926,7 +926,7 @@
security is how it is annotated:
</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
@PrePersist @Restrict
public void prePersist() {}
]]></programlisting>
@@ -971,7 +971,7 @@
You can install this listener by using the following
<literal>META-INF/orm.xml</literal> file:
</para>
- <programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
+ <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
@@ -1033,7 +1033,7 @@
which it uses to evaluate permission checks. This is configured in
<literal>components.xml</literal> as follows:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:drools="http://jboss.com/products/seam/drools"
@@ -1225,7 +1225,7 @@
HTTPS:
</para>
- <programlisting><![CDATA[<page view-id="/login.xhtml"
scheme="https"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<page
view-id="/login.xhtml"
scheme="https"/>]]></programlisting>
<para>
This configuration is automatically extended to both
<literal>s:link</literal> and
@@ -1234,7 +1234,7 @@
link will use the HTTPS protocol because
<literal>/login.xhtml</literal> is configured to use it:
</para>
- <programlisting><![CDATA[<s:link view="/login.xhtml"
value="Login"/>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<s:link
view="/login.xhtml" value="Login"/>]]></programlisting>
<para>
Browsing directly to a view when using the
<emphasis>incorrect</emphasis> protocol will cause a
@@ -1252,7 +1252,7 @@
default <literal>scheme</literal>, add this line to
<literal>pages.xml</literal>:
</para>
- <programlisting><![CDATA[<page view-id="*"
scheme="http" />]]></programlisting>
+ <programlisting role="XML"><![CDATA[<page view-id="*"
scheme="http" />]]></programlisting>
<para>
Of course, if <emphasis>none</emphasis> of the pages in your
application use HTTPS then it is not
@@ -1264,7 +1264,7 @@
changes. Just add this line to <literal>components.xml</literal>:
</para>
- <programlisting><![CDATA[<core:servlet-session
invalidate-on-scheme-change="true"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<core:servlet-session
invalidate-on-scheme-change="true"/>]]></programlisting>
<para>
This option helps make your system less vulnerable to sniffing of the session id or
leakage of
@@ -1290,7 +1290,7 @@
challenge images to your pages. This requires the following entry in
<literal>web.xml</literal>:
</para>
- <programlisting><![CDATA[<servlet>
+ <programlisting role="XML"><![CDATA[<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
@@ -1309,7 +1309,7 @@
Adding a CAPTCHA challenge to a form is extremely easy. Here's an example:
</para>
- <programlisting><![CDATA[<h:graphicImage
value="/seam/resource/captcha"/>
+ <programlisting role="XHTML"><![CDATA[<h:graphicImage
value="/seam/resource/captcha"/>
<h:inputText id="verifyCaptcha" value="#{captcha.response}"
required="true">
<s:validate />
</h:inputText>
@@ -1330,7 +1330,7 @@
You may customize the CAPTCHA algorithm by overriding the built-in component:
</para>
- <programlisting><![CDATA[(a)Name("org.jboss.seam.captcha")
+ <programlisting
role="JAVA"><![CDATA[(a)Name("org.jboss.seam.captcha")
@Scope(SESSION)
public class HitchhikersCaptcha extends Captcha
{
@@ -1526,7 +1526,7 @@
code that will be executed with the elevated privileges.
</para>
- <programlisting><![CDATA[ new RunAsOperation() {
+ <programlisting role="JAVA"><![CDATA[ new RunAsOperation() {
@Override
public String[] getRoles() {
return new String[] { "admin" };
@@ -1565,7 +1565,7 @@
ensures that this extended Identity gets installed in preference to the built-in
Identity.
</para>
-
<programlisting><![CDATA[(a)Name("org.jboss.seam.security.identity")
+ <programlisting
role="JAVA"><![CDATA[(a)Name("org.jboss.seam.security.identity")
@Scope(SESSION)
@Install(precedence = APPLICATION)
@BypassInterceptors
@@ -1655,7 +1655,7 @@
<literal>IdentityManager</literal> to use it, it must be named
<literal>identityStore</literal>:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<identity-management:jpa-identity-store name="identityStore"
account-class="com.acme.UserAccount"/>
]]></programlisting>
</sect2>
@@ -1696,7 +1696,7 @@
And an example of the corresponding entity bean:
</para>
- <programlisting><![CDATA[@Entity @Table(name = "USER_ACCOUNT")
+ <programlisting role="JAVA"><![CDATA[@Entity @Table(name =
"USER_ACCOUNT")
public class UserAccount extends org.jboss.seam.security.management.UserAccount
implements Serializable
{
@@ -1744,7 +1744,7 @@
In the following example, it is configured as
<literal>com.acme.UserAccount</literal>:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<identity-management:jpa-identity-store name="identityStore"
account-class="com.acme.UserAccount"/>]]></programlisting>
<para>
@@ -1762,7 +1762,7 @@
convenience - it may be useful for generating password hashes for inclusion
in DML scripts, etc:
</para>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
public String hashPassword(String password, String saltPhrase)
{
try {
@@ -1809,13 +1809,13 @@
component as follows:
</para>
- <programlisting><![CDATA[ @In IdentityManager
identityManager;]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[ @In IdentityManager
identityManager;]]></programlisting>
<para>
or by accessing it through its static <literal>instance()</literal>
method:
</para>
- <programlisting><![CDATA[ IdentityManager identityManager =
IdentityManager.instance();]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[ IdentityManager
identityManager = IdentityManager.instance();]]></programlisting>
<para>
The following table describes each of the methods that
<literal>IdentityManager</literal> provides:
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Spring.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Spring.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Spring.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -45,7 +45,7 @@
<literal><seam:instance/></literal> namespace
handler. To enable the Seam namespace
handler, the Seam namespace must be added to the Spring beans definition
file:</para>
- <programlisting><![CDATA[<beans
xmlns="http://www.springframework.org/schema/beans"
+ <programlisting role="XML"><![CDATA[<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:seam="http://jboss.com/products/seam/spring-seam"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
@@ -55,7 +55,7 @@
<para> Now any Seam component may be injected into any Spring bean:
</para>
- <programlisting><![CDATA[<bean id="someSpringBean"
class="SomeSpringBeanClass" scope="prototype">
+ <programlisting role="XML"><![CDATA[<bean
id="someSpringBean" class="SomeSpringBeanClass"
scope="prototype">
<property name="someProperty">
<seam:instance name="someComponent"/>
</property>
@@ -63,7 +63,7 @@
<para> An EL expression may be used instead of a component name:
</para>
- <programlisting><![CDATA[<bean id="someSpringBean"
class="SomeSpringBeanClass" scope="prototype">
+ <programlisting role="XML"><![CDATA[<bean
id="someSpringBean" class="SomeSpringBeanClass"
scope="prototype">
<property name="someProperty">
<seam:instance name="#{someExpression}"/>
</property>
@@ -71,7 +71,7 @@
<para> Seam component instances may even be made available for injection
into Spring beans by a Spring bean id. </para>
- <programlisting><![CDATA[<seam:instance
name="someComponent" id="someSeamComponentInstance"/>
+ <programlisting role="XML"><![CDATA[<seam:instance
name="someComponent" id="someSeamComponentInstance"/>
<bean id="someSpringBean" class="SomeSpringBeanClass"
scope="prototype">
<property name="someProperty"
ref="someSeamComponentInstance">
@@ -92,7 +92,7 @@
<para>The <literal><seam:instance/></literal> tag
lets us automatically proxy the Seam component.</para>
- <programlisting><![CDATA[<seam:instance id="seamManagedEM"
name="someManagedEMComponent" proxy="true"/>
+ <programlisting role="XML"><![CDATA[<seam:instance
id="seamManagedEM" name="someManagedEMComponent"
proxy="true"/>
<bean id="someSpringBean" class="SomeSpringBeanClass">
<property name="entityManager" ref="seamManagedEM">
@@ -127,7 +127,7 @@
by their bean id. You'll need to add the
<literal>DelegatingVariableResolver</literal> to
<literal>faces-config.xml</literal>: </para>
- <programlisting><![CDATA[<application>
+ <programlisting role="XML"><![CDATA[<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
@@ -135,7 +135,7 @@
<para> Then you can inject Spring beans using
<literal>@In</literal>: </para>
- <programlisting><![CDATA[@In("#{bookingService}")
+ <programlisting
role="JAVA"><![CDATA[@In("#{bookingService}")
private BookingService bookingService;]]></programlisting>
<para>The use of Spring beans in EL is not limited to injection. Spring
beans may be used anywhere that EL
@@ -150,7 +150,7 @@
bean a Seam component. Just place the
<literal><seam:component/></literal> tag within the
declaration of the bean that you wish to be a Seam component: </para>
- <programlisting><![CDATA[<bean id="someSpringBean"
class="SomeSpringBeanClass" scope="prototype">
+ <programlisting role="XML"><![CDATA[<bean
id="someSpringBean" class="SomeSpringBeanClass"
scope="prototype">
<seam:component/>
</bean>]]></programlisting>
@@ -182,7 +182,7 @@
Spring bean with a particular Seam scope, specify the Seam scope in the
<literal>scope</literal> attribute
of the bean definition. </para>
- <programlisting><![CDATA[<!-- Only needs to be specified once per
bean factory-->
+ <programlisting role="XML"><![CDATA[<!-- Only needs to be
specified once per bean factory-->
<seam:configure-scopes/>
...
@@ -205,7 +205,7 @@
if you need to inject a Seam-scoped Spring bean into a singleton,
<literal><seam:instance/></literal> must be used:
</para>
- <programlisting><![CDATA[<bean id="someSpringBean"
class="SomeSpringBeanClass" scope="seam.CONVERSATION"/>
+ <programlisting role="XML"><![CDATA[<bean
id="someSpringBean" class="SomeSpringBeanClass"
scope="seam.CONVERSATION"/>
...
@@ -229,9 +229,7 @@
<para>To configure Seam to use Spring transactions enable the
SpringTransaction component like so:</para>
- <programlisting>
- <![CDATA[<spring:spring-transaction
platform-transaction-manager="#{transactionManager}"/>]]>
- </programlisting>
+ <programlisting
role="XML"><![CDATA[<spring:spring-transaction
platform-transaction-manager="#{transactionManager}"/>]]></programlisting>
<para>
The <literal>spring:spring-transaction</literal> component will utilize
Springs transaction synchronization
@@ -275,7 +273,7 @@
so the Seam integration works by wrapping an EntityManagerFactory around a Seam
managed persistence
context.</para>
- <programlisting><![CDATA[<bean
id="seamEntityManagerFactory"
class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
+ <programlisting role="XML"><![CDATA[<bean
id="seamEntityManagerFactory"
class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
<property name="persistenceContextName"
value="entityManager"/>
</bean>]]></programlisting>
@@ -284,7 +282,7 @@
If you wish to provide a different unitName you can do so by providing a
persistenceUnitName like so:
</para>
- <programlisting><![CDATA[<bean
id="seamEntityManagerFactory"
class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
+ <programlisting role="XML"><![CDATA[<bean
id="seamEntityManagerFactory"
class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
<property name="persistenceContextName"
value="entityManager"/>
<property name="persistenceUnitName"
value="bookingDatabase:extended"/>
</bean>]]></programlisting>
@@ -292,7 +290,7 @@
<para>This EntityManagerFactory can then be used in any Spring provided tools.
For example,
using Spring's
<literal>PersistenceAnnotationBeanPostProcessor</literal> is the exact same as
before.</para>
- <programlisting><![CDATA[<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>]]></programlisting>
<para>If you define your real EntityManagerFactory in Spring but wish to use a
Seam managed persistence context
you can tell the <literal>PersistenceAnnotationBeanPostProcessor</literal>
which persistenctUnitName you wish
@@ -300,7 +298,7 @@
</para>
<para>The <literal>applicationContext.xml</literal> might look
like:</para>
- <programlisting><![CDATA[<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+ <programlisting role="XML"><![CDATA[<bean
id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName"
value="bookingDatabase"/>
</bean>
<bean id="seamEntityManagerFactory"
class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
@@ -312,14 +310,14 @@
</bean>]]></programlisting>
<para>The <literal>component.xml</literal> might look
like:</para>
- <programlisting><![CDATA[<persistence:managed-persistence-context
name="entityManager"
+ <programlisting
role="XML"><![CDATA[<persistence:managed-persistence-context
name="entityManager"
auto-create="true"
entity-manager-factory="#{entityManagerFactory}"/>]]></programlisting>
<para><literal>JpaTemplate</literal> and
<literal>JpaDaoSupport</literal> are configured the same way for a
Seam managed persistence context as they would be fore a Seam managed persistence
context.</para>
- <programlisting><![CDATA[<bean id="bookingService"
class="org.jboss.seam.example.spring.BookingService">
+ <programlisting role="XML"><![CDATA[<bean
id="bookingService"
class="org.jboss.seam.example.spring.BookingService">
<property name="entityManagerFactory"
ref="seamEntityManagerFactory"/>
</bean>]]></programlisting>
</section>
@@ -334,7 +332,7 @@
by wrapping a proxy SessionFactory around a Seam managed Hibernate session
context.</para>
- <programlisting><![CDATA[<bean id="seamSessionFactory"
class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
+ <programlisting role="XML"><![CDATA[<bean
id="seamSessionFactory"
class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
<property name="sessionName" value="hibernateSession"/>
</bean>]]></programlisting>
@@ -368,7 +366,7 @@
<literal><spring:config-locations/></literal> element
following standard
<literal>components.xml</literal> multi value practices.
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:spring="http://jboss.com/products/seam/spring"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/components
@@ -388,14 +386,12 @@
immediate <literal>@Asynchronous</literal> method calls. To enable
this functionality install the
<literal>SpringTaskExecutorDispatchor</literal> and provide a spring
bean defined taskExecutor like so:</para>
- <programlisting>
- <![CDATA[<spring:task-executor-dispatcher
task-executor="#{springThreadPoolTaskExecutor}"/>]]>
- </programlisting>
+ <programlisting
role="XML"><![CDATA[<spring:task-executor-dispatcher
task-executor="#{springThreadPoolTaskExecutor}"/>]]></programlisting>
<para>Because a Spring <literal>TaskExecutor</literal> does not
support scheduling of an asynchronous event
a fallback Seam <literal>Dispatcher</literal> can be provided to
handle scheduled asynchronous event like so:</para>
- <programlisting>
+ <programlisting role="XML">
<![CDATA[<!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous
event -->
<core:thread-pool-dispatcher name="threadPoolDispatcher"/>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Testing.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Testing.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Testing.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -25,7 +25,7 @@
account for a customer:
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@Scope(EVENT)
@Name("statementOfAccount")
public class StatementOfAccount {
@@ -64,7 +64,7 @@
the business logic of the component) as follows:
</para>
- <programlisting><![CDATA[public class StatementOfAccountTest {
+ <programlisting role="JAVA"><![CDATA[public class
StatementOfAccountTest {
@Test
public testCalculateTotal {
@@ -107,7 +107,7 @@
JDK 1.5 and does not work with JDK 1.6).
</para>
-<programlisting><![CDATA[public class RegisterTest extends SeamTest
+<programlisting role="JAVA"><![CDATA[public class RegisterTest extends
SeamTest
{
@Test
@@ -146,7 +146,7 @@
Seam component which is a facade to some payment processing system:
</para>
- <programlisting><![CDATA[@Name("paymentProcessor")
+ <programlisting
role="JAVA"><![CDATA[@Name("paymentProcessor")
public class PaymentProcessor {
public boolean processPayment(Payment payment) { .... }
}]]></programlisting>
@@ -155,7 +155,7 @@
For integration tests, we can mock out this component as follows:
</para>
- <programlisting><![CDATA[@Name("paymentProcessor")
+ <programlisting
role="JAVA"><![CDATA[@Name("paymentProcessor")
@Install(precedence=MOCK)
public class MockPaymentProcessor extends PaymentProcessor {
public boolean processPayment(Payment payment) {
@@ -200,7 +200,7 @@
Let's consider a JSP view for the component we unit tested above:
</para>
- <programlisting><![CDATA[<html>
+ <programlisting role="XHTML"><![CDATA[<html>
<head>
<title>Register New User</title>
</head>
@@ -234,7 +234,7 @@
request lifecycle in an automated TestNG test:
</para>
-<programlisting><![CDATA[public class RegisterTest extends SeamTest
+<programlisting role="JAVA"><![CDATA[public class RegisterTest extends
SeamTest
{
@Test
@@ -533,7 +533,7 @@
You need to provide a dataset for DBUnit:
</para>
- <programlisting><![CDATA[<dataset>
+ <programlisting role="XML"><![CDATA[<dataset>
<ARTIST
id="1"
@@ -551,7 +551,7 @@
and tell Seam about it by overriding
<literal>prepareDBUnitOperations()</literal>:
</para>
- <programlisting><![CDATA[protected void prepareDBUnitOperations() {
+ <programlisting role="JAVA"><![CDATA[protected void
prepareDBUnitOperations() {
beforeTestOperations.add(
new DataSetOperation("my/datasets/BaseData.xml")
);
@@ -575,7 +575,7 @@
setting a TestNG test parameter named
<literal>datasourceJndiName</literal>:
</para>
- <programlisting>
+ <programlisting role="XML">
<![CDATA[<parameter name="datasourceJndiName"
value="java:/seamdiscsDatasource"/>]]>
</programlisting>
@@ -599,7 +599,7 @@
It's very easy to integration test your Seam Mail:
</para>
- <programlisting><![CDATA[public class MailTest extends SeamTest {
+ <programlisting role="JAVA"><![CDATA[public class MailTest
extends SeamTest {
@Test
public void testSimpleMessage() throws Exception {
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Text.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Text.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Text.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -23,7 +23,7 @@
the following HTML produced:
</para>
- <programlisting><![CDATA[<p>
+ <programlisting role="XHTML"><![CDATA[<p>
It's easy to make <i>emphasis</i>, <tt>monospace</tt>
<del>deleted text</del>, super<sup>scripts</sup> or
<u>underlines</u>.
</p>]]></programlisting>
@@ -47,7 +47,7 @@
This is the HTML that results:
</para>
- <programlisting><![CDATA[<h1>This is a big heading</h1>
+ <programlisting role="XHTML"><![CDATA[<h1>This is a big
heading</h1>
<p>
You <i>must</i> have some text following a heading!
</p>
@@ -78,7 +78,7 @@
=an item
=another item]]></programlisting>
- <programlisting><![CDATA[<p>
+ <programlisting role="XHTML"><![CDATA[<p>
An ordered list:
</p>
@@ -108,7 +108,7 @@
But what do you think he means by "nyeah-nee"?]]></programlisting>
- <programlisting><![CDATA[<p>
+ <programlisting role="XHTML"><![CDATA[<p>
The other guy said:
</p>
@@ -133,7 +133,7 @@
<programlisting><![CDATA[You can write down equations like 2\*3\=6 and
HTML tags
like \<body\> using the escape character: \\.]]></programlisting>
- <programlisting><![CDATA[<p>
+ <programlisting role="XHTML"><![CDATA[<p>
You can write down equations like 2*3=6 and HTML tags
like <body> using the escape character: \.
</p>]]></programlisting>
@@ -151,7 +151,7 @@
Any ideas?]]></programlisting>
- <programlisting><![CDATA[<p>
+ <programlisting role="XHTML"><![CDATA[<p>
My code doesn't work:
</p>
@@ -208,14 +208,14 @@
to be safe from cross-site scripting attacks). This is useful for creating
links:
</para>
- <programlisting><![CDATA[You might want to link to <a
href="http://jboss.com/products/seam">something
+ <programlisting role="XHTML"><![CDATA[You might want to link
to <a
href="http://jboss.com/products/seam">something
cool</a>, or even include an image: <img
src="/logo.jpg"/>]]></programlisting>
<para>
And for creating tables:
</para>
- <programlisting><![CDATA[<table>
+ <programlisting role="XHTML"><![CDATA[<table>
<tr><td>First name:</td><td>Gavin</td></tr>
<tr><td>Last name:</td><td>King</td></tr>
</table>]]></programlisting>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Tutorial.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Tutorial.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Tutorial.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -154,7 +154,7 @@
<area id="registration-notnull"
coords="22"/>
<area id="registration-id-annotation"
coords="44"/>
</areaspec>
- <programlisting><![CDATA[@Entity
+ <programlisting role="JAVA"><![CDATA[@Entity
@Name("user")
@Scope(SESSION)
@Table(name="users")
@@ -299,7 +299,7 @@
<area id="registration-outcome"
coords="25"/>
<area id="registration-builtin"
coords="29"/>
</areaspec>
- <programlisting><![CDATA[@Stateless
+ <programlisting
role="JAVA"><![CDATA[@Stateless
@Name("register")
public class RegisterAction implements Register
{
@@ -867,7 +867,7 @@
<area id="messages-delete"
coords="29"/>
<area id="messages-remove"
coords="36"/>
</areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting
role="JAVA"><![CDATA[@Stateful
@Scope(SESSION)
@Name("messageManager")
public class MessageManagerBean implements Serializable, MessageManager
@@ -1111,7 +1111,7 @@
<area id="todo-assignment"
coords="9"/>
<area id="todo-endstate" coords="14"/>
</areaspec>
- <programlisting><![CDATA[<process-definition
name="todo">
+ <programlisting
role="XML"><![CDATA[<process-definition name="todo">
<start-state name="start">
<transition to="todo"/>
@@ -1243,7 +1243,7 @@
<area id="todo-createprocess-annotation"
coords="15"/>
<area id="todo-task-annotations"
coords="18"/>
</areaspec>
- <programlisting><![CDATA[@Name("todoList")
+ <programlisting
role="JAVA"><![CDATA[@Name("todoList")
public class TodoList {
private String description;
@@ -1480,7 +1480,7 @@
<area id="numberguess-action"
coords="11"/>
<area id="numberguess-decision"
coords="16"/>
</areaspec>
- <programlisting><![CDATA[<pageflow-definition
+ <programlisting
role="XML"><![CDATA[<pageflow-definition
xmlns="http://jboss.com/products/seam/pageflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pageflow
@@ -1685,7 +1685,7 @@
<areaspec>
<area id="numberguess-create"
coords="13"/>
</areaspec>
- <programlisting><![CDATA[@Name("numberGuess")
+ <programlisting
role="JAVA"><![CDATA[@Name("numberGuess")
@Scope(ScopeType.CONVERSATION)
public class NumberGuess implements Serializable {
@@ -2017,7 +2017,7 @@
<area id="booking-datamodel-annotation"
coords="15"/>
<area id="booking-destroy-annotation"
coords="70"/>
</areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("hotelSearch")
@Scope(ScopeType.SESSION)
@Restrict("#{identity.loggedIn}")
@@ -2134,7 +2134,7 @@
<area id="booking-outputpanel-element"
coords="37"/>
<area id="booking-link-element"
coords="61"/>
</areaspec>
- <programlisting><![CDATA[<div class="section">
+ <programlisting role="XHTML"><![CDATA[<div
class="section">
<span class="errors">
<h:messages globalOnly="true"/>
@@ -2255,7 +2255,7 @@
<area id="booking-end-annotation"
coords="72"/>
<area id="booking-dest-annotation"
coords="85"/>
</areaspec>
- <programlisting><![CDATA[@Stateful
+ <programlisting role="JAVA"><![CDATA[@Stateful
@Name("hotelBooking")
@Restrict("#{identity.loggedIn}")
public class HotelBookingAction implements HotelBooking
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Validation.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Validation.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Validation.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -4,7 +4,7 @@
In plain JSF, validation is defined in the view:
</para>
- <programlisting><![CDATA[<h:form>
+ <programlisting role="XHTML"><![CDATA[<h:form>
<h:messages/>
<div>
@@ -37,7 +37,7 @@
<literal>Location</literal> class:
</para>
- <programlisting><![CDATA[public class Location {
+ <programlisting role="JAVA"><![CDATA[public class Location {
private String country;
private String zip;
@@ -59,7 +59,7 @@
built into Hibernate Validator:
</para>
- <programlisting><![CDATA[public class Location {
+ <programlisting role="JAVA"><![CDATA[public class Location {
private String country;
private String zip;
@@ -81,7 +81,7 @@
against the constraint defined on the model object.
</para>
- <programlisting><![CDATA[<h:form>
+ <programlisting role="XHTML"><![CDATA[<h:form>
<h:messages/>
<div>
@@ -120,7 +120,7 @@
so let's try <literal><s:validateAll></literal>:
</para>
- <programlisting><![CDATA[<h:form>
+ <programlisting role="XHTML"><![CDATA[<h:form>
<h:messages/>
@@ -169,7 +169,7 @@
layout in a facelets template:
</para>
- <programlisting><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting role="XHTML"><![CDATA[<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
@@ -200,7 +200,7 @@
<literal><s:decorate></literal>.
</para>
- <programlisting><![CDATA[<h:form>
+ <programlisting role="XHTML"><![CDATA[<h:form>
<h:messages globalOnly="true"/>
@@ -223,7 +223,7 @@
is navigating around the form:
</para>
- <programlisting><![CDATA[<h:form>
+ <programlisting role="XHTML"><![CDATA[<h:form>
<h:messages globalOnly="true"/>
@@ -254,7 +254,7 @@
anything on the page.
</para>
- <programlisting><![CDATA[<h:form id="form">
+ <programlisting role="XHTML"><![CDATA[<h:form
id="form">
<h:messages globalOnly="true"/>
@@ -283,7 +283,7 @@
and per-view message bundles) with the Hibernate Validator:
</para>
-<programlisting><![CDATA[public class Location {
+<programlisting role="JAVA"><![CDATA[public class Location {
private String name;
private String zip;
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Weblogic.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Weblogic.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Weblogic.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -449,20 +449,21 @@
<literal>resources/META-INF/persistence.xml</literal>
</term>
<listitem>
- <para>
<itemizedlist>
<listitem>
<para>Because the tech preview version will
only work with <literal>kodo</literal> or
<literal>openJPA</literal> as the JPA
provider you must change the provider to :
-
<programlisting><![CDATA[<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>]]></programlisting></para>
+ </para>
+ <programlisting
role="XML"><![CDATA[<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>]]></programlisting>
</listitem>
<listitem>
<para> Next you need to change the
<literal>jta-data-source</literal> to
what you entered above :
-
<programlisting><![CDATA[<jta-data-source>seam-jee5-ds</jta-data-source>]]></programlisting></para>
+ </para>
+ <programlisting
role="XML"><![CDATA[<jta-data-source>seam-jee5-ds</jta-data-source>]]></programlisting>
</listitem>
<listitem>
<para>The other properties in the file are
@@ -470,7 +471,7 @@
<literal>openJPA</literal> but can be
left in.</para>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
</varlistentry>
</variablelist>
@@ -493,11 +494,12 @@
is only needed if using the admin console to deploy. For
some reason Weblogic needs it in the
<literal>WAR</literal>
when it scans the application.
- <programlisting><![CDATA[<fileset
id="war.lib.extras" dir="${seam.dir}">
+ </para>
+ <programlisting role="XML"><![CDATA[<fileset
id="war.lib.extras" dir="${seam.dir}">
<include name="lib/jsf-api.jar" />
<include name="lib/jsf-impl.jar" />
<include name="lib/richfaces-api.jar" />
-</fileset>]]></programlisting></para>
+</fileset>]]></programlisting>
</listitem>
</varlistentry>
</variablelist>
@@ -621,6 +623,7 @@
<listitem>
<para>Between the the Weblogic 10.x and 9.2 examples there are
several differences:
+ </para>
<itemizedlist>
<listitem>
<para>
@@ -642,7 +645,7 @@
issue as well. </para>
- <programlisting><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
+ <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -662,33 +665,35 @@
file. </para>
- <programlisting><![CDATA[<property
name="hibernate.query.factory_class"
+ <programlisting
role="XML"><![CDATA[<property
name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>]]></programlisting>
</listitem>
<listitem>
<para>
<literal>WEB-INF/components.xml</literal>
— In the Weblogic 10.x version JPA entity
- transactions is enabled by adding:
+ transactions is enabled by adding:</para>
-
<programlisting><![CDATA[<transaction:entity-transaction
entity-manager="#{em}"/>]]></programlisting>
- </para>
+ <programlisting
role="XML"><![CDATA[<transaction:entity-transaction
entity-manager="#{em}"/>]]></programlisting>
+
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
<listitem>
<para>Between the Weblogic 10.x version and the JBoss version
there are more changes. Here is the rundown:
+ </para>
<itemizedlist>
<listitem>
<para>
<literal>META-INF/persistence.xml</literal>
— Except for datasource name the WebLogic
version sets:
- <programlisting><![CDATA[<property
name="hibernate.transaction.manager_lookup_class"
-
value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>]]></programlisting>
</para>
+ <programlisting
role="XML"><![CDATA[<property
+ name="hibernate.transaction.manager_lookup_class"
+
value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>]]></programlisting>
</listitem>
<listitem>
<para><literal>WEB-INF/jboss-web.xml</literal>
@@ -701,10 +706,12 @@
packages because they are not included as they are
with JBoss AS. These are primarily for hibernate,
JSF-RI support and their dependencies.
+ </para>
<itemizedlist>
<listitem>
<para> To use Hibernate as your JPA provider
you need the following jars:
+ </para>
<itemizedlist>
<listitem>
<simpara>
@@ -746,13 +753,14 @@
<literal>jboss-archive-browsing.jar</literal>
</simpara>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
<listitem>
<para>Seam requires JSF 1.2 and these are
jars needed for that. Weblogic 10.3.TP
does not ship JSF libraries installed by
default.
+ </para>
<itemizedlist>
<listitem>
<simpara>
@@ -764,11 +772,12 @@
<literal>jsf-impl.jar</literal>
</simpara>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
<listitem>
<para>Various third party jars that
Weblogic needs:
+ </para>
<itemizedlist>
<listitem>
<simpara>
@@ -800,11 +809,11 @@
<literal>javassist.jar</literal>
</simpara>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
</itemizedlist>
</section>
@@ -918,7 +927,6 @@
<section>
<title>Configuration file changes</title>
- <para>
<variablelist>
<varlistentry>
<term> <literal>build.xml</literal>
@@ -928,8 +936,9 @@
<listitem>
<para>Change the default target to
<literal>archive</literal>.
- <programlisting><![CDATA[<project
name="weblogic_example" default="archive"
basedir=".">]]></programlisting>
- </para>
+
+ </para>
+ <programlisting
role="XML"><![CDATA[<project name="weblogic_example"
default="archive" basedir=".">]]></programlisting>
</listitem>
</itemizedlist>
</listitem>
@@ -953,12 +962,12 @@
<para>Change the transaction type to
<literal>RESOURCE_LOCAL</literal> so
that we can use JPA transactions.</para>
- <programlisting><![CDATA[<persistence-unit
name="weblogic_example"
transaction-type="RESOURCE_LOCAL">]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<persistence-unit name="weblogic_example"
transaction-type="RESOURCE_LOCAL">]]></programlisting>
</listitem>
<listitem>
<para> Add/modify the properties below for
Weblogic support:</para>
- <programlisting><![CDATA[<property
name="hibernate.cache.provider_class"
+ <programlisting
role="XML"><![CDATA[<property
name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
@@ -968,7 +977,7 @@
<para> Remove the JBoss AS specific method of
exposing the EntityManagerFactory:
</para>
- <programlisting><![CDATA[<property
+ <programlisting
role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/weblogic_exampleEntityManagerFactory">]]></programlisting>
</listitem>
@@ -998,12 +1007,12 @@
<listitem>
<para> We want to use JPA transactions so we need to add
the following to let Seam know. </para>
-
<programlisting><![CDATA[<transaction:entity-transaction
entity-manager="#{entityManager}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<transaction:entity-transaction
entity-manager="#{entityManager}"/>]]></programlisting>
<para>You will also need to add the transaction
namespace and schema location to the top of the
document.</para>
-
<
programlisting><![CDATA[xmlns:transaction="http://jboss.com/pr...
-
<
programlisting><![CDATA[http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.1.xsd]]></programlisti...
+ <programlisting
role="XML"><![CDATA[xmlns:transaction="http://jboss....
+ <programlisting
role="XML"><![CDATA[http://jboss.com/products/seam/transa...
http://jboss.com/products/seam/transaction-2.1.xsd]]></programlisti...
</listitem>
</varlistentry>
<varlistentry>
@@ -1027,7 +1036,7 @@
administration console.</para>
</listitem>
</varlistentry>
- </variablelist> </para>
+ </variablelist>
</section>
<section id="weblogic-seam-gen-lib-changes">
<title>Library changes</title>
@@ -1044,6 +1053,7 @@
<literal>seam-gen</literal> does not provide by
default. These need to be copied into your projects
<literal>lib</literal> directory manually.
+ </para>
<itemizedlist>
<listitem>
<para>jboss-archive-browsing.jar — can
@@ -1056,16 +1066,16 @@
<literal>@SEAM_DIST/examples/jpa/lib</literal>
directory. </para>
</listitem>
- </itemizedlist> </para>
+ </itemizedlist>
</listitem>
<listitem>
<para>build.xml — Now we need to adjust the
<literal>build.xml</literal>. Find the target
<literal>war</literal> and add the following to the end
- of the target.
+ of the target.</para>
- <programlisting><![CDATA[<copy
todir="${war.dir}/WEB-INF/lib">
+ <programlisting role="XML"><![CDATA[<copy
todir="${war.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}">
<!--JSF implementation -->
<include name="jsf-api.jar" />
@@ -1090,7 +1100,6 @@
<include name="core.jar"/>
</fileset>
</copy>]]></programlisting>
- </para>
</listitem>
</itemizedlist>
@@ -1155,9 +1164,10 @@
linkend="weblogic-domain"/> we chose to have the domain
in
development mode. This means to deploy the application all we
need to do is copy it into the autodeploy directory.
+ </para>
- <programlisting>cp ./dist/weblogic_example.war
/home/jbalunas/bea/user_projects/domains/seam_examples/autodeploy</programlisting></para>
+ <programlisting role="XML">cp ./dist/weblogic_example.war
/home/jbalunas/bea/user_projects/domains/seam_examples/autodeploy</programlisting>
<para>Check out the application at the following
<literal>http://localhost:7001/weblogic_example/</literal>
.</para>
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Webservices.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Webservices.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Webservices.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -22,7 +22,7 @@
web service classes. This file contains the following SOAP handler configuration:
</para>
- <programlisting><![CDATA[<jaxws-config
xmlns="urn:jboss:jaxws-config:2.0"
+ <programlisting role="XML"><![CDATA[<jaxws-config
xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="urn:jboss:jaxws-config:2.0
jaxws-config_2_0.xsd">
@@ -50,7 +50,7 @@
and back again. Here's an example of a web service request that contains a
conversation ID:
</para>
- <programlisting><![CDATA[<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ <programlisting role="XML"><![CDATA[<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:seam="http://seambay.example.seam.jboss.org/">
<soapenv:Header>
<seam:conversationId
xmlns:seam='http://www.jboss.org/seam/webservice'>2</seam:c...
@@ -75,7 +75,7 @@
able to read the conversation ID from the request. Here's an example of a
response to the above request message:
</para>
- <programlisting><![CDATA[<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <programlisting role="XML"><![CDATA[<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header>
<seam:conversationId
xmlns:seam='http://www.jboss.org/seam/webservice'>2</seam:c...
</env:Header>
@@ -126,7 +126,7 @@
service methods:
</para>
- <programlisting><![CDATA[@Stateless
+ <programlisting role="JAVA"><![CDATA[@Stateless
@WebService(name = "AuctionService", serviceName = "AuctionService")
public class AuctionService implements AuctionServiceRemote
{
@@ -170,7 +170,7 @@
<literal>AuctionAction.createAuction()</literal> method:
</para>
- <programlisting><![CDATA[ @WebMethod
+ <programlisting role="JAVA"><![CDATA[ @WebMethod
public void createAuction(String title, String description, int categoryId)
{
AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class,
true);
@@ -182,7 +182,7 @@
And here's the code from <literal>AuctionAction</literal>:
</para>
- <programlisting><![CDATA[ @Begin
+ <programlisting role="JAVA"><![CDATA[ @Begin
public void createAuction()
{
auction = new Auction();
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Websphere.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Websphere.xml 2008-03-25 22:33:50 UTC
(rev 7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Websphere.xml 2008-03-25 22:36:31 UTC
(rev 7693)
@@ -141,7 +141,7 @@
look like this: </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<core:init jndi-pattern="java:comp/env/jboss-seam-jee5/#{ejbName}"
debug="true"/>
]]></programlisting>
</listitem>
@@ -160,8 +160,7 @@
following:</para>
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
+ <programlisting role="XML"><![CDATA[<xml
version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -177,7 +176,7 @@
below.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!-- JEE5 EJB3 names -->
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
@@ -243,7 +242,7 @@
<para>For this example we will be using the default
datasource that comes with Websphere. To do this change the
<literal>jta-data-source</literal>
element:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<jta-data-source>DefaultDatasource</jta-data-source>
]]></programlisting>
<para>Then we need to adjust some of the hibernate
@@ -251,7 +250,7 @@
Next you need to add/change the properties:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!--<property name="hibernate.transaction.flush_before_completion"
value="true"/>-->
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
@@ -402,9 +401,10 @@
<literal>jboss-seam-jee5.jar</literal>. The primary change
is the addition of the
<literal>GlassfishDerbyDialect.class</literal>:
+ </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<fileset id="jar.resources" dir="${resources.dir}">
<include name="import.sql" />
<include name="seam.properties" />
@@ -412,14 +412,15 @@
<include name="META-INF/persistence.xml" />
<include name="META-INF/ejb-jar.xml" />
</fileset>]]></programlisting>
- </para>
+
<para>Next we need to add the library dependencies discussed above.
For this add the following to bottom of the
<literal>ear.lib.extras</literal> fileset entry:
+ </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!--<include name="lib/log4j.jar" />-->
<include name="lib/el-api.jar" />
<include name="examples/jpa/lib/el-ri.jar" />
@@ -427,7 +428,7 @@
<include name="lib/jsf-impl.jar" />
<include name="lib/jboss-seam.jar" />
</fileset>]]></programlisting>
- </para>
+
<para>Now all that is left is to execute the <literal>ant
archive</literal> task and the built application will be in
@@ -1055,7 +1056,7 @@
linkend="jee5-websphere-section"/>:
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<property name="hibernate.dialect"
value="GlassfishDerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
@@ -1069,7 +1070,7 @@
<para> Remove the JBoss AS specific method of exposing
the EntityManagerFactory: </para>
- <programlisting><![CDATA[<property
+ <programlisting
role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/websphere_exampleEntityManagerFactory">]]></programlisting>
</listitem>
@@ -1146,7 +1147,7 @@
entry.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/websphere_exampleEntityManagerFactory"/>
]]></programlisting>
@@ -1164,7 +1165,7 @@
the <literal>web.xml</literal> file to look like the
following:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
@@ -1180,7 +1181,7 @@
Websphere to perform the proper binding.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<ejb-local-ref>
<ejb-ref-name>websphere_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
@@ -1230,12 +1231,12 @@
</itemizedlist>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
@Name("authenticator") @Stateless public class
AuthenticatorAction implements Authenticator {]]></programlisting>
- <programlisting><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
@Local public interface Authenticator {
public boolean authenticate();
}]]></programlisting>
@@ -1257,11 +1258,12 @@
<para>Change the default target to
<literal>archive</literal> (we aren't going to cover
automatic deployment to Websphere).
+ </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<project name="websphere_example" default="archive"
basedir=".">]]></programlisting>
- </para>
+
</listitem>
<listitem>
<para>Websphere looks for the drools
@@ -1273,13 +1275,14 @@
the top of the <literal> <target name="war"
depends="compile" description="Build the distribution
.war file"> </literal> target.
+ </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
</fileset>
-</copy>]]></programlisting></para>
+</copy>]]></programlisting>
</listitem>
<listitem>
<para>We need to ge the
@@ -1287,9 +1290,10 @@
our application jar. To do that find the
<literal>jar</literal> task and modify the top of it so
that
it looks like this:
+ </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<target name="jar" depends="compile,copyclasses"
description="Build the distribution .jar file">
<copy todir="${jar.dir}">
@@ -1300,7 +1304,6 @@
</fileset>
</copy>
...]]></programlisting>
- </para>
</listitem>
<listitem>
<para>Next we need to get the
@@ -1312,7 +1315,7 @@
task: </para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<fileset dir="${lib.dir}">
<include name="jboss-seam.jar" />
</fileset>]]></programlisting>
@@ -1320,7 +1323,7 @@
like:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<target name="archive" depends="jar,war,ear"
description="Package the archives">
<jar jarfile="${dist.dir}/${project.name}.jar"
basedir="${jar.dir}"/>
@@ -1346,7 +1349,7 @@
</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<target name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
@@ -1378,7 +1381,7 @@
<itemizedlist>
<listitem>
<para>Hibernate dependencies</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!-- Hibernate and deps -->
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
@@ -1391,7 +1394,7 @@
<para>JSF dependencies. You will need to copy the
<literal>el-ri.jar</literal> from the
<literal>$SEAM/examples/jpa/lib</literal>
directory.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!-- jsf libs -->
<include name="lib/jsf-api.jar" />
<include name="lib/jsf-impl.jar" />
@@ -1406,7 +1409,7 @@
also need to acquire the
<literal>concurrent.jar</literal>
and place it in the same directory. You can get this from
any jboss distribution or just search for it.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!-- 3rd party and supporting jars -->
<!--<include name="lib/log4j.jar" />-->
<include name="lib/javassist.jar"/>
@@ -1424,14 +1427,14 @@
both the <literal>ear</literal> base and
<literal>/lib</literal>
directory.</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />]]></programlisting>
</listitem>
</itemizedlist>
<para>You should end up with something like:</para>
- <programlisting><![CDATA[
+ <programlisting role="XML"><![CDATA[
<fileset dir="${basedir}">
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Xml.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Xml.xml 2008-03-25 22:33:50 UTC (rev
7692)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Xml.xml 2008-03-25 22:36:31 UTC (rev
7693)
@@ -95,7 +95,7 @@
For example, the following <literal>components.xml</literal>
file installs jBPM:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting 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/>
@@ -105,7 +105,7 @@
This example does the same thing:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<component class="org.jboss.seam.bpm.Jbpm"/>
</components>]]></programlisting>
@@ -113,7 +113,7 @@
This one installs and configures two different Seam-managed persistence
contexts:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting 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"
@@ -128,7 +128,7 @@
As does this one:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<component name="customerDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property
name="persistenceUnitJndiName">java:/customerEntityManagerFactory</property>
@@ -145,7 +145,7 @@
practice):
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context name="productDatabase"
@@ -154,7 +154,7 @@
</components>]]></programlisting>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<component name="productDatabase"
scope="session"
@@ -171,7 +171,7 @@
annotation.
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context name="productDatabase"
@@ -180,7 +180,7 @@
</components>]]></programlisting>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<component name="productDatabase"
auto-create="true"
@@ -196,7 +196,7 @@
referenced.
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<factory name="contact" method="#{contactManager.loadContact}"
scope="CONVERSATION"/>
@@ -206,7 +206,7 @@
You can create an "alias" (a second name) for a Seam component
like so:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<factory name="user" value="#{actor}"
scope="STATELESS"/>
@@ -216,7 +216,7 @@
You can even create an "alias" for a commonly used expression:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<factory name="contact" value="#{contactManager.contact}"
scope="STATELESS"/>
@@ -227,7 +227,7 @@
<literal><factory></literal> declaration:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<factory name="session" value="#{entityManager.delegate}"
scope="STATELESS" auto-create="true"/>
@@ -258,7 +258,7 @@
The first option lets you define multiple components in the file:
</para>
- <programlisting><![CDATA[<components>
+ <programlisting role="XML"><![CDATA[<components>
<component class="com.helloworld.Hello" name="hello">
<property name="name">#{user.name}</property>
</component>
@@ -269,7 +269,7 @@
The second option only lets you define or configure one component, but is
less noisy:
</para>
- <programlisting><![CDATA[<component name="hello">
+ <programlisting role="XML"><![CDATA[<component
name="hello">
<property name="name">#{user.name}</property>
</component>]]></programlisting>
@@ -292,9 +292,9 @@
<programlisting><![CDATA[org.jboss.seam.core.manager.conversationTimeout
60000]]></programlisting>
- <programlisting><![CDATA[<core:manager
conversation-timeout="60000"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<core:manager
conversation-timeout="60000"/>]]></programlisting>
- <programlisting><![CDATA[<component
name="org.jboss.seam.core.manager">
+ <programlisting role="XML"><![CDATA[<component
name="org.jboss.seam.core.manager">
<property name="conversationTimeout">60000</property>
</component>]]></programlisting>
@@ -304,7 +304,7 @@
<programlisting><![CDATA[org.jboss.seam.bpm.jbpm.processDefinitions
order.jpdl.xml, return.jpdl.xml, inventory.jpdl.xml]]></programlisting>
- <programlisting><![CDATA[<bpm:jbpm>
+ <programlisting role="XML"><![CDATA[<bpm:jbpm>
<bpm:process-definitions>
<value>order.jpdl.xml</value>
<value>return.jpdl.xml</value>
@@ -312,7 +312,7 @@
</bpm:process-definitions>
</bpm:jbpm>]]></programlisting>
- <programlisting><![CDATA[<component
name="org.jboss.seam.bpm.jbpm">
+ <programlisting role="XML"><![CDATA[<component
name="org.jboss.seam.bpm.jbpm">
<property name="processDefinitions">
<value>order.jpdl.xml</value>
<value>return.jpdl.xml</value>
@@ -324,7 +324,7 @@
Even maps with String-valued keys and string or primitive values are
supported:
</para>
- <programlisting><![CDATA[<component
name="issueEditor">
+ <programlisting role="XML"><![CDATA[<component
name="issueEditor">
<property name="issueStatuses">
<key>open</key> <value>open issue</value>
<key>resolved</key> <value>issue resolved by
developer</value>
@@ -340,9 +340,9 @@
</para>
- <programlisting><![CDATA[<drools:managed-working-memory
name="policyPricingWorkingMemory"
rule-base="#{policyPricingRules}"/>]]></programlisting>
+ <programlisting
role="XML"><![CDATA[<drools:managed-working-memory
name="policyPricingWorkingMemory"
rule-base="#{policyPricingRules}"/>]]></programlisting>
- <programlisting><![CDATA[<component
name="policyPricingWorkingMemory"
+ <programlisting role="XML"><![CDATA[<component
name="policyPricingWorkingMemory"
class="org.jboss.seam.drools.ManagedWorkingMemory">
<property name="ruleBase">#{policyPricingRules}</property>
</component>]]></programlisting>
@@ -357,7 +357,7 @@
without namespaces:
</para>
- <programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
+ <programlisting 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
http://jboss.com/products/seam/components-2.1.xsd">
@@ -375,7 +375,7 @@
<para>The namespaced version looks like this:</para>
- <programlisting><![CDATA[<?xml version="1.0"
encoding="UTF-8"?>
+ <programlisting 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"
@@ -407,7 +407,7 @@
<literal>package-info.java</literal> in the package
directory.) Here is an example from the seampay demo:
</para>
-
<programlisting>@Namespace(value="http://jboss.com/products/seam/examples/seampay")
+ <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>
@@ -417,7 +417,7 @@
Now we can write:
</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
@@ -434,7 +434,7 @@
<para>Or:</para>
- <programlisting><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
+ <programlisting role="XML"><![CDATA[<components
xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
@@ -458,7 +458,7 @@
component:
</para>
- <programlisting><![CDATA[package org.jboss.seam.example.seampay;
+ <programlisting role="JAVA"><![CDATA[package
org.jboss.seam.example.seampay;
...
@Name("paymentHome")
public class PaymentController
@@ -478,7 +478,7 @@
In this case <literal>Payment</literal> is an entity that is
being declared as a Seam component:
</para>
- <programlisting><![CDATA[package org.jboss.seam.example.seampay;
+ <programlisting role="JAVA"><![CDATA[package
org.jboss.seam.example.seampay;
...
@Entity
public class Payment