Seam SVN: r12804 - in branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide: en-US and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-05-26 04:58:36 -0400 (Wed, 26 May 2010)
New Revision: 12804
Added:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Conventions.xml
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Feedback.xml
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Legal_Notice.xml
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/images/
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/images/title_logo.svg
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/publican.cfg
Removed:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/ClusteringAndEJBPassivation.xml
Log:
added publican files for generation of docs
Deleted: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/ClusteringAndEJBPassivation.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/ClusteringAndEJBPassivation.xml 2010-05-26 04:40:42 UTC (rev 12803)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/ClusteringAndEJBPassivation.xml 2010-05-26 08:58:36 UTC (rev 12804)
@@ -1,424 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-<chapter id="ClusteringAndEJBPassivation">
- <title>Clustering and EJB Passivation</title>
-
- <para>
- <emphasis>Please note that this chapter is still being reviewed. Tread carefully.</emphasis>
- </para>
-
- <para>
- This chapter covers two distinct topics that happen share a common solution in Seam, (web) clustering and EJB
- passivation. Therefore, they are addressed together in this reference manual. Although performance tends to be
- grouped in this category as well, it's kept separate because the focus of this chapter is on the programming
- model and how it's affected by the use of the aforementioned features.
- </para>
-
- <para>
- In this chapter you will learn how Seam manages the passivation of Seam components and entity instances, how to
- activate this feature, and how this feature is related to clustering. You will also learn how to deploy a Seam
- application into a cluster and verify that HTTP session replication is working properly. Let's start with a
- little background on clustering and see an example of how you deploy a Seam application to a JBoss AS cluster.
- </para>
-
- <sect1>
- <title>Clustering</title>
-
- <para>
- Clustering (more formally web clustering) allows an application to run on two or more parallel servers
- (i.e., nodes) while providing a uniform view of the application to clients. Load is distributed across the
- servers in such a way that if one or more of the servers fails, the application is still accessible via any
- of the surviving nodes. This topology is crucial for building scalable enterprise applications as
- performance and availability can be improved simply by adding nodes. But it brings up an important question.
- <emphasis>What happens to the state that was on the server that failed?</emphasis>
- </para>
-
- <para>
- Since day one, Seam has always provided support for stateful applications running in a cluster. Up to this
- point, you have learned that Seam provides state management in the form of additional scopes and by governing
- the life cycle of stateful (scoped) components. But state management in Seam goes beyond creating, storing
- and destroying instances. Seam tracks changes to JavaBean components and stores the changes at strategic
- points during the request so that the changes can be restored when the request shifts to a secondary node in
- the cluster. Fortunately, monitoring and replication of stateful EJB components is already handled by the EJB
- server, so this feature of Seam is intended to put stateful JavaBeans on par with their EJB cohorts.
- </para>
-
- <para>
- But wait, there's more! Seam also offers an incredibly unique feature for clustered applications. In
- addition to monitoring JavaBean components, Seam ensures that managed entity instances (i.e. JPA and
- Hibernate entities) don't become detached during replication. Seam keeps a record of the entities that are
- loaded and automatically loads them on the secondary node. You must, however, be using a Seam-managed
- persistence context to get this feature. More in depth information about this feature is provided in the
- second half of this chapter.
- </para>
-
- <para>
- Now that you understand what features Seam offers to support a clustered environment, let's look at how you
- program for clustering.
- </para>
-
- <sect2>
- <title>Programming for clustering</title>
- <para>
- Any session- or conversation-scoped mutable JavaBean component that will be used in a clustered
- environment must implement the <literal>org.jboss.seam.core.Mutable</literal> interface from the Seam API. As part of the
- contract, the component must maintain a dirty flag that is reported and reset by the
- <literal>clearDirty()</literal> method. Seam calls this method to determine if it is necessary to
- replicate the component. This avoids having to use the more cumbersome Servlet API to add and remove the
- session attribute on every change of the object.
- </para>
- <para>
- You also must ensure that all session- and conversation-scoped JavaBean components are Serializable.
- Additional, all fields of a stateful component (EJB or JavaBean) must Serializable unless the field is
- marked transient or set to null in a <literal>@PrePassivate</literal> method. You can restore the value
- of a transient or nullified field in a <literal>@PostActivate</literal> method.
- </para>
- <para>
- One area where people often get bitten is by using <literal>List.subList</literal> to create a list. The
- resulting list is not Serializable. So watch out for situations like that. If hit a
- <literal>java.io.NotSerializableException</literal> and cannot locate the culprit at first glance, you
- can put a breakpoint on this exception, run the application server in debug mode and attach a debugger
- (such as Eclipse) to see what deserialization is choking on.
- </para>
- <note>
- <para>
- Please note that clustering does not work with hot deployable components. But then again, you shouldn't
- be using hot deployable components in a non-development environment anyway.
- </para>
- </note>
- </sect2>
-
- <sect2>
- <title>Deploying a Seam application to a JBoss AS cluster with session replication</title>
-
- <para>
- The procedure outlined in this tutorial has been validated with an seam-gen application and the Seam
- booking example.
- </para>
-
- <para>
- In the tutorial, I assume that the IP addresses of the master and slave servers are 192.168.1.2 and
- 192.168.1.3, respectively. I am intentionally not using the mod_jk load balancer so that it's easier to
- validate that both nodes are responding to requests and can share sessions.
- </para>
-
- <para>
- I'm using the farm deployment method in these instructions, though you could also deploy the application
- normally and allow the two servers to negotiate a master/slave relationship based on startup order.
- </para>
-
- <note>
- <para>
- JBoss AS clustering relies on UDP multicasting provided by jGroups. The SELinux configuration that
- ships with RHEL/Fedora blocks these packets by default. You can allow them to pass by modifying the
- iptables rules (as root). The following commands apply to an IP address that matches 192.168.1.x.
- </para>
- <programlisting>/sbin/iptables -I RH-Firewall-1-INPUT 5 -p udp -d 224.0.0.0/4 -j ACCEPT
-/sbin/iptables -I RH-Firewall-1-INPUT 9 -p udp -s 192.168.1.0/24 -j ACCEPT
-/sbin/iptables -I RH-Firewall-1-INPUT 10 -p tcp -s 192.168.1.0/24 -j ACCEPT
-/etc/init.d/iptables save</programlisting>
- <para>Detailed information can be found on <ulink url="http://www.jboss.org/community/docs/DOC-11935">this page</ulink> on the JBoss Wiki.</para>
- </note>
-
- <itemizedlist>
- <listitem>
- <para>Create two instances of JBoss AS (just extract the zip twice)</para>
- </listitem>
- <listitem>
- <para>Deploy the JDBC driver to server/all/lib/ on both instances if not using HSQLDB</para>
- </listitem>
- <listitem>
- <para>Add <literal><distributable/></literal> as the first child element in WEB-INF/web.xml</para>
- </listitem>
- <listitem>
- <para>Set the <literal>distributable</literal> property on
- <literal>org.jboss.seam.core.init</literal> to true to enable the ManagedEntityInterceptor (i.e.,
- <literal><![CDATA[<core:init distributable="true"/>]]></literal>)</para>
- </listitem>
- <listitem>
- <para>Ensure you have two IP addresses available (two computers, two network cards, or two IP
- addressses bound to the same interface). I'll assume the two IP address are 192.168.1.2 and
- 192.168.1.3</para>
- </listitem>
- <listitem>
- <para>Start the master JBoss AS instance on the first IP</para>
- <programlisting>./bin/run.sh -c all -b 192.168.1.2</programlisting>
- <para>The log should report that there are 1 cluster members and 0 other members.</para>
- </listitem>
- <listitem>
- <para>Verify that the server/all/farm directory is empty in the slave JBoss AS instance</para>
- </listitem>
- <listitem>
- <para>Start the slave JBoss AS instance on the second IP</para>
- <programlisting>./bin/run.sh -c all -b 192.168.1.3</programlisting>
- <para>The log should report that there are 2 cluster members and 1 other members. It should also
- show the state being retrieved from the master.</para>
- </listitem>
- <listitem>
- <para>Deploy the -ds.xml to server/all/farm of the master instance</para>
- <para>In the log of the master you should see acknowledgement of the deployment. In the log of the
- slave you should see a corresponding message acknowledging the deployment to the slave.</para>
- </listitem>
- <listitem>
- <para>Deploy the application to the server/all/farm directory</para>
- <para>In the log of the master you should see acknowledgement of the deployment. In the log of the
- slave you should see a corresponding message acknowledging the deployment to the slave. Note that
- you may have to wait up to 3 minutes for the deployed archive to be transfered.</para>
- </listitem>
- </itemizedlist>
- <para>
- You're application is now running in a cluster with HTTP session replication! But, of course, you are
- going to want to validate that the clustering actually works.
- </para>
- </sect2>
- <sect2>
- <title>Validating the distributable services of an application running in a JBoss AS cluster </title>
- <para>
- It's all well and fine to see the application start successfully on two different JBoss AS servers, but
- seeing is believing. You likely want to validate that the two instances are exchanging HTTP sessions to
- allow the slave to take over when the master instance is stopped.
- </para>
-
- <para>
- Start off by visiting the application running on the master instance in your browser. That will produce
- the first HTTP session. Now, open up the JBoss AS JMX console on that instance and navigate to the
- following MBean:
- </para>
-
- <itemizedlist>
- <listitem>
- <para><emphasis>Category:</emphasis> jboss.cache</para>
- </listitem>
- <listitem>
- <para><emphasis>Entry:</emphasis> service=TomcatClusteringCache</para>
- </listitem>
- <listitem>
- <para><emphasis>Method:</emphasis> printDetails()</para>
- </listitem>
- </itemizedlist>
-
- <para>
- Invoke the printDetails() method. You will see a tree of active HTTP sessions. Verify that the session
- your browser is using corresponds to one of the sessions in this tree.
- </para>
-
- <para>
- Now switch over to the slave instance and invoke the same method in the JMX console. You should see an
- identical list (at least underneath this application's context path).
- </para>
-
- <para>
- So you can see that at least both servers claim to have identical sessions. Now, time to test that the
- data is serializing and unserializing properly.
- </para>
-
- <para>
- Sign in using using the URL of the master instance. Then, construct a URL for the second instance by
- putting the ;jsessionid=XXXX immediately after the servlet path and changing the IP address. You should
- see that the session has carried over to the other instance. Now kill the master instance and see that
- you can continue to use the application from the slave instance. Remove the deployments from the
- server/all/farm directory and start the instance again. Switch the IP in the URL back to that of the
- master instance and visit the URL. You'll see that the original session is still being used.
- </para>
-
- <para>
- One way to watch objects passivate and activate is to create a session- or conversation-scoped Seam
- component and implement the appropriate life-cycle methods. You can either use methods from the
- HttpSessionActivationListener interface (Seam automatically registers this interface on all non-EJB
- components):
- </para>
-
- <programlisting role="JAVA"><![CDATA[public void sessionWillPassivate(HttpSessionEvent e);
-public void sessionDidActivate(HttpSessionEvent e);]]></programlisting>
-
- <para>
- Or you can simply mark two no-argument public void methods with <literal>@PrePassivate</literal> and
- <literal>@PostActivate</literal>, respectively. Note that the passivation step occurs at the end of
- every request, while the activation step occurs when a node is called upon.
- </para>
-
- </sect2>
- <para>
- Now that you understand the big picture of running Seam in a cluster, it's time to address Seam's most
- mysterious, yet remarkable agent, the ManagedEntityInterceptor.
- </para>
- </sect1>
-
- <sect1>
- <title>EJB Passivation and the ManagedEntityInterceptor</title>
-
- <para>
- The ManagedEntityInterceptor (MEI) is an optional interceptor in Seam that gets applied to
- conversation-scoped components when enabled. Enabling it is simple. You just set the distributable property
- on the org.jboss.seam.init.core component to true. More simply put, you add (or update) the following
- component declaration in the component descriptor (i.e., components.xml).
- </para>
-
- <programlisting role="XML"><![CDATA[<core:init distributable="true"/>]]></programlisting>
-
- <para>
- Note that this doesn't enable replication of HTTP sessions, but it does prepare Seam to be able to deal with
- passivation of either EJB components or components in the HTTP session.
- </para>
-
- <para>
- The MEI serves two distinct scenarios (EJB passivation and HTTP session passivation), although to accomplish
- the same overall goal. It ensures that throughout the life of a conversation using at least one extended
- persistence context, the entity instances loaded by the persistence context(s) remain managed (they do not
- become detached prematurally by a passivation event). In short, it ensures the integrity of the extended
- persistence context (and therefore its guarantees).
- </para>
-
- <para>
- The previous statement implies that there is a challenge that threatens this contract. In fact, there are
- two. One case is when a stateful session bean (SFSB) that hosts an extended persistence context is
- passivated (to save memory or to migrate it to another node in the cluster) and the second is when the HTTP
- session is passivated (to prepare it to be migrated to another node in the cluster).
- </para>
-
- <para>
- I first want to discuss the general problem of passivation and then look at the two challenges cited
- individually.
- </para>
-
- <sect2>
- <title>The friction between passivation and persistence</title>
-
- <para>
- The persistence context is where the persistence manager (i.e., JPA EntityManager or Hibernate Session)
- stores entity instances (i.e., objects) it has loaded from the database (via the object-relational
- mappings). Within a persistence context, there is no more than one object per unique database record.
- The persistence context is often referred to as the first-level cache because if the application asks
- for a record by its unique identifier that has already been loaded into the persistence context, a call
- to the database is avoided. But it's about more than just caching.
- </para>
-
- <para>
- Objects held in the persistence context can be modified, which the persistence manager tracks. When an
- object is modified, it's considered "dirty". The persistence manager will migrate these changes to the
- database using a technique known as write-behind (which basically means only when necessary). Thus, the
- persistence context maintains a set of pending changes to the database.
- </para>
-
- <para>
- Database-oriented applications do much more than just read from and write to the database. They capture
- transactional bits of information that need to be tranfered into the database atomically (at once). It's
- not always possible to capture this information all on one screen. Additionally, the user might need to
- make a judgement call about whether to approve or reject the pending changes.
- </para>
-
- <para>
- What we are getting at here is that the idea of a transaction from the user's perspective needs to be
- extended. And that is why the extended persistence context fits so perfectly with this requirement. It
- can hold such changes for as long as the application can keep it open and then use the built-in
- capabilities of the persistence manager to push these pending changes to the database without requiring
- the application developer to worry about the low-level details (a simple call to
- <literal>EntityManager#flush()</literal> does the trick).
- </para>
-
- <para>
- The link between the persistence manager and the entity instances is maintained using object references.
- The entity instances are serializable, but the persistence manager (and in turn its persistence context)
- is not. Therefore, the process of serialization works against this design. Serialization can occur
- either when a SFSB or the HTTP session is passivated. In order to sustain the activity in the
- application, the persistence manager and the entity instances it manages must weather serialization
- without losing their relationship. That's the aid that the MEI provides.
- </para>
-
- </sect2>
-
- <sect2>
- <title>Case #1: Surviving EJB passivation</title>
-
- <para>
- Conversations were initially designed with stateful session beans (SFSBs) in mind, primarily because the
- EJB 3 specification designates SFSBs as hosts of the extended persistence context. Seam introduces a
- complement to the extended persistence context, known as a Seam-managed persistence context, which works
- around a number of limitations in the specification (complex propagation rules and lack of manual
- flushing). Both can be used with a SFSB.
- </para>
-
- <para>
- A SFSB relies on a client to hold a reference to it in order to keep it active. Seam has provided an
- ideal place for this reference in the conversation context. Thus, for as long as the conversation
- context is active, the SFSB is active. If an EntityManager is injected into that SFSB using the
- annotation @PersistenceContext(EXTENDED), then that EntityManager will be bound to the SFSB and remain
- open throughout its lifetime, the lifetime of the conversation. If an EntityManager is injected using
- @In, then that EntityManager is maintained by Seam and stored directly in the conversation context, thus
- living for the lifetime of the conversation independent of the lifetime of the SFSB.
- </para>
-
- <para>
- With all of that said, the Java EE container can passivate a SFSB, which means it will serialize the
- object to an area of storage external to the JVM. When this happens depends on the settings of the
- individual SFSB. This process can even be disabled. However, the persistence context is not serialized
- (is this only true of SMPC?). In fact, what happens depends highly on the Java EE container. The spec is
- not very clear about this situation. Many vendors just tell you not to let it happen if you need the
- guarantees of the extended persistence context. Seam's approach is more conservative. Seam basically
- doesn't trust the SFSB with the persistence context or the entity instances. After each invocation of
- the SFSB, Seam moves the reference to entity instance held by the SFSB into the current conversation
- (and therefore into the HTTP session), nullifying those fields on the SFSB. It then restores this
- references at the beginning of the next invocation. Of course, Seam is already storing the persistence
- manager in the conversation. Thus, when the SFSB passivates and later activates, it has absolutely no
- averse affect on the application.
- </para>
-
- <note>
- <para>
- If you are using SFSBs in your application that hold references to extended persistence contexts,
- and those SFSBs can passivate, then you must use the MEI. This requirement holds even if you are
- using a single instance (not a cluster). However, if you are using clustered SFSB, then this
- requirement also applies.
- </para>
- </note>
-
- <para>
- It is possible to disable passivation on a SFSB. See the <ulink
- url="http://www.jboss.org/community/docs/DOC-9656">Ejb3DisableSfsbPassivation</ulink> page on the JBoss
- Wiki for details.
- </para>
- </sect2>
-
- <sect2>
- <title>Case #2: Surviving HTTP session replication</title>
-
- <para>
- Dealing with passivation of a SFSB works by leveraging the HTTP session. But what happens when the HTTP
- session passivates? This happens in a clustered environment with session replication enabled. This case
- is much tricker to deal with and is where a bulk of the MEI infrastructure comes into play. In thise
- case, the persistence manager is going to be destroyed because it cannot be serialized. Seam handles
- this deconstruction (hence ensuring that the HTTP session serializes properly). But what happens on the
- other end. Well, when the MEI sticks an entity instance into the conversation, it embeds the instance in
- a wrapper that provides information on how to reassociate the instance with a persistence manager
- post-serialization. So when the application jumps to another node in the cluster (presumably because the
- target node went down) the MEI infrastruture essentially reconstructs the persistence context. The huge
- drawback here is that since the persistence context is being reconstructed (from the database), pending
- changes are dropped. However, what Seam does do is ensure that if the entity instance is versioned, that
- the guarantees of optimistic locking are upheld. (why isn't the dirty state transfered?)
- </para>
-
- <note>
- <para>
- If you are deploying your application in a cluster and using HTTP session replication, you must use the MEI.
- </para>
- </note>
- </sect2>
-
- <sect2>
- <title>ManagedEntityInterceptor wrap-up</title>
-
- <para>
- The important point of this section is that the MEI is there for a reason. It's there to ensure that the
- extended persistence context can retain intact in the face of passivation (of either a SFSB or the HTTP
- session). This matters because the natural design of Seam applications (and conversational state in
- general) revolve around the state of this resource.
- </para>
-
- </sect2>
-
- </sect1>
-
-<!--
- vim:et:ts=4:sw=4:tw=120
--->
-</chapter>
Added: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Conventions.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Conventions.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Conventions.xml 2010-05-26 08:58:36 UTC (rev 12804)
@@ -0,0 +1,171 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section>
+ <title>Document Conventions</title>
+ <para>
+ This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.
+ </para>
+ <para>
+ In PDF and paper editions, this manual uses typefaces drawn from the <ulink url="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</ulink> set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default.
+ </para>
+ <section>
+ <title>Typographic Conventions</title>
+ <para>
+ Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.
+ </para>
+ <para>
+ <literal>Mono-spaced Bold</literal>
+ </para>
+ <para>
+ Used to highlight system input, including shell commands, file names and paths. Also used to highlight keycaps and key combinations. For example:
+ </para>
+ <blockquote>
+ <para>
+ To see the contents of the file <filename>my_next_bestselling_novel</filename> in your current working directory, enter the <command>cat my_next_bestselling_novel</command> command at the shell prompt and press <keycap>Enter</keycap> to execute the command.
+ </para>
+ </blockquote>
+ <para>
+ The above includes a file name, a shell command and a keycap, all presented in mono-spaced bold and all distinguishable thanks to context.
+ </para>
+ <para>
+ Key combinations can be distinguished from keycaps by the hyphen connecting each part of a key combination. For example:
+ </para>
+ <blockquote>
+ <para>
+ Press <keycap>Enter</keycap> to execute the command.
+ </para>
+ <para>
+ Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F1</keycap></keycombo> to switch to the first virtual terminal. Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F7</keycap></keycombo> to return to your X-Windows session.
+ </para>
+ </blockquote>
+ <para>
+ The first paragraph highlights the particular keycap to press. The second highlights two key combinations (each a set of three keycaps with each set pressed simultaneously).
+ </para>
+ <para>
+ If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in <literal>mono-spaced bold</literal>. For example:
+ </para>
+ <blockquote>
+ <para>
+ File-related classes include <classname>filesystem</classname> for file systems, <classname>file</classname> for files, and <classname>dir</classname> for directories. Each class has its own associated set of permissions.
+ </para>
+ </blockquote>
+ <para>
+ <application>Proportional Bold</application>
+ </para>
+ <para>
+ This denotes words or phrases encountered on a system, including application names; dialog box text; labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:
+ </para>
+ <blockquote>
+ <para>
+ Choose <guimenu>System > Preferences > Mouse</guimenu> from the main menu bar to launch <application>Mouse Preferences</application>. In the <guilabel>Buttons</guilabel> tab, click the <guilabel>Left-handed mouse</guilabel> check box and click <guibutton>Close</guibutton> to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand).
+ </para>
+ <para>
+ To insert a special character into a <application>gedit</application> file, choose <guimenu>Applications > Accessories > Character Map</guimenu> from the main menu bar. Next, choose <guimenu>Search > Find…</guimenu> from the <application>Character Map</application> menu bar, type the name of the character in the <guilabel>Search</guilabel> field and click <guibutton>Next</guibutton>. The character you sought will be highlighted in the <guilabel>Character Table</guilabel>. Double-click this highlighted character to place it in the <guilabel>Text to copy</guilabel> field and then click the <guibutton>Copy</guibutton> button. Now switch back to your document and choose <guimenu>Edit > Paste</guimenu> from the <application>gedit</application> menu bar.
+ </para>
+ </blockquote>
+ <para>
+ The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.
+ </para>
+ <para>
+ Note the <guimenu>></guimenu> shorthand used to indicate traversal through a menu and its sub-menus. This avoids difficult-to-follow phrasing such as 'Select <guimenuitem>Mouse</guimenuitem> from the <guimenu>Preferences</guimenu> sub-menu in the <guimenu>System</guimenu> menu of the main menu bar'.
+ </para>
+ <para>
+ <command><replaceable>Mono-spaced Bold Italic</replaceable></command> or <application><replaceable>Proportional Bold Italic</replaceable></application>
+ </para>
+ <para>
+ Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:
+ </para>
+ <blockquote>
+ <para>
+ To connect to a remote machine using ssh, type <command>ssh <replaceable>username</replaceable>@<replaceable>domain.name</replaceable></command> at a shell prompt. If the remote machine is <filename>example.com</filename> and your username on that machine is john, type <command>ssh john(a)example.com</command>.
+ </para>
+ <para>
+ The <command>mount -o remount <replaceable>file-system</replaceable></command> command remounts the named file system. For example, to remount the <filename>/home</filename> file system, the command is <command>mount -o remount /home</command>.
+ </para>
+ <para>
+ To see the version of a currently installed package, use the <command>rpm -q <replaceable>package</replaceable></command> command. It will return a result as follows: <command><replaceable>package-version-release</replaceable></command>.
+ </para>
+ </blockquote>
+ <para>
+ Note the words in bold italics above — username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.
+ </para>
+ <para>
+ Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:
+ </para>
+ <blockquote>
+ <para>
+ When the Apache HTTP Server accepts requests, it dispatches child processes or threads to handle them. This group of child processes or threads is known as a <firstterm>server-pool</firstterm>. Under Apache HTTP Server 2.0, the responsibility for creating and maintaining these server-pools has been abstracted to a group of modules called <firstterm>Multi-Processing Modules</firstterm> (<firstterm>MPMs</firstterm>). Unlike other modules, only one module from the MPM group can be loaded by the Apache HTTP Server.
+ </para>
+ </blockquote>
+ </section>
+
+ <section>
+ <title>Pull-quote Conventions</title>
+ <para>
+ Terminal output and source code listings are set off visually from the surrounding text.
+ </para>
+ <para>
+ Output sent to a terminal is set in <computeroutput>mono-spaced roman</computeroutput> and presented thus:
+ </para>
+
+<screen>
+books Desktop documentation drafts mss photos stuff svn
+books_tests Desktop1 downloads images notes scripts svgs
+</screen>
+ <para>
+ Source-code listings are also set in <computeroutput>mono-spaced roman</computeroutput> but add syntax highlighting as follows:
+ </para>
+
+<programlisting language="Java">
+package org.jboss.book.jca.ex1;
+
+import javax.naming.InitialContext;
+
+public class ExClient
+{
+ public static void main(String args[])
+ throws Exception
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object ref = iniCtx.lookup("EchoBean");
+ EchoHome home = (EchoHome) ref;
+ Echo echo = home.create();
+
+ System.out.println("Created Echo");
+
+ System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));
+ }
+
+}
+</programlisting>
+ </section>
+
+ <section>
+ <title>Notes and Warnings</title>
+ <para>
+ Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.
+ </para>
+ <note>
+ <title>Note</title>
+ <para>
+ Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.
+ </para>
+ </note>
+ <important>
+ <title>Important</title>
+ <para>
+ Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring a box labeled 'Important' won't cause data loss but may cause irritation and frustration.
+ </para>
+ </important>
+ <warning>
+ <title>Warning</title>
+ <para>
+ Warnings should not be ignored. Ignoring warnings will most likely cause data loss.
+ </para>
+ </warning>
+ </section>
+
+</section>
+
+
Added: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Feedback.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Feedback.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Feedback.xml 2010-05-26 08:58:36 UTC (rev 12804)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section>
+ <title>We Need Feedback!</title>
+ <indexterm>
+ <primary>feedback</primary>
+ <secondary>contact information for this manual</secondary>
+ </indexterm>
+ <para>
+ You should over ride this by creating your own local Feedback.xml file.
+ </para>
+</section>
+
+
Added: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Legal_Notice.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Legal_Notice.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/Legal_Notice.xml 2010-05-26 08:58:36 UTC (rev 12804)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<legalnotice>
+ <para>
+ Copyright <trademark class="copyright"></trademark> &YEAR; &HOLDER; This material may only be distributed subject to the terms and conditions set forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is presently available at <ulink url="http://www.gnu.org/licenses/fdl.txt">http://www.gnu.org/licenses/fdl.txt</ulink>).
+ </para>
+</legalnotice>
+
Added: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/images/title_logo.svg
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/images/title_logo.svg (rev 0)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/fallback_content/images/title_logo.svg 2010-05-26 08:58:36 UTC (rev 12804)
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="265"
+ height="151"
+ id="svg2898"
+ sodipodi:version="0.32"
+ inkscape:version="0.46+devel"
+ sodipodi:docname="title_logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="/home/rlerch/Source/SVN/publican/trunk/publican-jboss/en-US/images/title_logo.png"
+ inkscape:export-xdpi="20.840239"
+ inkscape:export-ydpi="20.840239">
+ <metadata
+ id="metadata16">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="" />
+ <dc:title />
+ <dc:date />
+ <dc:creator>
+ <cc:Agent>
+ <dc:title />
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title />
+ </cc:Agent>
+ </dc:rights>
+ <dc:publisher>
+ <cc:Agent>
+ <dc:title />
+ </cc:Agent>
+ </dc:publisher>
+ <dc:identifier />
+ <dc:source />
+ <dc:relation />
+ <dc:language />
+ <dc:subject>
+ <rdf:Bag />
+ </dc:subject>
+ <dc:coverage />
+ <dc:description />
+ <dc:contributor>
+ <cc:Agent>
+ <dc:title />
+ </cc:Agent>
+ </dc:contributor>
+ <cc:license
+ rdf:resource="" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="692"
+ inkscape:window-width="640"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="1"
+ inkscape:cx="170.83251"
+ inkscape:cy="121.7868"
+ inkscape:window-x="1936"
+ inkscape:window-y="174"
+ inkscape:current-layer="svg2898"
+ units="px" />
+ <defs
+ id="defs21">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="-50 : 600 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="700 : 600 : 1"
+ inkscape:persp3d-origin="300 : 400 : 1"
+ id="perspective18" />
+ <inkscape:perspective
+ id="perspective2683"
+ inkscape:persp3d-origin="107.759 : 40.782333 : 1"
+ inkscape:vp_z="215.51801 : 61.1735 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 61.1735 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2733"
+ inkscape:persp3d-origin="150 : 46.666667 : 1"
+ inkscape:vp_z="300 : 70 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 70 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2787"
+ inkscape:persp3d-origin="150 : 46.666667 : 1"
+ inkscape:vp_z="300 : 70 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 70 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g2622"
+ transform="scale(1.2286387,1.2286387)"
+ inkscape:export-filename="/home/rlerch/Source/SVN/publican/trunk/publican-jboss/en-US/images/rhlogo.png"
+ inkscape:export-xdpi="61.361534"
+ inkscape:export-ydpi="61.361534">
+ <g
+ id="g2624">
+ <path
+ id="path2626"
+ d="m 140.253,110.221 2.945,5.891 -2.492,0 -2.863,-5.705 -3.255,0 0,5.705 -2.121,0 0,-14.419 6.323,0 c 2.514,0 4.635,1.339 4.635,4.306 0,2.306 -1.215,3.728 -3.172,4.222 z m -1.463,-6.489 -4.202,0 0,4.635 4.202,0 c 1.442,0 2.451,-0.741 2.451,-2.307 0,-1.504 -0.988,-2.328 -2.451,-2.328 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2628"
+ d="m 155.164,111.458 -7.148,0 c 0.227,2.08 1.401,2.966 2.72,2.966 0.906,0 1.627,-0.329 2.348,-0.865 l 1.257,1.359 c -0.947,0.906 -2.08,1.421 -3.729,1.421 -2.533,0 -4.676,-2.039 -4.676,-5.623 0,-3.667 1.937,-5.645 4.737,-5.645 3.069,0 4.553,2.492 4.553,5.418 0,0.39 -0.041,0.742 -0.062,0.969 z m -4.635,-4.471 c -1.422,0 -2.287,0.988 -2.473,2.719 l 5.026,0 c -0.102,-1.483 -0.802,-2.719 -2.553,-2.719 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2630"
+ d="m 164.37,116.112 0,-1.029 c -0.783,0.721 -1.689,1.256 -2.822,1.256 -2.328,0 -4.161,-1.688 -4.161,-5.809 0,-3.708 2.019,-5.459 4.264,-5.459 1.092,0 2.122,0.577 2.72,1.236 l 0,-4.12 2.101,-1.092 0,15.017 -2.102,0 z m 0.021,-7.662 c -0.474,-0.639 -1.463,-1.422 -2.534,-1.422 -1.524,0 -2.348,1.154 -2.348,3.44 0,2.719 0.865,3.913 2.431,3.913 1.009,0 1.895,-0.68 2.451,-1.379 l 0,-4.552 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2632"
+ d="m 184.266,116.112 0,-6.468 -6.634,0 0,6.468 -2.162,0 0,-14.419 2.162,0 0,5.829 6.634,0 0,-5.829 2.162,0 0,14.419 -2.162,0 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2634"
+ d="m 196.065,116.112 0,-1.07 c -0.741,0.741 -1.792,1.297 -2.966,1.297 -1.751,0 -3.749,-0.988 -3.749,-3.646 0,-2.41 1.854,-3.502 4.305,-3.502 1.01,0 1.813,0.144 2.41,0.412 l 0,-0.804 c 0,-1.174 -0.721,-1.833 -2.039,-1.833 -1.112,0 -1.978,0.206 -2.822,0.68 l -0.824,-1.606 c 1.03,-0.639 2.184,-0.969 3.708,-0.969 2.41,0 4.059,1.174 4.059,3.626 l 0,7.415 -2.082,0 0,0 z m 0,-4.613 c -0.576,-0.289 -1.318,-0.475 -2.472,-0.475 -1.359,0 -2.225,0.618 -2.225,1.607 0,1.07 0.68,1.792 2.08,1.792 1.134,0 2.122,-0.7 2.616,-1.38 l 0,-1.544 0.001,0 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2636"
+ d="m 206.363,115.844 c -0.516,0.289 -1.236,0.494 -2.081,0.494 -1.504,0 -2.431,-0.926 -2.431,-2.863 l 0,-6.241 -1.545,0 0,-1.937 1.545,0 0,-3.09 2.081,-1.112 0,4.202 2.678,0 0,1.937 -2.678,0 0,5.871 c 0,1.009 0.329,1.298 1.112,1.298 0.556,0 1.174,-0.206 1.565,-0.433 l -0.246,1.874 z"
+ style="fill:#cc0000" />
+ </g>
+ <g
+ id="g2638">
+ <path
+ id="path2640"
+ d="m 106.389,51.025 c 3.57,-1.787 6,-5.101 6,-9.181 0,-9.509 -8.614,-11.555 -16.465,-11.421 l -21.186,0 -0.121,0 -11.746,0 0,30.362 c 0,4.409 -1.537,5.936 -4.274,5.936 -2.941,0 -4.595,-1.654 -4.595,-4.658 l 0,-4.205 -11.17,0 0,1.969 c 0,10.154 3.892,17.099 15.952,17.099 9.837,0 15.038,-4.356 15.833,-12.958 l 0,12.004 21.879,0 c 9.761,0 17.737,-3.315 17.737,-14.161 0,-5.165 -2.991,-9.376 -7.844,-10.786 z m -19.902,-11.42 9.181,0 c 2.493,0 4.852,1.092 4.852,4.405 0,3.253 -2.806,4.338 -4.852,4.338 l -9.181,0 0,-8.743 z m 9.502,26.864 -9.502,0 0,-10.469 9.502,0 c 3.576,0 6.384,1.345 6.384,5.355 0,3.77 -2.617,5.114 -6.384,5.114 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2642"
+ d="m 90.067,108.399 c 0,-7.695 -6.245,-13.947 -13.944,-13.947 -7.714,0 -13.955,6.252 -13.955,13.947 0,7.709 6.241,13.948 13.955,13.948 7.699,0 13.944,-6.239 13.944,-13.948 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2644"
+ d="m 53.012,103.999 c 0,-6.818 -5.533,-12.349 -12.357,-12.349 -6.823,0 -12.352,5.53 -12.352,12.349 0,6.824 5.528,12.357 12.352,12.357 6.824,0 12.357,-5.533 12.357,-12.357 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2646"
+ d="m 25.097,81.68 c 0,-6.157 -4.984,-11.151 -11.15,-11.151 -6.168,0 -11.16,4.994 -11.16,11.151 0,6.174 4.992,11.168 11.16,11.168 6.165,0 11.15,-4.994 11.15,-11.168 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2648"
+ d="m 19.918,50.615 c 0,-5.506 -4.455,-9.956 -9.955,-9.956 -5.499,0 -9.963,4.449 -9.963,9.956 0,5.5 4.464,9.964 9.963,9.964 5.5,0 9.955,-4.465 9.955,-9.964 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2650"
+ d="m 33.88,22.719 c 0,-4.619 -3.756,-8.366 -8.372,-8.366 -4.619,0 -8.369,3.747 -8.369,8.366 0,4.623 3.75,8.367 8.369,8.367 4.616,0 8.372,-3.744 8.372,-8.367 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2652"
+ d="m 57.78,10.364 c 0,-4.18 -3.385,-7.571 -7.566,-7.571 -4.18,0 -7.571,3.391 -7.571,7.571 0,4.187 3.392,7.578 7.571,7.578 4.182,0 7.566,-3.391 7.566,-7.578 z"
+ style="fill:#cc0000" />
+ <path
+ id="path2654"
+ d="M 82.891,6.377 C 82.891,2.855 80.042,0 76.517,0 73.001,0 70.14,2.855 70.14,6.377 c 0,3.526 2.861,6.38 6.377,6.38 3.525,0 6.374,-2.854 6.374,-6.38 z"
+ style="fill:#cc0000" />
+ </g>
+ <g
+ id="g2656">
+ <g
+ id="g2658">
+ <path
+ id="path2660"
+ d="m 161.415,62.895 c -5.338,-1.352 -11.706,-1.777 -14.243,-6.153 0.121,0.882 0.204,1.78 0.204,2.706 0,1.985 -0.299,3.867 -0.84,5.619 l 9.258,0 c 0,1.654 0.71,2.866 1.788,3.695 1.022,0.77 2.494,1.142 4.022,1.142 2.097,0 5.102,-0.884 5.102,-3.504 0,-2.545 -3.385,-3.064 -5.291,-3.505 z"
+ style="fill:none" />
+ <path
+ id="path2662"
+ d="m 129.896,50.193 c -5.045,0 -6.578,5.051 -6.578,9.255 0,4.217 1.533,9.187 6.578,9.187 5.039,0 6.633,-4.97 6.633,-9.187 -0.001,-4.204 -1.594,-9.255 -6.633,-9.255 z"
+ style="fill:none" />
+ <path
+ id="path2664"
+ d="M 192.015,62.895 C 185.337,61.204 176.724,60.97 176.338,52.616 l -9.62,0 c 0,-1.396 -0.512,-2.29 -1.396,-2.866 -0.903,-0.569 -2.107,-0.827 -3.447,-0.827 -1.781,0 -4.992,0.188 -4.992,2.487 0,3.132 7.273,3.705 12.247,4.787 6.649,1.335 8.399,6.118 8.423,8.869 l 8.842,0 c 0,1.654 0.71,2.866 1.788,3.695 1.023,0.77 2.494,1.142 4.021,1.142 2.097,0 5.103,-0.884 5.103,-3.504 -10e-4,-2.544 -3.385,-3.063 -5.292,-3.504 z"
+ style="fill:none" />
+ <path
+ id="path2666"
+ d="m 199.729,56.198 c -4.975,-1.082 -12.581,-1.654 -12.581,-4.787 0,-2.3 2.879,-2.487 4.66,-2.487 1.339,0 2.544,0.258 3.447,0.827 0.884,0.576 1.396,1.47 1.396,2.866 l 10.019,0 c -0.385,-8.606 -7.98,-10.714 -15.239,-10.714 -6.048,0 -13.905,1.882 -14.992,8.54 -1.485,-6.781 -8.344,-8.54 -14.943,-8.54 -6.51,0 -15.461,2.172 -15.461,10.146 0,0.141 0.021,0.261 0.024,0.398 -2.525,-6.296 -8.49,-10.544 -16.163,-10.544 -8.299,0 -14.504,4.847 -16.602,11.996 1.604,2.158 2.448,4.973 2.448,7.912 0,2.413 -0.384,4.549 -1.111,6.419 2.853,5.273 8.343,8.696 15.265,8.696 7.354,0 13.123,-3.872 15.815,-9.719 1.414,7.509 8.762,9.719 15.957,9.719 6.187,0 13.02,-2.027 15.179,-7.772 2.235,5.949 8.89,7.772 15.421,7.772 7.462,0 15.886,-2.931 15.886,-11.801 -0.001,-2.742 -1.731,-7.583 -8.425,-8.927 z m -69.833,12.437 c -5.045,0 -6.578,-4.97 -6.578,-9.187 0,-4.205 1.533,-9.255 6.578,-9.255 5.039,0 6.633,5.051 6.633,9.255 -0.001,4.218 -1.594,9.187 -6.633,9.187 z m 31.708,1.269 c -1.528,0 -3,-0.!
372 -4.022,-1.142 -1.078,-0.829 -1.788,-2.041 -1.788,-3.695 l -9.258,0 c 0.541,-1.752 0.84,-3.634 0.84,-5.619 0,-0.926 -0.083,-1.824 -0.204,-2.706 2.537,4.375 8.905,4.801 14.243,6.153 1.906,0.441 5.291,0.96 5.291,3.505 0,2.62 -3.005,3.504 -5.102,3.504 z m 30.599,0 c -1.527,0 -2.998,-0.372 -4.021,-1.142 -1.078,-0.829 -1.788,-2.041 -1.788,-3.695 l -8.842,0 c -0.023,-2.751 -1.773,-7.534 -8.423,-8.869 -4.974,-1.082 -12.247,-1.654 -12.247,-4.787 0,-2.3 3.211,-2.487 4.992,-2.487 1.34,0 2.544,0.258 3.447,0.827 0.885,0.576 1.396,1.47 1.396,2.866 l 9.62,0 c 0.386,8.354 8.999,8.587 15.677,10.279 1.907,0.441 5.291,0.96 5.291,3.505 0.001,2.619 -3.005,3.503 -5.102,3.503 z"
+ style="fill:#60605b" />
+ </g>
+ <path
+ id="path2668"
+ d="m 209.127,36.16 0.965,0 1.452,2.386 0.941,0 -1.571,-2.43 c 0.807,-0.102 1.42,-0.53 1.42,-1.509 0,-1.099 -0.638,-1.573 -1.938,-1.573 l -2.102,0 0,5.512 0.833,0 0,-2.386 z m 0,-0.714 0,-1.711 1.143,0 c 0.567,0 1.2,0.132 1.2,0.815 0,0.847 -0.633,0.896 -1.339,0.896 l -1.004,0 z"
+ style="fill:#60605b" />
+ <path
+ id="path2670"
+ d="m 215.518,35.8 c 0,2.98 -2.42,5.392 -5.399,5.392 -2.986,0 -5.406,-2.412 -5.406,-5.392 0,-2.987 2.42,-5.405 5.406,-5.405 2.979,0.001 5.399,2.418 5.399,5.405 z m -5.4,-4.444 c -2.464,0 -4.452,1.982 -4.452,4.444 0,2.451 1.988,4.432 4.452,4.432 2.45,0 4.438,-1.981 4.438,-4.432 10e-4,-2.462 -1.988,-4.444 -4.438,-4.444 z"
+ style="fill:#60605b" />
+ </g>
+ <g
+ id="g2672">
+ <path
+ id="path2674"
+ d="m 108.227,116.338 c -1.092,0 -2.122,-0.576 -2.719,-1.235 l 0,1.009 -2.102,0 0,-13.925 2.102,-1.092 0,5.232 c 0.782,-0.722 1.688,-1.257 2.822,-1.257 2.327,0 4.16,1.689 4.16,5.809 0,3.709 -2.018,5.459 -4.263,5.459 z m -0.289,-9.31 c -1.01,0 -1.896,0.68 -2.451,1.381 l 0,4.552 c 0.474,0.639 1.462,1.421 2.533,1.421 1.524,0 2.349,-1.152 2.349,-3.439 0,-2.72 -0.865,-3.915 -2.431,-3.915 z"
+ style="fill:#60605b" />
+ <path
+ id="path2676"
+ d="m 118.915,119.923 -2.245,0 1.565,-4.017 -3.976,-10.609 2.328,0 1.771,5.295 c 0.329,0.947 0.824,2.554 0.947,3.15 0.186,-0.638 0.639,-2.183 0.968,-3.109 l 1.834,-5.336 2.245,0 -5.437,14.626 z"
+ style="fill:#60605b" />
+ </g>
+ </g>
+</svg>
Added: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/publican.cfg
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/publican.cfg (rev 0)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/publican.cfg 2010-05-26 08:58:36 UTC (rev 12804)
@@ -0,0 +1,9 @@
+# Config::Simple 4.59
+# Tue May 25 15:58:40 2010
+
+docname: Seam_Reference_Guide
+debug: 1
+xml_lang: en-US
+brand: JBoss
+product: Seam_Framework
+
15 years, 11 months
Seam SVN: r12803 - modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-05-26 00:40:42 -0400 (Wed, 26 May 2010)
New Revision: 12803
Modified:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
Log:
comments
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-05-26 04:39:45 UTC (rev 12802)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-05-26 04:40:42 UTC (rev 12803)
@@ -248,7 +248,7 @@
* Returns the value which dictates the JSF lifecycle phase in which the
* action is invoked. If the value of this attribute is
* <literal>true</literal>, the action will be invoked in the Apply Request
- * Values phase. If the value of this attribute is <literal>true</literal>,
+ * Values phase. If the value of this attribute is <literal>false</literal>,
* the default, the action will be invoked in the Invoke Application Phase.
*/
public boolean isImmediate()
@@ -377,7 +377,7 @@
/**
* Returns a boolean value that controls whether the action is invoked during
- * faces (postback) request.
+ * faces (postback) request. The default is false.
*/
public boolean isOnPostback()
{
15 years, 11 months
Seam SVN: r12801 - modules/faces/trunk/docs/reference/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-05-26 00:39:26 -0400 (Wed, 26 May 2010)
New Revision: 12801
Modified:
modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
Log:
minor point
Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml 2010-05-26 04:35:44 UTC (rev 12800)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml 2010-05-26 04:39:26 UTC (rev 12801)
@@ -295,7 +295,7 @@
<para>
You can also just specify the phase directly, using the name of the phase constant in the
- <literal>PhaseId</literal> class.
+ <literal>PhaseId</literal> class (the case does not matter).
</para>
<programlisting role="XML"><![CDATA[<s:viewAction action="#{sessionManager.validateSession}" phase="APPLY_REQUEST_VALUES"/>]]></programlisting>
@@ -319,6 +319,10 @@
</listitem>
</itemizedlist>
</tip>
+
+ <para>
+ If the phase is set, it takes precedence over the immediate flag.
+ </para>
</section>
<section>
15 years, 11 months
Seam SVN: r12800 - modules/faces/trunk/docs/reference/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-05-26 00:35:44 -0400 (Wed, 26 May 2010)
New Revision: 12800
Modified:
modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
Log:
SEAMFACES-7 documentation for UIViewAction
Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml 2010-05-26 04:35:02 UTC (rev 12799)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml 2010-05-26 04:35:44 UTC (rev 12800)
@@ -1,39 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
<chapter id="components">
<title>Seam Faces Components</title>
- <para>While Seam Faces does not provide layout components or other UI-design related features, it does provide
- functional components designed to make developing JSF applications easier, more functional, more scalable, and
- more practical.</para>
<para>
- For layout and design components, take a look at <ulink url="http://jboss.org/richfaces">RichFaces</ulink>, a
- UI component library specifically tailored for easy, rich web-interfaces.
+ While Seam Faces does not provide layout components or other UI-design related features, it does provide
+ functional components designed to make developing JSF applications easier, more functional, more
+ scalable, and more practical.
</para>
+
+ <para>
+ For layout and design components, take a look at <ulink
+ url="http://jboss.org/richfaces">RichFaces</ulink>, a UI component library specifically tailored for
+ easy, rich web-interfaces.
+ </para>
+
<section id="basicUsage">
<title>Introduction</title>
<para>
In order to use the Seam Faces components, you must first add the namespace to your view file,
just like the standard JSF component libraries.
+ </para>
- <programlisting><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:s="http://jboss.com/products/seam/faces"
- xmlns:ui="http://java.sun.com/jsf/facelets">
+ <programlisting role="XML"><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.org/seam/faces"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
- <h1>This is a view using Seam Faces</h1>
- <h:outputText value="#{bean.sayHello()}" />
+ <h1>Welcome to Seam Faces!</h1>
+ <p>
+ This view imports the Seam Faces component library.
+ Read on to discover what components it provides.
+ </p>
</html>]]></programlisting>
- <tip>
- <para>
- All Seam Faces components use the same namespace:
- <literal>http://jboss.com/products/seam/faces</literal>
- </para>
- </tip>
- </para>
+ <tip>
+ <para>
+ All Seam Faces components use the following namespace:
+ <literal>http://jboss.org/seam/faces</literal>
+ </para>
+ </tip>
+
</section>
+
<section id="validateForm">
<title><s:validateForm></title>
<para>
@@ -42,19 +52,22 @@
Performing cross-field form validation is simple - just place the <s:validateForm> component
in the form you wish to validate, then attach your custom Validator.
- <programlisting><![CDATA[<h:form id="locationForm">
- <h:inputText id="city" value="#{bean.city}" />
- <h:inputText id="state" value="#{bean.state}" />
- <h:inputText id="zip" value="#{bean.zip}" />
- <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
+ </para>
+
+ <programlisting role="XML"><![CDATA[<h:form id="locationForm">
+ <h:inputText id="city" value="#{bean.city}" />
+ <h:inputText id="state" value="#{bean.state}" />
+ <h:inputText id="zip" value="#{bean.zip}" />
+ <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
- <s:validateForm validatorId="locationValidator" />
+ <s:validateForm validatorId="locationValidator" />
</h:form>]]></programlisting>
+ <para>
+ The corresponding Validator for the example above would look something like this:
+ </para>
-
- The corresponding Validator for the example above would look something like this:
- <programlisting>@FacesValidator("locationValidator")
+ <programlisting role="JAVA"><![CDATA[@FacesValidator("locationValidator")
public class LocationValidator implements Validator
{
@Inject
@@ -73,77 +86,285 @@
private ZipCode zip;
@Override
- public void validate(final FacesContext context, final UIComponent comp, final Object values) throws ValidatorException
+ public void validate(final FacesContext context, final UIComponent comp, final Object values)
+ throws ValidatorException
{
if(!directory.exists(city, state, zip))
{
- throw new ValidatorException(new FacesMessage("Sorry, that location is not in our database. Please try again."));
+ throw new ValidatorException(
+ new FacesMessage("Sorry, that location is not in our database. Please try again."));
}
}
-}</programlisting>
- </para>
+}]]></programlisting>
- <tip>
- <para>
- You may inject the correct type directly.
- <programlisting>@Inject
+ <tip>
+ <para>
+ You may inject the correct type directly.
+ <programlisting><![CDATA[@Inject
@InputField
-private ZipCode zip;</programlisting>
- </para>
- </tip>
+private ZipCode zip;]]></programlisting>
+ </para>
+ </tip>
<para>
Notice that the IDs of the inputText components match the IDs of your Validator
@InputFields; each @Inject @InputField member will be injected with the value of the form input field
who's ID matches the name of the variable.
</para>
+
<para>
In other words - the name of the @InputField annotated member variable will automatically
be matched to the ID of the input component, unless overridden by using a field
ID alias (see below.)
+ </para>
- <programlisting><![CDATA[<h:form id="locationForm">
- <h:inputText id="cityId" value="#{bean.city}" />
- <h:inputText id="stateId" value="#{bean.state}" />
- <h:inputText id="zip" value="#{bean.zip}" />
- <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
+ <programlisting role="XML"><![CDATA[<h:form id="locationForm">
+ <h:inputText id="cityId" value="#{bean.city}" />
+ <h:inputText id="stateId" value="#{bean.state}" />
+ <h:inputText id="zip" value="#{bean.zip}" />
+ <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
- <s:validateForm fields="city=cityId state=stateId" validatorId="locationValidator" />
+ <s:validateForm fields="city=cityId state=stateId" validatorId="locationValidator" />
</h:form>]]></programlisting>
+ <para>
Notice that "zip" will still be referenced normally; you need only
specify aliases for fields that differ in name from the Validator @InputFields.
-
</para>
+
+ <tip>
+ <para>
+ <literal>Using @InputField("customID")</literal> with an ID override can also be used to specify a
+ custom ID, instead of using the default: the name of the field. This gives you the ability to
+ change the name of the private field, without worrying about changing the name of input fields in
+ the View itself.
+ <programlisting><![CDATA[@Inject
+@InputField("state")
+private String sectorTwo;]]></programlisting>
+ </para>
+ </tip>
+
+ </section>
+
+ <section id="viewaction">
+ <title><s:viewAction></title>
+
<para>
+ The view action component (<literal>UIViewAction</literal>) is an <literal>ActionSource2</literal>
+ <literal>UIComponent</literal> that specifies an application-specific command (or action), using
+ using an EL method expression, to be invoked during one of the JSF lifecycle phases proceeding Render
+ Response (i.e., view rendering).
+ </para>
+
+ <para>
+ View actions provide a lightweight front-controller for JSF, allowing the application to accommodate
+ scenarios such as registration confirmation links, security and sanity checking a request (e.g.,
+ ensuring the resource can be loaded). They also allow JSF to work alongside action-oriented
+ frameworks, and existing applications that use them.
+ </para>
+ <section>
+ <title>Motivation</title>
+
+ <para>
+ JSF employs an event-oriented architecture. Listeners are invoked in response to user-interface
+ events, such as the user clicking on a button or changing the value of a form input. Unfortunately,
+ the most important event on the web, a URL request (initiated by the user clicking on a link,
+ entering a URL into the browser's location bar or selecting a bookmark), has long been overlooked in
+ JSF. Historically, listeners have exclusively been activated on postback, which has led to the common
+ complaint that in JSF, "everything is a POST."
+ </para>
+
+ <para>
+ <emphasis>We want to change that perception.</emphasis>
+ </para>
+
+ <para>
+ Processing a URL request event is commonly referred to as bookmarkable or GET support. Some GET
+ support was added to JSF 2.0 with the introduction of view parameters and the pre-render view event.
+ View parameters are used to bind query string parameters to model properties. The pre-render view
+ event gives the developer a window to invoke a listener immediately prior to the view being rendered.
+ </para>
+
+ <para>
+ <emphasis>That's a start.</emphasis>
+ </para>
+
+ <para>
+ Seam brings the GET support full circle by introducing the view action component. A view action is
+ the compliment of a <literal>UICommand</literal> for an initial (non-faces) request. Like its
+ cohort, it gets executed by default during the Invoke Application phase (now used on both faces
+ and non-faces requests). A view action can optionally be invoked on postback as well.
+ </para>
+
+ <para>
+ View actions (<literal>UIViewAction</literal>) are closely tied to view parameters
+ (<literal>UIViewParameter</literal>). Most of the time, the view parameter is used to populate the
+ model with data that is consumed by the method being invoked by a <literal>UIViewAction</literal>
+ component, much like form inputs populate the model with data to support the method being invoked
+ by a <literal>UICommand</literal> component.
+ </para>
+
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>
+ Let's consider a typical scenario in web applications. You want to display the contents of a blog
+ entry that matches the identifier specified in the URL. We'll assume the URL is:
+ </para>
+
+ <programlisting>http://localhost:8080/blog/entry.jsf?id=10</programlisting>
+
+ <para>
+ We'll use a view parameter to capture the identifier of the entry from the query string and a view
+ action to fetch the entry from the database.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<f:metadata>
+ <f:viewParam name="id" value="#{blogManager.entryId}"/>
+ <s:viewAction action="#{blogManager.loadEntry}"/>
+</f:metadata>]]></programlisting>
+
<tip>
<para>
- <literal>Using @InputField("customID")</literal> with an ID override can also be used to
- specify a custom ID, instead of using the default: the name of the field. This gives you
- the ability to change the name of the private field, without worrying about changing the
- name of input fields in the View itself.
- <programlisting>@Inject
-@InputField("state")
-private String sectorTwo;</programlisting>
+ The view action component must be declared as a child of the view metadata facet (i.e.,
+ <literal><f:metadata></literal>) so that it gets incorporated into the JSF lifecycle on both
+ non-faces (initial) requests and faces (postback) requests. If you put it anywhere else in the
+ page, the behavior is undefined.
</para>
</tip>
- </para>
- </section>
+
+ <warning>
+ <para>
+ In JSF 2.0, there must be at least one view parameter for the view metadata facet to be processed.
+ This requirement was introduced into the JSF specification accidentally, but it's not so
+ unfortunate since view parameters are typically needed to capture input needed by the view action.
+ </para>
+ </warning>
+
+ <para>
+ What do we do if the entry can't be found? View actions support declarative navigation just like
+ <literal>UICommand</literal> components. So you can write a navigation rule that will be consulted
+ before the page is rendered. If the rule matches, navigation occurs just as though this were a
+ postback.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<navigation-rule>
+ <from-view-id>/entry.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{blogManager.loadEntry}</from-action>
+ <if>#{empty entry}</if>
+ <to-view-id>/home.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>]]></programlisting>
+
+ <para>
+ After each view action is invoked, the navigation handler looks for a navigation case that matches
+ the action's EL method signature and outcome. If a navigation case is matched, or the response is
+ marked complete by the action, subsequent view actions are short-circuited. The lifecycle then
+ advances appropriately.
+ </para>
+
+ <para>
+ By default, a view action is not executed on postback, since the primary intention of a view
+ action is to support a non-faces request. If your application (or use case) is decidedly stateless,
+ you may need the view action to execute on any type of request. You can enable the view action
+ on postback using the <literal>onPostback</literal> attribute:
+ </para>
+ <programlisting role="XML"><![CDATA[<s:viewAction action="#{blogManager.loadEntry}" onPostback="true"/>]]></programlisting>
+ <para>
+ You may only want the view action to be invoked under certain conditions. For instance, you may only
+ need it to be invoked if the conversation is transient. For that, you can use the
+ <literal>if</literal> attribute, which accepts an EL value expression:
+ </para>
+ <programlisting role="XML"><![CDATA[<s:viewAction action="#{blogEditor.loadEntry}" if="#{conversation.transient}"/>]]></programlisting>
- <section id="viewaction">
- <title><s:viewAction></title>
- <para>
- ViewAction doc
- <programlisting><![CDATA[<s:viewAction> example]]></programlisting>
+ <para>
+ There are two ways to control the phase in which the view action is invoked. You can set the
+ <literal>immediate</literal> attribute to true, which moves the invocation to the Apply Request Values phase
+ instead of the default, the Invoke Application phase.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<s:viewAction action="#{sessionManager.validateSession}" immediate="true"/>]]></programlisting>
+
+ <para>
+ You can also just specify the phase directly, using the name of the phase constant in the
+ <literal>PhaseId</literal> class.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<s:viewAction action="#{sessionManager.validateSession}" phase="APPLY_REQUEST_VALUES"/>]]></programlisting>
+
<tip>
<para>
- Maybe a tip here?
+ The valid phases for a view action are:
</para>
+ <itemizedlist>
+ <listitem>
+ <para><literal>APPLY_REQUEST_VALUES</literal> (default if <literal>immediate="true"</literal>)</para>
+ </listitem>
+ <listitem>
+ <para><literal>UPDATE_MODEL_VALUES</literal></para>
+ </listitem>
+ <listitem>
+ <para><literal>PROCESS_VALIDATIONS</literal></para>
+ </listitem>
+ <listitem>
+ <para><literal>INVOKE_APPLICATION</literal> (default)</para>
+ </listitem>
+ </itemizedlist>
</tip>
- </para>
+ </section>
+
+ <section>
+ <title>View actions vs the PreRenderViewEvent</title>
+ <para>
+ The purpose of the view action is similar to use of the PreRenderViewEvent. In fact, the code to
+ load a blog entry before the page is rendered could be written as:
+ </para>
+
+ <programlisting role="XML"><![CDATA[<f:metadata>
+ <f:viewParam name="id" value="#{blogManager.entryId}"/>
+ <f:event type="preRenderView" listener="#{blogManager.loadEntry}"/>
+</f:metadata>]]></programlisting>
+
+ <para>
+ However, the view action has several important advantages:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>It's lightweight</para>
+ </listitem>
+ <listitem>
+ <para>It's timing can be controlled</para>
+ </listitem>
+ <listitem>
+ <para>It's contextual</para>
+ </listitem>
+ <listitem>
+ <para>It can trigger navigation</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ View actions are lightweight because they get processed on a non-faces (initial) request
+ <emphasis>before</emphasis> the full component tree is built. When the view actions are invoked,
+ the component tree only contains view metadata.
+ </para>
+
+ <para>
+ As demonstrated above, you can specify a prerequisite condition for invoking the view action,
+ control whether it's invoked on postback, specify the phase in which it's invoked and tie the
+ invocation into the declarative navigation system. The PreRenderViewEvent is quite basic in
+ comparison.
+ </para>
+
+ </section>
</section>
-</chapter>
\ No newline at end of file
+</chapter>
15 years, 11 months
Seam SVN: r12799 - modules/faces/trunk/docs/reference.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-05-26 00:35:02 -0400 (Wed, 26 May 2010)
New Revision: 12799
Modified:
modules/faces/trunk/docs/reference/pom.xml
Log:
set default build target
Modified: modules/faces/trunk/docs/reference/pom.xml
===================================================================
--- modules/faces/trunk/docs/reference/pom.xml 2010-05-25 21:40:50 UTC (rev 12798)
+++ modules/faces/trunk/docs/reference/pom.xml 2010-05-26 04:35:02 UTC (rev 12799)
@@ -23,6 +23,7 @@
</pluginRepositories>
<build>
+ <defaultGoal>jdocbook:generate</defaultGoal>
<plugins>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
15 years, 11 months
Seam SVN: r12798 - in modules/international/trunk/api/src/main/java/org/jboss/seam/international/status: builder and 1 other directory.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-05-25 17:40:50 -0400 (Tue, 25 May 2010)
New Revision: 12798
Modified:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java
Log:
Implemented the BundleMessage resourcebundle loader.
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java 2010-05-25 20:40:09 UTC (rev 12797)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java 2010-05-25 21:40:50 UTC (rev 12798)
@@ -67,6 +67,11 @@
public ResourceBundle get(final Object key)
{
+ if (!containsKey(key))
+ {
+ ResourceBundle bundle = ResourceBundle.getBundle(key.toString());
+ bundles.put(key.toString(), bundle);
+ }
return bundles.get(key);
}
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java 2010-05-25 20:40:09 UTC (rev 12797)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/builder/BundleMessage.java 2010-05-25 21:40:50 UTC (rev 12798)
@@ -61,7 +61,7 @@
*/
public class BundleMessage implements MessageBuilder
{
- private TemplateMessage template;
+ private final TemplateMessage template;
private String textDefault;
private BundleKey textKey;
@@ -70,7 +70,7 @@
public BundleMessage(final Bundles bundles, final Level level)
{
this.bundles = bundles;
- this.template.level(level);
+ this.template = new TemplateMessage(level);
}
/**
15 years, 11 months
Seam SVN: r12797 - in modules/international/trunk: api/src/main/java/org/jboss/seam/international/locale and 6 other directories.
by seam-commits@lists.jboss.org
Author: kenfinni
Date: 2010-05-25 16:40:09 -0400 (Tue, 25 May 2010)
New Revision: 12797
Added:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/locale/
modules/international/trunk/api/src/main/java/org/jboss/seam/international/locale/UserLocale.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/AvailableLocales.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/DefaultLocaleProducer.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/LocaleUtils.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/UserLocaleProducer.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/AvailableLocalesTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideFailTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryVariantTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/UserLocaleTest.java
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-available.xml
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-fail.xml
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country-variant.xml
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country.xml
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang.xml
Log:
SEAMINTL-2 User, Application and Available Locale handling
Added: modules/international/trunk/api/src/main/java/org/jboss/seam/international/locale/UserLocale.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/locale/UserLocale.java (rev 0)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/locale/UserLocale.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.locale;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * User Locale
+ *
+ * @author Ken Finnigan
+ */
+@Target( { METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+@Inherited
+public @interface UserLocale
+{
+}
Added: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/AvailableLocales.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/AvailableLocales.java (rev 0)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/AvailableLocales.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.locale;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.slf4j.Logger;
+
+@ApplicationScoped
+public class AvailableLocales
+{
+ private String[] supportedLocaleKeys;
+
+ @Inject
+ Logger log;
+
+ @Produces
+ private List<Locale> locales = null;
+
+ @PostConstruct
+ public void init()
+ {
+ locales = new ArrayList<Locale>();
+
+ for (String localeKey : supportedLocaleKeys)
+ {
+ try
+ {
+ Locale lc = LocaleUtils.toLocale(localeKey);
+ locales.add(lc);
+ }
+ catch (IllegalArgumentException e)
+ {
+ log.error("AvailableLocales: Supported Locale key of " + localeKey + " was not formatted correctly", e);
+ }
+ }
+
+ Collections.sort(locales, new Comparator<Locale>()
+ {
+ public int compare(final Locale a, final Locale b)
+ {
+ return a.toString().compareTo(b.toString());
+ }
+ });
+
+ locales = Collections.unmodifiableList(locales);
+ }
+}
Added: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/DefaultLocaleProducer.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/DefaultLocaleProducer.java (rev 0)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/DefaultLocaleProducer.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.locale;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.slf4j.Logger;
+
+@ApplicationScoped
+public class DefaultLocaleProducer implements Serializable
+{
+ private static final long serialVersionUID = -4534087316489937649L;
+
+ private String defaultLocaleKey;
+
+ @Inject
+ Logger log;
+
+ @Produces
+ @Named
+ private Locale defaultLocale;
+
+ @PostConstruct
+ public void init()
+ {
+ if (null != defaultLocaleKey)
+ {
+ try
+ {
+ defaultLocale = LocaleUtils.toLocale(defaultLocaleKey);
+ }
+ catch (IllegalArgumentException e)
+ {
+ log.error("DefaultLocaleProducer: Default Locale key of " + defaultLocale + " was not formatted correctly", e);
+ }
+ }
+ if (null == defaultLocale)
+ {
+ defaultLocale = Locale.getDefault();
+ }
+ }
+}
Added: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/LocaleUtils.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/LocaleUtils.java (rev 0)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/LocaleUtils.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.locale;
+
+import java.util.Locale;
+
+public final class LocaleUtils
+{
+ /**
+ * <p>
+ * Converts a String to a Locale.
+ * </p>
+ *
+ * <p>
+ * This method takes the string format of a locale and creates the locale
+ * object from it.
+ * </p>
+ *
+ * <pre>
+ * LocaleUtils.toLocale("en") = new Locale("en", "")
+ * LocaleUtils.toLocale("en_GB") = new Locale("en", "GB")
+ * LocaleUtils.toLocale("en_GB_xxx") = new Locale("en", "GB", "xxx") (#)
+ * </pre>
+ *
+ * <p>
+ * This method validates the input strictly. The language code must be
+ * lowercase. The country code must be uppercase. The separator must be an
+ * underscore. The length must be correct.
+ * </p>
+ *
+ * @param str the locale String to convert, null returns null
+ * @return a Locale, null if null input
+ * @throws IllegalArgumentException if the string is an invalid format
+ */
+ public static Locale toLocale(String str)
+ {
+ if (str == null)
+ {
+ return null;
+ }
+ int len = str.length();
+ if (len != 2 && len != 5 && len < 7)
+ {
+ throw new IllegalArgumentException("Invalid locale format: " + str);
+ }
+ char ch0 = str.charAt(0);
+ char ch1 = str.charAt(1);
+ if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z')
+ {
+ throw new IllegalArgumentException("Invalid locale format: " + str);
+ }
+ if (len == 2)
+ {
+ return new Locale(str, "");
+ }
+ else
+ {
+ if (str.charAt(2) != '_')
+ {
+ throw new IllegalArgumentException("Invalid locale format: " + str);
+ }
+ char ch3 = str.charAt(3);
+ if (ch3 == '_')
+ {
+ return new Locale(str.substring(0, 2), "", str.substring(4));
+ }
+ char ch4 = str.charAt(4);
+ if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z')
+ {
+ throw new IllegalArgumentException("Invalid locale format: " + str);
+ }
+ if (len == 5)
+ {
+ return new Locale(str.substring(0, 2), str.substring(3, 5));
+ }
+ else
+ {
+ if (str.charAt(5) != '_')
+ {
+ throw new IllegalArgumentException("Invalid locale format: " + str);
+ }
+ return new Locale(str.substring(0, 2), str.substring(3, 5), str.substring(6));
+ }
+ }
+ }
+}
Added: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/UserLocaleProducer.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/UserLocaleProducer.java (rev 0)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/locale/UserLocaleProducer.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.locale;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.seam.international.Changed;
+
+/**
+ * Locale for a User Session. Defaults to the Locale within DefaultLocale
+ * and is altered when it receives the @Changed event.
+ *
+ * @author Ken Finnigan
+ */
+
+@SessionScoped
+public class UserLocaleProducer implements Serializable
+{
+ private static final long serialVersionUID = -7602504535585397561L;
+
+ @Produces
+ @UserLocale
+ @Named
+ private Locale userLocale;
+
+ @Inject
+ public void init(Locale defaultLocale)
+ {
+ this.userLocale = defaultLocale;
+ }
+
+ public void changeLocale(@Observes @Changed Locale lc)
+ {
+ this.userLocale = lc;
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/AvailableLocalesTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/AvailableLocalesTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/AvailableLocalesTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.AvailableLocales;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class AvailableLocalesTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(AvailableLocales.class, MockLogger.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/locale/override-available.xml", ArchivePaths.create("seam-beans.xml"));
+ }
+
+ @Inject
+ List<Locale> locales;
+
+ @Test
+ public void testAvailableLocalesProducer()
+ {
+ Assert.assertNotNull(locales);
+ Assert.assertEquals(2, locales.size());
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideFailTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideFailTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideFailTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultLocaleOverrideFailTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/locale/override-fail.xml", ArchivePaths.create("seam-beans.xml"));
+ }
+
+ @Inject
+ Locale locale;
+
+ @Test
+ public void testDefaultLocaleProducerDirect()
+ {
+ Assert.assertNotNull(locale);
+ Assert.assertEquals(Locale.getDefault().toString(), locale.toString());
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultLocaleOverrideLangCountryTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/locale/override-lang-country.xml", ArchivePaths.create("seam-beans.xml"));
+ }
+
+ @Inject
+ Locale locale;
+
+ @Test
+ public void testDefaultLocaleProducerDirect()
+ {
+ Assert.assertNotNull(locale);
+ Assert.assertEquals("en_US", locale.toString());
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryVariantTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryVariantTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangCountryVariantTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultLocaleOverrideLangCountryVariantTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/locale/override-lang-country-variant.xml", ArchivePaths.create("seam-beans.xml"));
+ }
+
+ @Inject
+ Locale locale;
+
+ @Test
+ public void testDefaultLocaleProducerDirect()
+ {
+ Assert.assertNotNull(locale);
+ Assert.assertEquals("en_US_UNIX", locale.toString());
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleOverrideLangTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultLocaleOverrideLangTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/locale/override-lang.xml", ArchivePaths.create("seam-beans.xml"));
+ }
+
+ @Inject
+ Locale locale;
+
+ @Test
+ public void testDefaultLocaleProducerDirect()
+ {
+ Assert.assertNotNull(locale);
+ Assert.assertEquals("fr", locale.toString());
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/DefaultLocaleTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultLocaleTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("defaultlocaletest.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ Locale lc;
+
+ @Test
+ public void testDefaultLocaleProducerDirect()
+ {
+ Assert.assertNotNull(lc);
+ }
+}
Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/UserLocaleTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/UserLocaleTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/locale/UserLocaleTest.java 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.locale;
+
+import java.util.Locale;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.Changed;
+import org.jboss.seam.international.locale.DefaultLocaleProducer;
+import org.jboss.seam.international.locale.UserLocale;
+import org.jboss.seam.international.locale.UserLocaleProducer;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class UserLocaleTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return ShrinkWrap.create("userlocaletest.jar", JavaArchive.class).addClasses(MockLogger.class, UserLocaleProducer.class, UserLocale.class, DefaultLocaleProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ @UserLocale
+ Locale locale;
+
+ @Inject
+ @Changed
+ Event<Locale> localeEvent;
+
+ @Inject
+ @UserLocale
+ Instance<Locale> localeSource;
+
+ @Test
+ public void testUserLocaleProducerDirect()
+ {
+ Assert.assertNotNull(locale);
+ }
+
+ @Test
+ public void testUserLocaleEvent()
+ {
+ Locale canada = Locale.CANADA;
+ Assert.assertNotNull(locale);
+ Assert.assertFalse(locale.equals(canada));
+ localeEvent.fire(canada);
+ Locale lc = localeSource.get();
+ Assert.assertNotNull(lc);
+ Assert.assertTrue(lc.equals(canada));
+ }
+}
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-available.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-available.xml (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-available.xml 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,37 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <lc:AvailableLocales>
+ <s:specializes/>
+ <lc:supportedLocaleKeys>
+ <s:value>en</s:value>
+ <s:value>fr</s:value>
+ </lc:supportedLocaleKeys>
+ </lc:AvailableLocales>
+</beans>
\ No newline at end of file
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-fail.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-fail.xml (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-fail.xml 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <lc:DefaultLocaleProducer>
+ <s:specializes/>
+ <lc:defaultLocaleKey>z</lc:defaultLocaleKey>
+ </lc:DefaultLocaleProducer>
+</beans>
\ No newline at end of file
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country-variant.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country-variant.xml (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country-variant.xml 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <lc:DefaultLocaleProducer>
+ <s:specializes/>
+ <lc:defaultLocaleKey>en_US_UNIX</lc:defaultLocaleKey>
+ </lc:DefaultLocaleProducer>
+</beans>
\ No newline at end of file
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country.xml (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang-country.xml 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <lc:DefaultLocaleProducer>
+ <s:specializes/>
+ <lc:defaultLocaleKey>en_US</lc:defaultLocaleKey>
+ </lc:DefaultLocaleProducer>
+</beans>
\ No newline at end of file
Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang.xml (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/locale/override-lang.xml 2010-05-25 20:40:09 UTC (rev 12797)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <lc:DefaultLocaleProducer>
+ <s:specializes/>
+ <lc:defaultLocaleKey>fr</lc:defaultLocaleKey>
+ </lc:DefaultLocaleProducer>
+</beans>
\ No newline at end of file
15 years, 11 months
Seam SVN: r12796 - in modules: faces/trunk/api/src/main/resources/META-INF and 11 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-05-25 14:36:02 -0400 (Tue, 25 May 2010)
New Revision: 12796
Added:
modules/faces/trunk/api/src/main/resources/META-INF/
modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java
modules/international/trunk/api/src/main/resources/META-INF/
modules/international/trunk/api/src/main/resources/META-INF/beans.xml
Removed:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java
modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java
Modified:
modules/faces/trunk/impl/pom.xml
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java
Log:
Repackaged and removed unnecessary ResourceResolver extensions.
Added: modules/faces/trunk/api/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/faces/trunk/api/src/main/resources/META-INF/beans.xml (rev 0)
+++ modules/faces/trunk/api/src/main/resources/META-INF/beans.xml 2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,27 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>
\ No newline at end of file
Modified: modules/faces/trunk/impl/pom.xml
===================================================================
--- modules/faces/trunk/impl/pom.xml 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/pom.xml 2010-05-25 18:36:02 UTC (rev 12796)
@@ -35,6 +35,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<artifactId>seam-faces-api</artifactId>
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -41,7 +41,7 @@
import org.jboss.seam.faces.event.qualifier.After;
import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.util.BeanManagerAccessor;
+import org.jboss.weld.extensions.beanManager.BeanManagerAccessor;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContext.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,36 +0,0 @@
-package org.jboss.seam.faces.environment;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.ExternalContextWrapper;
-import javax.faces.view.facelets.ResourceResolver;
-
-public class SeamExternalContext extends ExternalContextWrapper
-{
- private final ExternalContext wrapped;
- private final ResourceResolver resolver = new SeamResourceResolver();
-
- public SeamExternalContext(final ExternalContext wrapped)
- {
- this.wrapped = wrapped;
- }
-
- @Override
- public URL getResource(final String path) throws MalformedURLException
- {
- URL url = resolver.resolveUrl(path);
- if (url == null)
- {
- url = getWrapped().getResource(path);
- }
- return url;
- }
-
- @Override
- public ExternalContext getWrapped()
- {
- return wrapped;
- }
-}
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamExternalContextFactory.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,28 +0,0 @@
-package org.jboss.seam.faces.environment;
-
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.ExternalContextFactory;
-
-public class SeamExternalContextFactory extends ExternalContextFactory
-{
- private final ExternalContextFactory parent;
-
- public SeamExternalContextFactory(final ExternalContextFactory parent)
- {
- super();
- this.parent = parent;
- }
-
- @Override
- public ExternalContext getExternalContext(final Object context, final Object request, final Object response) throws FacesException
- {
- return new SeamExternalContext(getWrapped().getExternalContext(context, request, response));
- }
-
- @Override
- public ExternalContextFactory getWrapped()
- {
- return parent;
- }
-}
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamResourceResolver.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.faces.environment;
-
-import java.net.URL;
-
-import javax.faces.view.facelets.ResourceResolver;
-
-/**
- * Allow resolution of classpath resources.
- *
- * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
- *
- */
-public class SeamResourceResolver extends ResourceResolver
-{
- private final ResourceResolver parent;
-
- public SeamResourceResolver()
- {
- this.parent = null;
- }
-
- public SeamResourceResolver(final ResourceResolver parent)
- {
- this.parent = parent;
- }
-
- @Override
- public URL resolveUrl(final String path)
- {
- URL result = null;
- if (path != null)
- {
- String canonicalPath = path;
- if (path.startsWith("/"))
- {
- canonicalPath = path.substring(1);
- }
-
- result = Thread.currentThread().getContextClassLoader().getResource(canonicalPath);
- if ((result == null) && (parent != null))
- {
- result = parent.resolveUrl(path);
- }
- }
- return result;
- }
-}
Copied: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status (from rev 12795, modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display)
Copied: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java (from rev 12795, modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessages.java)
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/MessagesAdapter.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.status;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.event.PhaseEvent;
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.event.qualifier.Before;
+import org.jboss.seam.faces.event.qualifier.RenderResponse;
+import org.jboss.seam.international.status.Level;
+import org.jboss.seam.international.status.Message;
+import org.jboss.seam.international.status.Messages;
+
+/**
+ * Convert Seam Messages into FacesMessages before RenderResponse phase.<br>
+ * TODO perform EL evaluation.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+@SessionScoped
+public class MessagesAdapter implements Serializable
+{
+ private static final long serialVersionUID = -2908193057765795662L;
+
+ @Inject
+ private Messages messages;
+
+ @SuppressWarnings("unused")
+ private void convert(@Observes @Before @RenderResponse final PhaseEvent event)
+ {
+ for (Message m : messages.getAll())
+ {
+ event.getFacesContext().addMessage(m.getTargets(), new FacesMessage(getSeverity(m.getLevel()), m.getText(), null));
+ }
+ messages.clear();
+ }
+
+ private Severity getSeverity(final Level level)
+ {
+ Severity result = FacesMessage.SEVERITY_INFO;
+ switch (level)
+ {
+ case INFO:
+ break;
+ case WARN:
+ result = FacesMessage.SEVERITY_WARN;
+ break;
+ case ERROR:
+ result = FacesMessage.SEVERITY_ERROR;
+ break;
+ case FATAL:
+ result = FacesMessage.SEVERITY_FATAL;
+ break;
+ default:
+ break;
+ }
+ return result;
+ }
+
+}
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessages.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/status/SeamMessages.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.faces.display;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.event.Observes;
-import javax.faces.application.FacesMessage;
-import javax.faces.application.FacesMessage.Severity;
-import javax.faces.event.PhaseEvent;
-import javax.inject.Inject;
-
-import org.jboss.seam.faces.event.qualifier.Before;
-import org.jboss.seam.faces.event.qualifier.RenderResponse;
-import org.jboss.seam.international.status.Level;
-import org.jboss.seam.international.status.Message;
-import org.jboss.seam.international.status.Messages;
-
-/**
- * Convert Seam Messages into FacesMessages <br>
- * TODO perform EL evaluation.
- *
- * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
- *
- */
-@SessionScoped
-public class SeamMessages implements Serializable
-{
- private static final long serialVersionUID = -2908193057765795662L;
-
- @Inject
- Messages sm;
-
- @SuppressWarnings("unused")
- private void convert(@Observes @Before @RenderResponse final PhaseEvent event)
- {
- for (Message m : sm.getAll())
- {
- event.getFacesContext().addMessage(m.getTargets(), new FacesMessage(getSeverity(m.getLevel()), m.getText(), null));
- }
- sm.clear();
- }
-
- private Severity getSeverity(final Level level)
- {
- Severity result = FacesMessage.SEVERITY_INFO;
- switch (level)
- {
- case INFO:
- break;
- case WARN:
- result = FacesMessage.SEVERITY_WARN;
- break;
- case ERROR:
- result = FacesMessage.SEVERITY_ERROR;
- break;
- case FATAL:
- result = FacesMessage.SEVERITY_FATAL;
- break;
- default:
- break;
- }
- return result;
- }
-
-}
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerAccessor.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.faces.util;
-
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.extensions.beanManager.BeanManagerAware;
-
-/**
- * <b>***DO NOT USE THIS CLASS***</b>
- * <p>
- * See {@link BeanManagerAware}
- *
- * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
- *
- */
-public class BeanManagerAccessor extends BeanManagerAware
-{
- public static BeanManager getManager()
- {
- return new BeanManagerAccessor().getBeanManager();
- }
-}
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -47,7 +47,7 @@
private BeanManager manager;
@Inject
- FormValidationTypeOverrideExtension classExtension;
+ private FormValidationTypeOverrideExtension classExtension;
/**
* Perform @{@link Inject} on an object as if it were a bean managed by CDI.
@@ -79,6 +79,9 @@
return result;
}
+ /**
+ * Determine if a bean is {@link Dependent} scoped.
+ */
@SuppressWarnings("unchecked")
public <T> boolean isDependentScoped(final Class<T> type)
{
@@ -100,14 +103,17 @@
@SuppressWarnings("unchecked")
public <T> T getContextualInstance(final Class<T> type)
{
+ T result = null;
Bean<T> bean = (Bean<T>) manager.resolve(manager.getBeans(type));
if (bean != null)
{
CreationalContext<T> context = manager.createCreationalContext(bean);
- T result = (T) manager.getReference(bean, type, context);
- return result;
+ if (context != null)
+ {
+ result = (T) manager.getReference(bean, type, context);
+ }
}
- return null;
+ return result;
}
/**
@@ -123,7 +129,10 @@
for (Bean<?> bean : manager.getBeans(type))
{
CreationalContext<T> context = (CreationalContext<T>) manager.createCreationalContext(bean);
- result.add((T) manager.getReference(bean, type, context));
+ if (context != null)
+ {
+ result.add((T) manager.getReference(bean, type, context));
+ }
}
return result;
}
Modified: modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-05-25 18:36:02 UTC (rev 12796)
@@ -17,10 +17,6 @@
<phase-listener>org.jboss.seam.faces.event.DelegatingPhaseListener</phase-listener>
</lifecycle>
- <factory>
- <external-context-factory>org.jboss.seam.faces.environment.SeamExternalContextFactory</external-context-factory>
- </factory>
-
<application>
<system-event-listener>
<system-event-listener-class>org.jboss.seam.faces.event.DelegatingSystemEventListener</system-event-listener-class>
Modified: modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml 2010-05-25 18:36:02 UTC (rev 12796)
@@ -8,9 +8,4 @@
<listener-class>org.jboss.seam.faces.beanManager.BeanManagerServletContextListener</listener-class>
</listener>
- <context-param>
- <param-name>javax.faces.FACELETS_RESOURCE_RESOLVER</param-name>
- <param-value>org.jboss.seam.faces.environment.SeamResourceResolver</param-value>
- </context-param>
-
</web-fragment>
\ No newline at end of file
Deleted: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/environment/SeamResourceResolverTest.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.seam.faces.environment;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URL;
-
-import javax.faces.view.facelets.ResourceResolver;
-
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
- *
- */
-public class SeamResourceResolverTest
-{
- SeamResourceResolver resolver = new SeamResourceResolver(new ResourceResolver()
- {
- @Override
- public URL resolveUrl(final String path)
- {
- return null;
- }
- });
-
- @Test
- public void testResolveClasspathUrl()
- {
- String validPath = "/org/jboss/seam/faces/environment/mock.resource";
- URL url = resolver.resolveUrl(validPath);
- assertTrue(url instanceof URL);
- }
-
- @Test
- public void testResolveUnprefixedClasspathUrl()
- {
- String validPath = "org/jboss/seam/faces/environment/mock.resource";
- URL url = resolver.resolveUrl(validPath);
- assertTrue(url instanceof URL);
- }
-
- @Test
- public void testNullInputYieldsNullOutput() throws Exception
- {
- URL url = resolver.resolveUrl(null);
- assertNull(url);
- }
-
- @Test
- public void testResolveUrlReturnsNullIfNotFound()
- {
- String invalidPath = "some/nonexistent/mock.resource";
- URL url = resolver.resolveUrl(invalidPath);
- assertNull(url);
- }
-
-}
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Bundles.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -21,6 +21,7 @@
*/
package org.jboss.seam.international.status;
+import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.ResourceBundle;
@@ -38,8 +39,10 @@
*/
@Named
@ApplicationScoped
-public class Bundles implements Map<String, ResourceBundle>
+public class Bundles implements Map<String, ResourceBundle>, Serializable
{
+ private static final long serialVersionUID = 1207758648760266247L;
+
private final Map<String, ResourceBundle> bundles = new ConcurrentHashMap<String, ResourceBundle>();
public void clear()
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/MessageFactory.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -21,6 +21,8 @@
*/
package org.jboss.seam.international.status;
+import java.io.Serializable;
+
import javax.inject.Inject;
import org.jboss.seam.international.status.builder.BundleKey;
@@ -28,13 +30,18 @@
import org.jboss.seam.international.status.builder.TemplateMessage;
/**
+ * A utility for building {@link Message} objects via message templates, or
+ * message bundles. See {@link TemplateMessage} or {@link BundleMessage}.
+ *
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*
*/
-public class MessageFactory
+public class MessageFactory implements Serializable
{
+ private static final long serialVersionUID = -7899463141244189001L;
+
@Inject
- Bundles bundles;
+ private Bundles bundles;
/*
* Bundle Factory Methods
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java 2010-05-25 15:12:21 UTC (rev 12795)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/status/Messages.java 2010-05-25 18:36:02 UTC (rev 12796)
@@ -45,10 +45,11 @@
public class Messages implements Serializable
{
private static final long serialVersionUID = -2908193057765795662L;
+
private final Set<Message> messages = Collections.synchronizedSet(new HashSet<Message>());
@Inject
- MessageFactory factory;
+ private MessageFactory factory;
/**
* Clear all pending messages.
Added: modules/international/trunk/api/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/international/trunk/api/src/main/resources/META-INF/beans.xml (rev 0)
+++ modules/international/trunk/api/src/main/resources/META-INF/beans.xml 2010-05-25 18:36:02 UTC (rev 12796)
@@ -0,0 +1,27 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>
\ No newline at end of file
15 years, 11 months