Seam SVN: r10917 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: milesif
Date: 2009-05-16 13:30:12 -0400 (Sat, 16 May 2009)
New Revision: 10917
Modified:
branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Webservices.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Webservices.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Webservices.po 2009-05-15 20:24:14 UTC (rev 10916)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Webservices.po 2009-05-16 17:30:12 UTC (rev 10917)
@@ -6,8 +6,8 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-05-10 10:19+0000\n"
-"PO-Revision-Date: 2009-05-10 12:27+0100\n"
-"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
+"PO-Revision-Date: 2009-05-16 17:46+0100\n"
+"Last-Translator: Francesco Milesi <milesif(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -125,13 +125,13 @@
#: Webservices.xml:39
#, no-c-format
msgid "As you can see in the above SOAP message, there is a <literal>conversationId</literal> element within the SOAP header that contains the conversation ID for the request, in this case <literal>2</literal>. Unfortunately, because web services may be consumed by a variety of web service clients written in a variety of languages, it is up to the developer to implement conversation ID propagation between individual web services that are intended to be used within the scope of a single conversation."
-msgstr ""
+msgstr "Come si può vedere nel messaggio SOAP sovrastante, dentro l'header SOAP c'è un elemento <literal>conversationId</literal> che contiene l'ID della conversazione di appartenenza della richiesta, in questo caso <literal>2</literal>. Purtroppo, poiché i web services possono essere utilizzati da una varietà di client scritti in diversi linguaggi, spetta allo sviluppatore implementare la propagazione dell'ID della conversazione tra i distinti web service che si intende usare nell'ambito di una singola conversazione."
#. Tag: para
#: Webservices.xml:47
#, no-c-format
msgid "An important thing to note is that the <literal>conversationId</literal> header element must be qualified with a namespace of <literal>http://www.jboss.org/seam/webservice</literal>, otherwise Seam will not be able to read the conversation ID from the request. Here's an example of a response to the above request message:"
-msgstr ""
+msgstr "E' importante notare che l'elemento <literal>conversationId</literal> dell'header deve essere qualificato con il namespace <literal>http://www.jboss.org/seam/webservice</literal>, altrimenti Seam non sarà in grado di leggere l'ID della conversazione dalla richiesta. Ecco un esempio di una risposta al messagio della richiesta di cui sopra:"
#. Tag: programlisting
#: Webservices.xml:53
@@ -161,7 +161,7 @@
#: Webservices.xml:55
#, no-c-format
msgid "As you can see, the response message contains the same <literal>conversationId</literal> element as the request."
-msgstr ""
+msgstr "Come si può vedere, il messaggio di risposta contiene lo stesso elemento <literal>conversationId</literal> della richiesta."
#. Tag: title
#: Webservices.xml:60
@@ -169,17 +169,18 @@
msgid "A Recommended Strategy"
msgstr "Una strategia raccomandata"
+# facade=interfaccia? (non è lo stesso....)
#. Tag: para
#: Webservices.xml:62
#, no-c-format
msgid "As web services must be implemented as either a stateless session bean or POJO, it is recommended that for conversational web services, the web service acts as a facade to a conversational Seam component."
-msgstr ""
+msgstr "Dal momento che i web service devono essere implementati come stateless session bean oppure come POJO, per web service conversazionali si raccomanda che fungano da facade ad un componente Seam conversazionale."
#. Tag: para
#: Webservices.xml:76
#, no-c-format
msgid "If the web service is written as a stateless session bean, then it is also possible to make it a Seam component by giving it a <literal>@Name</literal>. Doing this allows Seam's bijection (and other) features to be used in the web service class itself."
-msgstr ""
+msgstr "Se il web service è scritto come session bean stateless, allora è pure possibile farlo diventare un componente Seam dandogli un nome, <literal>@Name</literal>. Ciò abilita la bijection di Seam ed altre caratteristiche che possono essere utilizzate nella classe stessa del web service."
#. Tag: title
#: Webservices.xml:87
@@ -191,7 +192,7 @@
#: Webservices.xml:89
#, no-c-format
msgid "Let's walk through an example web service. The code in this section all comes from the seamBay example application in Seam's <literal>/examples</literal> directory, and follows the recommended strategy as described in the previous section. Let's first take a look at the web service class and one of its web service methods:"
-msgstr ""
+msgstr "Esaminiamo un web service di esempio. Il codice di questa sezione proviene tutto dall'applicazione di esempio seamBay nella directory <literal>/examples</literal> di Seam, e segue la strategia raccomandata nella precedente sezione. Diamo innanzitutto un'occhiata alla classe del web service e a uno dei suoi metodi esposti come web service:"
#. Tag: programlisting
#: Webservices.xml:96
@@ -233,25 +234,25 @@
#: Webservices.xml:98
#, no-c-format
msgid "As you can see, our web service is a stateless session bean, and is annotated using the JWS annotations from the <literal>javax.jws</literal> package, as defined by JSR-181. The <literal>@WebService</literal> annotation tells the container that this class implements a web service, and the <literal>@WebMethod</literal> annotation on the <literal>login()</literal> method identifies the method as a web service method. The <literal>name</literal> and <literal>serviceName</literal> attributes in the <literal>@WebService</literal> annotation are optional."
-msgstr ""
+msgstr "Come si può notare, il nostro web service è un session bean stateless, ed è annotato usando l'annotazione JWS del package <literal>javax.jws</literal>, come specificato dalla JSR-181. L'annotazione <literal>@WebService</literal> comunica al container che questa classe implementa un web service, e l'annotazione <literal>@WebMethod</literal> sul metodo <literal>login()</literal> lo identifica come metodo di tipo web service. Gli attributi <literal>name</literal> e <literal>serviceName</literal> dell'annotazione <literal>@WebService</literal> sono opzionali."
#. Tag: para
#: Webservices.xml:107
#, no-c-format
msgid "As is required by the specification, each method that is to be exposed as a web service method must also be declared in the remote interface of the web service class (when the web service is a stateless session bean). In the above example, the <literal>AuctionServiceRemote</literal> interface must declare the <literal>login()</literal> method as it is annotated as a <literal>@WebMethod</literal>."
-msgstr ""
+msgstr "Come richiesto dalle specifiche, ogni metodo che deve essere esposto come web service deve essere dichiarato anche nell'interfaccia remota della classe del web service (quando il web service è un session bean stateless). Nell'esempio suddetto, l'interfaccia <literal>AuctionServiceRemote</literal> deve dichiarare il metodo <literal>login()</literal> poiché esso è annotato come <literal>@WebMethod</literal>."
#. Tag: para
#: Webservices.xml:114
#, no-c-format
msgid "As you can see in the above code, the web service implements a <literal>login()</literal> method that delegates to Seam's built-in <literal>Identity</literal> component. In keeping with our recommended strategy, the web service is written as a simple facade, passing off the real work to a Seam component. This allows for the greatest reuse of business logic between web services and other clients."
-msgstr ""
+msgstr "Come si può notare nel codice sovrastante, il web service implementa un metodo <literal>login()</literal> che delega l'esecuzione al componente <literal>Identity</literal> di Seam. Attenendoci alla strategia da noi raccomandata, il web service è scritto come un semplice facade, che inoltra il lavoro vero e proprio ad un componente Seam. Questo permette il massimo riutilizzo di business logic tra web service e altri clients."
#. Tag: para
#: Webservices.xml:121
#, no-c-format
msgid "Let's look at another example. This web service method begins a new conversation by delegating to the <literal>AuctionAction.createAuction()</literal> method:"
-msgstr ""
+msgstr "Vediamo un altro esempio. Questo metodo web service inizia una nuova conversazione delelgando l'esecuzione al metodo <literal>AuctionAction.createAuction()</literal>:"
#. Tag: programlisting
#: Webservices.xml:126
@@ -277,7 +278,7 @@
#: Webservices.xml:128
#, no-c-format
msgid "And here's the code from <literal>AuctionAction</literal>:"
-msgstr ""
+msgstr "Ed ecco il codice di <literal>AuctionAction</literal>:"
#. Tag: programlisting
#: Webservices.xml:132
@@ -305,7 +306,7 @@
#: Webservices.xml:134
#, no-c-format
msgid "From this we can see how web services can participate in long running conversations, by acting as a facade and delegating the real work to a conversational Seam component."
-msgstr ""
+msgstr "Da ciò si può notare come i web service possano partecipare a conversazioni long running, svolgendo il ruolo di facade e delegando il vero lavoro a un componente Seam conversazionale."
#. Tag: title
#: Webservices.xml:142
@@ -317,67 +318,67 @@
#: Webservices.xml:144
#, no-c-format
msgid "Seam integrates the RESTEasy implementation of the JAX-RS specification (JSR 311). You can decide how \"deep\" the integration into your Seam application is going to be:"
-msgstr ""
+msgstr "Seam integra l'implementazone RESTEasy delle specifiche JAX-RS (JSR 311). E' possibile decidere quanto l'integrazione alla vostra applicazione debba spingersi in profondità:"
#. Tag: para
#: Webservices.xml:151
#, no-c-format
msgid "Seamless integration of RESTEasy bootstrap and configuration, automatic detection of resources and providers."
-msgstr ""
+msgstr "Integrazione trasparente della configurazione e del bootstrap RESTEasy, rilevamento automatico di risorse e providers."
#. Tag: para
#: Webservices.xml:157
#, no-c-format
msgid "Serving HTTP/REST requests with the SeamResourceServlet, no external servlet or configuration in web.xml required."
-msgstr ""
+msgstr "Gestione di richieste HTTP/REST con SeamResourceServlet, senza richiedere alcuna configurazione del servlet esterna o nel file web.xml."
#. Tag: para
#: Webservices.xml:163
#, no-c-format
msgid "Writing resources as Seam components, with full Seam lifecycle management and interception (bijection)."
-msgstr ""
+msgstr "Scrivere risorse come componenti Seam, con gestione completa del ciclo di vita e della interception (biJection) di Seam."
#. Tag: title
#: Webservices.xml:170
#, no-c-format
msgid "RESTEasy configuration and request serving"
-msgstr ""
+msgstr "Configurazione RESTEasy e gestione delle richieste"
#. Tag: para
#: Webservices.xml:172
#, no-c-format
msgid "First, get the RESTEasy libraries and the <literal>jaxrs-api.jar</literal>, deploy them with the other libraries of your application. Also deploy the integration library, <literal>jboss-seam-resteasy.jar</literal>."
-msgstr ""
+msgstr "Innanzitutto, si prendano le librerie RESTEasy e <literal>jaxrs-api.jar</literal>, e le si installi con le altre librerie della vostra applicazione. Si installi anche la libreria di integrazione, <literal>jboss-seam-resteasy.jar</literal>."
#. Tag: para
#: Webservices.xml:178
#, no-c-format
msgid "On startup, all classes annotated <literal>@javax.ws.rs.Path</literal> will be discovered automatically and registered as HTTP resources. Seam automatically accepts and serves HTTP requests with its built-in <literal>SeamResourceServlet</literal>. The URI of a resource is build as follows:"
-msgstr ""
+msgstr "All'avvio, saranno automaticamente individuate e registrate come risorse HTTP tutte le classi annotate con <literal>@javax.ws.rs.Path</literal>. Seam accetta e gestisce automaticamente richieste HTTP col proprio componente <literal>SeamResourceServlet</literal>. L'URI di una risorsa è costruito come segue:"
#. Tag: para
#: Webservices.xml:186
#, no-c-format
msgid "The URI starts with the pattern mapped in <literal>web.xml</literal> for the <literal>SeamResourceServlet</literal>, e.g <literal>/seam/resource</literal> if you follow the common examples. Change this setting to expose your RESTful resources under a different base. Note that this is a global change and other Seam resources (e.g. <literal>s:graphicImage</literal>) are then also served under that base path."
-msgstr ""
+msgstr "L'URI inizia con il pattern mappato in <literal>web.xml</literal> per il servlet <literal>SeamResourceServlet</literal>, ad esempio <literal>/seam/resource</literal>, se si seguono gli esempi comuni. Modificate questa impostazione per esporre le risorse RESTful con un diverso percorso di base. Si noti che questo cambiamento è globale e anche altre risorse Seam (ad esempio <literal>s:graphicImage</literal>) saranno servite sotto questo percorso di base."
#. Tag: para
#: Webservices.xml:195
#, no-c-format
msgid "The RESTEasy integration for Seam then appends a configurable string to the base path, by default this is <literal>/rest</literal>. Hence, the full base path of your resources would e.g. be <literal>/seam/resource/rest</literal>. We recommend that you change this string in your application, you could for example add a version number to prepare for a future REST API upgrade of your services (old clients would keep the old URI base): <literal>/seam/resource/restv1</literal>."
-msgstr ""
+msgstr "L'integratzione RESTEasy di Seam appende allora una stringa configurabile al percorso base, di default <literal>/rest</literal>. Quindi, il percorso completo delle risorse sarebbe, ad esempio, <literal>/seam/resource/rest</literal>. Si raccomanda di modificare questa stringa nella vostra applicazione. Ad esempio, si potrebbe aggiungere un numero di versione per prepararsi a futuri aggiornamenti di versione delle API REST dei vostri servizi (i vecchi client manterrebbero il vecchio URI di base): <literal>/seam/resource/restv1</literal>."
#. Tag: para
#: Webservices.xml:204
#, no-c-format
msgid "Finally, the actual resource is available under the defined <literal>@Path</literal>, e.g. a resource mapped with <literal>@Path(\"/customer\")</literal> would be available under <literal>/seam/resource/rest/customer</literal>."
-msgstr ""
+msgstr "Infine, la risorsa vera e propria è disponibile sotto il<literal>@Path</literal> definito, ad esempio una risorsa mappata con <literal>@Path(\"/customer\")</literal> sarebbe raggiungibile sotto <literal>/seam/resource/rest/customer</literal>."
#. Tag: para
#: Webservices.xml:212
#, no-c-format
msgid "As an example, the following resource definition would return a plaintext representation for any GET requests using the URI <literal>http://your.hostname/seam/resource/rest/customer/123</literal>:"
-msgstr ""
+msgstr "Come esempio, la seguente definizione di risorsa restituirebbe una rappresentazione puramente testuale for ogni richiesta GET diretta all'URI <literal>http://your.hostname/seam/resource/rest/customer/123</literal>:"
#. Tag: programlisting
#: Webservices.xml:217
@@ -411,7 +412,7 @@
#: Webservices.xml:219
#, no-c-format
msgid "No additional configuration is required, you do not have to edit <literal>web.xml</literal> or any other setting if these defauls are acceptable. However, you can configure RESTEasy in your Seam application. First import the <literal>resteasy</literal> namespace into your XML configuration file header:"
-msgstr ""
+msgstr "Non è richiesta alcuna configurazione addizionale, non è necessario editare il file <literal>web.xml</literal> o nessun altra configurazione se questi valori di default sono accettabili. Comunque, è possibile procedere alla configurazione RESTEasy in un'applicazione Seam. Innanzitutto, occorre importare il namespace <literal>resteasy</literal> nell'header del file di configurazione XML:"
#. Tag: programlisting
#: Webservices.xml:225
@@ -441,7 +442,7 @@
#: Webservices.xml:227
#, no-c-format
msgid "You can then change the <literal>/rest</literal> prefix as mentioned earlier:"
-msgstr ""
+msgstr "Allora è possibile modificare il prefisso <literal>/rest</literal> come accennato in precedenza:"
#. Tag: programlisting
#: Webservices.xml:231
@@ -453,13 +454,14 @@
#: Webservices.xml:233
#, no-c-format
msgid "The full base path to your resources is now <literal>/seam/resource/restv1/{resource}</literal> - note that your <literal>@Path</literal> definitions and mappings do NOT change. This is an application-wide switch usually used for versioning of the HTTP API."
-msgstr ""
+msgstr "Il percorso completa alle risorse è ora <literal>/seam/resource/restv1/{resource}</literal> - si noti che che le definizioni e le mappature di tipo path <literal>@Path</literal> NON cambiano. Questo è uno \"switch\" a livello di applicazione di solito usato per la gestione delle versioni delle API HTTP."
+# troncamento??? ritaglio....
#. Tag: para
#: Webservices.xml:239
#, no-c-format
msgid "You can disable stripping of the base path if you'd like to map the full path in your resources:"
-msgstr ""
+msgstr "E' possibile disabilitare il troncamento del percorso base, qualora nelle risorse si voglia mappare il percorso completo:"
#. Tag: programlisting
#: Webservices.xml:243
@@ -471,13 +473,13 @@
#: Webservices.xml:245
#, no-c-format
msgid "The path of a resource is now mapped with e.g. <literal>@Path(\"/seam/resource/rest/customer\")</literal>. We do not recommend disabling this feature, as your resource class mappings are then bound to a particular deployment scenario."
-msgstr ""
+msgstr "Il percorso di una risorsa è ora mappato, per esempio, con <literal>@Path(\"/seam/resource/rest/customer\")</literal>. Non è raccomandabile disabilitare questa caratteristica, poiché le mappature delle classi delle risorse risulta allora legato al particolare scenario di deploy."
#. Tag: para
#: Webservices.xml:251
#, no-c-format
msgid "Seam will scan your classpath for any deployed <literal>@javax.ws.rs.Path</literal> resources and any <literal>@javax.ws.rs.ext.Provider</literal> classes. You can disable scanning and configure these classes manually:"
-msgstr ""
+msgstr "Seam scandaglierà il classpath alla ricerca delle risorsa <literal>@javax.ws.rs.Path</literal> e di ogni classe <literal>@javax.ws.rs.ext.Provider</literal>. E' possibile disabilitare la ricerca e configurare queste classi manualmente:"
#. Tag: programlisting
#: Webservices.xml:257
@@ -517,23 +519,27 @@
"\n"
" </resteasy:application>]]>"
+# interni, precostituiti=built-in???
+# marshalling=serializzazione, invio???
#. Tag: para
#: Webservices.xml:259
#, no-c-format
msgid "The <literal>use-built-in-providers</literal> switch enables (default) or disables the RESTEasy built-in providers. We recommend you leave them enabled, as they provide plaintext, JSON, and JAXB marshalling out of the box."
-msgstr ""
+msgstr "L'interruttore <literal>use-built-in-providers</literal> abilita (default) o disabilita i providers RESTEasy precostituiti. Si raccomanda di lasciarli abilitati, poiché essi forniscono automaticamente la gestione del \"marshalling\" testuale, JSON, and JAXB."
+# Seam <literal>jndi-pattern</literal> su <literal><core:init/></literal>????????????
#. Tag: para
#: Webservices.xml:265
#, no-c-format
msgid "RESTEasy supports plain EJBs (EJBs that are not Seam components) as resources. Instead of configuring the JNDI names in a non-portable fashion in <literal>web.xml</literal> (see RESTEasy documentation), you can simply list the EJB implementation classes, not the business interfaces, in <literal>components.xml</literal> as shown above. Note that you have to annotate the <literal>@Local</literal> interface of the EJB with <literal>@Path</literal>, <literal>@GET</literal>, and so on - not the bean implementation class. This allows you to keep your application deployment-portable with the global Seam <literal>jndi-pattern</literal> switch on <literal><core:init/></literal>. Note that EJB resources will not be found even if scanning of resources is enabled, you always have to list them manually. Again, this is only relevant for EJB resources that are not also Seam components and that do not have a <literal>@Name</literal> annotation."
-msgstr ""
+msgstr "RESTEasy supporta gli EJB semplici (EJB che non sono componenti Seam) alla stregua di risorse. Invece di configurare i nomi JNDI in modo non portabile nel file<literal>web.xml</literal> (si veda la documentazione RESTEasy), è possibile elencare semplicemente le classi di implementazione degli EJB, non le interfacce di business, nel file <literal>components.xml</literal>, come mostrato sopra. Si noti che si deve annotare l'interfaccia <literal>@Local</literal> dell'EJB con <literal>@Path</literal>, <literal>@GET</literal>, e così via - non la classe di implementazionedel bean. Ciò permette di mantenere l'applicazione portabile rispetto al tipo di deploy con lo switch globale di Seam <literal>jndi-pattern</literal> su <literal><core:init/></literal>. Si noti che le risorse EJB non verrano trovate anche se la ricerca delle risorse è abilitata, bisogna sempre elencarle manualmente. Di nuovo, ciò è rilevante solo per risorse EJB che non sono anche componenti !
Seam e che non hanno l'annotazione <literal>@Name</literal>."
+# verificare, molto aprossimativo
#. Tag: para
#: Webservices.xml:277
#, no-c-format
msgid "Finally, you can configure media type and language URI extensions:"
-msgstr ""
+msgstr "Infine, è possibile configurare le estensioni degli URI dei tipi di media e dei linguaggi:"
#. Tag: programlisting
#: Webservices.xml:281
@@ -563,11 +569,12 @@
"\n"
"</resteasy:application>]]>"
+# VERIFICARE
#. Tag: para
#: Webservices.xml:283
#, no-c-format
msgid "This definition would map the URI suffix of <literal>.txt.deutsch</literal> to additional <literal>Accept</literal> and <literal>Accept-Language</literal> header values <literal>text/plain</literal> and <literal>de-DE</literal>."
-msgstr ""
+msgstr "Questa definizione mapperebbe il suffisso dell'URI di <literal>.txt.deutsch</literal> sui valori aggiuntivi <literal>text/plain</literal> and <literal>de-DE</literal> ripettivamente degli header <literal>Accept</literal> e <literal>Accept-Language</literal>."
#. Tag: title
#: Webservices.xml:292
@@ -579,13 +586,13 @@
#: Webservices.xml:294
#, no-c-format
msgid "Any resource and provider instances are managed by RESTEasy by default. That means a resource class will be instantiated by RESTEasy and serve a single request, after which it will be destroyed. This is the default JAX-RS lifecycle. Providers are instantiated once for the whole application and are effectively singletons and supposed to be stateless."
-msgstr ""
+msgstr "Qualunque istanza di risorsa e di provider è gestita da RESTEasy di default. Ciò significa che la classe di una risorsa sarà istanziata da RESTEasy e servirà una singola richiesta, dopo di ché sarà distrutta. I provider sono istanziati una sola volta per tutta l'applicazione e in effetti sono dei singletons che sono supposti stateless."
#. Tag: para
#: Webservices.xml:301
#, no-c-format
msgid "You can write resources and providers as Seam components and benefit from the richer lifecycle management of Seam, and interception for bijection, security, and so on. Simply make your resource class a Seam component:"
-msgstr ""
+msgstr "E' possibile scrivere risorse e provider come componenti Seam e trarre beneficio dalla più ricca gestione del ciclo di vita di Seam e dall'interception, dalla bijection, dalla sicurezza e così via. Occorre semplicemente rendere la classe della risorsa un componente Seam:"
#. Tag: programlisting
#: Webservices.xml:307
@@ -627,19 +634,21 @@
#: Webservices.xml:309
#, no-c-format
msgid "An instance of <literal>customerResource</literal> is now handled by Seam when a request hits the server. This is a Seam JavaBean component that is <literal>EVENT</literal>-scoped, hence no different than the default JAX-RS lifecycle. You get full Seam injection support and all other Seam components and contexts are available to you. Currently also supported are <literal>APPLICATION</literal> and <literal>STATELESS</literal> resource Seam components. These scopes allow you to create an effectively stateless Seam middle-tier HTTP request-processing application."
-msgstr ""
+msgstr "Quando una richiesta raggiunge il server, un'istanza di <literal>customerResource</literal> è ora gestita da Seam. Si tratta di un componente JavaBean di Seam con scope <literal>EVENT</literal>, quindi in nulla diverso dal ciclo di vita di defaul JAX-RS. Si ottiene il completo supporto di Seam per la bijection e tutti gli altri componenti e contesti di Seam sono disponibili. Attualmente sono supportati anche i componenti Seam che sono risorse di tipo <literal>APPLICATION</literal> e <literal>STATELESS</literal>. Questi scope permettono di creare un'applicazione Seam middle-tier che processa le richieste HTTP in modo stateless."
+# L'integrazione RESTEasy con Seam di default ipotizza che le sessioni non vengano utilizzate, per cui una serie di sessioni anemiche si accumulerebbe dal momento che ogni richiesta REST darebbe avvio a una sessione destinata ad essere rimossa soltanto allo scadere del suo time out.
+# ??????????????????????????????????????????????
#. Tag: para
#: Webservices.xml:318
#, no-c-format
msgid "You can use <literal>SESSION</literal>-scoped Seam components. By default, the session will however be shortened to a single request. In other words, when an HTTP request is being processed by the RESTEasy integration code, an HTTP session will be created so that Seam components can utilize that context. When the request has been processed, Seam will look at the session and decide if the session was created only to serve that single request (no session identifier has been provided with the request, or no session existed for the request). If the session has been created only to serve this request, the session will be destroyed after the request! Assuming that your Seam application only uses event, application, or stateless components, this procedure prevents exhaustion of available HTTP sessions on the server. The RESTEasy integration with Seam assumes by default that sessions are not used, hence anemic sessions would add up as every REST request would start a session!
that will only be removed when timed out."
-msgstr ""
+msgstr "E' possibile utilizzare componenti Seam con scope <literal>SESSION</literal>. Di default, la sessione sarà comunque ridotta ad una singola richiesta. In altre parole, mentre una richiesta HTTP viene processata dal codice di integrazione RESTEasy, viene creata una sessione HTTP in modo che i componenti Seam possano utilizzare tale contesto. Dopo che la richiesta è stata processata, Seam esamina la sessione e decide se è stata creata soltanto per servire quella singola richiesta (nessun identificatore di sessione è stato fornito con la richiesta o nessuna sessione esiste per la richiesta). Se la sessione è stata creata solo per servire la richiesta corrente, essa sarà distrutta al termine della richiesta! Nell'ipotesi che l'applicazione Seam usi soltanto componenti stateless o di tipo evento o applicazione, questa procedura previene l'esaurimento delle sessioni HTTP a disposizione sul server. L'integrazione RESTEasy con Seam di default ipotizza che le sessioni n!
on vengano utilizzate, dal momento che una serie di sessioni anemiche si accumulerebbe qualora ogni richiesta REST desse avvio a una sessione destinata ad essere rimossa soltanto allo scadere del suo time out."
#. Tag: para
#: Webservices.xml:331
#, no-c-format
msgid "If your RESTful Seam application has to preserve session state across REST HTTP requests, disable this behavior in your configuration file:"
-msgstr ""
+msgstr "Se l'applicazione RESTful di Seam deve preservare lo stato della sessione fra richieste HTTP REST, occorre disabilitare questo comportamento nel file di configurazione:"
#. Tag: programlisting
#: Webservices.xml:336
@@ -651,43 +660,45 @@
#: Webservices.xml:338
#, no-c-format
msgid "Every RESTful HTTP request will now create a new session that will only be removed by timeout or explicit invalidation in your code through <literal>Session.instance().invalidate()</literal>. It is your responsibility to pass a valid session identifier along with your HTTP requests, if you want to utilize the session context across requests."
-msgstr ""
+msgstr "Tutte le richieste HTTP RESTful creeranno ora una nuova sessione che sarà rimossa soltanto alla sua scadenza o per invalidazione esplicita da parte del codice dell'applicazione usando <literal>Session.instance().invalidate()</literal>. E' responsabilità dello sviluppatore passare un identificatore di sessione valido insieme a ciascuna richiesta HTTP, se si vuole utilizzare il contesto di sessione tra una richiesta e l'altra."
#. Tag: para
#: Webservices.xml:345
#, no-c-format
msgid "<literal>CONVERSATION</literal>-scoped resource components and mapping of conversations to temporary HTTP resources and paths is planned but currently not supported."
-msgstr ""
+msgstr "Risorse che siano componenti con scope <literal>CONVERSATION</literal> e la mappatura delle conversazioni su risorse e percorsi HTTP temporanei è nei piani ma non ancora supportato."
#. Tag: para
#: Webservices.xml:350
#, no-c-format
msgid "EJB Seam components are currently <emphasis>NOT</emphasis> supported! However, as explained above, you can map plain stateless EJBs (with no Seam lifecycle or injection) as REST resources."
-msgstr ""
+msgstr "I componenti Seam EJBsono <emphasis>NON</emphasis> sono attualmente supportati! Comunque, come spiegato sopra, è possibile mappare semplici EJB stateless (senza alcuna gestione del ciclo di vita o injection da parte di Seam) come risorse REST."
#. Tag: para
#: Webservices.xml:355
#, no-c-format
msgid "Provider classes can also be Seam components, currently only <literal>APPLICATION</literal>-scoped provider components are supported."
-msgstr ""
+msgstr "Anche le classi dei provider possono essere dei componenti Seam, e attualmente sono supportati soltanto componenti provider con scope <literal>APPLICATION</literal>."
#. Tag: title
#: Webservices.xml:363
#, no-c-format
msgid "Mapping exceptions to HTTP responses"
-msgstr ""
+msgstr "Mappare eccezioni e risposte HTTP"
+# VERIFICARE ultima frase
#. Tag: para
#: Webservices.xml:365
#, no-c-format
msgid "Section 3.3.4 of the JAX-RS specification defines how checked or unchecked exceptions are handled by the JAX RS implementation. In addition to using an exception mapping provider as defined by JAX-RS, the integration of RESTEasy with Seam allows you to map exceptions to HTTP response codes within Seam's <literal>pages.xml</literal> facility. If you are already using <literal>pages.xml</literal> declarations, this is easier to maintain than potentially many JAX RS exception mapper classes."
-msgstr ""
+msgstr "La sezione 3.3.4 delle specifiche JAX-RS definisce come le eccezioni di tipo checked o unchecked debbano essere trattate dall'implementazione JAX-RS. Oltre all'utilizzo di un provider della mappatura delle eccezioni come definito dalle JAX-RS, l'integrazione di RESTEasy con Seam permette di mappare le eccezioni con i codici di risposta HTTP all'interno del file <literal>pages.xml</literal> di Seam. Se si stanno già utilizzando dichiarazioni di <literal>pages.xml</literal>, ciò è più semplice da manutenetere delle numerose potenziali classi JAX RS di mappatura delle eccezioni."
+# VERIFICARE: not - as some Seam examples might show - a request URI pattern that doesn't cover your REST request paths
#. Tag: para
#: Webservices.xml:373
#, no-c-format
msgid "Exception handling within Seam requires that the Seam filter is executed for your HTTP request. Ensure that you do filter <emphasis>all</emphasis> requests in your <literal>web.xml</literal>, not - as some Seam examples might show - a request URI pattern that doesn't cover your REST request paths. The following example intercepts <emphasis>all</emphasis> HTTP requests and enables Seam exception handling:"
-msgstr ""
+msgstr "In Seam la gestione delle eccezioni richiede che il filtro di Seam intercetti le richieste HTTP. Assicuratevi di filtrare <emphasis>tutte</emphasis> le richieste nel file <literal>web.xml</literal>, e non - come mostrato in alcuni esempi di Seam - quelle corrispondenti ad URI di richiesta che non coprono i percorsi delle richieste REST. L'esempio seguente intercetta <emphasis>tutte</emphasis> le richieste HTTP e abilita la gestione delle eccezioni di Seam:"
#. Tag: programlisting
#: Webservices.xml:380
@@ -717,7 +728,7 @@
#: Webservices.xml:382
#, no-c-format
msgid "To convert the unchecked <literal>UnsupportedOperationException</literal> thrown by your resource methods to a <literal>501 Not Implemented</literal> HTTP status response, add the following to your <literal>pages.xml</literal> descriptor:"
-msgstr ""
+msgstr "Per convertire l'eccezione unchecked <literal>UnsupportedOperationException</literal> lanciata dai metodi delle risorse nel codice di riposta HTTP <literal>501 Not Implemented</literal> , occorre aggiungere ciò che segue al descrittore <literal>pages.xml</literal>:"
#. Tag: programlisting
#: Webservices.xml:388
@@ -739,7 +750,7 @@
#: Webservices.xml:390
#, no-c-format
msgid "Custom or checked exceptions are handled the same:"
-msgstr ""
+msgstr "Le eccezioni di tipo custom e di tipo checked sono gestite allo stesso modo:"
#. Tag: programlisting
#: Webservices.xml:394
@@ -761,11 +772,11 @@
#: Webservices.xml:396
#, no-c-format
msgid "You do not have to send an HTTP error to the client if an exception occurs. Seam allows you to map the exception as a redirect to a view of your Seam application. As this feature is typically used for human clients (web browsers) and not for REST API remote clients, you should pay extra attention to conflicting exception mappings in <literal>pages.xml</literal>."
-msgstr ""
+msgstr "Se si verifica un'eccezione, non è necessario inviare al client un codice di errore HTTP. Seam permette di mappare l'eccezione con la redirezione ad una vista dell'applicazione Seam . Poichè questa caratteristica è tipicamente usata per i client umani (browser web) e non per i client remoti dell'API REST, occorre prestare un'attenzione particolare a mappature di eccezioni in conflitto fra loro in <literal>pages.xml</literal>."
#. Tag: para
#: Webservices.xml:403
#, no-c-format
msgid "Note that the HTTP response still passes through the servlet container, so an additional mapping might apply if you have <literal><error-page></literal> mappings in your <literal>web.xml</literal> configuration. The HTTP status code would then be mapped to a rendered HTML error page with status <literal>200 OK</literal>!"
-msgstr ""
+msgstr "Si noti che la risposta HTTP continua a passare attraverso il servlet container, così che è possibile apportare una mappatura aggiuntiva se nel file <literal>web.xml</literal> vi sono delle mappature <literal><error-page></literal>. Il codice di risposta HHTP sarebbe in questo caso mappato con una pagina HTML di errore con codice <literal>200 OK</literal>!"
15 years, 6 months
Seam SVN: r10916 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: cpopetz
Date: 2009-05-15 16:24:14 -0400 (Fri, 15 May 2009)
New Revision: 10916
Modified:
branches/community/Seam_2_1/doc/Seam_Reference_Guide/en-US/Wicket.xml
Log:
JBSEAM-4010
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/en-US/Wicket.xml
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/en-US/Wicket.xml 2009-05-15 19:21:05 UTC (rev 10915)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/en-US/Wicket.xml 2009-05-15 20:24:14 UTC (rev 10916)
@@ -190,14 +190,70 @@
<para>
Seam needs to instrument the bytecode of your Wicket classes to be able
- to intercept the annotations you use. Seam provides two ways to do
- this.The first is to place your classes in <code>WEB-INF/wicket</code>.
- Seam will look for classes placed in this directory at startup and
- instrument them. An alternative approach, which can be used alongside
- the first, is to use an ant task for instrumention. Seam provides such
- a task; it is packaged in <literal>jboss-seam-wicket-ant.jar </literal>,
- and can be used in the following manner:
- </para>
+ to intercept the annotations you use. The first decision to make is: do
+ you want your code instrumented at runtime as your app is running, or
+ at compile time? The former requires no integration
+ with your build environment, but has a performance penalty when loading each
+ instrumented class for the first time. The latter is faster, but requires
+ you to integrate this instrumentation into your build environment.
+ </para>
+ <section>
+ <title>Runtime instrumentation</title>
+ <para>
+ There are two ways to achieve runtime instrumentation. One relies on
+ placing wicket components to be instrumented in a special folder in your WAR
+ deployment. If this is not acceptable or possible, you can also use an
+ instrumentation "agent," which you specify in the command line for launching
+ your container.
+ </para>
+ <section>
+ <title>Location-specific instrumentation</title>
+ <para>
+ Any classes placed in the <literal>WEB-INF/wicket</literal> folder within your
+ WAR deployment will be automatically instrumented by the seam-wicket runtime.
+ You can arrange to place your wicket pages and components here by specifying
+ a separate output folder for those classes in your IDE, or through the use of
+ ant scripts.
+ </para>
+ </section>
+ <section>
+ <title>Runtime instrumentation agent</title>
+ <para>The jar file <literal>jboss-seam-wicket.jar</literal> can be used as an iinstrumentation
+ agent through the Java Instrumentation api. This is accomplished through the following
+ steps:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Arrange for the <literal>jboss-seam-wicket.jar</literal> file to live in a
+ location for which you have an absolute path, as the Java Instrumentation API does
+ not allow relative paths when specifying the location of an agent lib. </para>
+ </listitem>
+ <listitem>
+ <para>Add <literal>javaagent:/path/to/jboss-seam-wicket.jar</literal> to the command line options
+ when launching your webapp container:</para>
+ </listitem>
+ <listitem>
+ <para> In addition, you will need to add an environment variable that specifies
+ packages that the agent should instrument. This is accomplished by a comma separated
+ list of package names:</para>
+ <programlisting>-Dorg.jboss.seam.wicket.instrumented-packages=my.package.one,my.other.package</programlisting>
+ <para>Note that if a package A is specified, classes in subpackages of A are also examined. The
+ classes chosen for instrumentation can be further limited by specifying:
+ <programlisting>-Dorg.jboss.seam.wicket.scanAnnotations=true</programlisting>
+ and then marking instrumentable classes with the <literal>@SeamWicketComponent</literal>
+ annotation, see <xref linkend="SeamWicketComponent"/>.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Compile-time instrumentation</title>
+ <para>
+ Seam supports instrumentation at compile time through either Apache Ant or Apache Maven.</para>
+ <section>
+ <title> Instrumenting with ant</title>
+ <para>
+ Seam provides an ant task in the <literal>jboss-seam-wicket-ant.jar </literal>. This is used
+ in the following manner:
<programlisting role="XML"><![CDATA[<taskdef name="instrumentWicket"
classname="org.jboss.seam.wicket.ioc.WicketInstrumentationTask">
<classpath>
@@ -208,23 +264,78 @@
</classpath>
</taskdef>
-<instrumentWicket outputDirectory="${build.instrumented}">
+<instrumentWicket outputDirectory="${build.instrumented}" useAnnotations="true">
<classpath refid="build.classpath"/>
<fileset dir="${build.classes}" includes="**/*.class"/>
</instrumentWicket>]]></programlisting>
+ </para>
<para>
- Then have ant copy the instrumented classes in
- <literal>${build.instrumented}</literal> into
- <literal>WEB-INF/classes</literal>. If you want to hot deploy the
- Wicket components, you can copy the instrumented classes to
+ This results in the instrumented classes being placed in the directory
+ specified by <literal>${build.instrumented}</literal>. You will then
+ need to instruct ant to copy these classes into <literal>WEB-INF/classes</literal>.
+ If you want to hot deploy the Wicket components, you can copy the instrumented classes to
<literal>WEB-INF/dev</literal>; if you use hot deploy, make sure that
your <literal>WicketApplication</literal> class is also hot-deployed.
Upon a reload of hot-deployed classes, the entire WicketApplication
instance has to be re-initialized, in order to pick up new references
to the classes of mounted pages.
</para>
-
-
+ <para> The <literal>useAnnotations</literal> attribute is used to make the ant task only include
+ classes that have been marked with the <literal>@SeamWicketComponent</literal> annotation,
+ see <xref linkend="SeamWicketComponent"/>.
+ </para>
+ </section>
+ <section>
+ <title>Instrumenting with maven</title>
+ <para>
+ The jboss maven repository <literal>repository.jboss.org</literal> provides a plugin named
+ <literal>seam-instrument-wicket</literal> with a <literal>process-classes</literal> mojo. An
+ example configuration in your pom.xml might look like:
+ <programlisting role="XML"><![CDATA[<build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-instrument-wicket</artifactId>
+ <version>2.1.2</version>
+ <configuration>
+ <scanAnnotations>true</scanAnnotations>
+ <includes>
+ <include>your.package.name</include>
+ </includes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>instrument</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+</build>]]></programlisting>
+ The above example illustrates that the instrumentation is limited to classes specified by
+ the <literal>includes</literal> element. In this example, the <literal>scanAnnotations</literal>
+ is specified, see <xref linkend="SeamWicketComponent"/>.
+ </para>
+ </section>
+ </section>
+ <section id="SeamWicketComponent">
+ <title>The <literal>@SeamWicketComponent</literal> annotation</title>
+ <para>
+ Classes placed in WEB-INF/wicket will unconditionally be instrumented. The other instrumentation
+ mechanisms all allow you to specify that instrumentation should only be applied to classes
+ annotated with the <literal>@SeamWicketComponent</literal> annotation. This annotation is inherited,
+ which means all subclasses of an annotated class will also be instrumented. An example usage is:
+ <programlisting role="JAVA"><![CDATA[import org.jboss.seam.wicket.ioc.SeamWicketComponent;
+@SeamWicketComponent
+public class MyPage extends WebPage{
+ ...
+}]]></programlisting>
+ </para>
+ </section>
+
<section>
<title>Defining the Application</title>
15 years, 6 months
Seam SVN: r10915 - maven-plugins/trunk/seam-instrument-wicket/src/main/java/org/jboss/seam/wicket.
by seam-commits@lists.jboss.org
Author: cpopetz
Date: 2009-05-15 15:21:05 -0400 (Fri, 15 May 2009)
New Revision: 10915
Modified:
maven-plugins/trunk/seam-instrument-wicket/src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java
Log:
JBSEAM-4139
Modified: maven-plugins/trunk/seam-instrument-wicket/src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java
===================================================================
--- maven-plugins/trunk/seam-instrument-wicket/src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java 2009-05-15 15:43:44 UTC (rev 10914)
+++ maven-plugins/trunk/seam-instrument-wicket/src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java 2009-05-15 19:21:05 UTC (rev 10915)
@@ -3,8 +3,10 @@
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.regex.Pattern;
import javassist.ClassPool;
@@ -20,7 +22,7 @@
* This mojo takes classes specified with the "includes" parameter in the plugin configuration
* and instruments them with Seam's Wicket JavassistInstrumentor.
* @goal instrument
- * @requiresDependencyResolution
+ * @requiresDependencyResolution compile
* @phase process-classes
*/
public class InstrumentationMojo extends AbstractMojo
@@ -140,18 +142,11 @@
JavassistInstrumentor instrumentor = new JavassistInstrumentor(classPool, scanAnnotations);
- List<String> classes = new ArrayList<String>();
+ Set<String> classes = new HashSet<String>();
visitDir(classesDirectory, classes);
- for (String path : classes)
- {
- instrumentedClasses.put(path, instrumentor.instrumentClass(filenameToClassname(path)));
- }
- for (Map.Entry<String, CtClass> entry : instrumentedClasses.entrySet())
- {
- if (entry.getValue().isModified())
- entry.getValue().writeFile(classesDirectory.getPath());
- }
+
+ instrumentor.instrumentClassSet(classes, classesDirectory.getPath());
}
catch (Exception e)
{
@@ -160,7 +155,7 @@
}
}
- private void visitDir(File classesDir, List<String> classes)
+ private void visitDir(File classesDir, Set<String> classes)
{
for (File file : classesDir.listFiles())
{
@@ -170,7 +165,7 @@
{
if (pat.matcher(file.getPath()).find())
{
- classes.add(file.getPath());
+ classes.add(filenameToClassname(file.getPath()));
break;
}
}
15 years, 6 months
Seam SVN: r10914 - branches/community/Seam_2_1.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-15 11:43:44 -0400 (Fri, 15 May 2009)
New Revision: 10914
Modified:
branches/community/Seam_2_1/build.xml
Log:
dist the metawidget JARs
Modified: branches/community/Seam_2_1/build.xml
===================================================================
--- branches/community/Seam_2_1/build.xml 2009-05-15 03:27:51 UTC (rev 10913)
+++ branches/community/Seam_2_1/build.xml 2009-05-15 15:43:44 UTC (rev 10914)
@@ -638,6 +638,11 @@
</target>
<target name="copyexamples">
+ <ant dir="examples" target="copyextradependencies" inheritall="false">
+ <property name="lib.dir" value="../${dist.lib.dir}"/>
+ <property name="metawidget-war.lib" value="true"/>
+ <property name="metawidget-ear.lib" value="true"/>
+ </ant>
<copy todir="${dist.dir}/examples">
<fileset dir="${basedir}/examples">
<include name="booking/**/*" />
15 years, 6 months
Seam SVN: r10913 - in branches/community/Seam_2_1/examples: metawidget/booking/resources/WEB-INF and 5 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-14 23:27:51 -0400 (Thu, 14 May 2009)
New Revision: 10913
Added:
branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/metawidget.xml
branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/metawidget.xml
branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/metawidget.xml
Removed:
branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml
branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml
branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml
Modified:
branches/community/Seam_2_1/examples/build.xml
branches/community/Seam_2_1/examples/metawidget/booking/view/book.xhtml
branches/community/Seam_2_1/examples/metawidget/booking/view/confirm.xhtml
branches/community/Seam_2_1/examples/metawidget/booking/view/hotelview.xhtml
branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/account.xhtml
branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/card.xhtml
branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/contact.xhtml
branches/community/Seam_2_1/examples/metawidget/groovybooking/view/book.xhtml
branches/community/Seam_2_1/examples/metawidget/groovybooking/view/confirm.xhtml
branches/community/Seam_2_1/examples/metawidget/groovybooking/view/hotel.xhtml
Log:
upgrade to metawidget 0.75 since there are crucial API changes we want people to adopt from day 1
Modified: branches/community/Seam_2_1/examples/build.xml
===================================================================
--- branches/community/Seam_2_1/examples/build.xml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/build.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -587,14 +587,14 @@
<target name="getmetawidget-war" if="metawidget-war.lib">
<copyInlineDependencies id="metawidget" scope="runtime" todir="${lib.dir}">
- <dependency groupId="org.metawidget" artifactId="metawidget" version="0.7"/>
+ <dependency groupId="org.metawidget" artifactId="metawidget" version="0.75"/>
</copyInlineDependencies>
</target>
<target name="getmetawidget-ear" if="metawidget-ear.lib">
<copyInlineDependencies id="metawidget" scope="runtime" todir="${lib.dir}">
- <dependency groupId="org.metawidget" artifactId="metawidget-frontend" version="0.7"/>
- <dependency groupId="org.metawidget" artifactId="metawidget-backend" version="0.7"/>
+ <dependency groupId="org.metawidget" artifactId="metawidget-frontend" version="0.75"/>
+ <dependency groupId="org.metawidget" artifactId="metawidget-backend" version="0.75"/>
</copyInlineDependencies>
</target>
Deleted: branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<inspector-config xmlns="http://metawidget.org/inspector-config"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
-
- <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
- <inspectors>
- <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
- <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
- <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
- <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
- <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
- </inspectors>
- </compositeInspector>
-
-</inspector-config>
\ No newline at end of file
Added: branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/metawidget.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/metawidget.xml (rev 0)
+++ branches/community/Seam_2_1/examples/metawidget/booking/resources/WEB-INF/metawidget.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<metawidget xmlns="http://metawidget.org"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org http://metawidget.org/metawidget-1.0.xsd" version="1.0">
+
+ <htmlMetawidget xmlns="java:org.metawidget.faces.component.html">
+ <rendererType>
+ <string>div</string>
+ </rendererType>
+ <parameter>
+ <string>divStyleClasses</string>
+ <string>entry,label,required,input,error errors</string>
+ </parameter>
+ <widgetBuilder>
+ <compositeWidgetBuilder xmlns="urn:java:org.metawidget.widgetbuilder.composite" config="CompositeWidgetBuilderConfig">
+ <widgetBuilders>
+ <list>
+ <richFacesWidgetBuilder xmlns="java:org.metawidget.faces.component.html.widgetbuilder.richfaces"/>
+ <htmlWidgetBuilder xmlns="java:org.metawidget.faces.component.html.widgetbuilder"/>
+ </list>
+ </widgetBuilders>
+ </compositeWidgetBuilder>
+ </widgetBuilder>
+ <inspector>
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <list>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
+ </list>
+ </inspectors>
+ </compositeInspector>
+ </inspector>
+ </htmlMetawidget>
+
+</metawidget>
\ No newline at end of file
Modified: branches/community/Seam_2_1/examples/metawidget/booking/view/book.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/booking/view/book.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/booking/view/book.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -6,7 +6,7 @@
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
- xmlns:m="http://metawidget.org/faces/richfaces"
+ xmlns:m="http://metawidget.org/faces"
template="template.xhtml">
<!-- content -->
@@ -28,9 +28,7 @@
<s:validateAll>
- <m:metawidget value="#{booking}" rendererType="div" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
- <f:param name="divStyleClasses" value="entry,label,required,input,error errors"/>
- </m:metawidget>
+ <m:metawidget value="#{booking}" validatorClass="org.metawidget.faces.component.validator.RequiredValidator"/>
</s:validateAll>
Modified: branches/community/Seam_2_1/examples/metawidget/booking/view/confirm.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/booking/view/confirm.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/booking/view/confirm.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -4,7 +4,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:m="http://metawidget.org/faces/richfaces"
+ xmlns:m="http://metawidget.org/faces"
template="template.xhtml">
<!-- content -->
@@ -18,8 +18,7 @@
<ui:include src="hotelview.xhtml"/>
- <m:metawidget value="#{booking}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,input"/>
+ <m:metawidget value="#{booking}" readOnly="#{true}">
<h:outputText value="#{booking.total}"/>
<m:stub value="#{booking.creditCardExpiryMonth}"/>
<m:stub value="#{booking.creditCardExpiryYear}"/>
Modified: branches/community/Seam_2_1/examples/metawidget/booking/view/hotelview.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/booking/view/hotelview.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/booking/view/hotelview.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -2,10 +2,8 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:m="http://metawidget.org/faces/richfaces">
+ xmlns:m="http://metawidget.org/faces">
- <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,input"/>
- </m:metawidget>
+ <m:metawidget value="#{hotel}" readOnly="#{true}"/>
</ui:composition>
Deleted: branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<inspector-config xmlns="http://metawidget.org/inspector-config"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
-
- <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
- <inspectors>
- <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
- <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
- <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
- <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
- <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
- <jbpmInspector xmlns="java:org.metawidget.inspector.jbpm" config="JbpmInspectorConfig">
- <files>
- <string>checkout.jpdl.xml</string>
- <string>newuser.jpdl.xml</string>
- </files>
- </jbpmInspector>
- </inspectors>
- </compositeInspector>
-
-</inspector-config>
\ No newline at end of file
Added: branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/metawidget.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/metawidget.xml (rev 0)
+++ branches/community/Seam_2_1/examples/metawidget/dvdstore/resources/WEB-INF/metawidget.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<metawidget xmlns="http://metawidget.org"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org http://metawidget.org/metawidget-1.0.xsd" version="1.0">
+
+ <htmlMetawidget xmlns="java:org.metawidget.faces.component.html">
+ <parameter>
+ <string>labelStyle</string>
+ <string>text-align: left; font-weight: normal</string>
+ </parameter>
+ <parameter>
+ <string>messageStyleClass</string>
+ <string>cntError</string>
+ </parameter>
+ <inspector>
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <list>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
+ <jbpmInspector xmlns="java:org.metawidget.inspector.jbpm" config="JbpmInspectorConfig">
+ <inputStreams>
+ <list>
+ <resource>checkout.jpdl.xml</resource>
+ <resource>newuser.jpdl.xml</resource>
+ </list>
+ </inputStreams>
+ </jbpmInspector>
+ </list>
+ </inspectors>
+ </compositeInspector>
+ </inspector>
+ </htmlMetawidget>
+
+</metawidget>
\ No newline at end of file
Modified: branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/account.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/account.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/account.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -35,9 +35,6 @@
<h:form id="NewAccountForm">
<m:metawidget>
- <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
- <f:param name="messageStyleClass" value="cntError"/>
-
<m:metawidget value="#{customer.userName}" inspectFromParent="true" rendererType="simple"/>
<m:metawidget value="#{customer.password}" inspectFromParent="true" rendererType="simple"/>
<m:metawidget value="#{editCustomer.passwordVerify}" inspectFromParent="true" rendererType="simple"/>
Modified: branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/card.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/card.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/card.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -25,9 +25,6 @@
<h:form id="NewAccountForm">
<m:metawidget>
- <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
- <f:param name="messageStyleClass" value="cntError"/>
-
<m:metawidget value="#{customer.creditCardType}" inspectFromParent="true" rendererType="simple"/>
<m:metawidget value="#{customer.creditCard}" inspectFromParent="true" rendererType="simple"/>
<m:stub value="#{customer.creditCardMonth}">
Modified: branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/contact.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/contact.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/dvdstore/view/newuser/contact.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -26,8 +26,6 @@
<h:form id="NewAccountForm">
<s:validateAll id="ValidateAll">
<m:metawidget value="#{customer}" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
- <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
- <f:param name="messageStyleClass" value="cntError"/>
<m:stub value="#{customer.userName}"/>
<m:stub value="#{customer.password}"/>
Deleted: branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<inspector-config xmlns="http://metawidget.org/inspector-config"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
-
- <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
- <inspectors>
- <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
- <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
- </metawidgetAnnotationInspector>
- <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
- <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
- </propertyTypeInspector>
- <facesInspector xmlns="java:org.metawidget.inspector.faces" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
- <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
- </facesInspector>
- <jpaInspector xmlns="java:org.metawidget.inspector.jpa" config="JpaInspectorConfig">
- <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
- </jpaInspector>
- <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
- <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
- </hibernateValidatorInspector>
- </inspectors>
- </compositeInspector>
-
-</inspector-config>
\ No newline at end of file
Added: branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/metawidget.xml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/metawidget.xml (rev 0)
+++ branches/community/Seam_2_1/examples/metawidget/groovybooking/resources/WEB-INF/metawidget.xml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<metawidget xmlns="http://metawidget.org"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org http://metawidget.org/metawidget-1.0.xsd" version="1.0">
+
+ <htmlMetawidget xmlns="java:org.metawidget.faces.component.html">
+ <rendererType>
+ <string>div</string>
+ </rendererType>
+ <parameter>
+ <string>divStyleClasses</string>
+ <string>entry,label,required,output,error errors</string>
+ </parameter>
+ <widgetBuilder>
+ <compositeWidgetBuilder xmlns="urn:java:org.metawidget.widgetbuilder.composite" config="CompositeWidgetBuilderConfig">
+ <widgetBuilders>
+ <list>
+ <richFacesWidgetBuilder xmlns="java:org.metawidget.faces.component.html.widgetbuilder.richfaces"/>
+ <htmlWidgetBuilder xmlns="java:org.metawidget.faces.component.html.widgetbuilder"/>
+ </list>
+ </widgetBuilders>
+ </compositeWidgetBuilder>
+ </widgetBuilder>
+ <inspector>
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <list>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>
+ <class>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</class>
+ </propertyStyle>
+ </metawidgetAnnotationInspector>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>
+ <class>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</class>
+ </propertyStyle>
+ </propertyTypeInspector>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>
+ <class>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</class>
+ </propertyStyle>
+ </facesInspector>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa" config="JpaInspectorConfig">
+ <propertyStyle>
+ <class>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</class>
+ </propertyStyle>
+ </jpaInspector>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>
+ <class>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</class>
+ </propertyStyle>
+ </hibernateValidatorInspector>
+ </list>
+ </inspectors>
+ </compositeInspector>
+ </inspector>
+ </htmlMetawidget>
+
+</metawidget>
\ No newline at end of file
Modified: branches/community/Seam_2_1/examples/metawidget/groovybooking/view/book.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/groovybooking/view/book.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/groovybooking/view/book.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -6,7 +6,7 @@
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
- xmlns:m="http://metawidget.org/faces/richfaces"
+ xmlns:m="http://metawidget.org/faces"
template="template.xhtml">
<!-- content -->
@@ -18,13 +18,11 @@
<h:form id="booking">
<fieldset>
- <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,output"/>
- </m:metawidget>
+ <m:metawidget value="#{hotel}" readOnly="#{true}"/>
<s:validateAll>
- <m:metawidget value="#{booking}" rendererType="div" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
+ <m:metawidget value="#{booking}" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
<f:param name="divStyleClasses" value="entry,label,required,input,error errors"/>
</m:metawidget>
Modified: branches/community/Seam_2_1/examples/metawidget/groovybooking/view/confirm.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/groovybooking/view/confirm.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/groovybooking/view/confirm.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -4,7 +4,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:m="http://metawidget.org/faces/richfaces"
+ xmlns:m="http://metawidget.org/faces"
template="template.xhtml">
<!-- content -->
@@ -16,12 +16,9 @@
<h:form id="confirm">
<fieldset>
- <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,output"/>
- </m:metawidget>
+ <m:metawidget value="#{hotel}" readOnly="#{true}"/>
- <m:metawidget value="#{booking}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,output"/>
+ <m:metawidget value="#{booking}" readOnly="#{true}">
<h:outputText value="#{booking.total}"/>
<m:stub value="#{booking.creditCardExpiryMonth}"/>
<m:stub value="#{booking.creditCardExpiryYear}"/>
Modified: branches/community/Seam_2_1/examples/metawidget/groovybooking/view/hotel.xhtml
===================================================================
--- branches/community/Seam_2_1/examples/metawidget/groovybooking/view/hotel.xhtml 2009-05-14 09:24:59 UTC (rev 10912)
+++ branches/community/Seam_2_1/examples/metawidget/groovybooking/view/hotel.xhtml 2009-05-15 03:27:51 UTC (rev 10913)
@@ -4,7 +4,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:m="http://metawidget.org/faces/richfaces"
+ xmlns:m="http://metawidget.org/faces"
template="template.xhtml">
<!-- content -->
@@ -14,9 +14,7 @@
</div>
<div class="section">
- <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
- <f:param name="divStyleClasses" value="entry,label,required,output"/>
- </m:metawidget>
+ <m:metawidget value="#{hotel}" readOnly="#{true}"/>
</div>
<div class="section">
15 years, 6 months
Seam SVN: r10912 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-05-14 05:24:59 -0400 (Thu, 14 May 2009)
New Revision: 10912
Modified:
branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Gettingstarted.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Gettingstarted.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Gettingstarted.po 2009-05-14 07:27:28 UTC (rev 10911)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Gettingstarted.po 2009-05-14 09:24:59 UTC (rev 10912)
@@ -715,7 +715,7 @@
#: Gettingstarted.xml:260
#, no-c-format
msgid "Seam debug mode must be enabled and <literal>jboss-seam-debug.jar</literal> must be in <literal>WEB-INF/lib</literal>"
-msgstr "La modalità di degub di Seam deve essere abilitata e <literal>jboss-seam-debug.jar</literal> deve trovarsi in <literal>WEB-INF/lib</literal>"
+msgstr "La modalità di debug di Seam deve essere abilitata e <literal>jboss-seam-debug.jar</literal> deve trovarsi in <literal>WEB-INF/lib</literal>"
#. Tag: para
#: Gettingstarted.xml:265
15 years, 6 months
Seam SVN: r10911 - modules/trunk/security/src/main/java/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-14 03:27:28 -0400 (Thu, 14 May 2009)
New Revision: 10911
Added:
modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java
Modified:
modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
refactor configuration into separate bean
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2009-05-14 01:29:51 UTC (rev 10910)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2009-05-14 07:27:28 UTC (rev 10911)
@@ -12,32 +12,21 @@
import java.util.Set;
import javax.annotation.Named;
-import javax.context.ApplicationScoped;
+import javax.context.RequestScoped;
import javax.inject.Current;
import javax.inject.Initializer;
import javax.inject.manager.Manager;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
+import javax.persistence.PersistenceContext;
import org.jboss.seam.security.Role;
import org.jboss.seam.security.SimplePrincipal;
-import org.jboss.seam.security.annotations.management.PasswordSalt;
-import org.jboss.seam.security.annotations.management.RoleConditional;
-import org.jboss.seam.security.annotations.management.RoleGroups;
-import org.jboss.seam.security.annotations.management.RoleName;
-import org.jboss.seam.security.annotations.management.UserEnabled;
-import org.jboss.seam.security.annotations.management.UserFirstName;
-import org.jboss.seam.security.annotations.management.UserLastName;
-import org.jboss.seam.security.annotations.management.UserPassword;
-import org.jboss.seam.security.annotations.management.UserPrincipal;
-import org.jboss.seam.security.annotations.management.UserRoles;
import org.jboss.seam.security.crypto.BinTools;
import org.jboss.seam.security.events.PrePersistUserEvent;
import org.jboss.seam.security.events.PrePersistUserRoleEvent;
import org.jboss.seam.security.events.UserAuthenticatedEvent;
import org.jboss.seam.security.events.UserCreatedEvent;
-import org.jboss.seam.security.util.AnnotatedBeanProperty;
-import org.jboss.seam.security.util.TypedBeanProperty;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -47,7 +36,7 @@
* @author Shane Bryzak
*/
@Named("identityStore")
-@ApplicationScoped
+@RequestScoped
public class JpaIdentityStore implements IdentityStore, Serializable
{
private static final long serialVersionUID = 1171875389743972646L;
@@ -55,27 +44,12 @@
private static final LogProvider log = Logging.getLogProvider(JpaIdentityStore.class);
protected FeatureSet featureSet;
-
- @Current Manager manager;
- @Current PasswordHash passwordHash;
+
+ @PersistenceContext EntityManager entityManager;
- private Class<?> userEntityClass;
- private Class<?> roleEntityClass;
- private Class<?> xrefEntityClass;
- private TypedBeanProperty xrefUserProperty;
- private TypedBeanProperty xrefRoleProperty;
+ JpaIdentityStoreConfig config;
+ Manager manager;
- private AnnotatedBeanProperty<UserPrincipal> userPrincipalProperty;
- private AnnotatedBeanProperty<UserPassword> userPasswordProperty;
- private AnnotatedBeanProperty<PasswordSalt> passwordSaltProperty;
- private AnnotatedBeanProperty<UserRoles> userRolesProperty;
- private AnnotatedBeanProperty<UserEnabled> userEnabledProperty;
- private AnnotatedBeanProperty<UserFirstName> userFirstNameProperty;
- private AnnotatedBeanProperty<UserLastName> userLastNameProperty;
- private AnnotatedBeanProperty<RoleName> roleNameProperty;
- private AnnotatedBeanProperty<RoleGroups> roleGroupsProperty;
- private AnnotatedBeanProperty<RoleConditional> roleConditionalProperty;
-
public Set<Feature> getFeatures()
{
return featureSet.getFeatures();
@@ -89,101 +63,32 @@
public boolean supportsFeature(Feature feature)
{
return featureSet.supports(feature);
- }
+ }
@Initializer
- public void init()
+ public void init(@Current JpaIdentityStoreConfig config, @Current Manager manager)
{
+ this.config = config;
+ this.manager = manager;
+
if (featureSet == null)
{
featureSet = new FeatureSet();
featureSet.enableAll();
}
- if (userEntityClass == null)
+ if (config.userEntityClass == null)
{
log.error("Error in JpaIdentityStore configuration - userClass must be configured.");
return;
- }
-
- initProperties();
- }
-
- private void initProperties()
- {
- userPrincipalProperty = new AnnotatedBeanProperty<UserPrincipal>(userEntityClass, UserPrincipal.class);
- userPasswordProperty = new AnnotatedBeanProperty<UserPassword>(userEntityClass, UserPassword.class);
- passwordSaltProperty = new AnnotatedBeanProperty<PasswordSalt>(userEntityClass, PasswordSalt.class);
- userRolesProperty = new AnnotatedBeanProperty<UserRoles>(userEntityClass, UserRoles.class);
- userEnabledProperty = new AnnotatedBeanProperty<UserEnabled>(userEntityClass, UserEnabled.class);
- userFirstNameProperty = new AnnotatedBeanProperty<UserFirstName>(userEntityClass, UserFirstName.class);
- userLastNameProperty = new AnnotatedBeanProperty<UserLastName>(userEntityClass, UserLastName.class);
-
- if (!userPrincipalProperty.isSet())
- {
- throw new IdentityManagementException("Invalid userClass " + userEntityClass.getName() +
- " - required annotation @UserPrincipal not found on any Field or Method.");
- }
-
- if (!userRolesProperty.isSet())
- {
- throw new IdentityManagementException("Invalid userClass " + userEntityClass.getName() +
- " - required annotation @UserRoles not found on any Field or Method.");
}
-
- if (roleEntityClass != null)
- {
- roleNameProperty = new AnnotatedBeanProperty<RoleName>(roleEntityClass, RoleName.class);
- roleGroupsProperty = new AnnotatedBeanProperty<RoleGroups>(roleEntityClass, RoleGroups.class);
- roleConditionalProperty = new AnnotatedBeanProperty<RoleConditional>(roleEntityClass, RoleConditional.class);
-
- if (!roleNameProperty.isSet())
- {
- throw new IdentityManagementException("Invalid roleClass " + roleEntityClass.getName() +
- " - required annotation @RoleName not found on any Field or Method.");
- }
-
- Type type = userRolesProperty.getPropertyType();
- if (type instanceof ParameterizedType &&
- Collection.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType()))
- {
- Type genType = Object.class;
-
- for (Type t : ((ParameterizedType) type).getActualTypeArguments())
- {
- genType = t;
- break;
- }
-
- // If the @UserRoles property isn't a collection of <roleClass>, then assume the relationship
- // is going through a cross-reference table
- if (!genType.equals(roleEntityClass))
- {
- xrefEntityClass = (Class<?>) genType;
- xrefUserProperty = new TypedBeanProperty(xrefEntityClass, userEntityClass);
- xrefRoleProperty = new TypedBeanProperty(xrefEntityClass, roleEntityClass);
-
- if (!xrefUserProperty.isSet())
- {
- throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
- "you're using a cross-reference table, however the user property cannot be determined.");
- }
-
- if (!xrefRoleProperty.isSet())
- {
- throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
- "you're using a cross-reference table, however the role property cannot be determined.");
- }
- }
- }
- }
- }
+ }
public boolean createUser(String username, String password, String firstname, String lastname)
{
try
{
- if (userEntityClass == null)
+ if (config.userEntityClass == null)
{
throw new IdentityManagementException("Could not create account, userClass not set");
}
@@ -193,26 +98,26 @@
throw new IdentityManagementException("Could not create account, already exists");
}
- Object user = userEntityClass.newInstance();
+ Object user = config.userEntityClass.newInstance();
- userPrincipalProperty.setValue(user, username);
+ config.userPrincipalProperty.setValue(user, username);
- if (userFirstNameProperty.isSet()) userFirstNameProperty.setValue(user, firstname);
- if (userLastNameProperty.isSet()) userLastNameProperty.setValue(user, lastname);
+ if (config.userFirstNameProperty.isSet()) config.userFirstNameProperty.setValue(user, firstname);
+ if (config.userLastNameProperty.isSet()) config.userLastNameProperty.setValue(user, lastname);
if (password == null)
{
- if (userEnabledProperty.isSet()) userEnabledProperty.setValue(user, false);
+ if (config.userEnabledProperty.isSet()) config.userEnabledProperty.setValue(user, false);
}
else
{
setUserPassword(user, password);
- if (userEnabledProperty.isSet()) userEnabledProperty.setValue(user, true);
+ if (config.userEnabledProperty.isSet()) config.userEnabledProperty.setValue(user, true);
}
manager.fireEvent(new PrePersistUserEvent(user));
- persistEntity(user);
+ entityManager.persist(user);
manager.fireEvent(new UserCreatedEvent(user));
@@ -233,15 +138,15 @@
protected void setUserPassword(Object user, String password)
{
- if (passwordSaltProperty.isSet())
+ if (config.passwordSaltProperty.isSet())
{
byte[] salt = generateUserSalt(user);
- passwordSaltProperty.setValue(user, BinTools.bin2hex(salt));
- userPasswordProperty.setValue(user, generatePasswordHash(password, salt));
+ config.passwordSaltProperty.setValue(user, BinTools.bin2hex(salt));
+ config.userPasswordProperty.setValue(user, generatePasswordHash(password, salt));
}
else
{
- userPasswordProperty.setValue(user, generatePasswordHash(password, getUserAccountSalt(user)));
+ config.userPasswordProperty.setValue(user, generatePasswordHash(password, getUserAccountSalt(user)));
}
}
@@ -252,7 +157,7 @@
protected String getUserAccountSalt(Object user)
{
// By default, we'll use the user's username as the password salt
- return userPrincipalProperty.getValue(user).toString();
+ return config.userPrincipalProperty.getValue(user).toString();
}
/**
@@ -260,7 +165,7 @@
*/
public byte[] generateUserSalt(Object user)
{
- return passwordHash.generateRandomSalt();
+ return getPasswordHash().generateRandomSalt();
}
public boolean createUser(String username, String password)
@@ -276,19 +181,19 @@
throw new NoSuchUserException("Could not delete, user '" + name + "' does not exist");
}
- removeEntity(user);
+ entityManager.remove(user);
return true;
}
@SuppressWarnings("unchecked")
public boolean grantRole(String username, String role)
{
- if (roleEntityClass == null) return false;
+ if (config.roleEntityClass == null) return false;
Object user = lookupUser(username);
if (user == null)
{
- if (userPasswordProperty.isSet())
+ if (config.userPasswordProperty.isSet())
{
// If no userPasswordProperty is set, it means that authentication is being performed
// by another identity store and this one is just managing roles
@@ -315,10 +220,10 @@
throw new NoSuchRoleException("Could not grant role, role '" + role + "' does not exist");
}
- Collection<?> userRoles = (Collection<?>) userRolesProperty.getValue(user);
+ Collection<?> userRoles = (Collection<?>) config.userRolesProperty.getValue(user);
if (userRoles == null)
{
- Type propType = userRolesProperty.getPropertyType();
+ Type propType = config.userRolesProperty.getPropertyType();
Class<?> collectionType;
if (propType instanceof Class && Collection.class.isAssignableFrom((Class<?>) propType))
@@ -345,30 +250,30 @@
userRoles = new ArrayList<Object>();
}
- userRolesProperty.setValue(user, userRoles);
+ config.userRolesProperty.setValue(user, userRoles);
}
- else if (((Collection<?>) userRolesProperty.getValue(user)).contains(roleToGrant))
+ else if (((Collection<?>) config.userRolesProperty.getValue(user)).contains(roleToGrant))
{
return false;
}
- if (xrefEntityClass == null)
+ if (config.xrefEntityClass == null)
{
// If this is a Many-To-Many relationship, simply add the role
- ((Collection<Object>) userRolesProperty.getValue(user)).add(roleToGrant);
+ ((Collection<Object>) config.userRolesProperty.getValue(user)).add(roleToGrant);
}
else
{
// Otherwise we need to insert a cross-reference entity instance
try
{
- Object xref = xrefEntityClass.newInstance();
- xrefUserProperty.setValue(xref, user);
- xrefRoleProperty.setValue(xref, roleToGrant);
+ Object xref = config.xrefEntityClass.newInstance();
+ config.xrefUserProperty.setValue(xref, user);
+ config.xrefRoleProperty.setValue(xref, roleToGrant);
manager.fireEvent(new PrePersistUserRoleEvent(xref));
- ((Collection<Object>) userRolesProperty.getValue(user)).add(mergeEntity(xref));
+ ((Collection<Object>) config.userRolesProperty.getValue(user)).add(entityManager.merge(xref));
}
catch (Exception ex)
{
@@ -395,17 +300,17 @@
boolean success = false;
- if (xrefEntityClass == null)
+ if (config.xrefEntityClass == null)
{
- success = ((Collection<?>) userRolesProperty.getValue(user)).remove(roleToRevoke);
+ success = ((Collection<?>) config.userRolesProperty.getValue(user)).remove(roleToRevoke);
}
else
{
- Collection<?> roles = ((Collection<?>) userRolesProperty.getValue(user));
+ Collection<?> roles = ((Collection<?>) config.userRolesProperty.getValue(user));
for (Object xref : roles)
{
- if (xrefRoleProperty.getValue(xref).equals(roleToRevoke))
+ if (config.xrefRoleProperty.getValue(xref).equals(roleToRevoke))
{
success = roles.remove(xref);
break;
@@ -419,7 +324,7 @@
@SuppressWarnings("unchecked")
public boolean addRoleToGroup(String role, String group)
{
- if (!roleGroupsProperty.isSet()) return false;
+ if (!config.roleGroupsProperty.isSet()) return false;
Object targetRole = lookupRole(role);
if (targetRole == null)
@@ -433,14 +338,14 @@
throw new NoSuchRoleException("Could not grant role, group '" + group + "' does not exist");
}
- Collection<?> roleGroups = (Collection<?>) roleGroupsProperty.getValue(targetRole);
+ Collection<?> roleGroups = (Collection<?>) config.roleGroupsProperty.getValue(targetRole);
if (roleGroups == null)
{
// This should either be a Set, or a List...
Class<?> rawType = null;
- if (roleGroupsProperty.getPropertyType() instanceof ParameterizedType)
+ if (config.roleGroupsProperty.getPropertyType() instanceof ParameterizedType)
{
- rawType = (Class<?>) ((ParameterizedType) roleGroupsProperty.getPropertyType()).getRawType();
+ rawType = (Class<?>) ((ParameterizedType) config.roleGroupsProperty.getPropertyType()).getRawType();
}
else
{
@@ -456,21 +361,21 @@
roleGroups = new ArrayList<Object>();
}
- roleGroupsProperty.setValue(targetRole, roleGroups);
+ config.roleGroupsProperty.setValue(targetRole, roleGroups);
}
- else if (((Collection<?>) roleGroupsProperty.getValue(targetRole)).contains(targetGroup))
+ else if (((Collection<?>) config.roleGroupsProperty.getValue(targetRole)).contains(targetGroup))
{
return false;
}
- ((Collection<Object>) roleGroupsProperty.getValue(targetRole)).add(targetGroup);
+ ((Collection<Object>) config.roleGroupsProperty.getValue(targetRole)).add(targetGroup);
return true;
}
public boolean removeRoleFromGroup(String role, String group)
{
- if (!roleGroupsProperty.isSet()) return false;
+ if (!config.roleGroupsProperty.isSet()) return false;
Object roleToRemove = lookupRole(role);
if (role == null)
@@ -484,7 +389,7 @@
throw new NoSuchRoleException("Could not remove role from group, no such group '" + group + "'");
}
- boolean success = ((Collection<?>) roleGroupsProperty.getValue(roleToRemove)).remove(targetGroup);
+ boolean success = ((Collection<?>) config.roleGroupsProperty.getValue(roleToRemove)).remove(targetGroup);
return success;
}
@@ -493,7 +398,7 @@
{
try
{
- if (roleEntityClass == null)
+ if (config.roleEntityClass == null)
{
throw new IdentityManagementException("Could not create role, roleClass not set");
}
@@ -503,9 +408,9 @@
throw new IdentityManagementException("Could not create role, already exists");
}
- Object instance = roleEntityClass.newInstance();
- roleNameProperty.setValue(instance, role);
- persistEntity(instance);
+ Object instance = config.roleEntityClass.newInstance();
+ config.roleNameProperty.setValue(instance, role);
+ entityManager.persist(instance);
return true;
}
@@ -530,9 +435,9 @@
throw new NoSuchRoleException("Could not delete role, role '" + role + "' does not exist");
}
- if (xrefEntityClass != null)
+ if (config.xrefEntityClass != null)
{
- lookupEntityManager().createQuery("delete " + xrefEntityClass.getName() + " where role = :role")
+ entityManager.createQuery("delete " + config.xrefEntityClass.getName() + " where role = :role")
.setParameter("role", roleToDelete)
.executeUpdate();
}
@@ -551,15 +456,16 @@
removeRoleFromGroup(r, role);
}
- removeEntity(roleToDelete);
+ entityManager.remove(roleToDelete);
return true;
}
public boolean enableUser(String name)
{
- if (!userEnabledProperty.isSet())
+ if (!config.userEnabledProperty.isSet())
{
- log.debug("Can not enable user, no @UserEnabled property configured in userClass " + userEntityClass.getName());
+ log.debug("Can not enable user, no @UserEnabled property configured in userClass " +
+ config.userEntityClass.getName());
return false;
}
@@ -570,20 +476,21 @@
}
// Can't enable an already-enabled user, return false
- if (((Boolean) userEnabledProperty.getValue(user)) == true)
+ if (((Boolean) config.userEnabledProperty.getValue(user)) == true)
{
return false;
}
- userEnabledProperty.setValue(user, true);
+ config.userEnabledProperty.setValue(user, true);
return true;
}
public boolean disableUser(String name)
{
- if (!userEnabledProperty.isSet())
+ if (!config.userEnabledProperty.isSet())
{
- log.debug("Can not disable user, no @UserEnabled property configured in userClass " + userEntityClass.getName());
+ log.debug("Can not disable user, no @UserEnabled property configured in userClass " +
+ config.userEntityClass.getName());
return false;
}
@@ -594,12 +501,12 @@
}
// Can't disable an already-disabled user, return false
- if (((Boolean) userEnabledProperty.getValue(user)) == false)
+ if (((Boolean) config.userEnabledProperty.getValue(user)) == false)
{
return false;
}
- userEnabledProperty.setValue(user, false);
+ config.userEnabledProperty.setValue(user, false);
return true;
}
@@ -629,7 +536,8 @@
public boolean isUserEnabled(String name)
{
Object user = lookupUser(name);
- return user != null && (!userEnabledProperty.isSet() || (((Boolean) userEnabledProperty.getValue(user))) == true);
+ return user != null && (!config.userEnabledProperty.isSet() ||
+ (((Boolean) config.userEnabledProperty.getValue(user))) == true);
}
public List<String> getGrantedRoles(String name)
@@ -642,20 +550,20 @@
List<String> roles = new ArrayList<String>();
- Collection<?> userRoles = (Collection<?>) userRolesProperty.getValue(user);
+ Collection<?> userRoles = (Collection<?>) config.userRolesProperty.getValue(user);
if (userRoles != null)
{
for (Object role : userRoles)
{
- if (xrefEntityClass == null)
+ if (config.xrefEntityClass == null)
{
- roles.add((String) roleNameProperty.getValue(role));
+ roles.add((String) config.roleNameProperty.getValue(role));
}
else
{
- Object xref = roleNameProperty.getValue(role);
- Object userRole = xrefRoleProperty.getValue(xref);
- roles.add((String) roleNameProperty.getValue(userRole));
+ Object xref = config.roleNameProperty.getValue(role);
+ Object userRole = config.xrefRoleProperty.getValue(xref);
+ roles.add((String) config.roleNameProperty.getValue(userRole));
}
}
}
@@ -673,14 +581,14 @@
List<String> groups = new ArrayList<String>();
- if (roleGroupsProperty.isSet())
+ if (config.roleGroupsProperty.isSet())
{
- Collection<?> roleGroups = (Collection<?>) roleGroupsProperty.getValue(role);
+ Collection<?> roleGroups = (Collection<?>) config.roleGroupsProperty.getValue(role);
if (roleGroups != null)
{
for (Object group : roleGroups)
{
- groups.add((String) roleNameProperty.getValue(group));
+ groups.add((String) config.roleNameProperty.getValue(group));
}
}
}
@@ -697,12 +605,12 @@
}
Set<String> roles = new HashSet<String>();
- Collection<?> userRoles = (Collection<?>) userRolesProperty.getValue(user);
+ Collection<?> userRoles = (Collection<?>) config.userRolesProperty.getValue(user);
if (userRoles != null)
{
for (Object role : userRoles)
{
- addRoleAndMemberships((String) roleNameProperty.getValue(role), roles);
+ addRoleAndMemberships((String) config.roleNameProperty.getValue(role), roles);
}
}
@@ -715,15 +623,15 @@
{
Object instance = lookupRole(role);
- if (roleGroupsProperty.isSet())
+ if (config.roleGroupsProperty.isSet())
{
- Collection<?> groups = (Collection<?>) roleGroupsProperty.getValue(instance);
+ Collection<?> groups = (Collection<?>) config.roleGroupsProperty.getValue(instance);
if (groups != null)
{
for (Object group : groups)
{
- addRoleAndMemberships((String) roleNameProperty.getValue(group), roles);
+ addRoleAndMemberships((String) config.roleNameProperty.getValue(group), roles);
}
}
}
@@ -732,12 +640,12 @@
public String generatePasswordHash(String password, byte[] salt)
{
- if (passwordSaltProperty.isSet())
+ if (config.passwordSaltProperty.isSet())
{
try
{
- return passwordHash.createPasswordKey(password.toCharArray(), salt,
- userPasswordProperty.getAnnotation().iterations());
+ return getPasswordHash().createPasswordKey(password.toCharArray(), salt,
+ config.userPasswordProperty.getAnnotation().iterations());
}
catch (GeneralSecurityException ex)
{
@@ -757,17 +665,17 @@
@Deprecated
protected String generatePasswordHash(String password, String salt)
{
- String algorithm = userPasswordProperty.getAnnotation().hash();
+ String algorithm = config.userPasswordProperty.getAnnotation().hash();
if (algorithm == null || "".equals(algorithm))
{
if (salt == null || "".equals(salt))
{
- return passwordHash.generateHash(password);
+ return getPasswordHash().generateHash(password);
}
else
{
- return passwordHash.generateSaltedHash(password, salt);
+ return getPasswordHash().generateSaltedHash(password, salt);
}
}
else if ("none".equalsIgnoreCase(algorithm))
@@ -778,11 +686,11 @@
{
if (salt == null || "".equals(salt))
{
- return passwordHash.generateHash(password, algorithm);
+ return getPasswordHash().generateHash(password, algorithm);
}
else
{
- return passwordHash.generateSaltedHash(password, salt, algorithm);
+ return getPasswordHash().generateSaltedHash(password, salt, algorithm);
}
}
}
@@ -790,16 +698,17 @@
public boolean authenticate(String username, String password)
{
Object user = lookupUser(username);
- if (user == null || (userEnabledProperty.isSet() && ((Boolean) userEnabledProperty.getValue(user) == false)))
+ if (user == null || (config.userEnabledProperty.isSet() &&
+ ((Boolean) config.userEnabledProperty.getValue(user) == false)))
{
return false;
}
String passwordHash = null;
- if (passwordSaltProperty.isSet())
+ if (config.passwordSaltProperty.isSet())
{
- String encodedSalt = (String) passwordSaltProperty.getValue(user);
+ String encodedSalt = (String) config.passwordSaltProperty.getValue(user);
if (encodedSalt == null)
{
throw new IdentityManagementException("A @PasswordSalt property was found on entity " + user +
@@ -814,7 +723,7 @@
}
- boolean success = passwordHash.equals(userPasswordProperty.getValue(user));
+ boolean success = passwordHash.equals(config.userPasswordProperty.getValue(user));
if (success)
{
@@ -828,8 +737,8 @@
{
try
{
- Object user = lookupEntityManager().createQuery(
- "select u from " + userEntityClass.getName() + " u where " + userPrincipalProperty.getName() +
+ Object user = entityManager.createQuery(
+ "select u from " + config.userEntityClass.getName() + " u where " + config.userPrincipalProperty.getName() +
" = :username")
.setParameter("username", username)
.getSingleResult();
@@ -844,17 +753,17 @@
public String getUserName(Object user)
{
- return (String) userPrincipalProperty.getValue(user);
+ return (String) config.userPrincipalProperty.getValue(user);
}
public String getRoleName(Object role)
{
- return (String) roleNameProperty.getValue(role);
+ return (String) config.roleNameProperty.getValue(role);
}
public boolean isRoleConditional(String role)
{
- return roleConditionalProperty.isSet() ? (Boolean) roleConditionalProperty.getValue(
+ return config.roleConditionalProperty.isSet() ? (Boolean) config.roleConditionalProperty.getValue(
lookupRole(role)) : false;
}
@@ -862,8 +771,8 @@
{
try
{
- Object value = lookupEntityManager().createQuery(
- "select r from " + roleEntityClass.getName() + " r where " + roleNameProperty.getName() +
+ Object value = entityManager.createQuery(
+ "select r from " + config.roleEntityClass.getName() + " r where " + config.roleNameProperty.getName() +
" = :role")
.setParameter("role", role)
.getSingleResult();
@@ -879,17 +788,17 @@
@SuppressWarnings("unchecked")
public List<String> listUsers()
{
- return (List<String>) lookupEntityManager().createQuery(
- "select u." + userPrincipalProperty.getName() + " from " + userEntityClass.getName() + " u")
+ return (List<String>) entityManager.createQuery(
+ "select u." + config.userPrincipalProperty.getName() + " from " + config.userEntityClass.getName() + " u")
.getResultList();
}
@SuppressWarnings("unchecked")
public List<String> listUsers(String filter)
{
- return (List<String>) lookupEntityManager().createQuery(
- "select u." + userPrincipalProperty.getName() + " from " + userEntityClass.getName() +
- " u where lower(" + userPrincipalProperty.getName() + ") like :username")
+ return (List<String>) entityManager.createQuery(
+ "select u." + config.userPrincipalProperty.getName() + " from " + config.userEntityClass.getName() +
+ " u where lower(" + config.userPrincipalProperty.getName() + ") like :username")
.setParameter("username", "%" + (filter != null ? filter.toLowerCase() : "") +
"%")
.getResultList();
@@ -898,8 +807,9 @@
@SuppressWarnings("unchecked")
public List<String> listRoles()
{
- return (List<String>) lookupEntityManager().createQuery(
- "select r." + roleNameProperty.getName() + " from " + roleEntityClass.getName() + " r").getResultList();
+ return (List<String>) entityManager.createQuery(
+ "select r." + config.roleNameProperty.getName() + " from " +
+ config.roleEntityClass.getName() + " r").getResultList();
}
public List<Principal> listMembers(String role)
@@ -924,17 +834,20 @@
{
Object roleEntity = lookupRole(role);
- if (xrefEntityClass == null)
+ if (config.xrefEntityClass == null)
{
- return (List<String>) lookupEntityManager().createQuery("select u." + userPrincipalProperty.getName() +
- " from " + userEntityClass.getName() + " u where :role member of u." + userRolesProperty.getName())
+ return (List<String>) entityManager.createQuery("select u." +
+ config.userPrincipalProperty.getName() +
+ " from " + config.userEntityClass.getName() + " u where :role member of u." +
+ config.userRolesProperty.getName())
.setParameter("role", roleEntity)
.getResultList();
}
else
{
- List<?> xrefs = lookupEntityManager().createQuery("select x from " + xrefEntityClass.getName() + " x where x." +
- xrefRoleProperty.getName() + " = :role")
+ List<?> xrefs = entityManager.createQuery("select x from " +
+ config.xrefEntityClass.getName() + " x where x." +
+ config.xrefRoleProperty.getName() + " = :role")
.setParameter("role", roleEntity)
.getResultList();
@@ -942,8 +855,8 @@
for (Object xref : xrefs)
{
- Object user = xrefUserProperty.getValue(xref);
- members.add(userPrincipalProperty.getValue(user).toString());
+ Object user = config.xrefUserProperty.getValue(xref);
+ members.add(config.userPrincipalProperty.getValue(user).toString());
}
return members;
@@ -954,12 +867,14 @@
@SuppressWarnings("unchecked")
private List<String> listRoleMembers(String role)
{
- if (roleGroupsProperty.isSet())
+ if (config.roleGroupsProperty.isSet())
{
Object roleEntity = lookupRole(role);
- return (List<String>) lookupEntityManager().createQuery("select r." + roleNameProperty.getName() +
- " from " + roleEntityClass.getName() + " r where :role member of r." + roleGroupsProperty.getName())
+ return (List<String>) entityManager.createQuery("select r." +
+ config.roleNameProperty.getName() +
+ " from " + config.roleEntityClass.getName() + " r where :role member of r." +
+ config.roleGroupsProperty.getName())
.setParameter("role", roleEntity)
.getResultList();
}
@@ -973,58 +888,23 @@
StringBuilder roleQuery = new StringBuilder();
roleQuery.append("select r.");
- roleQuery.append(roleNameProperty.getName());
+ roleQuery.append(config.roleNameProperty.getName());
roleQuery.append(" from ");
- roleQuery.append(roleEntityClass.getName());
+ roleQuery.append(config.roleEntityClass.getName());
roleQuery.append(" r");
- if (roleConditionalProperty.isSet())
+ if (config.roleConditionalProperty.isSet())
{
roleQuery.append(" where r.");
- roleQuery.append(roleConditionalProperty.getName());
+ roleQuery.append(config.roleConditionalProperty.getName());
roleQuery.append(" = false");
}
- return (List<String>) lookupEntityManager().createQuery(roleQuery.toString()).getResultList();
+ return (List<String>) entityManager.createQuery(roleQuery.toString()).getResultList();
}
- protected void persistEntity(Object entity)
+ protected PasswordHash getPasswordHash()
{
- lookupEntityManager().persist(entity);
+ return manager.getInstanceByType(PasswordHash.class);
}
-
- protected Object mergeEntity(Object entity)
- {
- return lookupEntityManager().merge(entity);
- }
-
- protected void removeEntity(Object entity)
- {
- lookupEntityManager().remove(entity);
- }
-
- public Class<?> getUserEntityClass()
- {
- return userEntityClass;
- }
-
- public void setUserEntityClass(Class<?> userEntityClass)
- {
- this.userEntityClass = userEntityClass;
- }
-
- public Class<?> getRoleEntityClass()
- {
- return roleEntityClass;
- }
-
- public void setRoleEntityClass(Class<?> roleEntityClass)
- {
- this.roleEntityClass = roleEntityClass;
- }
-
- private EntityManager lookupEntityManager()
- {
- return manager.getInstanceByType(EntityManager.class);
- }
}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java 2009-05-14 07:27:28 UTC (rev 10911)
@@ -0,0 +1,138 @@
+package org.jboss.seam.security.management;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Initializer;
+
+import org.jboss.seam.security.annotations.management.PasswordSalt;
+import org.jboss.seam.security.annotations.management.RoleConditional;
+import org.jboss.seam.security.annotations.management.RoleGroups;
+import org.jboss.seam.security.annotations.management.RoleName;
+import org.jboss.seam.security.annotations.management.UserEnabled;
+import org.jboss.seam.security.annotations.management.UserFirstName;
+import org.jboss.seam.security.annotations.management.UserLastName;
+import org.jboss.seam.security.annotations.management.UserPassword;
+import org.jboss.seam.security.annotations.management.UserPrincipal;
+import org.jboss.seam.security.annotations.management.UserRoles;
+import org.jboss.seam.security.util.AnnotatedBeanProperty;
+import org.jboss.seam.security.util.TypedBeanProperty;
+
+/**
+ * The configuration for JpaIdentityStore
+ *
+ * @author Shane Bryzak
+ */
+@ApplicationScoped
+public class JpaIdentityStoreConfig
+{
+ Class<?> userEntityClass;
+ Class<?> roleEntityClass;
+ Class<?> xrefEntityClass;
+ TypedBeanProperty xrefUserProperty;
+ TypedBeanProperty xrefRoleProperty;
+
+ AnnotatedBeanProperty<UserPrincipal> userPrincipalProperty;
+ AnnotatedBeanProperty<UserPassword> userPasswordProperty;
+ AnnotatedBeanProperty<PasswordSalt> passwordSaltProperty;
+ AnnotatedBeanProperty<UserRoles> userRolesProperty;
+ AnnotatedBeanProperty<UserEnabled> userEnabledProperty;
+ AnnotatedBeanProperty<UserFirstName> userFirstNameProperty;
+ AnnotatedBeanProperty<UserLastName> userLastNameProperty;
+ AnnotatedBeanProperty<RoleName> roleNameProperty;
+ AnnotatedBeanProperty<RoleGroups> roleGroupsProperty;
+ AnnotatedBeanProperty<RoleConditional> roleConditionalProperty;
+
+ @Initializer
+ public void initProperties()
+ {
+ userPrincipalProperty = new AnnotatedBeanProperty<UserPrincipal>(userEntityClass, UserPrincipal.class);
+ userPasswordProperty = new AnnotatedBeanProperty<UserPassword>(userEntityClass, UserPassword.class);
+ passwordSaltProperty = new AnnotatedBeanProperty<PasswordSalt>(userEntityClass, PasswordSalt.class);
+ userRolesProperty = new AnnotatedBeanProperty<UserRoles>(userEntityClass, UserRoles.class);
+ userEnabledProperty = new AnnotatedBeanProperty<UserEnabled>(userEntityClass, UserEnabled.class);
+ userFirstNameProperty = new AnnotatedBeanProperty<UserFirstName>(userEntityClass, UserFirstName.class);
+ userLastNameProperty = new AnnotatedBeanProperty<UserLastName>(userEntityClass, UserLastName.class);
+
+ if (!userPrincipalProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid userClass " + userEntityClass.getName() +
+ " - required annotation @UserPrincipal not found on any Field or Method.");
+ }
+
+ if (!userRolesProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid userClass " + userEntityClass.getName() +
+ " - required annotation @UserRoles not found on any Field or Method.");
+ }
+
+ if (roleEntityClass != null)
+ {
+ roleNameProperty = new AnnotatedBeanProperty<RoleName>(roleEntityClass, RoleName.class);
+ roleGroupsProperty = new AnnotatedBeanProperty<RoleGroups>(roleEntityClass, RoleGroups.class);
+ roleConditionalProperty = new AnnotatedBeanProperty<RoleConditional>(roleEntityClass, RoleConditional.class);
+
+ if (!roleNameProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid roleClass " + roleEntityClass.getName() +
+ " - required annotation @RoleName not found on any Field or Method.");
+ }
+
+ Type type = userRolesProperty.getPropertyType();
+ if (type instanceof ParameterizedType &&
+ Collection.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType()))
+ {
+ Type genType = Object.class;
+
+ for (Type t : ((ParameterizedType) type).getActualTypeArguments())
+ {
+ genType = t;
+ break;
+ }
+
+ // If the @UserRoles property isn't a collection of <roleClass>, then assume the relationship
+ // is going through a cross-reference table
+ if (!genType.equals(roleEntityClass))
+ {
+ xrefEntityClass = (Class<?>) genType;
+ xrefUserProperty = new TypedBeanProperty(xrefEntityClass, userEntityClass);
+ xrefRoleProperty = new TypedBeanProperty(xrefEntityClass, roleEntityClass);
+
+ if (!xrefUserProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the user property cannot be determined.");
+ }
+
+ if (!xrefRoleProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the role property cannot be determined.");
+ }
+ }
+ }
+ }
+ }
+
+ public Class<?> getUserEntityClass()
+ {
+ return userEntityClass;
+ }
+
+ public void setUserEntityClass(Class<?> userEntityClass)
+ {
+ this.userEntityClass = userEntityClass;
+ }
+
+ public Class<?> getRoleEntityClass()
+ {
+ return roleEntityClass;
+ }
+
+ public void setRoleEntityClass(Class<?> roleEntityClass)
+ {
+ this.roleEntityClass = roleEntityClass;
+ }
+}
15 years, 6 months
Seam SVN: r10910 - branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: cpopetz
Date: 2009-05-13 21:29:51 -0400 (Wed, 13 May 2009)
New Revision: 10910
Modified:
branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketClassLoader.java
branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketInstrumentationTask.java
Log:
JBSEAM-4173
Modified: branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java
===================================================================
--- branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2009-05-13 20:31:38 UTC (rev 10909)
+++ branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/JavassistInstrumentor.java 2009-05-14 01:29:51 UTC (rev 10910)
@@ -120,6 +120,11 @@
* If true, only instrument classes annotated with @WicketComponent and their non-static inner classes.
*/
private boolean scanAnnotations;
+
+ /**
+ * If we're only instrumenting a specific set of classes, these are the names of those classes
+ */
+ private Set<String> onlyTheseClasses;
public JavassistInstrumentor(ClassPool classPool)
{
@@ -173,13 +178,32 @@
*/
public void instrumentClass(CtClass implementation) throws NotFoundException, CannotCompileException
{
+
String className = implementation.getName();
CtClass handlerClass = classPool.get(WicketHandler.class.getName());
CtClass componentClass = classPool.get(WicketComponent.class.getName());
- CtField handlerField = new CtField(handlerClass, "handler", implementation);
- Initializer handlerInitializer = Initializer.byCall(handlerClass, "create");
- implementation.addField(handlerField, handlerInitializer);
+ /*
+ * We only want one WicketHandler field per bean, so don't add that field to classes whose
+ * parent has been or is to be be instrumented.
+ */
+ CtClass superclass = implementation.getSuperclass();
+ if (!isInstrumented(superclass)) {
+ if (!isInstrumentable(superclass)) {
+ //we're the top-most instrumentable class, so add the handler field
+ CtField handlerField = new CtField(handlerClass, "handler", implementation);
+ handlerField.setModifiers(Modifier.PROTECTED);
+ Initializer handlerInitializer = Initializer.byCall(handlerClass, "create");
+ implementation.addField(handlerField, handlerInitializer);
+ CtMethod getHandlerMethod = CtNewMethod.getter("getHandler", handlerField);
+ implementation.addMethod(getHandlerMethod);
+ }
+ else {
+ //in order for the below code to make reference to the handler instance we need to
+ //recursively instrument until we reach the top of the instrumentable class tree
+ instrumentClass(superclass);
+ }
+ }
CtField wicketComponentField = new CtField(componentClass, "component", implementation);
wicketComponentField.setModifiers(Modifier.STATIC);
@@ -189,10 +213,8 @@
CtClass exception = classPool.get(Exception.class.getName());
implementation.addInterface(getInstrumentedComponentInterface());
- CtMethod getHandlerMethod = CtNewMethod.getter("getHandler", handlerField);
- CtMethod getEnclosingInstance = CtNewMethod.make("public " + InstrumentedComponent.class.getName() + " getEnclosingInstance() { return handler == null ? null : handler.getEnclosingInstance(this); }", implementation);
+ CtMethod getEnclosingInstance = CtNewMethod.make("public " + InstrumentedComponent.class.getName() + " getEnclosingInstance() { return getHandler() == null ? null : getHandler().getEnclosingInstance(this); }", implementation);
implementation.addMethod(getEnclosingInstance);
- implementation.addMethod(getHandlerMethod);
for (CtMethod method : implementation.getDeclaredMethods())
{
@@ -216,9 +238,9 @@
{
{
String constructorObject = createConstructorObject(className, constructor);
- constructor.insertBeforeBody(constructorObject + "handler.beforeInvoke(this, constructor);");
- constructor.addCatch("{" + constructorObject + "throw new RuntimeException(handler.handleException(this, constructor, e));}", exception, "e");
- constructor.insertAfter(constructorObject + "handler.afterInvoke(this, constructor);");
+ constructor.insertBeforeBody(constructorObject + "getHandler().beforeInvoke(this, constructor);");
+ constructor.addCatch("{" + constructorObject + "throw new RuntimeException(getHandler().handleException(this, constructor, e));}", exception, "e");
+ constructor.insertAfter(constructorObject + "getHandler().afterInvoke(this, constructor);");
log.trace("instrumented constructor " + constructor.getName());
}
}
@@ -235,7 +257,7 @@
*/
private static String createBody(CtClass clazz, CtMethod method, CtMethod newMethod) throws NotFoundException
{
- String src = "{" + createMethodObject(clazz, method) + "if (this.handler != null) this.handler.beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "if (this.handler != null) result = ($r) this.handler.afterInvoke(this, method, ($w) result); return ($r) result;}";
+ String src = "{" + createMethodObject(clazz, method) + "if (getHandler() != null) getHandler().beforeInvoke(this, method);" + createMethodDelegation(newMethod) + "if (this.handler != null) result = ($r) this.handler.afterInvoke(this, method, ($w) result); return ($r) result;}";
log.trace("Creating method " + clazz.getName() + "." + newMethod.getName() + "(" + newMethod.getSignature() + ")" + src);
return src;
@@ -269,7 +291,7 @@
*/
private static String wrapInExceptionHandler(String src)
{
- return "try {" + src + "} catch (Exception e) { throw new RuntimeException(this.handler == null ? e : this.handler.handleException(this, method, e)); }";
+ return "try {" + src + "} catch (Exception e) { throw new RuntimeException(getHandler() == null ? e : getHandler().handleException(this, method, e)); }";
}
/**
@@ -390,6 +412,10 @@
{
return false;
}
+ if (onlyTheseClasses != null && !onlyTheseClasses.contains(clazz.getName()))
+ {
+ return false;
+ }
try
{
@@ -417,9 +443,8 @@
// do not instrument something we've already instrumented.
// can't use 'isSubtype' because the superclass may be instrumented
// while we are not
- for (String inf : clazz.getClassFile2().getInterfaces())
- if (inf.equals(getInstrumentedComponentInterface().getName()))
- return false;
+ if (isInstrumented(clazz))
+ return false;
}
catch (Exception e)
{
@@ -429,6 +454,14 @@
return true;
}
+ private boolean isInstrumented(CtClass clazz)
+ {
+ for (String inf : clazz.getClassFile2().getInterfaces())
+ if (inf.equals(getInstrumentedComponentInterface().getName()))
+ return true;
+ return false;
+ }
+
/**
* We have to look this up lazily because when our constructor is called we may not have the appropriate paths added to our ClassPool,
* particularly if we are doing runtime instrumentation using WEB-INF/wicket
@@ -465,14 +498,18 @@
{
try
{
- CtClass result = instrumentClass(classfileBuffer);
- if (result == null)
+ CtClass clazz = classPool.get(className);
+ if (clazz.isModified())
+ return clazz.toBytecode();
+ clazz = instrumentClass(classfileBuffer);
+ if (clazz == null)
return null;
else
- return result.toBytecode();
+ return clazz.toBytecode();
}
catch (Exception e)
{
+ e.printStackTrace();
throw new RuntimeException(e);
}
}
@@ -529,4 +566,32 @@
classPool.appendSystemPath();
instrumentation.addTransformer(new JavassistInstrumentor(classPool, packagesToInstrument, scanAnnotations));
}
+
+ /**
+ * This instruments a specific set of classes and writes their classes to the specified directory, if that
+ * directory is non-null
+ * @param toInstrument the set of class names to instrument
+ * @param path where to write the modified classes, or null to not write anything
+ * @throws CannotCompileException
+ * @throws NotFoundException
+ */
+ public void instrumentClassSet(Set<String> toInstrument, String path) throws CannotCompileException, NotFoundException
+ {
+ this.onlyTheseClasses = toInstrument;
+ for (String className : toInstrument)
+ {
+ CtClass clazz = instrumentClass(className);
+ if (path != null && clazz.isModified())
+ {
+ try
+ {
+ clazz.writeFile(path);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
}
Modified: branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketClassLoader.java
===================================================================
--- branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketClassLoader.java 2009-05-13 20:31:38 UTC (rev 10909)
+++ branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketClassLoader.java 2009-05-14 01:29:51 UTC (rev 10910)
@@ -5,8 +5,8 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
import javassist.CannotCompileException;
import javassist.ClassPool;
@@ -22,7 +22,7 @@
private static LogProvider log = Logging.getLogProvider(WicketClassLoader.class);
- private List<String> classes;
+ private Set<String> classes;
private File wicketComponentDirectory;
private ClassPool classPool;
private ClassLoader parentLoader;
@@ -33,7 +33,7 @@
public WicketClassLoader(ClassLoader parent, ClassPool classPool, File wicketComponentDirectory)
{
super(parent, classPool);
- this.classes = new ArrayList<String>();
+ this.classes = new HashSet<String>();
this.wicketComponentDirectory = wicketComponentDirectory;
this.classPool = classPool;
this.parentLoader = parent;
@@ -48,7 +48,8 @@
// Scan for classes
if (wicketComponentDirectory.exists())
{
- handleDirectory(wicketComponentDirectory, null);
+ handleDirectory(wicketComponentDirectory, null, classes);
+ instrumentor.instrumentClassSet(classes,null);
}
// Ensure classes' static initializers have run, to register the classes
@@ -60,7 +61,15 @@
return this;
}
- private void handleDirectory(File file, String path) throws NotFoundException, CannotCompileException
+ /**
+ * Recursively collect all class names for class files found in this directory.
+ * @param file which directory
+ * @param path parent path
+ * @param collectedClasses where to store the classes
+ * @throws NotFoundException
+ * @throws CannotCompileException
+ */
+ private void handleDirectory(File file, String path, Set<String> collectedClasses) throws NotFoundException, CannotCompileException
{
log.trace("directory: " + file);
for (File child : file.listFiles())
@@ -68,22 +77,18 @@
String newPath = path == null ? child.getName() : path + '/' + child.getName();
if (child.isDirectory())
{
- handleDirectory(child, newPath);
+ handleDirectory(child, newPath, collectedClasses);
}
else
{
- handleItem(newPath);
+ if (newPath.endsWith(".class"))
+ {
+ collectedClasses.add(filenameToClassname(newPath));
+ }
}
}
}
- private void handleItem(String path) throws NotFoundException, CannotCompileException
- {
- if (path.endsWith(".class"))
- {
- classes.add(instrumentor.instrumentClass(filenameToClassname(path)).getName());
- }
- }
@Override
protected Class loadClassByDelegation(String name) throws ClassNotFoundException
Modified: branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketInstrumentationTask.java
===================================================================
--- branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketInstrumentationTask.java 2009-05-13 20:31:38 UTC (rev 10909)
+++ branches/community/Seam_2_1/src/wicket/org/jboss/seam/wicket/ioc/WicketInstrumentationTask.java 2009-05-14 01:29:51 UTC (rev 10910)
@@ -2,7 +2,9 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javassist.ClassPool;
import javassist.CtClass;
@@ -75,18 +77,15 @@
JavassistInstrumentor instrumentor = new JavassistInstrumentor(classPool,useAnnotations);
+ Set<String> toInstrument = new HashSet<String>();
for (String file : fileset.getDirectoryScanner(getProject()).getIncludedFiles())
{
if (file.endsWith(".class"))
{
- instrumentedClasses.add(instrumentor.instrumentClass(filenameToClassname(file)));
+ toInstrument.add(filenameToClassname(file));
}
}
-
- for (CtClass clazz : instrumentedClasses)
- {
- clazz.writeFile(outputDirectory.getPath());
- }
+ instrumentor.instrumentClassSet(toInstrument,outputDirectory.getPath());
}
catch (Exception e)
{
15 years, 6 months
Seam SVN: r10909 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-05-13 16:31:38 -0400 (Wed, 13 May 2009)
New Revision: 10909
Modified:
branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Configuration.po
branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Events.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Configuration.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Configuration.po 2009-05-13 16:13:13 UTC (rev 10908)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Configuration.po 2009-05-13 20:31:38 UTC (rev 10909)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-05-05 12:31+0000\n"
-"PO-Revision-Date: 2009-05-05 14:36+0100\n"
+"PO-Revision-Date: 2009-05-13 22:31+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -301,13 +301,13 @@
#: Configuration.xml:131
#, no-c-format
msgid "Note that the patterns are matched against the URI path of the request (see <literal>HttpServletRequest.getURIPath()</literal>) and that the name of the servlet context is removed before matching."
-msgstr ""
+msgstr "Si noti che i pattern corrispondono al percorso URI della richiesta (si veda <literal>HttpServletRequest.getURIPath()</literal>) e che il nome del contesto servlet viene rimosso prima del matching."
#. Tag: para
#: Configuration.xml:137
#, no-c-format
msgid "Adding the master filter enables the following built-in filters."
-msgstr ""
+msgstr "L'aggiunta del filtro master abilita i seguenti filtri predefiniti."
#. Tag: title
#: Configuration.xml:140
@@ -319,13 +319,13 @@
#: Configuration.xml:141
#, no-c-format
msgid "This filter provides the exception mapping functionality in <literal>pages.xml</literal> (almost all applications will need this). It also takes care of rolling back uncommitted transactions when uncaught exceptions occur. (According to the Java EE specification, the web container should do this automatically, but we've found that this behavior cannot be relied upon in all application servers. And it is certainly not required of plain servlet engines like Tomcat.)"
-msgstr ""
+msgstr "Questo filtro fornisce la funzionalità di mappaturadelle eccezioni in <literal>pages.xml</literal> (quasi tutte le applicazioni ne hanno bisogno). Inoltre il filtro si preoccupa del rolling back delle transazioni non eseguite quando avviene un'eccezione non catturata. (In accordo alle specifiche Java EE, il web container dovrebbe fare questo in modo automatico, ma noi abbiamo visto che questo comportamento non può essere dato per scontato su tutti gli application server. E certamente non è richiesto sugli engine servlet come Tomcat.)"
#. Tag: para
#: Configuration.xml:147
#, no-c-format
msgid "By default, the exception handling filter will process all requests, however this behavior may be adjusted by adding a <literal><web:exception-filter></literal> entry to <literal>components.xml</literal>, as shown in this example:"
-msgstr ""
+msgstr "Di default il filtro di gestione eccezioni processerà tutte le richieste, comunque questo comportamento può essere sistemato aggiungendo una riga <literal><web:exception-filter></literal> a <literal>components.xml</literal>, come mostrato in quest'esempio:"
#. Tag: programlisting
#: Configuration.xml:151
@@ -355,13 +355,13 @@
#: Configuration.xml:158
#, no-c-format
msgid "This filter allows Seam to propagate the conversation context across browser redirects. It intercepts any browser redirects and adds a request parameter that specifies the Seam conversation identifier."
-msgstr ""
+msgstr "Questo filtro consente a Seam di propagare il contesto conversazione attraverso i redirect del browser. Intercetta qualsiasi redirect ed aggiunge un parametro di richiesta che specifica l'identificatore della conversazione di Seam."
#. Tag: para
#: Configuration.xml:162
#, no-c-format
msgid "The redirect filter will process all requests by default, but this behavior can also be adjusted in <literal>components.xml</literal>:"
-msgstr ""
+msgstr "Il filtro redirect processerà tutte le richieste di default, ma questo comportamento può essere aggiustato in <literal>components.xml</literal>:"
#. Tag: programlisting
#: Configuration.xml:165
@@ -379,7 +379,7 @@
#: Configuration.xml:171
#, no-c-format
msgid "This filter allows Seam to apply URL rewriting for views based on configuration in the <literal>pages.xml</literal> file. This filter is not activate by default, but can be activated by adding the configuration to <literal>components.xml</literal>:"
-msgstr ""
+msgstr "Questo filtro consente aSeam di applicare la riscrittura URL per le viste basate sulla configurazione nel file <literal>pages.xml</literal>. Questo filtro non è attivato di default, ma può essere attivato aggiungendo la configurazione in <literal>components.xml</literal>:"
#. Tag: programlisting
#: Configuration.xml:176
@@ -439,14 +439,14 @@
#: Configuration.xml:212
#, no-c-format
msgid "Sets the character encoding of submitted form data."
-msgstr ""
+msgstr "Imposta la codifica caratteri dei dati della form inviata."
#. Tag: para
#: Configuration.xml:214
#: Configuration.xml:309
#, no-c-format
msgid "This filter is not installed by default and requires an entry in <literal>components.xml</literal> to enable it:"
-msgstr ""
+msgstr "Questo filtro non è installato di default e richiede una riga in <literal>components.xml</literal> per essere abilitato:"
#. Tag: programlisting
#: Configuration.xml:217
@@ -600,7 +600,7 @@
#: Configuration.xml:326
#, no-c-format
msgid "Adding custom filters"
-msgstr ""
+msgstr "Aggiunta di filtri personalizzati"
#. Tag: para
#: Configuration.xml:327
@@ -636,7 +636,7 @@
#: Configuration.xml:343
#, no-c-format
msgid "Integrating Seam with your EJB container"
-msgstr ""
+msgstr "Integrazione di Seam con l'EJB container"
#. Tag: para
#: Configuration.xml:345
@@ -686,13 +686,13 @@
#: Configuration.xml:357
#, no-c-format
msgid "Seam needs to know where to go to find session beans in JNDI. One way to do this is specify the <literal>@JndiName</literal> annotation on every session bean Seam component. However, this is quite tedious. A better approach is to specify a pattern that Seam can use to calculate the JNDI name from the EJB name. Unfortunately, there is no standard mapping to global JNDI defined in the EJB3 specification, so this mapping is vendor-specific (and may depend on your own naming conventions as well). We usually specify this option in <literal>components.xml</literal>."
-msgstr ""
+msgstr "Seam necessita di sapere dove trovare i session bean in JNDI. Un modo per farlo è specificare l'annotazione <literal>@JndiName</literal> su ogni componente session bean. Comunque questa modalità è abbastanza noiosa. Un approccio migliore è specificare un pattern che Seam usa per calcolare il nome JNDI dal nome EJB. Sfortunatamente nella specifica EJB3 non è definita una mappatura standard al JNDI globale, quindi questa mappatura è specificata dal venditore (e può dipendere anche dalle proprie convenzioni di nome). Solitamente si specifica quest'opzione in <literal>components.xml</literal>."
#. Tag: para
#: Configuration.xml:364
#, no-c-format
msgid "For JBoss AS, the following pattern is correct:"
-msgstr ""
+msgstr "Per JBoss AS ilseguente pattern è corretto:"
#. Tag: programlisting
#: Configuration.xml:366
@@ -740,7 +740,7 @@
#: Configuration.xml:390
#, no-c-format
msgid "The value of the <literal>name</literal> attribute in the @Stateless or @Stateful annotation"
-msgstr ""
+msgstr "Il valore dell'attributo <literal>name</literal> nell'annotazione @Stateless o @Stateful"
#. Tag: para
#: Configuration.xml:393
@@ -1084,7 +1084,7 @@
#: Configuration.xml:563
#, no-c-format
msgid "Once you've packaged all this stuff together into an EAR, the archive structure will look something like this:"
-msgstr ""
+msgstr "Una volta impacchettato assieme tutte queste cose in un EAR, la struttura dell'archivio apparirà così:"
#. Tag: programlisting
#: Configuration.xml:566
@@ -1170,13 +1170,13 @@
#: Configuration.xml:573
#, no-c-format
msgid "If you want to use jBPM or Drools, you must include the needed jars in the EAR's lib directory."
-msgstr ""
+msgstr "Se si vuole usare jBPM o Drools, occorre includere i jar necessari nella directory lib di EAR."
#. Tag: para
#: Configuration.xml:575
#, no-c-format
msgid "If you want to use facelets (our recommendation), you must include <literal>jsf-facelets.jar</literal> in the <literal>WEB-INF/lib</literal> directory of the WAR."
-msgstr ""
+msgstr "Se si vuole usare facelets (consigliato), occorre includere <literal>jsf-facelets.jar</literal> nella directory <literal>WEB-INF/lib</literal> del WAR."
#. Tag: para
#: Configuration.xml:578
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Events.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Events.po 2009-05-13 16:13:13 UTC (rev 10908)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Events.po 2009-05-13 20:31:38 UTC (rev 10909)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-31 09:07+0000\n"
-"PO-Revision-Date: 2009-05-13 10:54+0100\n"
+"PO-Revision-Date: 2009-05-13 22:27+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -177,7 +177,7 @@
#: Events.xml:109
#, no-c-format
msgid "Multiple or conditional page actions my be specified using the <literal><action></literal> tag:"
-msgstr ""
+msgstr "Azioni di pagina multiple o condizionali possono essere specificate usando il tag <literal><action></literal>:"
#. Tag: programlisting
#: Events.xml:114
@@ -225,7 +225,7 @@
#: Events.xml:125
#, no-c-format
msgid "This condition consults the <literal>ResponseStateManager#isPostback(FacesContext)</literal> to determine if the request is a postback. The ResponseStateManager is accessed using <literal>FacesContext.getCurrentInstance().getRenderKit().getResponseStateManager()</literal>."
-msgstr ""
+msgstr "Questa condizione consulta <literal>ResponseStateManager#isPostback(FacesContext)</literal>per determinare sela richiesta è un postback. Il ResponseStateManager viene acceduto usando <literal>FacesContext.getCurrentInstance().getRenderKit().getResponseStateManager()</literal>."
#. Tag: para
#: Events.xml:131
@@ -403,7 +403,7 @@
#: Events.xml:277
#, no-c-format
msgid "URL rewriting with page parameters"
-msgstr ""
+msgstr "Riscrittura URL con parametri di pagina"
#. Tag: para
#: Events.xml:278
@@ -916,7 +916,7 @@
#: Events.xml:468
#, no-c-format
msgid "The view-id may be given as a JSF EL expression:"
-msgstr ""
+msgstr "Il view-id può essere assegnato come espressione JSF EL:"
#. Tag: programlisting
#: Events.xml:472
@@ -1586,7 +1586,7 @@
#: Events.xml:680
#, no-c-format
msgid "You can even use Seam interceptors with JavaBean components, not just EJB3 beans!"
-msgstr ""
+msgstr "Si possono usare gli interceptor Seam anche con i componenti JavaBean, non solo bean EJB3!"
#. Tag: para
#: Events.xml:684
@@ -1728,7 +1728,7 @@
#: Events.xml:788
#, no-c-format
msgid "You can also use EL to specify the <literal>viewId</literal> to redirect to."
-msgstr ""
+msgstr "Si può anche usare EL per specificare il <literal>viewId</literal> a cui reindirizzare."
#. Tag: para
#: Events.xml:792
@@ -1860,7 +1860,7 @@
#: Events.xml:829
#, no-c-format
msgid "<literal>org.jboss.seam.handledException</literal> holds the nested exception that was actually handled by an exception handler. The outermost (wrapper) exception is also available, as <literal>org.jboss.seam.caughtException</literal>."
-msgstr ""
+msgstr "<literal>org.jboss.seam.handledException</literal> mantiene l'eccezione annidata che è stata gestita dall'exception handler. L'eccezione più esterna (wrapper) è disponibile, come <literal>org.jboss.seam.caughtException</literal>."
#. Tag: title
#: Events.xml:836
@@ -2042,7 +2042,7 @@
#: Events.xml:894
#, no-c-format
msgid "A <literal>ViewExpiredException</literal> occurs if the user posts back to a page once their session has expired. <literal>no-conversation-view-id</literal> and <literal>conversation-required</literal> give you finer grained control over session expiration if you are inside a conversation."
-msgstr ""
+msgstr "Avviene una <literal>ViewExpiredException</literal> se l'utente invia una pagina quando la sessione è scaduta. <literal>no-conversation-view-id</literal> e <literal>conversation-required</literal> consentono un controllo più fine sulla scadenza della sessione se si è all'interno di una conversazione."
#. Tag: title
#: Events.xml:904
15 years, 6 months
Seam SVN: r10908 - branches/community/Seam_2_1/seam-gen.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-13 12:13:13 -0400 (Wed, 13 May 2009)
New Revision: 10908
Modified:
branches/community/Seam_2_1/seam-gen/build.xml
Log:
remove hardcoded values and use tokens for ejb-local-ref entry
Modified: branches/community/Seam_2_1/seam-gen/build.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/build.xml 2009-05-13 13:08:35 UTC (rev 10907)
+++ branches/community/Seam_2_1/seam-gen/build.xml 2009-05-13 16:13:13 UTC (rev 10908)
@@ -970,10 +970,10 @@
<replacevalue><![CDATA[ <!-- uncomment <ejb-local-ref> entries when deploying to GlassFish and (optionally) JBoss AS 5 -->
<!--
<ejb-local-ref>
- <ejb-ref-name>vehicles/AuthenticatorBean/local</ejb-ref-name>
+ <ejb-ref-name>@projectName@/AuthenticatorBean/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home/>
- <local>org.example.vehicles.action.Authenticator</local>
+ <local>@actionPackage@.Authenticator</local>
</ejb-local-ref>
-->
@@ -991,6 +991,7 @@
</replace>
<replace file="${project.home}/resources/WEB-INF/web.xml">
+ <replacefilter token="@actionPackage@" value="${action.package}"/>
<replacefilter token="@projectName@" value="${project.name}"/>
</replace>
15 years, 6 months