Seam SVN: r10080 - trunk/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-02-23 15:44:11 -0500 (Mon, 23 Feb 2009)
New Revision: 10080
Modified:
trunk/doc/Seam_Reference_Guide/it-IT/Controls.po
trunk/doc/Seam_Reference_Guide/it-IT/Framework.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: trunk/doc/Seam_Reference_Guide/it-IT/Controls.po
===================================================================
--- trunk/doc/Seam_Reference_Guide/it-IT/Controls.po 2009-02-23 17:42:29 UTC (rev 10079)
+++ trunk/doc/Seam_Reference_Guide/it-IT/Controls.po 2009-02-23 20:44:11 UTC (rev 10080)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-05 00:19+0000\n"
-"PO-Revision-Date: 2009-02-03 23:24+0100\n"
+"PO-Revision-Date: 2009-02-23 21:43+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -968,7 +968,7 @@
#: Controls.xml:582
#, no-c-format
msgid "Render a HTML <literal><div></literal>."
-msgstr ""
+msgstr "Generare un <literal><div></literal> HTML."
#. Tag: programlisting
#: Controls.xml:592
@@ -992,13 +992,13 @@
#: Controls.xml:599
#, no-c-format
msgid "Render a HTML <literal><span></literal>."
-msgstr ""
+msgstr "Generare un <literal><span></literal> HTML."
#. Tag: para
#: Controls.xml:607
#, no-c-format
msgid "<literal>title</literal> — Title for a span."
-msgstr ""
+msgstr "<literal>title</literal> — Fornisce un titolo per uno span."
#. Tag: programlisting
#: Controls.xml:615
@@ -1047,14 +1047,14 @@
#: Controls.xml:968
#, no-c-format
msgid "<literal>style</literal> — The control's style"
-msgstr ""
+msgstr "<literal>style</literal> — Lo stile del controllo"
#. Tag: para
#: Controls.xml:656
#: Controls.xml:973
#, no-c-format
msgid "<literal>styleClass</literal> — The control's style class"
-msgstr ""
+msgstr "<literal>styleClass</literal> — La classe di stile del controllo"
#. Tag: programlisting
#: Controls.xml:663
@@ -1104,7 +1104,7 @@
#: Controls.xml:687
#, no-c-format
msgid "Seam Text"
-msgstr ""
+msgstr "Seam Text"
#. Tag: literal
#: Controls.xml:690
@@ -1152,7 +1152,7 @@
#: Controls.xml:741
#, no-c-format
msgid "Dropdowns"
-msgstr ""
+msgstr "I dropdown"
#. Tag: literal
#: Controls.xml:744
Modified: trunk/doc/Seam_Reference_Guide/it-IT/Framework.po
===================================================================
--- trunk/doc/Seam_Reference_Guide/it-IT/Framework.po 2009-02-23 17:42:29 UTC (rev 10079)
+++ trunk/doc/Seam_Reference_Guide/it-IT/Framework.po 2009-02-23 20:44:11 UTC (rev 10080)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-18 15:00+0000\n"
-"PO-Revision-Date: 2008-12-20 16:14+0100\n"
+"PO-Revision-Date: 2009-02-23 21:40+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,33 +22,20 @@
#. Tag: para
#: Framework.xml:8
#, no-c-format
-msgid ""
-"Seam makes it really easy to create applications by writing plain Java "
-"classes with annotations, which don't need to extend any special interfaces "
-"or superclasses. But we can simplify some common programming tasks even "
-"further, by providing a set of pre-built components which can be re-used "
-"either by configuration in <literal>components.xml</literal> (for very "
-"simple cases) or extension."
-msgstr ""
+msgid "Seam makes it really easy to create applications by writing plain Java classes with annotations, which don't need to extend any special interfaces or superclasses. But we can simplify some common programming tasks even further, by providing a set of pre-built components which can be re-used either by configuration in <literal>components.xml</literal> (for very simple cases) or extension."
+msgstr "Seam semplifica la creazione di applicazioni tramite la scrittura di classi Java semplici con annotazioni, che non hanno bisogno di estendere speciali interfacce o superclassi. Ma è possibile semplificare ulteriormente alcuni comuni compiti di programmazione, fornendo un set di componenti predefiniti che possono essere riutilizzati o tramite configurazione in <literal>components.xml</literal> (per casi molto semplici) o tramite estensione."
#. Tag: para
#: Framework.xml:18
#, no-c-format
-msgid ""
-"The <emphasis>Seam Application Framework</emphasis> can reduce the amount of "
-"code you need to write when doing basic database access in a web "
-"application, using either Hibernate or JPA."
-msgstr ""
+msgid "The <emphasis>Seam Application Framework</emphasis> can reduce the amount of code you need to write when doing basic database access in a web application, using either Hibernate or JPA."
+msgstr "<emphasis>Seam Application Framework</emphasis> può ridurre la quantità di codice da scrivere nel fornire l'accesso ai database nelle applicazioni web, usando Hibernate o JPA."
#. Tag: para
#: Framework.xml:24
#, no-c-format
-msgid ""
-"We should emphasize that the framework is extremely simple, just a handful "
-"of simple classes that are easy to understand and extend. The \"magic\" is "
-"in Seam itself — the same magic you use when creating any Seam "
-"application even without using this framework."
-msgstr ""
+msgid "We should emphasize that the framework is extremely simple, just a handful of simple classes that are easy to understand and extend. The \"magic\" is in Seam itself — the same magic you use when creating any Seam application even without using this framework."
+msgstr "Sottolineiamo che il framework è estremamente semplice, solamente una manciata di classi molto semplici, facili da capire e da estendere. La \"magia\" è in Seam stesso — la stessa magia che si usa nel creare un'applicazione Seam anche senza usare questo framework."
#. Tag: title
#: Framework.xml:33
@@ -59,15 +46,8 @@
#. Tag: para
#: Framework.xml:35
#, no-c-format
-msgid ""
-"The components provided by the Seam application framework may be used in one "
-"of two different approaches. The first way is to install and configure an "
-"instance of the component in <literal>components.xml</literal>, just like we "
-"have done with other kinds of built-in Seam components. For example, the "
-"following fragment from <literal>components.xml</literal> installs a "
-"component which can perform basic CRUD operations for a <literal>Person</"
-"literal> entity:"
-msgstr ""
+msgid "The components provided by the Seam application framework may be used in one of two different approaches. The first way is to install and configure an instance of the component in <literal>components.xml</literal>, just like we have done with other kinds of built-in Seam components. For example, the following fragment from <literal>components.xml</literal> installs a component which can perform basic CRUD operations for a <literal>Person</literal> entity:"
+msgstr "I componenti forniti dal framework Seam possono essere usati secondo due differenti approcci. Il primo modo è installare e configurare un'istanza del componente in <literal>components.xml</literal>, come si è fatto con altri tipi di componenti Seam predefiniti. Per esempio, il seguente frammento da <literal>components.xml</literal> installa un componente che esegue semplici operazioni CRUD per un'entità <literal>Person</literal>:"
#. Tag: programlisting
#: Framework.xml:47
@@ -88,10 +68,8 @@
#. Tag: para
#: Framework.xml:49
#, no-c-format
-msgid ""
-"If that looks a bit too much like \"programming in XML\" for your taste, you "
-"can use extension instead:"
-msgstr ""
+msgid "If that looks a bit too much like \"programming in XML\" for your taste, you can use extension instead:"
+msgstr "Se per i propri gusti tutto questo sembra troppo \"programmare in XML\", è possibile altrimenti usare l'estensione:"
#. Tag: programlisting
#: Framework.xml:54
@@ -122,20 +100,14 @@
#. Tag: para
#: Framework.xml:56
#, no-c-format
-msgid ""
-"The second approach has one huge advantage: you can easily add extra "
-"functionality, and override the built-in functionality (the framework "
-"classes were carefully designed for extension and customization)."
-msgstr ""
+msgid "The second approach has one huge advantage: you can easily add extra functionality, and override the built-in functionality (the framework classes were carefully designed for extension and customization)."
+msgstr "Il secondo approccio ha un vantaggio enorme: si possono facilmente aggiungere funzionalità extra ed eseguire l'override di funzionalità predefinite (le classi del framework sono state attentamente progettate per l'estensione e la personalizzazione)."
#. Tag: para
#: Framework.xml:63
#, no-c-format
-msgid ""
-"A second advantage is that your classes may be EJB stateful session beans, "
-"if you like. (They do not have to be, they can be plain JavaBean components "
-"if you prefer.) If you are using JBoss AS, you'll need 4.2.2.GA or later:"
-msgstr ""
+msgid "A second advantage is that your classes may be EJB stateful session beans, if you like. (They do not have to be, they can be plain JavaBean components if you prefer.) If you are using JBoss AS, you'll need 4.2.2.GA or later:"
+msgstr "Un secondo vantaggio è che le classi possono essere bean di sessione stateful EJB, se si vuole. (Non devono per forza esserlo, se si vuole possono essere componenti JavaBean semplici.) Se si sta usando JBoss AS, serve la versione 4.2.2.GA o successive:"
#. Tag: programlisting
#: Framework.xml:70
@@ -143,26 +115,21 @@
msgid ""
"<![CDATA[@Stateful\n"
"@Name(\"personHome\")\n"
-"public class PersonHome extends EntityHome<Person> implements "
-"LocalPersonHome {\n"
+"public class PersonHome extends EntityHome<Person> implements LocalPersonHome {\n"
" \n"
"}]]>"
msgstr ""
"<![CDATA[@Stateful\n"
"@Name(\"personHome\")\n"
-"public class PersonHome extends EntityHome<Person> implements "
-"LocalPersonHome {\n"
+"public class PersonHome extends EntityHome<Person> implements LocalPersonHome {\n"
" \n"
"}]]>"
#. Tag: para
#: Framework.xml:72
#, no-c-format
-msgid ""
-"You can also make your classes stateless session beans. In this case you "
-"<emphasis>must</emphasis> use injection to provide the persistence context, "
-"even if it is called <literal>entityManager</literal>:"
-msgstr ""
+msgid "You can also make your classes stateless session beans. In this case you <emphasis>must</emphasis> use injection to provide the persistence context, even if it is called <literal>entityManager</literal>:"
+msgstr "Si possono rendere le proprie classi bean di sessione stateless. In questo caso <emphasis>occorre</emphasis> usare l'injection per fornire il contesto di persistenza, anche se viene chiamato l'<literal>entityManager</literal>:"
#. Tag: programlisting
#: Framework.xml:79
@@ -170,8 +137,7 @@
msgid ""
"<![CDATA[@Stateless\n"
"@Name(\"personHome\")\n"
-"public class PersonHome extends EntityHome<Person> implements "
-"LocalPersonHome {\n"
+"public class PersonHome extends EntityHome<Person> implements LocalPersonHome {\n"
" \n"
" @In EntityManager entityManager;\n"
" \n"
@@ -183,8 +149,7 @@
msgstr ""
"<![CDATA[@Stateless\n"
"@Name(\"personHome\")\n"
-"public class PersonHome extends EntityHome<Person> implements "
-"LocalPersonHome {\n"
+"public class PersonHome extends EntityHome<Person> implements LocalPersonHome {\n"
" \n"
" @In EntityManager entityManager;\n"
" \n"
@@ -197,30 +162,20 @@
#. Tag: para
#: Framework.xml:81
#, no-c-format
-msgid ""
-"At this time, the Seam Application Framework provides four main built-in "
-"components: <literal>EntityHome</literal> and <literal>HibernateEntityHome</"
-"literal> for CRUD, along with <literal>EntityQuery</literal> and "
-"<literal>HibernateEntityQuery</literal> for queries."
-msgstr ""
+msgid "At this time, the Seam Application Framework provides four main built-in components: <literal>EntityHome</literal> and <literal>HibernateEntityHome</literal> for CRUD, along with <literal>EntityQuery</literal> and <literal>HibernateEntityQuery</literal> for queries."
+msgstr "Attualmente Seam fornisce quattro componenti predefiniti: <literal>EntityHome</literal> e <literal>HibernateEntityHome</literal> per le operazioni CRUD, assieme a <literal>EntityQuery</literal> e <literal>HibernateEntityQuery</literal> le query."
#. Tag: para
#: Framework.xml:89
#, no-c-format
-msgid ""
-"The Home and Query components are written so that they can function with a "
-"scope of session, event or conversation. Which scope you use depends upon "
-"the state model you wish to use in your application."
-msgstr ""
+msgid "The Home and Query components are written so that they can function with a scope of session, event or conversation. Which scope you use depends upon the state model you wish to use in your application."
+msgstr "I componenti Home e Query sono scritti per funzionare con scope di sessione, evento o conversazione. Quale scope usare dipende dal modello di stato che si desidera usare nella propria applicazione."
#. Tag: para
#: Framework.xml:95
#, no-c-format
-msgid ""
-"The Seam Application Framework only works with Seam-managed persistence "
-"contexts. By default, the components will look for a persistence context "
-"named <literal>entityManager</literal>."
-msgstr ""
+msgid "The Seam Application Framework only works with Seam-managed persistence contexts. By default, the components will look for a persistence context named <literal>entityManager</literal>."
+msgstr "Seam Application Framework funziona solo con contesti di persistenza gestiti da Seam. Di default i componenti cercano un contesto di persistenza chiamato <literal>entityManager</literal>."
#. Tag: title
#: Framework.xml:104
@@ -231,10 +186,8 @@
#. Tag: para
#: Framework.xml:106
#, no-c-format
-msgid ""
-"A Home object provides persistence operations for a particular entity class. "
-"Suppose we have our trusty <literal>Person</literal> class:"
-msgstr ""
+msgid "A Home object provides persistence operations for a particular entity class. Suppose we have our trusty <literal>Person</literal> class:"
+msgstr "Un oggetto Home fornisce operazioni per la persistenza per una particolare classe entity. Si supponga di avere una classe <literal>Person</literal>:"
#. Tag: programlisting
#: Framework.xml:111
@@ -263,20 +216,14 @@
#. Tag: para
#: Framework.xml:113
#, no-c-format
-msgid ""
-"We can define a <literal>personHome</literal> component either via "
-"configuration:"
-msgstr ""
+msgid "We can define a <literal>personHome</literal> component either via configuration:"
+msgstr "E' possibile definire un componente <literal>personHome</literal> o via configurazione:"
#. Tag: programlisting
#: Framework.xml:118
#, no-c-format
-msgid ""
-"<![CDATA[<framework:entity-home name=\"personHome\" entity-class=\"eg.Person"
-"\" />]]>"
-msgstr ""
-"<![CDATA[<framework:entity-home name=\"personHome\" entity-class=\"eg.Person"
-"\" />]]>"
+msgid "<![CDATA[<framework:entity-home name=\"personHome\" entity-class=\"eg.Person\" />]]>"
+msgstr "<![CDATA[<framework:entity-home name=\"personHome\" entity-class=\"eg.Person\" />]]>"
#. Tag: para
#: Framework.xml:120
@@ -297,20 +244,14 @@
#. Tag: para
#: Framework.xml:126
#, no-c-format
-msgid ""
-"A Home object provides the following operations: <literal>persist()</"
-"literal>, <literal>remove()</literal>, <literal>update()</literal> and "
-"<literal>getInstance()</literal>. Before you can call the <literal>remove()</"
-"literal>, or <literal>update()</literal> operations, you must first set the "
-"identifier of the object you are interested in, using the <literal>setId()</"
-"literal> method."
-msgstr ""
+msgid "A Home object provides the following operations: <literal>persist()</literal>, <literal>remove()</literal>, <literal>update()</literal> and <literal>getInstance()</literal>. Before you can call the <literal>remove()</literal>, or <literal>update()</literal> operations, you must first set the identifier of the object you are interested in, using the <literal>setId()</literal> method."
+msgstr "Un oggetto Home fornisce le seguenti operazioni: <literal>persist()</literal>, <literal>remove()</literal>, <literal>update()</literal> e <literal>getInstance()</literal>. Prima di chiamare le operazioni <literal>remove()</literal>, o <literal>update()</literal>, occorre prima impostare l'identificatore dell'oggetto interessato, usando il metodo <literal>setId()</literal>."
#. Tag: para
#: Framework.xml:135
#, no-c-format
msgid "We can use a Home directly from a JSF page, for example:"
-msgstr ""
+msgstr "Si può usare un Home direttamente da una pagina JSF, per esempio:"
#. Tag: programlisting
#: Framework.xml:139
@@ -318,36 +259,27 @@
msgid ""
"<![CDATA[<h1>Create Person</h1>\n"
"<h:form>\n"
-" <div>First name: <h:inputText value=\"#{personHome.instance.firstName}\"/"
-"></div>\n"
-" <div>Last name: <h:inputText value=\"#{personHome.instance.lastName}\"/"
-"></div>\n"
+" <div>First name: <h:inputText value=\"#{personHome.instance.firstName}\"/></div>\n"
+" <div>Last name: <h:inputText value=\"#{personHome.instance.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\"/>\n"
" </div>\n"
"</h:form>]]>"
msgstr ""
"<![CDATA[<h1>Create Person</h1>\n"
"<h:form>\n"
-" <div>First name: <h:inputText value=\"#{personHome.instance.firstName}\"/"
-"></div>\n"
-" <div>Last name: <h:inputText value=\"#{personHome.instance.lastName}\"/"
-"></div>\n"
+" <div>First name: <h:inputText value=\"#{personHome.instance.firstName}\"/></div>\n"
+" <div>Last name: <h:inputText value=\"#{personHome.instance.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\"/>\n"
" </div>\n"
"</h:form>]]>"
#. Tag: para
#: Framework.xml:141
#, no-c-format
-msgid ""
-"Usually, it is much nicer to be able to refer to the <literal>Person</"
-"literal> merely as <literal>person</literal>, so let's make that possible by "
-"adding a line to <literal>components.xml</literal>:"
-msgstr ""
+msgid "Usually, it is much nicer to be able to refer to the <literal>Person</literal> merely as <literal>person</literal>, so let's make that possible by adding a line to <literal>components.xml</literal>:"
+msgstr "Di solito è più comodo poter fare riferimento a <literal>Person</literal> semplicemente come <literal>person</literal>, e quindi si aggiunga una linea a <literal>components.xml</literal>:"
#. Tag: programlisting
#: Framework.xml:147
@@ -368,10 +300,8 @@
#. Tag: para
#: Framework.xml:149
#, no-c-format
-msgid ""
-"(If we are using configuration.) Or by adding a <literal>@Factory</literal> "
-"method to <literal>PersonHome</literal>:"
-msgstr ""
+msgid "(If we are using configuration.) Or by adding a <literal>@Factory</literal> method to <literal>PersonHome</literal>:"
+msgstr "(Se si usa la configurazione.) O si aggiunga un metodo <literal>@Factory</literal> a <literal>PersonHome</literal>:"
#. Tag: programlisting
#: Framework.xml:154
@@ -396,10 +326,8 @@
#. Tag: para
#: Framework.xml:156
#, no-c-format
-msgid ""
-"(If we are using extension.) This change simplifies our JSF page to the "
-"following:"
-msgstr ""
+msgid "(If we are using extension.) This change simplifies our JSF page to the following:"
+msgstr "(Se si usa l'estensione.) Questo cambiamento semplifica le pagine JSF come segue:"
#. Tag: programlisting
#: Framework.xml:161
@@ -410,8 +338,7 @@
" <div>First name: <h:inputText value=\"#{person.firstName}\"/></div>\n"
" <div>Last name: <h:inputText value=\"#{person.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\"/>\n"
" </div>\n"
"</h:form>]]>"
msgstr ""
@@ -420,21 +347,15 @@
" <div>First name: <h:inputText value=\"#{person.firstName}\"/></div>\n"
" <div>Last name: <h:inputText value=\"#{person.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\"/>\n"
" </div>\n"
"</h:form>]]>"
#. Tag: para
#: Framework.xml:163
#, no-c-format
-msgid ""
-"Well, that lets us create new <literal>Person</literal> entries. Yes, that "
-"is all the code that is required! Now, if we want to be able to display, "
-"update and delete pre-existing <literal>Person</literal> entries in the "
-"database, we need to be able to pass the entry identifier to the "
-"<literal>PersonHome</literal>. Page parameters are a great way to do that:"
-msgstr ""
+msgid "Well, that lets us create new <literal>Person</literal> entries. Yes, that is all the code that is required! Now, if we want to be able to display, update and delete pre-existing <literal>Person</literal> entries in the database, we need to be able to pass the entry identifier to the <literal>PersonHome</literal>. Page parameters are a great way to do that:"
+msgstr "Bene, queste crea le nuove entry per <literal>Person</literal>. Esatto, è tutto quanto il codice che serve! Ora se si vuole mostrare, aggiornare e cancellare entry di <literal>Person</literal> già esistenti nel database, occorre passare l'identificatore delle entry a <literal>PersonHome</literal>. I parametri di pagina sono un eccezionale modo per farlo:"
#. Tag: programlisting
#: Framework.xml:172
@@ -456,67 +377,51 @@
#: Framework.xml:174
#, no-c-format
msgid "Now we can add the extra operations to our JSF page:"
-msgstr ""
+msgstr "Ora possiamo aggiungere operazioni extra alle pagine JSF:"
#. Tag: programlisting
#: Framework.xml:178
#, no-c-format
msgid ""
"<![CDATA[<h1>\n"
-" <h:outputText rendered=\"#{!personHome.managed}\" value=\"Create Person"
-"\"/>\n"
-" <h:outputText rendered=\"#{personHome.managed}\" value=\"Edit Person\"/"
-">\n"
+" <h:outputText rendered=\"#{!personHome.managed}\" value=\"Create Person\"/>\n"
+" <h:outputText rendered=\"#{personHome.managed}\" value=\"Edit Person\"/>\n"
"</h1>\n"
"<h:form>\n"
" <div>First name: <h:inputText value=\"#{person.firstName}\"/></div>\n"
" <div>Last name: <h:inputText value=\"#{person.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\" rendered=\"#{!personHome.managed}\"/>\n"
-" <h:commandButton value=\"Update Person\" action=\"#{personHome."
-"update}\" rendered=\"#{personHome.managed}\"/>\n"
-" <h:commandButton value=\"Delete Person\" action=\"#{personHome."
-"remove}\" rendered=\"#{personHome.managed}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\" rendered=\"#{!personHome.managed}\"/>\n"
+" <h:commandButton value=\"Update Person\" action=\"#{personHome.update}\" rendered=\"#{personHome.managed}\"/>\n"
+" <h:commandButton value=\"Delete Person\" action=\"#{personHome.remove}\" rendered=\"#{personHome.managed}\"/>\n"
" </div>\n"
"</h:form>]]>"
msgstr ""
"<![CDATA[<h1>\n"
-" <h:outputText rendered=\"#{!personHome.managed}\" value=\"Create Person"
-"\"/>\n"
-" <h:outputText rendered=\"#{personHome.managed}\" value=\"Edit Person\"/"
-">\n"
+" <h:outputText rendered=\"#{!personHome.managed}\" value=\"Create Person\"/>\n"
+" <h:outputText rendered=\"#{personHome.managed}\" value=\"Edit Person\"/>\n"
"</h1>\n"
"<h:form>\n"
" <div>First name: <h:inputText value=\"#{person.firstName}\"/></div>\n"
" <div>Last name: <h:inputText value=\"#{person.lastName}\"/></div>\n"
" <div>\n"
-" <h:commandButton value=\"Create Person\" action=\"#{personHome."
-"persist}\" rendered=\"#{!personHome.managed}\"/>\n"
-" <h:commandButton value=\"Update Person\" action=\"#{personHome."
-"update}\" rendered=\"#{personHome.managed}\"/>\n"
-" <h:commandButton value=\"Delete Person\" action=\"#{personHome."
-"remove}\" rendered=\"#{personHome.managed}\"/>\n"
+" <h:commandButton value=\"Create Person\" action=\"#{personHome.persist}\" rendered=\"#{!personHome.managed}\"/>\n"
+" <h:commandButton value=\"Update Person\" action=\"#{personHome.update}\" rendered=\"#{personHome.managed}\"/>\n"
+" <h:commandButton value=\"Delete Person\" action=\"#{personHome.remove}\" rendered=\"#{personHome.managed}\"/>\n"
" </div>\n"
"</h:form>]]>"
#. Tag: para
#: Framework.xml:180
#, no-c-format
-msgid ""
-"When we link to the page with no request parameters, the page will be "
-"displayed as a \"Create Person\" page. When we provide a value for the "
-"<literal>personId</literal> request parameter, it will be an \"Edit Person\" "
-"page."
-msgstr ""
+msgid "When we link to the page with no request parameters, the page will be displayed as a \"Create Person\" page. When we provide a value for the <literal>personId</literal> request parameter, it will be an \"Edit Person\" page."
+msgstr "Quando ci si collega alla pagina senza parametri di richiesta, la pagina verrà mostrata come una pagina \"Create Person\". Quando si fornisce un valore per il parametro di richiesta <literal>personId</literal>, sarà una pagina \"Edit Person\"."
#. Tag: para
#: Framework.xml:187
#, no-c-format
-msgid ""
-"Suppose we need to create <literal>Person</literal> entries with their "
-"nationality initialized. We can do that easily, via configuration:"
-msgstr ""
+msgid "Suppose we need to create <literal>Person</literal> entries with their nationality initialized. We can do that easily, via configuration:"
+msgstr "Si supponga di dover creare entry di <literal>Person</literal> con la nazionalità inizializzata. E' possibile farlo semplicemente via configurazione:"
#. Tag: programlisting
#: Framework.xml:192
@@ -587,18 +492,14 @@
#. Tag: para
#: Framework.xml:200
#, no-c-format
-msgid ""
-"Of course, the <literal>Country</literal> could be an object managed by "
-"another Home object, for example, <literal>CountryHome</literal>."
-msgstr ""
+msgid "Of course, the <literal>Country</literal> could be an object managed by another Home object, for example, <literal>CountryHome</literal>."
+msgstr "Certamente <literal>Country</literal> può essere un oggetto gestito da un altro oggetto Home, per esempio, <literal>CountryHome</literal>."
#. Tag: para
#: Framework.xml:205
#, no-c-format
-msgid ""
-"To add more sophisticated operations (association management, etc), we can "
-"just add methods to <literal>PersonHome</literal>."
-msgstr ""
+msgid "To add more sophisticated operations (association management, etc), we can just add methods to <literal>PersonHome</literal>."
+msgstr "Per aggiungere altre operazioni sofisticate (gestione dell'associazione, ecc.) si possono aggiungere dei metodi a <literal>PersonHome</literal>."
#. Tag: programlisting
#: Framework.xml:210
@@ -647,24 +548,14 @@
#. Tag: para
#: Framework.xml:212
#, no-c-format
-msgid ""
-"The Home object raises an <literal>org.jboss.seam.afterTransactionSuccess</"
-"literal> event when a transaction succeeds (a call to <literal>persist()</"
-"literal>, <literal>update()</literal> or <literal>remove()</literal> "
-"succeeds). By observing this event we can refresh our queries when the "
-"underlying entities are changed. If we only want to refresh certain queries "
-"when a particular entity is persited, updated or removed we can observe the "
-"<literal>org.jboss.seam.afterTransactionSuccess.<name></literal> event "
-"(where <literal><name></literal> is the name of the entity)."
-msgstr ""
+msgid "The Home object raises an <literal>org.jboss.seam.afterTransactionSuccess</literal> event when a transaction succeeds (a call to <literal>persist()</literal>, <literal>update()</literal> or <literal>remove()</literal> succeeds). By observing this event we can refresh our queries when the underlying entities are changed. If we only want to refresh certain queries when a particular entity is persited, updated or removed we can observe the <literal>org.jboss.seam.afterTransactionSuccess.<name></literal> event (where <literal><name></literal> is the name of the entity)."
+msgstr "L'oggetto Home solleva un'evento <literal>org.jboss.seam.afterTransactionSuccess</literal> quando una transazione ha successo (una chiamata a <literal>persist()</literal>, <literal>update()</literal> o <literal>remove()</literal> ha successo). Osservando questo evento si può fare il refresh delle query quando le entità sottostanti cambiano. Se si vuole solo eseguire il refresh quando una particolare entità viene persistita, aggiornata o rimossa, si può osservare l'evento <literal>org.jboss.seam.afterTransactionSuccess.<name></literal> (dove <literal><name></literal> è il nome dell'entity)."
#. Tag: para
#: Framework.xml:223
#, no-c-format
-msgid ""
-"The Home object automatically displays faces messages when an operation is "
-"successful. To customize these messages we can, again, use configuration:"
-msgstr ""
+msgid "The Home object automatically displays faces messages when an operation is successful. To customize these messages we can, again, use configuration:"
+msgstr "L'oggetto Home mostra automaticamente i messaggi faces quando un'operazione ha successo. Per personalizzare questi messaggi si può ancora usare la configurazione:"
#. Tag: programlisting
#: Framework.xml:228
@@ -676,12 +567,9 @@
"<framework:entity-home name=\"personHome\"\n"
" entity-class=\"eg.Person\"\n"
" new-instance=\"#{newPerson}\">\n"
-" <framework:created-message>New person #{person.firstName} #{person."
-"lastName} created</framework:created-message>\n"
-" <framework:deleted-message>Person #{person.firstName} #{person.lastName} "
-"deleted</framework:deleted-message>\n"
-" <framework:updated-message>Person #{person.firstName} #{person.lastName} "
-"updated</framework:updated-message>\n"
+" <framework:created-message>New person #{person.firstName} #{person.lastName} created</framework:created-message>\n"
+" <framework:deleted-message>Person #{person.firstName} #{person.lastName} deleted</framework:deleted-message>\n"
+" <framework:updated-message>Person #{person.firstName} #{person.lastName} updated</framework:updated-message>\n"
"</framework:entity-home>\n"
"\n"
"<component name=\"newPerson\" \n"
@@ -695,12 +583,9 @@
"<framework:entity-home name=\"personHome\"\n"
" entity-class=\"eg.Person\"\n"
" new-instance=\"#{newPerson}\">\n"
-" <framework:created-message>New person #{person.firstName} #{person."
-"lastName} created</framework:created-message>\n"
-" <framework:deleted-message>Person #{person.firstName} #{person.lastName} "
-"deleted</framework:deleted-message>\n"
-" <framework:updated-message>Person #{person.firstName} #{person.lastName} "
-"updated</framework:updated-message>\n"
+" <framework:created-message>New person #{person.firstName} #{person.lastName} created</framework:created-message>\n"
+" <framework:deleted-message>Person #{person.firstName} #{person.lastName} deleted</framework:deleted-message>\n"
+" <framework:updated-message>Person #{person.firstName} #{person.lastName} updated</framework:updated-message>\n"
"</framework:entity-home>\n"
"\n"
"<component name=\"newPerson\" \n"
@@ -712,7 +597,7 @@
#: Framework.xml:230
#, no-c-format
msgid "Or extension:"
-msgstr ""
+msgstr "O estensione:"
#. Tag: programlisting
#: Framework.xml:234
@@ -730,12 +615,9 @@
" return new Person(country);\n"
" }\n"
" \n"
-" protected String getCreatedMessage() { return createValueExpression"
-"(\"New person #{person.firstName} #{person.lastName} created\"); }\n"
-" protected String getUpdatedMessage() { return createValueExpression"
-"(\"Person #{person.firstName} #{person.lastName} updated\"); }\n"
-" protected String getDeletedMessage() { return createValueExpression"
-"(\"Person #{person.firstName} #{person.lastName} deleted\"); }\n"
+" protected String getCreatedMessage() { return createValueExpression(\"New person #{person.firstName} #{person.lastName} created\"); }\n"
+" protected String getUpdatedMessage() { return createValueExpression(\"Person #{person.firstName} #{person.lastName} updated\"); }\n"
+" protected String getDeletedMessage() { return createValueExpression(\"Person #{person.firstName} #{person.lastName} deleted\"); }\n"
" \n"
"}]]>"
msgstr ""
@@ -751,53 +633,41 @@
" return new Person(country);\n"
" }\n"
" \n"
-" protected String getCreatedMessage() { return createValueExpression"
-"(\"New person #{person.firstName} #{person.lastName} created\"); }\n"
-" protected String getUpdatedMessage() { return createValueExpression"
-"(\"Person #{person.firstName} #{person.lastName} updated\"); }\n"
-" protected String getDeletedMessage() { return createValueExpression"
-"(\"Person #{person.firstName} #{person.lastName} deleted\"); }\n"
+" protected String getCreatedMessage() { return createValueExpression(\"New person #{person.firstName} #{person.lastName} created\"); }\n"
+" protected String getUpdatedMessage() { return createValueExpression(\"Person #{person.firstName} #{person.lastName} updated\"); }\n"
+" protected String getDeletedMessage() { return createValueExpression(\"Person #{person.firstName} #{person.lastName} deleted\"); }\n"
" \n"
"}]]>"
#. Tag: para
#: Framework.xml:236
#, no-c-format
-msgid ""
-"But the best way to specify the messages is to put them in a resource bundle "
-"known to Seam (the bundle named <literal>messages</literal>, by default)."
-msgstr ""
+msgid "But the best way to specify the messages is to put them in a resource bundle known to Seam (the bundle named <literal>messages</literal>, by default)."
+msgstr "Ma il modo migliore per specificare i messaggi è metterli in un resource bundle noto a Seam (di default, il nome del bundle è <literal>messages</literal>)."
#. Tag: programlisting
#: Framework.xml:242
#, no-c-format
msgid ""
-"<![CDATA[Person_created=New person #{person.firstName} #{person.lastName} "
-"created\n"
+"<![CDATA[Person_created=New person #{person.firstName} #{person.lastName} created\n"
"Person_deleted=Person #{person.firstName} #{person.lastName} deleted\n"
"Person_updated=Person #{person.firstName} #{person.lastName} updated]]>"
msgstr ""
-"<![CDATA[Person_created=New person #{person.firstName} #{person.lastName} "
-"created\n"
+"<![CDATA[Person_created=New person #{person.firstName} #{person.lastName} created\n"
"Person_deleted=Person #{person.firstName} #{person.lastName} deleted\n"
"Person_updated=Person #{person.firstName} #{person.lastName} updated]]>"
#. Tag: para
#: Framework.xml:244
#, no-c-format
-msgid ""
-"This enables internationalization, and keeps your code and configuration "
-"clean of presentation concerns."
-msgstr ""
+msgid "This enables internationalization, and keeps your code and configuration clean of presentation concerns."
+msgstr "Questo abilita l'internazionalizzazione e mantiene il codice e la configurazione puliti dagli elementi di presentazione."
#. Tag: para
#: Framework.xml:249
#, no-c-format
-msgid ""
-"The final step is to add validation functionality to the page, using "
-"<literal><s:validateAll></literal> and <literal><s:decorate></"
-"literal>, but I'll leave that for you to figure out."
-msgstr ""
+msgid "The final step is to add validation functionality to the page, using <literal><s:validateAll></literal> and <literal><s:decorate></literal>, but I'll leave that for you to figure out."
+msgstr "Il passo finale è aggiungere alla pagina la funzionalità di validazione, usando <literal><s:validateAll></literal> e <literal><s:decorate></literal>, ma verrà lasciato al lettore come esercizio."
#. Tag: title
#: Framework.xml:258
@@ -808,10 +678,8 @@
#. Tag: para
#: Framework.xml:260
#, no-c-format
-msgid ""
-"If we need a list of all <literal>Person</literal> instance in the database, "
-"we can use a Query object. For example:"
-msgstr ""
+msgid "If we need a list of all <literal>Person</literal> instance in the database, we can use a Query object. For example:"
+msgstr "Se occorre una lista di tutte le istanze <literal>Person</literal> nel database, si può usare un oggetto Query. Per esempio:"
#. Tag: programlisting
#: Framework.xml:265
@@ -827,7 +695,7 @@
#: Framework.xml:267
#, no-c-format
msgid "We can use it from a JSF page:"
-msgstr ""
+msgstr "E' possibile usarlo da una pagina JSF:"
#. Tag: programlisting
#: Framework.xml:271
@@ -836,8 +704,7 @@
"<![CDATA[<h1>List of people</h1>\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
@@ -846,8 +713,7 @@
"<![CDATA[<h1>List of people</h1>\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
@@ -857,7 +723,7 @@
#: Framework.xml:273
#, no-c-format
msgid "We probably need to support pagination:"
-msgstr ""
+msgstr "Probabilmente occorre un supporto per la paginazione:"
#. Tag: programlisting
#: Framework.xml:277
@@ -877,7 +743,7 @@
#: Framework.xml:279
#, no-c-format
msgid "We'll use a page parameter to determine the page to display:"
-msgstr ""
+msgstr "Si userà un parametro di pagina per determinare la pagina da mostrare:"
#. Tag: programlisting
#: Framework.xml:284
@@ -899,7 +765,7 @@
#: Framework.xml:286
#, no-c-format
msgid "The JSF code for a pagination control is a bit verbose, but manageable:"
-msgstr ""
+msgstr "Il codice JSF per il controllo della paginazione è un pò verboso, ma gestibile:"
#. Tag: programlisting
#: Framework.xml:290
@@ -908,71 +774,58 @@
"<![CDATA[<h1>Search for people</h1>\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
"</h:dataTable>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value="
-"\"First Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value=\"First Page\">\n"
" <f:param name=\"firstResult\" value=\"0\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value="
-"\"Previous Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value=\"Previous Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.previousFirstResult}\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value="
-"\"Next Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value=\"Next Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.nextFirstResult}\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value="
-"\"Last Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value=\"Last Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.lastFirstResult}\"/>\n"
"</s:link>]]>"
msgstr ""
"<![CDATA[<h1>Search for people</h1>\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
"</h:dataTable>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value="
-"\"First Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value=\"First Page\">\n"
" <f:param name=\"firstResult\" value=\"0\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value="
-"\"Previous Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.previousExists}\" value=\"Previous Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.previousFirstResult}\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value="
-"\"Next Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value=\"Next Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.nextFirstResult}\"/>\n"
"</s:link>\n"
"\n"
-"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value="
-"\"Last Page\">\n"
+"<s:link view=\"/search.xhtml\" rendered=\"#{people.nextExists}\" value=\"Last Page\">\n"
" <f:param name=\"firstResult\" value=\"#{people.lastFirstResult}\"/>\n"
"</s:link>]]>"
#. Tag: para
#: Framework.xml:292
#, no-c-format
-msgid ""
-"Real search screens let the user enter a bunch of optional search criteria "
-"to narrow the list of results returned. The Query object lets you specify "
-"optional \"restrictions\" to support this important usecase:"
-msgstr ""
+msgid "Real search screens let the user enter a bunch of optional search criteria to narrow the list of results returned. The Query object lets you specify optional \"restrictions\" to support this important usecase:"
+msgstr "Le schermate di ricerca consentono all'utente di inserire una serie di criteri di ricerca per restringere la lista dei risultati restituiti. L'oggetto Query consente di specificare delle \"restrizioni\" opzionali per supportare quest'importante caso d'uso:"
#. Tag: programlisting
#: Framework.xml:298
@@ -985,10 +838,8 @@
" order=\"lastName\" \n"
" max-results=\"20\">\n"
" <framework:restrictions>\n"
-" <value>lower(firstName) like lower( concat(#{examplePerson."
-"firstName},'%') )</value>\n"
-" <value>lower(lastName) like lower( concat(#{examplePerson."
-"lastName},'%') )</value>\n"
+" <value>lower(firstName) like lower( concat(#{examplePerson.firstName},'%') )</value>\n"
+" <value>lower(lastName) like lower( concat(#{examplePerson.lastName},'%') )</value>\n"
" </framework:restrictions>\n"
"</framework:entity-query>]]>"
msgstr ""
@@ -999,10 +850,8 @@
" order=\"lastName\" \n"
" max-results=\"20\">\n"
" <framework:restrictions>\n"
-" <value>lower(firstName) like lower( concat(#{examplePerson."
-"firstName},'%') )</value>\n"
-" <value>lower(lastName) like lower( concat(#{examplePerson."
-"lastName},'%') )</value>\n"
+" <value>lower(firstName) like lower( concat(#{examplePerson.firstName},'%') )</value>\n"
+" <value>lower(lastName) like lower( concat(#{examplePerson.lastName},'%') )</value>\n"
" </framework:restrictions>\n"
"</framework:entity-query>]]>"
@@ -1010,7 +859,7 @@
#: Framework.xml:300
#, no-c-format
msgid "Notice the use of an \"example\" object."
-msgstr ""
+msgstr "Si noti l'uso di un oggetto \"esempio\"."
#. Tag: programlisting
#: Framework.xml:304
@@ -1018,17 +867,14 @@
msgid ""
"<![CDATA[<h1>Search for people</h1>\n"
"<h:form>\n"
-" <div>First name: <h:inputText value=\"#{examplePerson.firstName}\"/></"
-"div>\n"
-" <div>Last name: <h:inputText value=\"#{examplePerson.lastName}\"/></"
-"div>\n"
+" <div>First name: <h:inputText value=\"#{examplePerson.firstName}\"/></div>\n"
+" <div>Last name: <h:inputText value=\"#{examplePerson.lastName}\"/></div>\n"
" <div><h:commandButton value=\"Search\" action=\"/search.jsp\"/></div>\n"
"</h:form>\n"
"\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
@@ -1036,17 +882,14 @@
msgstr ""
"<![CDATA[<h1>Search for people</h1>\n"
"<h:form>\n"
-" <div>First name: <h:inputText value=\"#{examplePerson.firstName}\"/></"
-"div>\n"
-" <div>Last name: <h:inputText value=\"#{examplePerson.lastName}\"/></"
-"div>\n"
+" <div>First name: <h:inputText value=\"#{examplePerson.firstName}\"/></div>\n"
+" <div>Last name: <h:inputText value=\"#{examplePerson.lastName}\"/></div>\n"
" <div><h:commandButton value=\"Search\" action=\"/search.jsp\"/></div>\n"
"</h:form>\n"
"\n"
"<h:dataTable value=\"#{people.resultList}\" var=\"person\">\n"
" <h:column>\n"
-" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #"
-"{person.lastName}\">\n"
+" <s:link view=\"/editPerson.jsp\" value=\"#{person.firstName} #{person.lastName}\">\n"
" <f:param name=\"personId\" value=\"#{person.id}\"/>\n"
" </s:link>\n"
" </h:column>\n"
@@ -1055,10 +898,8 @@
#. Tag: para
#: Framework.xml:306
#, no-c-format
-msgid ""
-"To refresh the query when the underlying entities change we observe the "
-"<literal>org.jboss.seam.afterTransactionSuccess</literal> event:"
-msgstr ""
+msgid "To refresh the query when the underlying entities change we observe the <literal>org.jboss.seam.afterTransactionSuccess</literal> event:"
+msgstr "Per fare il refresh della query qualora cambino le entità sottostanti, si può osservare l'evento <literal>org.jboss.seam.afterTransactionSuccess</literal>:"
#. Tag: programlisting
#: Framework.xml:311
@@ -1075,10 +916,8 @@
#. Tag: para
#: Framework.xml:313
#, no-c-format
-msgid ""
-"Or, to just refresh the query when the person entity is persisted, updated "
-"or removed through <literal>PersonHome</literal>:"
-msgstr ""
+msgid "Or, to just refresh the query when the person entity is persisted, updated or removed through <literal>PersonHome</literal>:"
+msgstr "O semplicemente per fare il refresh della query quando l'entity person viene persistita, aggiornata o rimossa attraverso <literal>PersonHome</literal>:"
#. Tag: programlisting
#: Framework.xml:318
@@ -1095,20 +934,14 @@
#. Tag: para
#: Framework.xml:320
#, no-c-format
-msgid ""
-"Unfortunately Query objects don't work well with <emphasis>join fetch</"
-"emphasis> queries - the use of pagination with these queries is not "
-"recomended, and you'll have to implement your own method of calculating the "
-"total number of results (by overriding <literal>getCountEjbql()</literal>."
-msgstr ""
+msgid "Unfortunately Query objects don't work well with <emphasis>join fetch</emphasis> queries - the use of pagination with these queries is not recomended, and you'll have to implement your own method of calculating the total number of results (by overriding <literal>getCountEjbql()</literal>."
+msgstr "Sfortunatamente gli oggetti Query non funzionano bene con query <emphasis>join fetch</emphasis> - non è consigliato l'uso della paginazione con queste query, ed occorrerà implementare un proprio metodo di calcolo del numero totale di risultati (con l'override di <literal>getCountEjbql()</literal>)."
#. Tag: para
#: Framework.xml:328
#, no-c-format
-msgid ""
-"The examples in this section have all shown reuse by configuration. However, "
-"reuse by extension is equally possible for Query objects."
-msgstr ""
+msgid "The examples in this section have all shown reuse by configuration. However, reuse by extension is equally possible for Query objects."
+msgstr "Gli esempi in questa sezione hanno mostrato tutti il riuso tramite configurazione. Comunque il riuso tramite estensione è ugualmente possibile per gli oggetti Query."
#. Tag: title
#: Framework.xml:336
@@ -1119,24 +952,14 @@
#. Tag: para
#: Framework.xml:337
#, no-c-format
-msgid ""
-"A totally optional part of the Seam Application Framework is the class "
-"<literal>Controller</literal> and its subclasses <literal>EntityController</"
-"literal> <literal>HibernateEntityController</literal> and "
-"<literal>BusinessProcessController</literal>. These classes provide nothing "
-"more than some convenience methods for access to commonly used built-in "
-"components and methods of built-in components. They help save a few "
-"keystrokes (characters can add up!) and provide a great launchpad for new "
-"users to explore the rich functionality built in to Seam."
-msgstr ""
+msgid "A totally optional part of the Seam Application Framework is the class <literal>Controller</literal> and its subclasses <literal>EntityController</literal> <literal>HibernateEntityController</literal> and <literal>BusinessProcessController</literal>. These classes provide nothing more than some convenience methods for access to commonly used built-in components and methods of built-in components. They help save a few keystrokes (characters can add up!) and provide a great launchpad for new users to explore the rich functionality built in to Seam."
+msgstr "Una parte totalmente opzionale del framework Seam è la classe <literal>Controller</literal> e le sue sottoclassi <literal>EntityController</literal>, <literal>HibernateEntityController</literal> e <literal>BusinessProcessController</literal>. Queste classi forniscono nient'altro che alcuni metodi di convenienza per l'accesso a componenti predefiniti comunemente usati e a metodi di componenti predefiniti. Essi aiutano a risparmiare alcuni colpi di tastiera ed a fornire un trampolino di lancio ai nuovi utenti per esplorare le ricche funzionalità definite in Seam."
#. Tag: para
#: Framework.xml:349
#, no-c-format
-msgid ""
-"For example, here is what <literal>RegisterAction</literal> from the Seam "
-"registration example would look like:"
-msgstr ""
+msgid "For example, here is what <literal>RegisterAction</literal> from the Seam registration example would look like:"
+msgstr "Per esempio, qua è come appare <literal>RegisterAction</literal> dell'esempio Registrazione:"
#. Tag: programlisting
#: Framework.xml:354
@@ -1151,8 +974,7 @@
" \n"
" public String register()\n"
" {\n"
-" List existing = createQuery(\"select u.username from User u where u."
-"username=:username\")\n"
+" List existing = createQuery(\"select u.username from User u where u.username=:username\")\n"
" .setParameter(\"username\", user.getUsername())\n"
" .getResultList();\n"
" \n"
@@ -1180,8 +1002,7 @@
" \n"
" public String register()\n"
" {\n"
-" List existing = createQuery(\"select u.username from User u where u."
-"username=:username\")\n"
+" List existing = createQuery(\"select u.username from User u where u.username=:username\")\n"
" .setParameter(\"username\", user.getUsername())\n"
" .getResultList();\n"
" \n"
@@ -1204,4 +1025,5 @@
#: Framework.xml:356
#, no-c-format
msgid "As you can see, its not an earthshattering improvement..."
-msgstr ""
+msgstr "Come si può vedere, non è un miglioramento sconvolgente..."
+
15 years, 2 months
Seam SVN: r10079 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-02-23 12:42:29 -0500 (Mon, 23 Feb 2009)
New Revision: 10079
Modified:
trunk/src/main/org/jboss/seam/Component.java
Log:
JBSEAM-3950
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2009-02-23 17:14:33 UTC (rev 10078)
+++ trunk/src/main/org/jboss/seam/Component.java 2009-02-23 17:42:29 UTC (rev 10079)
@@ -997,31 +997,38 @@
private List<Interceptor> newSort(List<Interceptor> list)
{
List<SortItem<Interceptor>> siList = new ArrayList<SortItem<Interceptor>>();
- Map<Class<?>,SortItem<Interceptor>> ht = new HashMap<Class<?>,SortItem<Interceptor>>();
+ Map<Class<?>,SortItem<Interceptor>> ht =
+ new HashMap<Class<?>,SortItem<Interceptor>>();
- for (Interceptor i : list)
- {
+ for (Interceptor i: list) {
SortItem<Interceptor> si = new SortItem<Interceptor>(i);
siList.add(si);
- ht.put( i.getUserInterceptorClass(), si );
+ ht.put(i.getUserInterceptorClass(), si);
}
- for (SortItem<Interceptor> si : siList)
- {
- Class<?> clazz = si.getObj().getUserInterceptorClass();
- if ( clazz.isAnnotationPresent(org.jboss.seam.annotations.intercept.Interceptor.class) )
- {
- org.jboss.seam.annotations.intercept.Interceptor interceptorAnn = clazz.getAnnotation(org.jboss.seam.annotations.intercept.Interceptor.class);
- for (Class<?> cl : Arrays.asList( interceptorAnn.around() ) )
- {
- SortItem<Interceptor> sortItem = ht.get(cl);
- if (sortItem!=null) si.getAround().add( sortItem );
+ for (SortItem<Interceptor> si : siList) {
+ Class<?> clazz = si.getObj().getUserInterceptorClass();
+ org.jboss.seam.annotations.intercept.Interceptor interceptorAnn =
+ seamInterceptor(clazz);
+
+ if (interceptorAnn != null) {
+ for (Class<?> cl : Arrays.asList(interceptorAnn.around())) {
+ if (!isCompatibleInterceptor(interceptorAnn, seamInterceptor(cl))) {
+ log.warn("Interceptor " + clazz +
+ " has different type than around interceptor " + cl);
+ }
+
+ si.addAround(ht.get(cl));
+ }
+
+ for (Class<?> cl : Arrays.asList( interceptorAnn.within())) {
+ if (!isCompatibleInterceptor(interceptorAnn, seamInterceptor(cl))) {
+ log.warn("Interceptor " + clazz +
+ " has different type than within interceptor " + cl);
+ }
+
+ si.addWithin(ht.get(cl));
}
- for (Class<?> cl : Arrays.asList( interceptorAnn.within() ) )
- {
- SortItem<Interceptor> sortItem = ht.get(cl);
- if (sortItem!=null) si.getWithin().add( sortItem );
- }
}
}
@@ -1029,13 +1036,35 @@
siList = sList.sort(siList);
list.clear();
- for (SortItem<Interceptor> si : siList)
- {
- list.add( si.getObj() );
+ for (SortItem<Interceptor> si : siList) {
+ list.add(si.getObj());
}
return list ;
}
+
+ private org.jboss.seam.annotations.intercept.Interceptor seamInterceptor(Class<?> clazz) {
+ return clazz.getAnnotation(org.jboss.seam.annotations.intercept.Interceptor.class);
+ }
+ private boolean isCompatibleInterceptor(
+ org.jboss.seam.annotations.intercept.Interceptor anno1,
+ org.jboss.seam.annotations.intercept.Interceptor anno2) {
+
+ if (anno1==null || anno2==null) {
+ return true;
+ }
+
+ if (anno1.type()==InterceptorType.CLIENT && anno2.type()==InterceptorType.SERVER) {
+ return false;
+ }
+
+ if (anno2.type()==InterceptorType.CLIENT && anno2.type()==InterceptorType.SERVER) {
+ return false;
+ }
+
+ return true;
+ }
+
private void initDefaultInterceptors()
{
List<String> interceptors;
15 years, 2 months
Seam SVN: r10078 - trunk/src/main/org/jboss/seam/document.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-02-23 12:14:33 -0500 (Mon, 23 Feb 2009)
New Revision: 10078
Modified:
trunk/src/main/org/jboss/seam/document/DocumentStore.java
Log:
change JBSEAM-3684
Modified: trunk/src/main/org/jboss/seam/document/DocumentStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/document/DocumentStore.java 2009-02-23 15:44:59 UTC (rev 10077)
+++ trunk/src/main/org/jboss/seam/document/DocumentStore.java 2009-02-23 17:14:33 UTC (rev 10078)
@@ -20,7 +20,7 @@
public class DocumentStore
implements Serializable
{
- public static final String DOCSTORE_BASE_URL = "/seam/docstore/";
+ public static final String DOCSTORE_BASE_URL = "/seam/docstore/document";
private static final long serialVersionUID = -357154201942127711L;
15 years, 2 months
Seam SVN: r10077 - in branches/enterprise/JBPAPP_4_3_FP01: examples/seamdiscs/view/layout and 11 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-02-23 10:44:59 -0500 (Mon, 23 Feb 2009)
New Revision: 10077
Added:
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/build.xml
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/jboss.xml
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java
Modified:
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artist.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artists.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/disc.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/discs.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/menu.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/template.xhtml
branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/login.xhtml
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/build.xml
Log:
JBPAPP-1700
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artist.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artist.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artist.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -15,10 +15,10 @@
<rich:panel>
<f:facet name="header"><tr:outputText value="#{artist.name} (#{messages[artist.class.name]})" rendered="#{artist.name ne null}" /></f:facet>
<tr:panelPartialRoot>
- <h:form>
+ <h:form id="artist">
<s:validateAll>
<tr:panelFormLayout>
- <tr:inputText label="Artist" value="#{artist.name}" readOnly="#{not identity.loggedIn}" required="true"/>
+ <tr:inputText label="Artist" id="name" value="#{artist.name}" readOnly="#{not identity.loggedIn}" required="true"/>
<tr:panelLabelAndMessage label="Band Members" rendered="#{artist.class.simpleName eq 'Band'}">
<ul>
<ui:repeat value="#{artist.bandMembers}" var="bandMember">
@@ -33,7 +33,7 @@
</ui:repeat>
</ul>
<f:facet name="end">
- <h:commandButton action="#{artistHome.addBandMember}" value="Add Band Member" rendered="#{identity.loggedIn}"/>
+ <h:commandButton id="addBandMember" action="#{artistHome.addBandMember}" value="Add Band Member" rendered="#{identity.loggedIn}"/>
</f:facet>
</tr:panelLabelAndMessage>
<tr:panelLabelAndMessage label="Details">
@@ -47,7 +47,7 @@
</s:div>
</tr:panelLabelAndMessage>
<tr:panelLabelAndMessage label="Discs">
- <tr:table value="#{artist.discs}" var="disc" rows="5" emptyText="None Known">
+ <tr:table value="#{artist.discs}" var="disc" rows="5" emptyText="None Known" id="discs">
<tr:column>
<f:facet name="header">
Disc
@@ -68,16 +68,16 @@
</f:facet>
</tr:table>
<f:facet name="end">
- <h:commandButton action="#{artistHome.addDisc}" value="Add Disc" rendered="#{identity.loggedIn}"/>
+ <h:commandButton action="#{artistHome.addDisc}" value="Add Disc" rendered="#{identity.loggedIn}" id="addDisc"/>
</f:facet>
</tr:panelLabelAndMessage>
</tr:panelFormLayout>
</s:validateAll>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <h:commandButton action="#{artistHome.update}" value="Save" rendered="#{artistHome.managed}" />
- <h:commandButton action="#{artistHome.persist}" value="Save" rendered="#{not artistHome.managed}" />
- <s:button action="cancel" value="Cancel" />
+ <h:commandButton action="#{artistHome.update}" value="Save" rendered="#{artistHome.managed}" id="update"/>
+ <h:commandButton action="#{artistHome.persist}" value="Save" rendered="#{not artistHome.managed}" id="persist"/>
+ <s:button action="cancel" value="Cancel" id="cancel"/>
</tr:panelButtonBar>
</h:form>
</tr:panelPartialRoot>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artists.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artists.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/artists.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -65,11 +65,11 @@
</tr:form>
</a:outputPanel>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <s:button action="artist" value="Add artist">
+ <s:button action="artist" value="Add artist" id="addArtist">
<f:param name="artistId" value="" />
<f:param name="type" value="artist" />
</s:button>
- <s:button action="artist" value="Add band">
+ <s:button action="artist" value="Add band" id="addBand">
<f:param name="artistId" value="" />
<f:param name="type" value="band" />
</s:button>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/disc.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/disc.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/disc.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -20,7 +20,7 @@
</s:fragment>
</f:facet>
<tr:panelPartialRoot>
- <tr:form>
+ <tr:form id="disc">
<s:validateAll>
<tr:panelFormLayout>
<tr:inputText label="Disc" value="#{disc.name}" readOnly="#{not identity.loggedIn}" required="true" />
@@ -42,10 +42,10 @@
</s:validateAll>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <h:commandButton action="#{discHome.update}" value="Save" rendered="#{discHome.managed}" />
- <h:commandButton action="#{discHome.persist}" value="Save" rendered="#{not discHome.managed}" />
- <h:commandButton action="#{discHome.remove}" value="Delete" rendered="#{discHome.managed}" />
- <s:button action="cancel" value="Cancel" />
+ <h:commandButton action="#{discHome.update}" value="Save" rendered="#{discHome.managed}" id="update"/>
+ <h:commandButton action="#{discHome.persist}" value="Save" rendered="#{not discHome.managed}" id="persist"/>
+ <h:commandButton action="#{discHome.remove}" value="Delete" rendered="#{discHome.managed}" id="remove"/>
+ <s:button action="cancel" value="Cancel" id="cancel"/>
</tr:panelButtonBar>
</tr:form>
</tr:panelPartialRoot>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/discs.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/discs.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/discs.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -11,7 +11,7 @@
<ui:define name="body">
- <rich:panel>
+ <rich:panel id="discs">
<f:facet name="header">Discs</f:facet>
<tr:panelPartialRoot>
<tr:form>
@@ -39,7 +39,7 @@
</f:facet>
</tr:table>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <s:button action="disc" value="Add disc">
+ <s:button action="disc" value="Add disc" id="addDisc">
<f:param name="discId" value="" />
</s:button>
</tr:panelButtonBar>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/menu.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/menu.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/menu.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -9,12 +9,12 @@
<rich:toolBarGroup>
<h:outputText value="#{projectName}:"/>
<s:link view="/home.xhtml" value="Home" propagation="none"/>
- <s:link view="/artists.xhtml" value="Artists" propagation="none"/>
- <s:link view="/discs.xhtml" value="Discs" propagation="none"/>
+ <s:link view="/artists.xhtml" value="Artists" propagation="none" id="manageArtists"/>
+ <s:link view="/discs.xhtml" value="Discs" propagation="none" id="manageDiscs"/>
</rich:toolBarGroup>
<rich:toolBarGroup location="right">
<h:outputText value="Welcome, #{identity.username}" rendered="#{identity.loggedIn}"/>
- <s:link view="/login.xhtml" value="Login" rendered="#{not identity.loggedIn}"/>
- <s:link view="/home.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
+ <s:link view="/login.xhtml" id="loginlink" value="Login" rendered="#{not identity.loggedIn}"/>
+ <s:link view="/home.xhtml" id="logout" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
</rich:toolBarGroup>
</rich:toolBar>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/template.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/layout/template.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -21,7 +21,7 @@
<ui:param name="projectName" value="SeamDiscs"/>
</ui:include>
- <tr:messages globalOnly="true"/>
+ <tr:messages globalOnly="true" id="messages"/>
<div class="body">
<ui:insert name="body"/>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/login.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/login.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seamdiscs/view/login.xhtml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -34,7 +34,7 @@
</rich:panel>
<div class="actionButtons">
- <h:commandButton value="Login" action="#{identity.login}"/>
+ <h:commandButton value="Login" action="#{identity.login}" id="loginbutton"/>
</div>
</h:form>
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/build.xml 2009-02-23 15:40:57 UTC (rev 10076)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/build.xml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -68,6 +68,7 @@
<testexample name="registration" />
<testexample name="remoting/chatroom" />
<testexample name="seambay" />
+ <testexample name="seamdiscs" />
<testexample name="seampay" />
<testexample name="seamspace" />
<testexample name="spring" />
@@ -111,6 +112,7 @@
<cleanexample name="registration" />
<cleanexample name="remoting/chatroom" />
<cleanexample name="seambay" />
+ <cleanexample name="seamdiscs" />
<cleanexample name="seampay" />
<cleanexample name="seamspace" />
<cleanexample name="spring" />
@@ -138,6 +140,7 @@
<undeployexample name="registration" />
<undeployexample name="remoting/chatroom" />
<undeployexample name="seambay" />
+ <undeployexample name="seamdiscs" />
<undeployexample name="seampay" />
<undeployexample name="seamspace" />
<undeployexample name="spring" />
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/build.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/build.xml (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/build.xml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, 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.
+-->
+<project name="seamdiscs.ftest.build" basedir="." default="build">
+ <property name="example.name" value="seamdiscs"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="jboss.example.ready.check.url" value="seam-discs/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/jboss.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/jboss.xml (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/jboss.xml 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,33 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, 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.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Seamdiscs example" verbose="2" parallel="false">
+ <test name="seamdiscs_jboss">
+ <parameter name="PROPERTY_FILE" value="" />
+ <parameter name="CONTEXT_PATH" value="/seam-discs" />
+ <classes>
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.LoginTest" />
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.ArtistsTest" />
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.DiscsTest" />
+ </classes>
+ </test>
+</suite>
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,140 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import java.text.MessageFormat;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests artists management in SeamDiscs application
+ * @author Ondrej Skutka
+ *
+ */
+public class ArtistsTest extends SeleniumSeamDiscsTest
+{
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.clickAndWait(MANAGE_ARTISTS);
+ }
+
+ /* @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void paginationTest()
+ {
+ findAndClickArtist("Fairport Convention"); // should be on second page
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }*/
+
+ @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void filterTest()
+ {
+ browser.type(ARTIST_FILTER, "Fairport");
+ browser.keyUp(ARTIST_FILTER, "t"); // to trigger ajax search
+ sleep(3000);
+ browser.clickAndWait(ARTISTS_FIRST_ARTIST_LINK);
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }
+
+ @Test(dependsOnGroups = {"loginTest"})
+ public void createWithDiscsTest()
+ {
+ browser.clickAndWait(CREATE_ARTIST_BUTTON);
+ browser.type(ARTIST_NAME, "Lou Reed");
+ browser.type(ARTIST_DESCRIPTION, "First came to prominence as the guitarist and principal singer-songwriter of The Velvet Underground. Than began a long and eclectic solo career.");
+ createDisc("Metal Machine Music", "1975");
+ createDisc("Sally Can't Dance", "1974");
+ createDisc("Rock and Roll Heart", "1977");
+ browser.clickAndWait(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", browser.isTextPresent("Successfully created"));
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1977", EMPTY_DISC_DESCRIPTION);
+ }
+
+// TODO check creating empty disc
+
+
+ @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void editDiscsTest()
+ {
+ // correct Rock and Roll Heart releas date
+ findAndClickArtist("Lou Reed");
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_YEAR, "last()"), "1976");
+
+ browser.clickAndWait(ARTIST_UPDATE);
+ findAndClickArtist("Lou Reed");
+
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", EMPTY_DISC_DESCRIPTION); // this was altered
+ }
+
+ @Test(dependsOnGroups = {"loginTest"})
+ public void addBandTest()
+ {
+ browser.clickAndWait(CREATE_BAND_BUTTON);
+ browser.type(ARTIST_NAME, "The Velvet Underground");
+ browser.type(ARTIST_DESCRIPTION, "An underground band.");
+ createDisc("White Light/White Heat", "1968");
+ createDisc("The Velvet Underground and Nico", "1967");
+
+ addBandMember("Lou Reed");
+ addBandMember("Sterling Morrison");
+ addBandMember("John Cale");
+ addBandMember("Maureen Tucker");
+ addBandMember("Nico");
+
+ browser.clickAndWait(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", browser.isTextPresent("Successfully created"));
+
+ findAndClickArtist("The Velvet Underground");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not the Velvet Underground!", browser.getAttribute(ARTIST_NAME + "@value").equals("The Velvet Underground"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "The Velvet Underground and Nico", "1967", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "White Light/White Heat", "1968", EMPTY_DISC_DESCRIPTION);
+
+ checkBandMember(1, "Lou Reed");
+ checkBandMember(2, "Sterling Morrison");
+ checkBandMember(3, "John Cale");
+ checkBandMember(4, "Maureen Tucker");
+ checkBandMember(5, "Nico");
+ }
+
+
+}
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests artists management in SeamDiscs application
+ * @author Ondrej Skutka
+ *
+ */
+public class DiscsTest extends SeleniumSeamDiscsTest
+{
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.clickAndWait(MANAGE_DISCS);
+ }
+
+ @Test(dependsOnMethods = {"editDiscsTest"})
+/* public void discPaginationTest()
+ {
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "", "Lou Reed");
+ }*/
+
+
+ /* @Test(dependsOnMethods = {"editDiscsTest"})
+ public void editDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "", "Lou Reed");
+
+ browser.type(DISC_DETAIL_DESCRIPTION, "A sensitive and revealing look into the prince of darkness.");
+
+ browser.clickAndWait(DISC_DETAIL_UPDATE);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }*/
+
+ @Test(dependsOnMethods = {"editDiscTest"})
+ public void addDiscTest()
+ {
+ browser.clickAndWait(CREATE_DISC_BUTTON);
+ browser.type(DISC_DETAIL_TITLE, "Berlin");
+ browser.select(DISC_DETAIL_ARTIST, "Lou Reed");
+ browser.type(DISC_DETAIL_RELEASE_DATE, "1973");
+ browser.type(DISC_DETAIL_DESCRIPTION, "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ browser.clickAndWait(DISC_DETAIL_PERSIST);
+ assertTrue("Cannot create disc", browser.isTextPresent("Successfully created"));
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ checkDisc(2, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(4, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+
+ @Test(dependsOnMethods = {"addDiscTest"})
+ public void removeDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Berlin");
+ checkDiscDetail("Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.", "Lou Reed");
+
+ browser.clickAndWait(DISC_DETAIL_REMOVE);
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test(dependsOnMethods = {"removeDiscTest"})
+ public void cancelDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ browser.type(DISC_DETAIL_DESCRIPTION, "Pretty lame album.");
+
+ browser.clickAndWait(DISC_DETAIL_CANCEL);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+}
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.Test;
+
+/**
+ * Basic test covering user authentication
+ * @author Jozef Hartinger
+ *
+ */
+public class LoginTest extends SeleniumSeamDiscsTest
+{
+
+ @Test(groups = {"loginTest"})
+ public void loginTest() {
+ assertTrue("Login failed.", isLoggedIn());
+ }
+
+ @Test(dependsOnMethods = {"loginTest"})
+ public void logoutTest() {
+ browser.clickAndWait(LOGOUT);
+ assertFalse("Logout failed.", isLoggedIn());
+ }
+
+
+}
Added: branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java (rev 0)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java 2009-02-23 15:44:59 UTC (rev 10077)
@@ -0,0 +1,232 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.BeforeMethod;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+/**
+ *
+ * @author Ondrej Skutka
+ *
+ */
+public abstract class SeleniumSeamDiscsTest extends SeamSeleniumTest
+{
+ // TODO final
+ public static String LOGIN = "id=loginlink";
+ public static String LOGOUT = "id=logout";
+ public static String LOGIN_USERNAME = "id=login:username";
+ public static String LOGIN_PASSWORD = "id=login:password";
+ public static String LOGIN_LOGIN = "id=login:loginbutton";
+ public static String HOME_URL = "/home.seam";
+// public static String SECURITY = "id=security";
+//
+ public static String MANAGE_DISCS = "id=manageDiscs";
+ public static String CREATE_ARTIST_BUTTON = "id=addArtist";
+ public static String CREATE_BAND_BUTTON = "id=addBand";
+ public static String ARTIST_FILTER = "//form[1]//input[@type='text']";
+ public static String ARTIST_NAME = "id=artist:name";
+ public static String ARTIST_CREATE_DISC_BUTTON = "id=artist:addDisc";
+ public static String ARTIST_DESCRIPTION = "id=artist:description";
+ public static String ARTIST_PERSIST = "id=artist:persist";
+ public static String ARTIST_UPDATE = "id=artist:update";
+ public static String ARTIST_CANCEL = "id=artist:cancel";
+ public static String ARTIST_ADD_BAND_MEMBER = "id=artist:addBandMember";
+ public static String ARTIST_NTH_BAND_MEMBER = "xpath=id(\"artist\")//tr[1]//tr[3]/td[2]//ul/li[{0}]//input[@type=\"text\"]";
+ public static String ARTIST_LAST_BAND_MEMBER = MessageFormat.format(ARTIST_NTH_BAND_MEMBER, "last()");
+
+
+ public static String ARTIST_NTH_DISC = "xpath=id(\"artist:discs\")/table/tbody/tr/td/table/tbody/tr[{0}]";
+ public static String ARTIST_NTH_DISC_SHOW_DETAILS = ARTIST_NTH_DISC + "/td[1]/div/a[2]";
+ public static String ARTIST_NTH_DISC_NAME = ARTIST_NTH_DISC + "/td[2]/input";
+ public static String ARTIST_NTH_DISC_YEAR = ARTIST_NTH_DISC + "/td[3]//input";
+ public static String ARTIST_NTH_DISC_DETAIL = ARTIST_NTH_DISC + "/td";
+ public static String ARTISTS_FIRST_ARTIST_LINK = "xpath=id(\"artists\")//table/tbody/tr/td/table/tbody/tr[2]/td[2]/a";
+ public static String ARTISTS_NEXT_PAGE_LINK = "xpath=id(\"artists\")//td[1]//td[7]/a";
+ public static String ARTIST_TABLE_ROW_BY_NAME = "xpath=id(\"artists\")//tr[normalize-space(td/a/text())=\"{0}\"]";
+ // these locators can only be used catenated with ARTIST_TABLE_ROW_BY_NAME
+ public static String ARTIST_TABLE_ROW_LINK = ARTIST_TABLE_ROW_BY_NAME + "/td[2]/a";
+
+
+ public static String MANAGE_ARTISTS = "id=manageArtists";
+ public static String CREATE_DISC_BUTTON = "id=addDisc";
+ public static String DISC_DETAIL_TITLE = "xpath=id(\"disc\")//tr//tr[2]/td[2]/input";
+ public static String DISC_DETAIL_RELEASE_DATE = "xpath=id(\"disc\")//tr//tr[3]/td[2]//input";
+ public static String DISC_DETAIL_ARTIST = "xpath=id(\"disc\")//tr//tr[5]//select";
+ public static String DISC_DETAIL_DESCRIPTION = "id=description";
+ public static String DISC_DETAIL_UPDATE = "id=update";
+ public static String DISC_DETAIL_PERSIST = "id=persist";
+ public static String DISC_DETAIL_REMOVE = "id=remove";
+ public static String DISC_DETAIL_CANCEL = "id=cancel";
+ public static String DISCS_NEXT_PAGE_LINK = "xpath=id(\"discs\")//td[1]//td[7]/a";
+ public static String DISC_TABLE_ROW_BY_NAME = "xpath=id(\"discs\")//tr[normalize-space(td/a/text())=\"{0}\"]";
+ // these locators can only be used catenated with DISC_TABLE_ROW_BY_NAME
+ public static String DISC_TABLE_ROW_LINK = DISC_TABLE_ROW_BY_NAME + "/td[2]/a";
+
+ public static String EMPTY_DISC_DESCRIPTION = "None known";
+
+ public static String DEFAULT_USERNAME = "administrator";
+ public static String DEFAULT_PASSWORD = "administrator";
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ super.setUp();
+ browser.open(CONTEXT_PATH + HOME_URL);
+ login();
+ }
+
+ public void login() {
+ login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public void login(String username, String password) {
+ if (isLoggedIn()) {
+ fail("User already logged in.");
+ }
+ browser.clickAndWait(LOGIN);
+ browser.type(LOGIN_USERNAME, username);
+ browser.type(LOGIN_PASSWORD, password);
+ browser.clickAndWait(LOGIN_LOGIN);
+ }
+
+ protected boolean isLoggedIn()
+ {
+ return !browser.isElementPresent(LOGIN) && browser.isElementPresent(LOGOUT);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDisc(int tableRow, String expectedDiscTitle, String expectedReleaseDate, String expectedDescription) {
+ tableRow++; // first row is header
+ String actualDiscTitle = browser.getAttribute(MessageFormat.format(ARTIST_NTH_DISC_NAME, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedDiscTitle + ") album (" + actualDiscTitle + ")!", actualDiscTitle.equals(expectedDiscTitle));
+
+ String actualReleaseDate = "";
+ if (browser.isElementPresent(MessageFormat.format(ARTIST_NTH_DISC_YEAR, tableRow) + "/attribute::value")) {
+ actualReleaseDate = browser.getAttribute(MessageFormat.format(ARTIST_NTH_DISC_YEAR, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedReleaseDate + ") release date (" + actualReleaseDate + ")!", actualReleaseDate.equals(expectedReleaseDate));
+ }
+
+ browser.clickAndWait(MessageFormat.format(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ String actualDescription = browser.getText(MessageFormat.format(ARTIST_NTH_DISC_DETAIL, tableRow + 1));
+ assertTrue("This is not expected (" + expectedDescription + ") description (" + actualDescription + ")!", actualDescription.equals(expectedDescription));
+ browser.clickAndWait(MessageFormat.format(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDiscDetail(String expectedDiscTitle, String expectedReleaseDate, String expectedDescription, String expectedArtist) {
+ String actualDiscTitle = browser.getAttribute(DISC_DETAIL_TITLE + "@value");
+ assertTrue("This is not expected (" + expectedDiscTitle + ") album: (" + actualDiscTitle + ")!", actualDiscTitle.equals(expectedDiscTitle));
+
+ String actualReleaseDate = "";
+ if (browser.isElementPresent(DISC_DETAIL_RELEASE_DATE + "/attribute::value")) {
+ actualReleaseDate = browser.getAttribute(DISC_DETAIL_RELEASE_DATE + "@value");
+ assertTrue("This is not expected (" + expectedReleaseDate + ") release date: (" + actualReleaseDate + ")!", actualReleaseDate.equals(expectedReleaseDate));
+ }
+
+ String actualDescription = browser.getText(DISC_DETAIL_DESCRIPTION);
+ assertTrue("This is not expected (" + expectedDescription + ") description: (" + actualDescription + ")!", actualDescription.equals(expectedDescription));
+
+ String actualArtist = browser.getSelectedLabel(DISC_DETAIL_ARTIST);
+ assertTrue("This is not expected (" + expectedArtist + ") artist: (" + actualArtist + ")!", actualArtist.equals(expectedArtist));
+ }
+
+ /**
+ * Creates new disc.
+ * Expected to be on artist's edit page.
+ *
+ */
+ protected void createDisc(String title, String year) {
+ browser.clickAndWait(ARTIST_CREATE_DISC_BUTTON);
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_NAME, "last()"), title);
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_YEAR, "last()"), year);
+ }
+
+ /**
+ * Finds the specified artist in paginated artists page and clicks it.
+ * Expected to be on artists page.
+ *
+ */
+ protected void findAndClickArtist(String artistName) {
+ // find the artist's page (it's paginated) and click it
+ String expectedArtist = MessageFormat.format(ARTIST_TABLE_ROW_BY_NAME, artistName);
+ while (!browser.isElementPresent(expectedArtist)) { // click through pages
+ assertTrue("Artist " + artistName + " not found.", browser.isElementPresent(ARTISTS_NEXT_PAGE_LINK));
+ browser.click(ARTISTS_NEXT_PAGE_LINK); // ajax
+ sleep(3000);
+ }
+
+ browser.clickAndWait(MessageFormat.format(ARTIST_TABLE_ROW_LINK, artistName)); // click artist link
+ }
+
+ /**
+ * Finds the specified disc in paginated discs page and clicks it.
+ * Expected to be on discs page.
+ *
+ */
+ protected void findAndClickDisc(String discName) {
+ // find the disc page (it's paginated) and click it
+ String expectedDisc = MessageFormat.format(DISC_TABLE_ROW_BY_NAME, discName);
+ while (!browser.isElementPresent(expectedDisc)) { // click through pages
+ assertTrue("Disc " + discName + " not found.", browser.isElementPresent(DISCS_NEXT_PAGE_LINK));
+ browser.click(DISCS_NEXT_PAGE_LINK); // ajax
+ sleep(3000);
+ }
+
+ browser.clickAndWait(MessageFormat.format(DISC_TABLE_ROW_LINK, discName)); // click disc link
+ }
+
+ /**
+ * @param in milliseconds
+ *
+ */
+ protected void sleep(int milliseconds) {
+ try {
+ Thread.sleep(milliseconds); // TODO how to do this properly?
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ protected void addBandMember(String artistName) {
+ browser.clickAndWait(ARTIST_ADD_BAND_MEMBER);
+ browser.type(ARTIST_LAST_BAND_MEMBER, artistName);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkBandMember(int tableRow, String expectedBandMember) {
+ String actualMemberName = browser.getAttribute(MessageFormat.format(ARTIST_NTH_BAND_MEMBER, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedBandMember + ") album (" + actualMemberName + ")!", actualMemberName.equals(expectedBandMember));
+ }
+}
15 years, 2 months
Seam SVN: r10076 - in trunk: examples/seamdiscs/view/layout and 11 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-02-23 10:40:57 -0500 (Mon, 23 Feb 2009)
New Revision: 10076
Added:
trunk/src/test/ftest/examples/seamdiscs/
trunk/src/test/ftest/examples/seamdiscs/build.xml
trunk/src/test/ftest/examples/seamdiscs/jboss.xml
trunk/src/test/ftest/examples/seamdiscs/src/
trunk/src/test/ftest/examples/seamdiscs/src/org/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java
trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java
Modified:
trunk/examples/seamdiscs/view/artist.xhtml
trunk/examples/seamdiscs/view/artists.xhtml
trunk/examples/seamdiscs/view/disc.xhtml
trunk/examples/seamdiscs/view/discs.xhtml
trunk/examples/seamdiscs/view/layout/menu.xhtml
trunk/examples/seamdiscs/view/layout/template.xhtml
trunk/examples/seamdiscs/view/login.xhtml
trunk/src/test/ftest/build.xml
Log:
JBSEAM-3690
Modified: trunk/examples/seamdiscs/view/artist.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/artist.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/artist.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -14,10 +14,10 @@
<rich:panel>
<f:facet name="header"><tr:outputText value="#{artist.name} (#{messages[artist.class.name]})" rendered="#{artist.name ne null}" /></f:facet>
- <h:form>
+ <h:form id="artist">
<s:validateAll>
<tr:panelFormLayout>
- <tr:inputText label="Artist" value="#{artist.name}" readOnly="#{not identity.loggedIn}" required="true"/>
+ <tr:inputText label="Artist" id="name" value="#{artist.name}" readOnly="#{not identity.loggedIn}" required="true"/>
<tr:panelLabelAndMessage label="Band Members" rendered="#{artist.class.simpleName eq 'Band'}">
<ul>
<ui:repeat value="#{artist.bandMembers}" var="bandMember">
@@ -32,7 +32,7 @@
</ui:repeat>
</ul>
<f:facet name="end">
- <h:commandButton action="#{artistHome.addBandMember}" value="Add Band Member" rendered="#{identity.loggedIn}"/>
+ <h:commandButton id="addBandMember" action="#{artistHome.addBandMember}" value="Add Band Member" rendered="#{identity.loggedIn}"/>
</f:facet>
</tr:panelLabelAndMessage>
<tr:panelLabelAndMessage label="Details">
@@ -46,7 +46,7 @@
</s:div>
</tr:panelLabelAndMessage>
<tr:panelLabelAndMessage label="Discs">
- <tr:table value="#{artist.discs}" var="disc" rows="5" emptyText="None Known">
+ <tr:table value="#{artist.discs}" var="disc" rows="5" emptyText="None Known" id="discs">
<tr:column>
<f:facet name="header">
Disc
@@ -67,16 +67,16 @@
</f:facet>
</tr:table>
<f:facet name="end">
- <h:commandButton action="#{artistHome.addDisc}" value="Add Disc" rendered="#{identity.loggedIn}"/>
+ <h:commandButton id="addDisc" action="#{artistHome.addDisc}" value="Add Disc" rendered="#{identity.loggedIn}"/>
</f:facet>
</tr:panelLabelAndMessage>
</tr:panelFormLayout>
</s:validateAll>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <h:commandButton action="#{artistHome.update}" value="Save" rendered="#{artistHome.managed}" />
- <h:commandButton action="#{artistHome.persist}" value="Save" rendered="#{not artistHome.managed}" />
- <s:button action="cancel" value="Cancel" />
+ <h:commandButton action="#{artistHome.update}" value="Save" rendered="#{artistHome.managed}" id="update"/>
+ <h:commandButton action="#{artistHome.persist}" value="Save" rendered="#{not artistHome.managed}" id="persist"/>
+ <s:button action="cancel" value="Cancel" id="cancel"/>
</tr:panelButtonBar>
</h:form>
</rich:panel>
Modified: trunk/examples/seamdiscs/view/artists.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/artists.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/artists.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -64,11 +64,11 @@
</tr:form>
</a:outputPanel>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <s:button action="artist" value="Add artist">
+ <s:button action="artist" value="Add artist" id="addArtist">
<f:param name="artistId" value="" />
<f:param name="type" value="artist" />
</s:button>
- <s:button action="artist" value="Add band">
+ <s:button action="artist" value="Add band" id="addBand">
<f:param name="artistId" value="" />
<f:param name="type" value="band" />
</s:button>
Modified: trunk/examples/seamdiscs/view/disc.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/disc.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/disc.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -19,7 +19,7 @@
<tr:outputText value=" by #{disc.artist.name}" />
</s:fragment>
</f:facet>
- <tr:form>
+ <tr:form id="disc">
<s:validateAll>
<tr:panelFormLayout>
<tr:inputText label="Disc" value="#{disc.name}" readOnly="#{not identity.loggedIn}" required="true" />
@@ -41,10 +41,10 @@
</s:validateAll>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <h:commandButton action="#{discHome.update}" value="Save" rendered="#{discHome.managed}" />
- <h:commandButton action="#{discHome.persist}" value="Save" rendered="#{not discHome.managed}" />
- <h:commandButton action="#{discHome.remove}" value="Delete" rendered="#{discHome.managed}" />
- <s:button action="cancel" value="Cancel" />
+ <h:commandButton action="#{discHome.update}" value="Save" rendered="#{discHome.managed}" id="update" />
+ <h:commandButton action="#{discHome.persist}" value="Save" rendered="#{not discHome.managed}" id="persist" />
+ <h:commandButton action="#{discHome.remove}" value="Delete" rendered="#{discHome.managed}" id="remove" />
+ <s:button action="cancel" value="Cancel" id="cancel"/>
</tr:panelButtonBar>
</tr:form>
</rich:panel>
Modified: trunk/examples/seamdiscs/view/discs.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/discs.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/discs.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -11,7 +11,7 @@
<ui:define name="body">
- <rich:panel>
+ <rich:panel id="discs">
<f:facet name="header">Discs</f:facet>
<tr:form>
<tr:table value="#{discs.dataModel}" var="disc" rows="#{discs.maxResults}">
@@ -38,7 +38,7 @@
</f:facet>
</tr:table>
<tr:panelButtonBar rendered="#{identity.loggedIn}">
- <s:button action="disc" value="Add disc">
+ <s:button action="disc" value="Add disc" id="addDisc">
<f:param name="discId" value="" />
</s:button>
</tr:panelButtonBar>
Modified: trunk/examples/seamdiscs/view/layout/menu.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/layout/menu.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/layout/menu.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -9,12 +9,12 @@
<rich:toolBarGroup>
<h:outputText value="#{projectName}:"/>
<s:link view="/home.xhtml" value="Home" propagation="none"/>
- <s:link view="/artists.xhtml" value="Artists" propagation="none"/>
- <s:link view="/discs.xhtml" value="Discs" propagation="none"/>
+ <s:link view="/artists.xhtml" id="manageArtists" value="Artists" propagation="none"/>
+ <s:link view="/discs.xhtml" id="manageDiscs" value="Discs" propagation="none"/>
</rich:toolBarGroup>
<rich:toolBarGroup location="right">
<h:outputText value="Welcome, #{identity.username}" rendered="#{identity.loggedIn}"/>
- <s:link view="/login.xhtml" value="Login" rendered="#{not identity.loggedIn}"/>
- <s:link view="/home.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
+ <s:link view="/login.xhtml" id="loginlink" value="Login" rendered="#{not identity.loggedIn}"/>
+ <s:link view="/home.xhtml" id="logout" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
</rich:toolBarGroup>
</rich:toolBar>
Modified: trunk/examples/seamdiscs/view/layout/template.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/layout/template.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/layout/template.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -21,7 +21,7 @@
<ui:param name="projectName" value="SeamDiscs"/>
</ui:include>
- <tr:messages globalOnly="true"/>
+ <tr:messages globalOnly="true" id="messages"/>
<div class="body">
<ui:insert name="body"/>
Modified: trunk/examples/seamdiscs/view/login.xhtml
===================================================================
--- trunk/examples/seamdiscs/view/login.xhtml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/examples/seamdiscs/view/login.xhtml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -34,7 +34,7 @@
</rich:panel>
<div class="actionButtons">
- <h:commandButton value="Login" action="#{identity.login}"/>
+ <h:commandButton value="Login" id="loginbutton" action="#{identity.login}"/>
</div>
</h:form>
Modified: trunk/src/test/ftest/build.xml
===================================================================
--- trunk/src/test/ftest/build.xml 2009-02-23 12:36:14 UTC (rev 10075)
+++ trunk/src/test/ftest/build.xml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -71,6 +71,7 @@
<testexample name="remoting/chatroom" />
<testexample name="rss" />
<testexample name="seambay" />
+ <testexample name="seamdiscs" />
<testexample name="seampay" />
<testexample name="seamspace" />
<testexample name="spring" />
@@ -160,6 +161,7 @@
<cleanexample name="remoting/chatroom" />
<cleanexample name="rss" />
<cleanexample name="seambay" />
+ <cleanexample name="seamdiscs" />
<cleanexample name="seampay" />
<cleanexample name="seamspace" />
<cleanexample name="spring" />
@@ -192,6 +194,7 @@
<undeployexample name="rss" />
<undeployexample name="remoting/chatroom" />
<undeployexample name="seambay" />
+ <undeployexample name="seamdiscs" />
<undeployexample name="seampay" />
<undeployexample name="seamspace" />
<undeployexample name="spring" />
Added: trunk/src/test/ftest/examples/seamdiscs/build.xml
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/build.xml (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/build.xml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, 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.
+-->
+<project name="seamdiscs.ftest.build" basedir="." default="build">
+ <property name="example.name" value="seamdiscs"/>
+ <property name="jboss.deploy.target" value="deploy"/>
+ <property name="jboss.undeploy.target" value="undeploy"/>
+ <property name="jboss.example.ready.check.url" value="seam-discs/home.seam"/>
+
+ <import file="../build.xml" />
+</project>
Added: trunk/src/test/ftest/examples/seamdiscs/jboss.xml
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/jboss.xml (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/jboss.xml 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,33 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, 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.
+-->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Seamdiscs example" verbose="2" parallel="false">
+ <test name="seamdiscs_jboss">
+ <parameter name="PROPERTY_FILE" value="" />
+ <parameter name="CONTEXT_PATH" value="/seam-discs" />
+ <classes>
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.LoginTest" />
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.ArtistsTest" />
+ <class name="org.jboss.seam.example.seamdiscs.test.selenium.DiscsTest" />
+ </classes>
+ </test>
+</suite>
Added: trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/ArtistsTest.java 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,140 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import java.text.MessageFormat;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests artists management in SeamDiscs application
+ * @author Ondrej Skutka
+ *
+ */
+public class ArtistsTest extends SeleniumSeamDiscsTest
+{
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.clickAndWait(MANAGE_ARTISTS);
+ }
+
+ /* @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void paginationTest()
+ {
+ findAndClickArtist("Fairport Convention"); // should be on second page
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }*/
+
+ @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void filterTest()
+ {
+ browser.type(ARTIST_FILTER, "Fairport");
+ browser.keyUp(ARTIST_FILTER, "t"); // to trigger ajax search
+ sleep(3000);
+ browser.clickAndWait(ARTISTS_FIRST_ARTIST_LINK);
+ checkDisc(1, "Liege and Lief", "", "The first folk-rock album ever made in the UK, this was the only studio recording of the classic line up of Sandy Denny, Richard Thompson, Dave Swarbick, Ashley Hutchings and Simon Nicol");
+ }
+
+ @Test(dependsOnGroups = {"loginTest"})
+ public void createWithDiscsTest()
+ {
+ browser.clickAndWait(CREATE_ARTIST_BUTTON);
+ browser.type(ARTIST_NAME, "Lou Reed");
+ browser.type(ARTIST_DESCRIPTION, "First came to prominence as the guitarist and principal singer-songwriter of The Velvet Underground. Than began a long and eclectic solo career.");
+ createDisc("Metal Machine Music", "1975");
+ createDisc("Sally Can't Dance", "1974");
+ createDisc("Rock and Roll Heart", "1977");
+ browser.clickAndWait(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", browser.isTextPresent("Successfully created"));
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1977", EMPTY_DISC_DESCRIPTION);
+ }
+
+// TODO check creating empty disc
+
+
+ @Test(dependsOnMethods = {"createWithDiscsTest"})
+ public void editDiscsTest()
+ {
+ // correct Rock and Roll Heart releas date
+ findAndClickArtist("Lou Reed");
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_YEAR, "last()"), "1976");
+
+ browser.clickAndWait(ARTIST_UPDATE);
+ findAndClickArtist("Lou Reed");
+
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", EMPTY_DISC_DESCRIPTION); // this was altered
+ }
+
+ @Test(dependsOnGroups = {"loginTest"})
+ public void addBandTest()
+ {
+ browser.clickAndWait(CREATE_BAND_BUTTON);
+ browser.type(ARTIST_NAME, "The Velvet Underground");
+ browser.type(ARTIST_DESCRIPTION, "An underground band.");
+ createDisc("White Light/White Heat", "1968");
+ createDisc("The Velvet Underground and Nico", "1967");
+
+ addBandMember("Lou Reed");
+ addBandMember("Sterling Morrison");
+ addBandMember("John Cale");
+ addBandMember("Maureen Tucker");
+ addBandMember("Nico");
+
+ browser.clickAndWait(ARTIST_PERSIST);
+ assertTrue("Cannot create artist with discs", browser.isTextPresent("Successfully created"));
+
+ findAndClickArtist("The Velvet Underground");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not the Velvet Underground!", browser.getAttribute(ARTIST_NAME + "@value").equals("The Velvet Underground"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "The Velvet Underground and Nico", "1967", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "White Light/White Heat", "1968", EMPTY_DISC_DESCRIPTION);
+
+ checkBandMember(1, "Lou Reed");
+ checkBandMember(2, "Sterling Morrison");
+ checkBandMember(3, "John Cale");
+ checkBandMember(4, "Maureen Tucker");
+ checkBandMember(5, "Nico");
+ }
+
+
+}
Added: trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/DiscsTest.java 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests artists management in SeamDiscs application
+ * @author Ondrej Skutka
+ *
+ */
+public class DiscsTest extends SeleniumSeamDiscsTest
+{
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.clickAndWait(MANAGE_DISCS);
+ }
+
+ @Test(dependsOnMethods = {"editDiscsTest"})
+ public void discPaginationTest()
+ {
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "", "Lou Reed");
+ }
+
+
+ @Test(dependsOnMethods = {"editDiscsTest"})
+ public void editDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "", "Lou Reed");
+
+ browser.type(DISC_DETAIL_DESCRIPTION, "A sensitive and revealing look into the prince of darkness.");
+
+ browser.clickAndWait(DISC_DETAIL_UPDATE);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test(dependsOnMethods = {"editDiscTest"})
+ public void addDiscTest()
+ {
+ browser.clickAndWait(CREATE_DISC_BUTTON);
+ browser.type(DISC_DETAIL_TITLE, "Berlin");
+ browser.select(DISC_DETAIL_ARTIST, "Lou Reed");
+ browser.type(DISC_DETAIL_RELEASE_DATE, "1973");
+ browser.type(DISC_DETAIL_DESCRIPTION, "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ browser.clickAndWait(DISC_DETAIL_PERSIST);
+ assertTrue("Cannot create disc", browser.isTextPresent("Successfully created"));
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.");
+ checkDisc(2, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(4, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+
+ @Test(dependsOnMethods = {"addDiscTest"})
+ public void removeDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Berlin");
+ checkDiscDetail("Berlin", "1973", "A tragic rock opera about a doomed couple that addresses themes of drug use and depression.", "Lou Reed");
+
+ browser.clickAndWait(DISC_DETAIL_REMOVE);
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+ @Test(dependsOnMethods = {"removeDiscTest"})
+ public void cancelDiscTest()
+ {
+ // correct Rock and Roll Heart description
+ findAndClickDisc("Rock and Roll Heart"); // should not be on the first page
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ browser.type(DISC_DETAIL_DESCRIPTION, "Pretty lame album.");
+
+ browser.clickAndWait(DISC_DETAIL_CANCEL);
+
+ findAndClickDisc("Rock and Roll Heart");
+ checkDiscDetail("Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.", "Lou Reed");
+
+ // check whether it's ok from the artists' perspective
+ browser.clickAndWait(MANAGE_ARTISTS);
+
+ findAndClickArtist("Lou Reed");
+
+ // check whether it is the Lou Reed
+ assertTrue("This artist is not Lou Reed!", browser.getAttribute(ARTIST_NAME + "@value").equals("Lou Reed"));
+
+ // check discs (they should be sorted by release date)
+ checkDisc(1, "Sally Can't Dance", "1974", EMPTY_DISC_DESCRIPTION);
+ checkDisc(2, "Metal Machine Music", "1975", EMPTY_DISC_DESCRIPTION);
+ checkDisc(3, "Rock and Roll Heart", "1976", "A sensitive and revealing look into the prince of darkness.");
+ }
+
+}
Added: trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/LoginTest.java 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import org.testng.annotations.Test;
+
+/**
+ * Basic test covering user authentication
+ * @author Jozef Hartinger
+ *
+ */
+public class LoginTest extends SeleniumSeamDiscsTest
+{
+
+ @Test(groups = {"loginTest"})
+ public void loginTest() {
+ assertTrue("Login failed.", isLoggedIn());
+ }
+
+ @Test(dependsOnMethods = {"loginTest"})
+ public void logoutTest() {
+ browser.clickAndWait(LOGOUT);
+ assertFalse("Logout failed.", isLoggedIn());
+ }
+
+
+}
Added: trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java
===================================================================
--- trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java (rev 0)
+++ trunk/src/test/ftest/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/selenium/SeleniumSeamDiscsTest.java 2009-02-23 15:40:57 UTC (rev 10076)
@@ -0,0 +1,232 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.seamdiscs.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.BeforeMethod;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+/**
+ *
+ * @author Ondrej Skutka
+ *
+ */
+public abstract class SeleniumSeamDiscsTest extends SeamSeleniumTest
+{
+ // TODO final
+ public static String LOGIN = "id=loginlink";
+ public static String LOGOUT = "id=logout";
+ public static String LOGIN_USERNAME = "id=login:username";
+ public static String LOGIN_PASSWORD = "id=login:password";
+ public static String LOGIN_LOGIN = "id=login:loginbutton";
+ public static String HOME_URL = "/home.seam";
+// public static String SECURITY = "id=security";
+//
+ public static String MANAGE_DISCS = "id=manageDiscs";
+ public static String CREATE_ARTIST_BUTTON = "id=addArtist";
+ public static String CREATE_BAND_BUTTON = "id=addBand";
+ public static String ARTIST_FILTER = "//form[1]//input[@type='text']";
+ public static String ARTIST_NAME = "id=artist:name";
+ public static String ARTIST_CREATE_DISC_BUTTON = "id=artist:addDisc";
+ public static String ARTIST_DESCRIPTION = "id=artist:description";
+ public static String ARTIST_PERSIST = "id=artist:persist";
+ public static String ARTIST_UPDATE = "id=artist:update";
+ public static String ARTIST_CANCEL = "id=artist:cancel";
+ public static String ARTIST_ADD_BAND_MEMBER = "id=artist:addBandMember";
+ public static String ARTIST_NTH_BAND_MEMBER = "xpath=id(\"artist\")//tr[1]//tr[3]/td[2]//ul/li[{0}]//input[@type=\"text\"]";
+ public static String ARTIST_LAST_BAND_MEMBER = MessageFormat.format(ARTIST_NTH_BAND_MEMBER, "last()");
+
+
+ public static String ARTIST_NTH_DISC = "xpath=id(\"artist:discs\")/table/tbody/tr/td/table/tbody/tr[{0}]";
+ public static String ARTIST_NTH_DISC_SHOW_DETAILS = ARTIST_NTH_DISC + "/td[1]/div/a[2]";
+ public static String ARTIST_NTH_DISC_NAME = ARTIST_NTH_DISC + "/td[2]/input";
+ public static String ARTIST_NTH_DISC_YEAR = ARTIST_NTH_DISC + "/td[3]//input";
+ public static String ARTIST_NTH_DISC_DETAIL = ARTIST_NTH_DISC + "/td";
+ public static String ARTISTS_FIRST_ARTIST_LINK = "xpath=id(\"artists\")//table/tbody/tr/td/table/tbody/tr[2]/td[2]/a";
+ public static String ARTISTS_NEXT_PAGE_LINK = "xpath=id(\"artists\")//td[1]//td[7]/a";
+ public static String ARTIST_TABLE_ROW_BY_NAME = "xpath=id(\"artists\")//tr[normalize-space(td/a/text())=\"{0}\"]";
+ // these locators can only be used catenated with ARTIST_TABLE_ROW_BY_NAME
+ public static String ARTIST_TABLE_ROW_LINK = ARTIST_TABLE_ROW_BY_NAME + "/td[2]/a";
+
+
+ public static String MANAGE_ARTISTS = "id=manageArtists";
+ public static String CREATE_DISC_BUTTON = "id=addDisc";
+ public static String DISC_DETAIL_TITLE = "xpath=id(\"disc\")//tr//tr[2]/td[2]/input";
+ public static String DISC_DETAIL_RELEASE_DATE = "xpath=id(\"disc\")//tr//tr[3]/td[2]//input";
+ public static String DISC_DETAIL_ARTIST = "xpath=id(\"disc\")//tr//tr[5]//select";
+ public static String DISC_DETAIL_DESCRIPTION = "id=description";
+ public static String DISC_DETAIL_UPDATE = "id=update";
+ public static String DISC_DETAIL_PERSIST = "id=persist";
+ public static String DISC_DETAIL_REMOVE = "id=remove";
+ public static String DISC_DETAIL_CANCEL = "id=cancel";
+ public static String DISCS_NEXT_PAGE_LINK = "xpath=id(\"discs\")//td[1]//td[7]/a";
+ public static String DISC_TABLE_ROW_BY_NAME = "xpath=id(\"discs\")//tr[normalize-space(td/a/text())=\"{0}\"]";
+ // these locators can only be used catenated with DISC_TABLE_ROW_BY_NAME
+ public static String DISC_TABLE_ROW_LINK = DISC_TABLE_ROW_BY_NAME + "/td[2]/a";
+
+ public static String EMPTY_DISC_DESCRIPTION = "None known";
+
+ public static String DEFAULT_USERNAME = "administrator";
+ public static String DEFAULT_PASSWORD = "administrator";
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ super.setUp();
+ browser.open(CONTEXT_PATH + HOME_URL);
+ login();
+ }
+
+ public void login() {
+ login(DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public void login(String username, String password) {
+ if (isLoggedIn()) {
+ fail("User already logged in.");
+ }
+ browser.clickAndWait(LOGIN);
+ browser.type(LOGIN_USERNAME, username);
+ browser.type(LOGIN_PASSWORD, password);
+ browser.clickAndWait(LOGIN_LOGIN);
+ }
+
+ protected boolean isLoggedIn()
+ {
+ return !browser.isElementPresent(LOGIN) && browser.isElementPresent(LOGOUT);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDisc(int tableRow, String expectedDiscTitle, String expectedReleaseDate, String expectedDescription) {
+ tableRow++; // first row is header
+ String actualDiscTitle = browser.getAttribute(MessageFormat.format(ARTIST_NTH_DISC_NAME, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedDiscTitle + ") album (" + actualDiscTitle + ")!", actualDiscTitle.equals(expectedDiscTitle));
+
+ String actualReleaseDate = "";
+ if (browser.isElementPresent(MessageFormat.format(ARTIST_NTH_DISC_YEAR, tableRow) + "/attribute::value")) {
+ actualReleaseDate = browser.getAttribute(MessageFormat.format(ARTIST_NTH_DISC_YEAR, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedReleaseDate + ") release date (" + actualReleaseDate + ")!", actualReleaseDate.equals(expectedReleaseDate));
+ }
+
+ browser.clickAndWait(MessageFormat.format(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ String actualDescription = browser.getText(MessageFormat.format(ARTIST_NTH_DISC_DETAIL, tableRow + 1));
+ assertTrue("This is not expected (" + expectedDescription + ") description (" + actualDescription + ")!", actualDescription.equals(expectedDescription));
+ browser.clickAndWait(MessageFormat.format(ARTIST_NTH_DISC_SHOW_DETAILS, tableRow));
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkDiscDetail(String expectedDiscTitle, String expectedReleaseDate, String expectedDescription, String expectedArtist) {
+ String actualDiscTitle = browser.getAttribute(DISC_DETAIL_TITLE + "@value");
+ assertTrue("This is not expected (" + expectedDiscTitle + ") album: (" + actualDiscTitle + ")!", actualDiscTitle.equals(expectedDiscTitle));
+
+ String actualReleaseDate = "";
+ if (browser.isElementPresent(DISC_DETAIL_RELEASE_DATE + "/attribute::value")) {
+ actualReleaseDate = browser.getAttribute(DISC_DETAIL_RELEASE_DATE + "@value");
+ assertTrue("This is not expected (" + expectedReleaseDate + ") release date: (" + actualReleaseDate + ")!", actualReleaseDate.equals(expectedReleaseDate));
+ }
+
+ String actualDescription = browser.getText(DISC_DETAIL_DESCRIPTION);
+ assertTrue("This is not expected (" + expectedDescription + ") description: (" + actualDescription + ")!", actualDescription.equals(expectedDescription));
+
+ String actualArtist = browser.getSelectedLabel(DISC_DETAIL_ARTIST);
+ assertTrue("This is not expected (" + expectedArtist + ") artist: (" + actualArtist + ")!", actualArtist.equals(expectedArtist));
+ }
+
+ /**
+ * Creates new disc.
+ * Expected to be on artist's edit page.
+ *
+ */
+ protected void createDisc(String title, String year) {
+ browser.clickAndWait(ARTIST_CREATE_DISC_BUTTON);
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_NAME, "last()"), title);
+ browser.type(MessageFormat.format(ARTIST_NTH_DISC_YEAR, "last()"), year);
+ }
+
+ /**
+ * Finds the specified artist in paginated artists page and clicks it.
+ * Expected to be on artists page.
+ *
+ */
+ protected void findAndClickArtist(String artistName) {
+ // find the artist's page (it's paginated) and click it
+ String expectedArtist = MessageFormat.format(ARTIST_TABLE_ROW_BY_NAME, artistName);
+ while (!browser.isElementPresent(expectedArtist)) { // click through pages
+ assertTrue("Artist " + artistName + " not found.", browser.isElementPresent(ARTISTS_NEXT_PAGE_LINK));
+ browser.click(ARTISTS_NEXT_PAGE_LINK); // ajax
+ sleep(3000);
+ }
+
+ browser.clickAndWait(MessageFormat.format(ARTIST_TABLE_ROW_LINK, artistName)); // click artist link
+ }
+
+ /**
+ * Finds the specified disc in paginated discs page and clicks it.
+ * Expected to be on discs page.
+ *
+ */
+ protected void findAndClickDisc(String discName) {
+ // find the disc page (it's paginated) and click it
+ String expectedDisc = MessageFormat.format(DISC_TABLE_ROW_BY_NAME, discName);
+ while (!browser.isElementPresent(expectedDisc)) { // click through pages
+ assertTrue("Disc " + discName + " not found.", browser.isElementPresent(DISCS_NEXT_PAGE_LINK));
+ browser.click(DISCS_NEXT_PAGE_LINK); // ajax
+ sleep(3000);
+ }
+
+ browser.clickAndWait(MessageFormat.format(DISC_TABLE_ROW_LINK, discName)); // click disc link
+ }
+
+ /**
+ * @param in milliseconds
+ *
+ */
+ protected void sleep(int milliseconds) {
+ try {
+ Thread.sleep(milliseconds); // TODO how to do this properly?
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ protected void addBandMember(String artistName) {
+ browser.clickAndWait(ARTIST_ADD_BAND_MEMBER);
+ browser.type(ARTIST_LAST_BAND_MEMBER, artistName);
+ }
+
+ /**
+ * Checks whether specified disc contains expected data.
+ */
+ protected void checkBandMember(int tableRow, String expectedBandMember) {
+ String actualMemberName = browser.getAttribute(MessageFormat.format(ARTIST_NTH_BAND_MEMBER, tableRow) + "@value");
+ assertTrue("This is not expected (" + expectedBandMember + ") album (" + actualMemberName + ")!", actualMemberName.equals(expectedBandMember));
+ }
+}
15 years, 2 months
Seam SVN: r10075 - branches/enterprise/JBPAPP_4_3_FP01/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-02-23 07:36:14 -0500 (Mon, 23 Feb 2009)
New Revision: 10075
Modified:
branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml
Log:
fixed exception in numberguess example, see JBSEAM-3254
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml 2009-02-23 10:53:40 UTC (rev 10074)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml 2009-02-23 12:36:14 UTC (rev 10075)
@@ -35,7 +35,7 @@
<displayName>JBoss Seam UI</displayName>
<shortName>s</shortName>
<tlibVersion>2.0</tlibVersion>
- <jspVersion>2.0</jspVersion>
+ <jspVersion>2.1</jspVersion>
</taglib>
</library>
</configuration>
15 years, 2 months
Seam SVN: r10074 - trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2009-02-23 05:53:40 -0500 (Mon, 23 Feb 2009)
New Revision: 10074
Modified:
trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties
Log:
JBSEAM-3690
Modified: trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
===================================================================
--- trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java 2009-02-23 09:21:40 UTC (rev 10073)
+++ trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java 2009-02-23 10:53:40 UTC (rev 10074)
@@ -24,6 +24,9 @@
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
import org.testng.annotations.Test;
import com.thoughtworks.selenium.Wait;
@@ -35,8 +38,11 @@
*/
public class SellTest extends SeleniumSeamBayTest
{
+
+ private NumberFormat nf = NumberFormat.getInstance();
+
@Test(dependsOnGroups={"searchTest"})
- public void joystickSellingTest()
+ public void joystickSellingTest() throws NumberFormatException, ParseException
{
String title = "Saitek X52 Pro Flight System";
int category = 7;
@@ -48,7 +54,7 @@
sellItem(title, category, subcategory, duration, price, description);
}
- protected void sellItem(String title, int category, int subcategory, String duration, String price, String description)
+ protected void sellItem(String title, int category, int subcategory, String duration, String price, String description) throws NumberFormatException, ParseException
{
login();
browser.clickAndWait(getProperty("SELL"));
@@ -76,7 +82,7 @@
@Override
public boolean until()
{
- return browser.isElementPresent(getProperty("SELL_CATEGORY_SELECT"));
+ return browser.isElementPresent(getProperty("SELL_CATEGORY_SELECT_SECOND_OPTION"));
}
};
browser.select(getProperty("SELL_CATEGORY_SELECT"), "index=" + category);
@@ -113,10 +119,10 @@
browser.clickAndWait(getProperty("SELL_NEXT"));
}
- protected void validatePreview(String price, String description)
+ protected void validatePreview(String price, String description) throws NumberFormatException, ParseException
{
assertTrue("Must be on preview page to validate preview.", browser.getLocation().contains(getProperty("SELL_PREVIEW_URL")));
- assertEquals("Unexpected price on preview page.", Double.valueOf(price), Double.valueOf(browser.getText(getProperty("SELL_PREVIEW_PRICE"))));
+ assertEquals("Unexpected price on preview page.", Double.valueOf(price), nf.parse(browser.getText(getProperty("SELL_PREVIEW_PRICE"))).doubleValue());
assertEquals("Unexpected description on description page.", description, browser.getText(getProperty("SELL_PREVIEW_DESCRIPTION")));
}
}
Modified: trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties
===================================================================
--- trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties 2009-02-23 09:21:40 UTC (rev 10073)
+++ trunk/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/seambay.properties 2009-02-23 10:53:40 UTC (rev 10074)
@@ -34,6 +34,7 @@
SELL_NEXT id=sellForm:next
SELL_CONFIRM id=sellForm:confirm
SELL_CATEGORY_SELECT id=rootCategory
+SELL_CATEGORY_SELECT_SECOND_OPTION xpath=id(\"rootCategory\")/option[2] # availability of second option indicates that category list has been loaded
SELL_SUBCATEGORY_SELECT id\=tier2
SEARCH_FIELD id=search:searchTerm
15 years, 2 months
Seam SVN: r10073 - trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2009-02-23 04:21:40 -0500 (Mon, 23 Feb 2009)
New Revision: 10073
Modified:
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
Log:
JBSEAM-3690 dvdstore test browser-compatibility fix
Modified: trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java 2009-02-22 21:37:46 UTC (rev 10072)
+++ trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SearchTest.java 2009-02-23 09:21:40 UTC (rev 10073)
@@ -58,20 +58,18 @@
/**
* This test does simple search in two windows verifying they do not affect
* each other
+ * @throws InterruptedException
*/
@Test(dependsOnMethods = { "testSearch" }, dependsOnGroups = { "login.basic" })
- public void testMultipleWindowSearch() {
+ public void testMultipleWindowSearch() throws InterruptedException {
String searchString1 = "Forrest Gump";
String searchString2 = "The Shawshank Redemption";
browser.openWindow(CONTEXT_PATH + getProperty("HOME_PAGE"), "1");
browser.selectWindow("1");
- browser.waitForPageToLoad(TIMEOUT);
+ Thread.sleep(10000); // ugly but turned out to be the most browser-compatible solution
assertTrue("User should be logged in by now.", isLoggedIn(browser));
- // search for dvd in first window
- browser.openWindow(CONTEXT_PATH + getProperty("HOME_PAGE"), "2");
- browser.selectWindow("2");
- browser.waitForPageToLoad(TIMEOUT);
+ browser.selectWindow(null); // select main window
assertTrue("User should be logged in by now.", isLoggedIn(browser));
browser.click(getProperty("SHOP"));
browser.waitForPageToLoad(TIMEOUT);
@@ -91,7 +89,7 @@
assertEquals("Unexpected search result in second window.",
searchString2, browser
.getText(getProperty("SEARCH_RESULT_FIRST_ROW_LINK")));
- browser.selectWindow("2");
+ browser.selectWindow(null);
browser.refresh();
browser.waitForPageToLoad(TIMEOUT);
assertEquals("Unexpected search result in first window after refresh.",
Modified: trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java
===================================================================
--- trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java 2009-02-22 21:37:46 UTC (rev 10072)
+++ trunk/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/ShoppingCartTest.java 2009-02-23 09:21:40 UTC (rev 10073)
@@ -27,9 +27,6 @@
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.text.ParseException;
-import java.util.Currency;
-import java.util.Locale;
-
import org.testng.annotations.Test;
/**
@@ -40,6 +37,8 @@
*
*/
public class ShoppingCartTest extends SeleniumDvdTest {
+
+ private NumberFormat nf = NumberFormat.getNumberInstance();
@Test(dependsOnGroups = { "search" })
public void simpleCartTest() {
@@ -60,8 +59,6 @@
@Test(dependsOnMethods = { "simpleCartTest" })
public void testCartCostCalculation() throws ParseException {
String[] dvds = new String[] { "Top Gun", "Pulp Fiction", "Top Gun" };
- NumberFormat nf = NumberFormat.getCurrencyInstance();
- nf.setCurrency(Currency.getInstance(Locale.US));
BigDecimal expectedSum = BigDecimal.ZERO;
for (String dvd : dvds) {
addDVDToCart(dvd);
@@ -72,18 +69,14 @@
.intValue();
assertNotSame("Cart should not be empty.", 0, items);
for (int i = 0; i < items; i++) {
- BigDecimal quantity = BigDecimal.valueOf(Double.parseDouble(browser
- .getValue(MessageFormat.format(
- getProperty("CART_TABLE_QUANTITY_BY_ID"), i))));
- BigDecimal price = BigDecimal.valueOf(nf.parse(
- browser.getText(MessageFormat.format(
- getProperty("CART_TABLE_PRICE_BY_ID"), i)))
- .doubleValue());
+ BigDecimal quantity = parseBalance(browser.getValue(MessageFormat.format(
+ getProperty("CART_TABLE_QUANTITY_BY_ID"), i)));
+ BigDecimal price = parseBalance(browser.getText(MessageFormat.format(
+ getProperty("CART_TABLE_PRICE_BY_ID"), i)));
BigDecimal priceForCurrentRow = price.multiply(quantity);
expectedSum = expectedSum.add(priceForCurrentRow);
}
- BigDecimal actualSum = BigDecimal.valueOf((nf.parse(browser
- .getText(getProperty("CART_SUBTOTAL"))).doubleValue()));
+ BigDecimal actualSum = parseBalance(browser.getText(getProperty("CART_SUBTOTAL")));
assertEquals("Price sum in cart is incorrect.", 0, expectedSum
.compareTo(actualSum));
}
@@ -144,4 +137,9 @@
browser.click(getProperty("SEARCH_RESULT_UPDATE_BUTTON"));
browser.waitForPageToLoad(TIMEOUT);
}
+
+ private BigDecimal parseBalance(String text) throws ParseException {
+ String number = text.replaceAll("\\$", "").trim();
+ return BigDecimal.valueOf(nf.parse(number).doubleValue());
+ }
}
15 years, 2 months
Seam SVN: r10072 - in trunk: examples/excel/view and 2 other directories.
by seam-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-02-22 16:37:46 -0500 (Sun, 22 Feb 2009)
New Revision: 10072
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
trunk/examples/excel/view/home.xhtml
trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
trunk/src/excel/org/jboss/seam/excel/css/ColumnStyle.java
trunk/src/excel/org/jboss/seam/excel/css/Parser.java
trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
trunk/src/excel/org/jboss/seam/excel/exporter/ExcelExporter.java
Log:
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2009-02-22 21:37:46 UTC (rev 10072)
@@ -2997,6 +2997,16 @@
</para>
</entry>
</row>
+ <row>
+ <entry valign="top">
+ <para>xls-column-export</para>
+ </entry>
+ <entry valign="top">
+ <para>
+ Should the column be shown in export? Valid values are "true" and "false". Default is "true".
+ </para>
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Modified: trunk/examples/excel/view/home.xhtml
===================================================================
--- trunk/examples/excel/view/home.xhtml 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/examples/excel/view/home.xhtml 2009-02-22 21:37:46 UTC (rev 10072)
@@ -54,6 +54,12 @@
</f:facet>
<h:outputText value="#{person.task}" />
</rich:column>
+ <rich:column style="xls-column-export:false">
+ <f:facet name="header">
+ <h:outputText value="Hide in export" style="xls-font: red bold" />
+ </f:facet>
+ <h:outputText value="Details" />
+ </rich:column>
</rich:dataTable>
<h:commandLink value="Export table as Excel spreadsheet"
rendered="#{!empty excelTest.result}"
Modified: trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2009-02-22 21:37:46 UTC (rev 10072)
@@ -53,5 +53,6 @@
public static final String COLUMN_WIDTHS = "xls-column-widths";
public static final String COLUMN_AUTO_SIZE = "xls-column-autosize";
public static final String COLUMN_HIDDEN = "xls-column-hidden";
+ public static final String COLUMN_EXPORT = "xls-column-export";
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/ColumnStyle.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/ColumnStyle.java 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/src/excel/org/jboss/seam/excel/css/ColumnStyle.java 2009-02-22 21:37:46 UTC (rev 10072)
@@ -12,10 +12,12 @@
public Boolean autoSize;
public Boolean hidden;
public Integer width;
+ public Boolean export;
public ColumnStyle(Map<String, Object> styleMap) {
autoSize = (Boolean) styleMap.get(CSSNames.COLUMN_AUTO_SIZE);
hidden = (Boolean) styleMap.get(CSSNames.COLUMN_HIDDEN);
width = (Integer) styleMap.get(CSSNames.COLUMN_WIDTH);
+ export = (Boolean) styleMap.get(CSSNames.COLUMN_EXPORT);
}
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/Parser.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/Parser.java 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/src/excel/org/jboss/seam/excel/css/Parser.java 2009-02-22 21:37:46 UTC (rev 10072)
@@ -138,6 +138,7 @@
propertyBuilders.put(CSSNames.COLUMN_WIDTH, new PropertyBuilders.ColumnWidth());
propertyBuilders.put(CSSNames.COLUMN_AUTO_SIZE, new PropertyBuilders.ColumnAutoSize());
propertyBuilders.put(CSSNames.COLUMN_HIDDEN, new PropertyBuilders.ColumnHidden());
+ propertyBuilders.put(CSSNames.COLUMN_EXPORT, new PropertyBuilders.ColumnExport());
propertyBuilders.put(CSSNames.COLUMN_WIDTHS, new PropertyBuilders.ColumnWidths());
propertyBuilders.put(CSSNames.FORCE_TYPE, new PropertyBuilders.ForceType());
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2009-02-22 21:37:46 UTC (rev 10072)
@@ -49,6 +49,10 @@
public static class ColumnHidden extends BooleanPropertyBuilder
{
}
+
+ public static class ColumnExport extends BooleanPropertyBuilder
+ {
+ }
public static class BorderBottomLineStyle extends StringPropertyBuilder
{
Modified: trunk/src/excel/org/jboss/seam/excel/exporter/ExcelExporter.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/exporter/ExcelExporter.java 2009-02-22 18:52:29 UTC (rev 10071)
+++ trunk/src/excel/org/jboss/seam/excel/exporter/ExcelExporter.java 2009-02-22 21:37:46 UTC (rev 10072)
@@ -13,6 +13,7 @@
import javax.faces.context.FacesContext;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
@@ -25,6 +26,7 @@
import org.jboss.seam.excel.ExcelWorkbook;
import org.jboss.seam.excel.ExcelWorkbookException;
import org.jboss.seam.excel.css.CSSNames;
+import org.jboss.seam.excel.css.ColumnStyle;
import org.jboss.seam.excel.css.Parser;
import org.jboss.seam.excel.css.StyleMap;
import org.jboss.seam.excel.ui.ExcelComponent;
@@ -43,6 +45,7 @@
*/
@Name("org.jboss.seam.excel.exporter.excelExporter")
@Scope(ScopeType.EVENT)
+@Install(precedence = Install.BUILT_IN)
@BypassInterceptors
public class ExcelExporter
{
@@ -75,6 +78,8 @@
{
excelWorkbook = ExcelFactory.instance().getExcelWorkbook(type);
+ Parser parser = new Parser();
+
// Gets the datatable
UIData dataTable = (UIData) FacesContext.getCurrentInstance().getViewRoot().findComponent(dataTableId);
if (dataTable == null)
@@ -101,10 +106,15 @@
int col = 0;
for (javax.faces.component.UIColumn column : columns)
{
- uiWorksheet.getChildren().add(column);
- Iterator iterator = UIWorksheet.unwrapIterator(dataTable.getValue());
- processColumn(column, iterator, dataTableVar, col++);
- excelWorkbook.nextColumn();
+ ColumnStyle columnStyle = new ColumnStyle(parser.getCascadedStyleMap(column));
+ boolean cssExport = columnStyle.export == null || columnStyle.export;
+ if (column.isRendered() && cssExport)
+ {
+ uiWorksheet.getChildren().add(column);
+ Iterator iterator = UIWorksheet.unwrapIterator(dataTable.getValue());
+ processColumn(column, iterator, dataTableVar, col++);
+ excelWorkbook.nextColumn();
+ }
}
// Restores the data table var
15 years, 2 months
Seam SVN: r10071 - trunk/src/excel/org/jboss/seam/excel/csv.
by seam-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-02-22 13:52:29 -0500 (Sun, 22 Feb 2009)
New Revision: 10071
Modified:
trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
Log:
JBSEAM-3949
Modified: trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java 2009-02-22 10:53:11 UTC (rev 10070)
+++ trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java 2009-02-22 18:52:29 UTC (rev 10071)
@@ -30,15 +30,25 @@
private int maxColumn = 0;
private int sheetStartRow = 0;
- private final String COLUMN_DELIMITER = "\"";
- private final String LINEBREAK = "\n";
- private final String COMMA = ",";
+ private final static String DEFAULT_COLUMN_DELIMITER = "\"";
+ private final static String DEFAULT_LINEBREAK = "\n";
+ private final static String DEFAULT_COLUMN_SEPERATOR = ",";
private Map<String, String> table = null;
private String sheetName = null;
private Log log = Logging.getLog(getClass());
+ protected String getColumnDelimeter() {
+ return DEFAULT_COLUMN_DELIMITER;
+ }
+ protected String getLineBreak() {
+ return DEFAULT_LINEBREAK;
+ }
+ protected String getColumnSeparator() {
+ return DEFAULT_COLUMN_SEPERATOR;
+ }
+
public void createWorkbook(UIWorkbook uiWorkbook) throws ExcelWorkbookException
{
table = new HashMap<String, String>();
@@ -73,10 +83,10 @@
{
String value = table.get(hash(i, j));
value = (value == null) ? "" : value;
- buffer.append(COLUMN_DELIMITER).append(value).append(COLUMN_DELIMITER).append(COMMA);
+ buffer.append(getColumnDelimeter()).append(value).append(getColumnDelimeter()).append(getColumnSeparator());
}
buffer.deleteCharAt(buffer.length() - 1);
- buffer.append(LINEBREAK);
+ buffer.append(getLineBreak());
}
return buffer.toString().getBytes();
@@ -138,7 +148,7 @@
private String hash(int row, int column)
{
StringBuffer buffer = new StringBuffer();
- buffer.append(row).append(COMMA).append(column);
+ buffer.append(row).append(getColumnSeparator()).append(column);
return buffer.toString();
}
15 years, 2 months