Seam SVN: r10907 - in branches/enterprise/JBPAPP_4_3_FP01: examples/todo/resources and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-05-13 09:08:35 -0400 (Wed, 13 May 2009)
New Revision: 10907
Modified:
branches/enterprise/JBPAPP_4_3_FP01/build/core.pom.xml
branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml
branches/enterprise/JBPAPP_4_3_FP01/examples/todo/resources/jbpm.cfg.xml
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ProcessInstance.java
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/TaskInstance.java
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Contexts.java
Log:
JBPAPP-1883
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/core.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/core.pom.xml 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/core.pom.xml 2009-05-13 13:08:35 UTC (rev 10907)
@@ -242,7 +242,7 @@
</dependency>
<dependency>
- <groupId>org.jbpm</groupId>
+ <groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-jpdl</artifactId>
<optional>true</optional>
</dependency>
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/root.pom.xml 2009-05-13 13:08:35 UTC (rev 10907)
@@ -247,9 +247,9 @@
</dependency>
<dependency>
- <groupId>org.jbpm</groupId>
+ <groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-jpdl</artifactId>
- <version>3.2.2.GA_SOA-P</version>
+ <version>3.2.5.SP5</version>
</dependency>
<dependency>
Modified: branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/build/ui.pom.xml 2009-05-13 13:08:35 UTC (rev 10907)
@@ -105,7 +105,7 @@
</dependency>
<dependency>
- <groupId>org.jbpm</groupId>
+ <groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-jpdl</artifactId>
<optional>true</optional>
<exclusions>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/todo/resources/jbpm.cfg.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/todo/resources/jbpm.cfg.xml 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/todo/resources/jbpm.cfg.xml 2009-05-13 13:08:35 UTC (rev 10907)
@@ -3,8 +3,9 @@
<jbpm-context>
<service name="persistence">
<factory>
- <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
+ <bean class="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory">
<field name="isTransactionEnabled"><false/></field>
+ <field name="isCurrentSessionEnabled"><true/></field>
</bean>
</factory>
</service>
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ManagedJbpmContext.java 2009-05-13 13:08:35 UTC (rev 10907)
@@ -83,6 +83,12 @@
throw new IllegalStateException("JbpmContext may only be used inside a transaction");
}
+ if (jbpmContext == null)
+ {
+ log.debug( "recreating seam managed jBPM context" );
+ jbpmContext = Jbpm.instance().getJbpmConfiguration().createJbpmContext() ;
+ }
+
if ( !synchronizationRegistered && !Lifecycle.isDestroying() && transaction.isActive() )
{
jbpmContext.getSession().isOpen();
@@ -100,7 +106,7 @@
public void beforeCompletion()
{
- log.debug( "flushing seam managed jBPM context" );
+ log.debug( "closing seam managed jBPM context" );
/*org.jbpm.graph.exe.ProcessInstance processInstance = ProcessInstance.instance();
if (processInstance!=null)
{
@@ -113,47 +119,41 @@
//destroyed, flush here:
Contexts.getBusinessProcessContext().flush();
}
- jbpmContext.getSession().flush();
- log.debug( "done flushing seam managed jBPM context" );
+ closeContext();
+ log.debug( "closed seam managed jBPM context" );
}
public void afterCompletion(int status)
{
synchronizationRegistered = false;
- if ( !Contexts.isEventContextActive() )
- {
- //in calls to MDBs and remote calls to SBs, the
- //transaction doesn't commit until after contexts
- //are destroyed, so wait until the transaction
- //completes before closing the session
- //on the other hand, if we still have an active
- //event context, leave it open
- closeContext();
- }
}
@Destroy
public void destroy()
{
- if ( !synchronizationRegistered )
- {
+// if ( !synchronizationRegistered )
+// {
//in requests that come through SeamPhaseListener,
//there can be multiple transactions per request,
//but they are all completed by the time contexts
- //are dstroyed
+ //are destroyed
//so wait until the end of the request to close
//the session
//on the other hand, if we are still waiting for
//the transaction to commit, leave it open
closeContext();
- }
+// }
}
private void closeContext()
{
- log.debug( "destroying seam managed jBPM context" );
- jbpmContext.close();
- log.debug( "done destroying seam managed jBPM context" );
+ if (jbpmContext != null)
+ {
+ log.debug( "destroying seam managed jBPM context" );
+ jbpmContext.close();
+ log.debug( "done destroying seam managed jBPM context" );
+ jbpmContext = null;
+ }
}
public static JbpmContext instance()
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ProcessInstance.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ProcessInstance.java 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/ProcessInstance.java 2009-05-13 13:08:35 UTC (rev 10907)
@@ -16,7 +16,6 @@
import org.jboss.seam.annotations.Unwrap;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.util.Work;
/**
* A Seam component that allows injection of the current
@@ -36,26 +35,16 @@
{
if ( !Contexts.isConversationContextActive() ) return null;
- return new Work<org.jbpm.graph.exe.ProcessInstance>()
+ Long processId = BusinessProcess.instance().getProcessId();
+ if (processId!=null)
{
-
- @Override
- protected org.jbpm.graph.exe.ProcessInstance work() throws Exception
- {
- Long processId = BusinessProcess.instance().getProcessId();
- if (processId!=null)
- {
- //TODO: do we need to cache this??
- return ManagedJbpmContext.instance().getProcessInstanceForUpdate(processId);
- }
- else
- {
- return null;
- }
- }
-
- }.workInTransaction();
-
+ //TODO: do we need to cache this??
+ return ManagedJbpmContext.instance().getProcessInstanceForUpdate(processId);
+ }
+ else
+ {
+ return null;
+ }
}
public static org.jbpm.graph.exe.ProcessInstance instance()
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/TaskInstance.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/TaskInstance.java 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/bpm/TaskInstance.java 2009-05-13 13:08:35 UTC (rev 10907)
@@ -36,25 +36,16 @@
{
if ( !Contexts.isConversationContextActive() ) return null;
- return new Work<org.jbpm.taskmgmt.exe.TaskInstance>()
+ Long taskId = BusinessProcess.instance().getTaskId();
+ if (taskId!=null)
{
-
- @Override
- protected org.jbpm.taskmgmt.exe.TaskInstance work() throws Exception
- {
- Long taskId = BusinessProcess.instance().getTaskId();
- if (taskId!=null)
- {
- //TODO: do we need to cache this??
- return ManagedJbpmContext.instance().getTaskInstanceForUpdate(taskId);
- }
- else
- {
- return null;
- }
- }
-
- }.workInTransaction();
+ //TODO: do we need to cache this??
+ return ManagedJbpmContext.instance().getTaskInstanceForUpdate(taskId);
+ }
+ else
+ {
+ return null;
+ }
}
public static org.jbpm.taskmgmt.exe.TaskInstance instance()
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Contexts.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Contexts.java 2009-05-13 08:55:13 UTC (rev 10906)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Contexts.java 2009-05-13 13:08:35 UTC (rev 10907)
@@ -18,6 +18,7 @@
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.transaction.Transaction;
+import org.jboss.seam.util.Work;
import org.jboss.seam.web.Session;
/**
@@ -344,17 +345,32 @@
//TODO: it would be nice if BP context spanned redirects along with the conversation
// this would also require changes to BusinessProcessContext
- boolean destroyBusinessProcessContext = !Init.instance().isJbpmInstalled() ||
- !BusinessProcess.instance().hasActiveProcess();
- if (destroyBusinessProcessContext)
+ try
{
- //TODO: note that this occurs from Lifecycle.endRequest(), after
- // the Seam-managed txn was committed, but Contexts.destroy()
- // calls BusinessProcessContext.getNames(), which hits the
- // database!
- log.debug("destroying business process context");
- destroy( getBusinessProcessContext() );
+ new Work<Object>()
+ {
+ @Override
+ protected Object work() throws Exception
+ {
+ boolean destroyBusinessProcessContext = !Init.instance().isJbpmInstalled() ||
+ !BusinessProcess.instance().hasActiveProcess();
+ if (destroyBusinessProcessContext)
+ {
+ //TODO: note that this occurs from Lifecycle.endRequest(), after
+ // the Seam-managed txn was committed, but Contexts.destroy()
+ // calls BusinessProcessContext.getNames(), which hits the
+ // database!
+ log.debug("destroying business process context");
+ destroy( getBusinessProcessContext() );
+ }
+ return null;
+ }
+ }.workInTransaction();
}
+ catch (final Exception ex)
+ {
+ log.warn("Exception destroying context ", ex);
+ }
}
if ( !Manager.instance().isLongRunningConversation() )
15 years, 6 months
Seam SVN: r10906 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-05-13 04:55:13 -0400 (Wed, 13 May 2009)
New Revision: 10906
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/Itext.po
Log:
JBSEAM-3767: Italian translation of Seam guide
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 00:08:24 UTC (rev 10905)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Events.po 2009-05-13 08:55:13 UTC (rev 10906)
@@ -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-04-25 20:11+0100\n"
+"PO-Revision-Date: 2009-05-13 10:54+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -23,7 +23,7 @@
#: Events.xml:7
#, no-c-format
msgid "Complementing the contextual component model, there are two further basic concepts that facilitate the extreme loose-coupling that is the distinctive feature of Seam applications. The first is a strong event model where events may be mapped to event listeners via JSF-like method binding expressions. The second is the pervasive use of annotations and interceptors to apply cross-cutting concerns to components which implement business logic."
-msgstr ""
+msgstr "A complemento del modello contestuale a componenti, ci sono due ulteriori concetti base che facilitano il disaccoppiamento estremo, caratteristica distintiva delle applicazioni Seam. Il primo è un forte modello a eventi in cui gli eventi possono essere mappati su degli event listener attraverso espressioni di method binding stile JSF. Il secondo è l'uso pervasivo di annotazioni ed interceptor per applicare concern incrociati ai componenti che implementano la business logic."
#. Tag: title
#: Events.xml:17
@@ -35,7 +35,7 @@
#: Events.xml:18
#, no-c-format
msgid "The Seam component model was developed for use with <emphasis>event-driven applications</emphasis>, specifically to enable the development of fine-grained, loosely-coupled components in a fine-grained eventing model. Events in Seam come in several types, most of which we have already seen:"
-msgstr ""
+msgstr "Il modello a componenti di Seam è stato sviluppato per l'uso con <emphasis>applicazioni event-driven</emphasis>, specificatamente per consentire lo sviluppo di componenti a granularità fine, disaccoppiati in un modello a eventi a granularità fine. Gli eventi in Seam avvengono in parecchi modi, la maggior parte dei quali è già stata vista:"
#. Tag: para
#: Events.xml:27
@@ -71,7 +71,7 @@
#: Events.xml:43
#, no-c-format
msgid "All of these various kinds of events are mapped to Seam components via JSF EL method binding expressions. For a JSF event, this is defined in the JSF template:"
-msgstr ""
+msgstr "Tutti questi vari tipi di eventi sono mappati sui componenti Seam tramite espressioni di method binding JSF EL. Per un evento JSF, questo è definito nel template JSF:"
#. Tag: programlisting
#: Events.xml:48
@@ -83,7 +83,7 @@
#: Events.xml:52
#, no-c-format
msgid "For a jBPM transition event, it is specified in the jBPM process definition or pageflow definition:"
-msgstr ""
+msgstr "Per un evento di transizione jBPM, è specificato nella definizione di processo o nella definizione di pageflow:"
#. Tag: programlisting
#: Events.xml:57
@@ -105,7 +105,7 @@
#: Events.xml:59
#, no-c-format
msgid "You can find out more information about JSF events and jBPM events elsewhere. Let's concentrate for now upon the two additional kinds of events defined by Seam."
-msgstr ""
+msgstr "In altri luoghi si possono trovare maggiori informazioni sugli eventi JSF e sugli eventi jBPM. Concentriamoci ora sui due tipi di evento aggiuntivi definiti da Seam."
#. Tag: title
#: Events.xml:66
@@ -117,7 +117,7 @@
#: Events.xml:68
#, no-c-format
msgid "A Seam page action is an event that occurs just before we render a page. We declare page actions in <literal>WEB-INF/pages.xml</literal>. We can define a page action for either a particular JSF view id:"
-msgstr ""
+msgstr "Un'azione di pagina Seam è un evento che avviene appena prima che la pagina viene renderizzata. Si dichiarano le azioni di pagina in <literal>WEB-INF/pages.xml</literal>. Si può definire un'azione di pagina anche per un particolare id di vista JSF:"
#. Tag: programlisting
#: Events.xml:74
@@ -135,7 +135,7 @@
#: Events.xml:76
#, no-c-format
msgid "Or we can use a <literal>*</literal> wildcard as a suffix to the <literal>view-id</literal> to specify an action that applies to all view ids that match the pattern:"
-msgstr ""
+msgstr "Oppure si può usare il wildcard <literal>*</literal> come suffisso a <literal>view-id</literal> per specificare un'azione che si applica a tutti gli id di vista che corrispondono al pattern:"
#. Tag: programlisting
#: Events.xml:82
@@ -153,19 +153,19 @@
#: Events.xml:84
#, no-c-format
msgid "Keep in mind that if the <literal><page></literal> element is defined in a fine-grained page descriptor, the <literal>view-id</literal> attribute can be left off since it is implied."
-msgstr ""
+msgstr "Si tenga presente che se l'elemento <literal><page></literal> è definito in un descrittore di pagina a granularità fine, l'attributo <literal>view-id</literal> può essere tralasciato poiché implicito."
#. Tag: para
#: Events.xml:90
#, no-c-format
msgid "If multiple wildcarded page actions match the current view-id, Seam will call all the actions, in order of least-specific to most-specific."
-msgstr ""
+msgstr "Se più azioni di pagina con wildcard corrispondono al corrente id di vista, Seam chiamerà tutte le azioni, nell'ordine dal meno al più specifico."
#. Tag: para
#: Events.xml:95
#, no-c-format
msgid "The page action method can return a JSF outcome. If the outcome is non-null, Seam will use the defined navigation rules to navigate to a view."
-msgstr ""
+msgstr "Il metodo di azione di pagine può restituire un esito JSF. Se l'esito è non-null, Seam userà le regole di navigazione definite per andare verso una vista."
#. Tag: para
#: Events.xml:100
@@ -277,19 +277,19 @@
#: Events.xml:161
#, no-c-format
msgid "You can use page parameters with or without an action method."
-msgstr ""
+msgstr "Si possono usare i parametri di pagina con o senza metodo d'azione."
#. Tag: title
#: Events.xml:166
#, no-c-format
msgid "Mapping request parameters to the model"
-msgstr ""
+msgstr "Mappatura dei parametri di richiesta sul modello"
#. Tag: para
#: Events.xml:168
#, no-c-format
msgid "Seam lets us provide a value binding that maps a named request parameter to an attribute of a model object."
-msgstr ""
+msgstr "Seam lascia fornire un valore di binding che mappa un parametro di richiesta su un attributo di un oggetto del modello."
#. Tag: programlisting
#: Events.xml:173
@@ -313,13 +313,13 @@
#: Events.xml:175
#, no-c-format
msgid "The <literal><param></literal> declaration is bidirectional, just like a value binding for a JSF input:"
-msgstr ""
+msgstr "La dichiarazione <literal><param></literal> è bidirezionale, proprio come un valore di binding per un input JSF:"
#. Tag: para
#: Events.xml:182
#, no-c-format
msgid "When a non-faces (GET) request for the view id occurs, Seam sets the value of the named request parameter onto the model object, after performing appropriate type conversions."
-msgstr ""
+msgstr "Quando avviene una richiesta non-faces (GET) per un id di vista, Seam imposta il valore del parametro di richiesta sull'oggetto del modello, dopo aver operato le dovute conversioni sul tipo."
#. Tag: para
#: Events.xml:189
@@ -385,7 +385,7 @@
#: Events.xml:245
#, no-c-format
msgid "Any <literal><s:link></literal> or <literal><s:button></literal> transparently propagates the request parameter if that parameter is listed as a page parameter for the view."
-msgstr ""
+msgstr "Qualsiasi <literal><s:link></literal> o <literal><s:button></literal> propaga in modo trasparente il parametro di richiesta se tale parametro è elencato come parametro di pagina per la vista."
#. Tag: para
#: Events.xml:252
@@ -1866,7 +1866,7 @@
#: Events.xml:836
#, no-c-format
msgid "Suppressing exception logging"
-msgstr ""
+msgstr "Soppressione del log delle eccezioni"
#. Tag: para
#: Events.xml:838
@@ -1894,7 +1894,7 @@
#: Events.xml:849
#, no-c-format
msgid "If the <literal>log</literal> attribute is not specified, then it defaults to <literal>true</literal> (i.e. the exception will be logged). Alternatively, you can specify the <literal>log-level</literal> to control at which log level the exception will be logged:"
-msgstr ""
+msgstr "Se l'attributo <literal>log</literal> non è specificato, allora il suo default è <literal>true</literal> (cioè l'eccezione viene loggata). in alternativa, si può specificare il <literal>log-level</literal> per controllare a quale livello verrà loggata l'eccezione:"
#. Tag: programlisting
#: Events.xml:855
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Itext.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Itext.po 2009-05-13 00:08:24 UTC (rev 10905)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Itext.po 2009-05-13 08:55:13 UTC (rev 10906)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-05-10 10:18+0000\n"
-"PO-Revision-Date: 2009-05-10 12:27+0100\n"
+"PO-Revision-Date: 2009-05-13 10:29+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -1328,7 +1328,7 @@
#: Itext.xml:1809
#, no-c-format
msgid "<literal>dataset</literal> — The dataset to be displayed, if programmatic dataset is being used."
-msgstr "literal>dataset</literal> — Il dataset da visualizzare, se viene usato un dataset via codice."
+msgstr "<literal>dataset</literal> — Il dataset da visualizzare, se viene usato un dataset via codice."
#. Tag: para
#: Itext.xml:1372
15 years, 6 months
Seam SVN: r10905 - modules/trunk/security/src/main/java/org/jboss/seam/security.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-12 20:08:24 -0400 (Tue, 12 May 2009)
New Revision: 10905
Modified:
modules/trunk/security/src/main/java/org/jboss/seam/security/RememberMe.java
Log:
fix compile errors
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/RememberMe.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/RememberMe.java 2009-05-12 21:44:15 UTC (rev 10904)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/RememberMe.java 2009-05-13 00:08:24 UTC (rev 10905)
@@ -20,7 +20,7 @@
import org.jboss.seam.security.events.QuietLoginEvent;
import org.jboss.seam.security.management.IdentityManager;
import org.jboss.seam.security.util.Base64;
-import org.jboss.seam.view.Selector;
+import org.jboss.seam.web.ManagedCookie;
/**
* Remember-me functionality is provided by this class, in two different flavours. The first mode
@@ -71,8 +71,8 @@
}
}
- private Selector usernameSelector;
- private Selector tokenSelector;
+ private ManagedCookie usernameSelector;
+ private ManagedCookie tokenSelector;
private TokenStore tokenStore;
@@ -80,7 +80,7 @@
private boolean enabled;
- private int cookieMaxAge = Selector.DEFAULT_MAX_AGE;
+ private int cookieMaxAge = ManagedCookie.DEFAULT_MAX_AGE;
private boolean autoLoggedIn;
@@ -148,7 +148,7 @@
@Initializer
public void create()
{
- Bean<Selector> selectorBean = manager.resolveByType(Selector.class).iterator().next();
+ Bean<ManagedCookie> selectorBean = manager.resolveByType(ManagedCookie.class).iterator().next();
if (mode.equals(Mode.usernameOnly))
{
15 years, 6 months
Seam SVN: r10904 - branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-05-12 17:44:15 -0400 (Tue, 12 May 2009)
New Revision: 10904
Modified:
branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Concepts.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Concepts.po
===================================================================
--- branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Concepts.po 2009-05-12 12:05:36 UTC (rev 10903)
+++ branches/community/Seam_2_1/doc/Seam_Reference_Guide/it-IT/Concepts.po 2009-05-12 21:44:15 UTC (rev 10904)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-18 15:00+0000\n"
-"PO-Revision-Date: 2009-05-10 12:15+0100\n"
+"PO-Revision-Date: 2009-05-12 23:43+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -1206,7 +1206,7 @@
#: Concepts.xml:719
#, no-c-format
msgid "Session bean and entity bean Seam components support all the usual EJB 3.0 lifecycle callback (<literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, etc). But Seam also supports the use of any of these callbacks with JavaBean components. However, since these annotations are not available in a J2EE environment, Seam defines two additional component lifecycle callbacks, equivalent to <literal>@PostConstruct</literal> and <literal>@PreDestroy</literal>."
-msgstr ""
+msgstr "I componenti di Seam session ed entity bean supportano tutte le chiamate del ciclo di vita EJB3.0 (<literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, ecc). Ma Seam supporta anche l'uso di queste chiamate con i componenti JavaBean. Comunque, poiché queste annotazioni non sono disponibile in un ambiente J2EE, Seam definisce due chiamate aggiuntive al ciclo di vita del componente, equivalenti a <literal>@PostConstruct</literal> e <literal>@PreDestroy</literal>."
#. Tag: para
#: Concepts.xml:727
@@ -1224,13 +1224,13 @@
#: Concepts.xml:737
#, no-c-format
msgid "In addition, stateful session bean components <emphasis>must</emphasis> define a method with no parameters annotated <literal>@Remove</literal>. This method is called by Seam when the context ends."
-msgstr ""
+msgstr "In aggiunta, i componenti bean stateful session <emphasis>devono</emphasis> definire un metodo senza paramentri annotato con <literal>@Remove</literal>. Questo metodo viene chiamato da Seam quando termina il contesto."
#. Tag: para
#: Concepts.xml:742
#, no-c-format
msgid "Finally, a related annotation is the <literal>@Startup</literal> annotation, which may be applied to any application or session scoped component. The <literal>@Startup</literal> annotation tells Seam to instantiate the component immediately, when the context begins, instead of waiting until it is first referenced by a client. It is possible to control the order of instantiation of startup components by specifying <literal>@Startup(depends={....})</literal>."
-msgstr ""
+msgstr "Infine, un'annotazione collegata è l'annotazione <literal>@Startup</literal>, che può essere applicata ad ogni componente con scope applicazione o sessione. L'annotazione <literal>@Startup</literal> dice a Seam di istanziare immediatamente il componente, quand inizia il contesto, invece di aspettare che venga referenziato per primo dal client. E' possibile controllare l'ordine di istanziamento dei componenti startup specificando <literal>@Startup(depends={....})</literal>."
#. Tag: title
#: Concepts.xml:753
@@ -1248,19 +1248,19 @@
#: Concepts.xml:762
#, no-c-format
msgid "You want to mock out some infrastructural component in tests."
-msgstr ""
+msgstr "Si vogliono costruire dei mock per qualche componente infrastrutturale da testare."
#. Tag: para
#: Concepts.xml:767
#, no-c-format
msgid "You want change the implementation of a component in certain deployment scenarios."
-msgstr ""
+msgstr "Si vuole cambiare l'implementazione di un componente in certi scenari di deploy."
#. Tag: para
#: Concepts.xml:773
#, no-c-format
msgid "You want to install some components only if their dependencies are available (useful for framework authors)."
-msgstr ""
+msgstr "Si vogliono installare alcuni componenti solo se le loro dipendenze sono disponibili (utile per gli autori di framework)."
#. Tag: para
#: Concepts.xml:780
@@ -1272,7 +1272,7 @@
#: Concepts.xml:785
#, no-c-format
msgid "The precedence of a component is a number that Seam uses to decide which component to install when there are multiple classes with the same component name in the classpath. Seam will choose the component with the higher precendence. There are some predefined precedence values (in ascending order):"
-msgstr ""
+msgstr "La precedenza di un componente è un numero che Seam usa per decidere quale componente installare quando ci sono più classi con lo stesso nome componente nel classpath. Seam sceglierà il componente con la precedenza più elevata. Ci sono alcuni valori di precedenza predefiniti (in ordine ascendente):"
#. Tag: para
#: Concepts.xml:794
@@ -1308,7 +1308,7 @@
#: Concepts.xml:825
#, no-c-format
msgid "Suppose we have a component named <literal>messageSender</literal> that talks to a JMS queue."
-msgstr ""
+msgstr "Si supponga di avere un componente chiamato <literal>messageSender</literal> che dialoga con una coda JMS."
#. Tag: programlisting
#: Concepts.xml:830
@@ -1332,7 +1332,7 @@
#: Concepts.xml:832
#, no-c-format
msgid "In our unit tests, we don't have a JMS queue available, so we would like to stub out this method. We'll create a <emphasis>mock</emphasis> component that exists in the classpath when unit tests are running, but is never deployed with the application:"
-msgstr ""
+msgstr "Nei test d'unità non si ha una coda JMS disponibile, e quindi si vuole costruire uno stub del metodo. Si creerà un componente <emphasis>mock</emphasis> che esiste nel classpath quando girano i test d'unità, ma non viene mai deployato con l'applicazione:"
#. Tag: programlisting
#: Concepts.xml:839
@@ -1358,13 +1358,13 @@
#: Concepts.xml:841
#, no-c-format
msgid "The <literal>precedence</literal> helps Seam decide which version to use when it finds both components in the classpath."
-msgstr ""
+msgstr "La <literal>precedenza</literal> aiuta Seam a decide quale versione usare quando vengono trovati entrambi i componenti nel classpath."
#. Tag: para
#: Concepts.xml:846
#, no-c-format
msgid "This is nice if we are able to control exactly which classes are in the classpath. But if I'm writing a reusable framework with many dependecies, I don't want to have to break that framework across many jars. I want to be able to decide which components to install depending upon what other components are installed, and upon what classes are available in the classpath. The <literal>@Install</literal> annotation also controls this functionality. Seam uses this mechanism internally to enable conditional installation of many of the built-in components. However, you probably won't need to use it in your application."
-msgstr ""
+msgstr "Sarebbe bello poter controllare esattamente quali classi sono nel classpath. Ma se si sta scrivendo un framework riusabile con molte dipendenze, non si vuole dover suddividere tale framework in molti jar. Si vuole poter decidere quali componenti installare a seconda di quali altri componenti sono installati, e a seconda di quali classi sono disponibili nel classpath. Anche l'annotazione <literal>@Install</literal> controlla questa funzionalità. Seam utilizza questo meccanismo internamente per abilitare l'installazione condizionale di molti componenti predefiniti. Comunque con ogni probabilità non lo si utilizzerà nelle applicazioni."
#. Tag: title
#: Concepts.xml:860
@@ -1408,7 +1408,7 @@
#: Concepts.xml:868
#, no-c-format
msgid "It is difficult to imagine how the code for a simple log message could possibly be more verbose. There is more lines of code tied up in logging than in the actual business logic! I remain totally astonished that the Java community has not come up with anything better in 10 years."
-msgstr ""
+msgstr "E' difficile immaginare come possa essere più prolisso il codice per un semplice messaggio di log. Ci sono più linee di codice per il loggin che per la business logic! Ci meravigliamo come la comunità Java non abbia fatto qualcosa di meglio in 10 anni."
#. Tag: para
#: Concepts.xml:874
@@ -1444,7 +1444,7 @@
#: Concepts.xml:886
#, no-c-format
msgid "Note that we don't need the noisy <literal>if ( log.isDebugEnabled() )</literal> guard, since string concatenation happens <emphasis>inside</emphasis> the <literal>debug()</literal> method. Note also that we don't usually need to specify the log category explicitly, since Seam knows what component it is injecting the <literal>Log</literal> into."
-msgstr ""
+msgstr "Si noti che non occorre il nioso controllo <literal>if ( log.isDebugEnabled() )</literal>, poiché la concatenazione della stringa avviene <emphasis>dentro</emphasis> il metodo <literal>debug()</literal>. Si noti inoltre che in genere non occorre specificare esplicitamente la categoria di log, poiché Seam conosce quale componente sta iniettando dentro <literal>Log</literal>."
#. Tag: para
#: Concepts.xml:901
@@ -1474,7 +1474,7 @@
#: Concepts.xml:908
#, no-c-format
msgid "Seam logging automagically chooses whether to send output to log4j or JDK logging. If log4j is in the classpath, Seam with use it. If it is not, Seam will use JDK logging."
-msgstr ""
+msgstr "Il logging di Seam sceglie automaticamente se inviare l'output a log4j o al logging JDK. Se log4j è nel classpath, Seam lo userà. Se non lo è, Seam userà il logging JDK."
#. Tag: title
#: Concepts.xml:916
@@ -1486,19 +1486,19 @@
#: Concepts.xml:917
#, no-c-format
msgid "Many application servers feature an amazingly broken implementation of <literal>HttpSession</literal> clustering, where changes to the state of mutable objects bound to the session are only replicated when the application calls <literal>setAttribute()</literal> explicitly. This is a source of bugs that can not effectively be tested for at development time, since they will only manifest when failover occurs. Furthermore, the actual replication message contains the entire serialized object graph bound to the session attribute, which is inefficient."
-msgstr ""
+msgstr "Molti application server forniscono un'incredibile implementazione inesatta del clustering <literal>HttpSession</literal>, dove i cambiamenti allo stato di oggetti mutabili legati alla sessione sono replicati solamente quando l'applicazione chiama esplicitamente <literal>setAttribute()</literal>. Questo è fonte di bug che non possono essere testati in modo efficace in fase di sviluppo, poiché si manifestano solo quando avviene un failover. Inoltre, il messaggio di replicazione contiene l'intero grafo oggetto serializzato associato all'attributo sessione, che è inefficiente."
#. Tag: para
#: Concepts.xml:926
#, no-c-format
msgid "Of course, EJB stateful session beans must perform automatic dirty checking and replication of mutable state and a sophisticated EJB container can introduce optimizations such as attribute-level replication. Unfortunately, not all Seam users have the good fortune to be working in an environment that supports EJB 3.0. So, for session and conversation scoped JavaBean and entity bean components, Seam provides an extra layer of cluster-safe state management over the top of the web container session clustering."
-msgstr ""
+msgstr "Certamente i bean EJB session stateful devono eseguire un dirty checking automatico e la replicazione dello stato mutabile, ed un sofisticato container EJB può introdurre ottimizzazioni quali la replicazione a livello di attributo. Sfortunatamente, non tutti gli utenti Seam hanno la fortuna di lavorare in un ambiente che supporta EJB 3.0. Quindi per i componenti JavaBean ed entity bean con scope sessione e conversazione, Seam fornisce un layer extra di gestione dello stato cluster-safe sopra il clustering di sessione del web container."
#. Tag: para
#: Concepts.xml:934
#, no-c-format
msgid "For session or conversation scoped JavaBean components, Seam automatically forces replication to occur by calling <literal>setAttribute()</literal> once in every request that the component was invoked by the application. Of course, this strategy is inefficient for read-mostly components. You can control this behavior by implementing the <literal>org.jboss.seam.core.Mutable</literal> interface, or by extending <literal>org.jboss.seam.core.AbstractMutable</literal>, and writing your own dirty-checking logic inside the component. For example,"
-msgstr ""
+msgstr "Per i componenti JavaBean con scope sessione o conversazione, Seam forza automaticamente la replicazione ad avvenire chiamando <literal>setAttribute()</literal> una sola volta per ogni richiesta in cui il componente viene invocato dall'applicazione. Certo che questa strategia è inefficiente per i componenti per lo più letti. Si può controllare questo comportamento implementando l'interfaccia <literal>org.jboss.seam.core.Mutable</literal>, od estendendo <literal>org.jboss.seam.core.AbstractMutable</literal>, e scrivendo la propria logica di dirty-checking dentro il componente. Per esempio, "
#. Tag: programlisting
#: Concepts.xml:943
@@ -1598,7 +1598,7 @@
#: Concepts.xml:951
#, no-c-format
msgid "For session or conversation scoped entity bean components, Seam automatically forces replication to occur by calling <literal>setAttribute()</literal> once in every request, <emphasis>unless the (conversation-scoped) entity is currently associated with a Seam-managed persistence context, in which case no replication is needed</emphasis>. This strategy is not necessarily efficient, so session or conversation scope entity beans should be used with care. You can always write a stateful session bean or JavaBean component to \"manage\" the entity bean instance. For example,"
-msgstr ""
+msgstr "Per i componenti entity bean con scope sessione o conversazione, Seam forza automaticamente la replicazione ad avvenire chiamando <literal>setAttribute()</literal> una sola volta per ogni richiesta, <emphasis>a menoché l'entity (con scope conversazione) sia associato ad un contesto di persistenza gestito da Seam, nel qual caso non occorre alcuna replicazione</emphasis>. Questa strategia non è necessariamente efficiente, quindi gli entity bean con scope sessione o conversazione dovrebbero essere usati con cautela. Si può sempre scrivere un componente session bean stateful o JavaBean per \"gestire\" l'istanza entity bean. Per esempio,"
#. Tag: programlisting
#: Concepts.xml:960
@@ -1640,7 +1640,7 @@
#: Concepts.xml:962
#, no-c-format
msgid "Note that the <literal>EntityHome</literal> class in the Seam Application Framework provides a great example of managing an entity bean instance using a Seam component."
-msgstr ""
+msgstr "Si noti che la classe <literal>EntityHome</literal> nel framework Seam fornisce un eccellente esempio di gestione di istanza entity bean usando un componente Seam."
#. Tag: title
#: Concepts.xml:970
@@ -1652,13 +1652,13 @@
#: Concepts.xml:971
#, no-c-format
msgid "We often need to work with objects that are not Seam components. But we still want to be able to inject them into our components using <literal>@In</literal> and use them in value and method binding expressions, etc. Sometimes, we even need to tie them into the Seam context lifecycle (<literal>@Destroy</literal>, for example). So the Seam contexts can contain objects which are not Seam components, and Seam provides a couple of nice features that make it easier to work with non-component objects bound to contexts."
-msgstr ""
+msgstr "Spesso occorre lavorare con oggetti che non sono componenti Seam. Ma si vuole comunque essere in grado di iniettarli nei componenti usando <literal>@In</literal> ed usarli nelle espressioni di value e method binding, ecc. A volte occorre anche legarli al ciclo di vita del contesto Seam (per esempio <literal>@Destroy</literal>). Quindi i contesti Seam possono contenere oggetti che non sono componenti Seam, e Seam fornisce un paio di funzionalità interessanti che facilitano il lavoro con oggetti non componenti associati ai contesti."
#. Tag: para
#: Concepts.xml:979
#, no-c-format
msgid "The <emphasis>factory component pattern</emphasis> lets a Seam component act as the instantiator for a non-component object. A <emphasis>factory method</emphasis> will be called when a context variable is referenced but has no value bound to it. We define factory methods using the <literal>@Factory</literal> annotation. The factory method binds a value to the context variable, and determines the scope of the bound value. There are two styles of factory method. The first style returns a value, which is bound to the context by Seam:"
-msgstr ""
+msgstr "Il <emphasis>pattern del componente factory</emphasis> lascia agire un componente Seam come istanziatore per un oggetto non componente. Un <emphasis>metodo factory</emphasis> verrà chiamato quando viene referenziata una variabile di contesto, ma nessun valore è associato ad essa. Si definiscono metodi factory usando l'annotazione <literal>@Factory</literal>. Il metodo factory associa il valore alla variabile di contesto, e determina lo scope del valore associato. Ci sono due stili di metodi factory. Il primo stile restituisce un valore, che è viene associato al contesto da Seam:"
#. Tag: programlisting
#: Concepts.xml:988
@@ -1702,13 +1702,13 @@
#: Concepts.xml:997
#, no-c-format
msgid "In both cases, the factory method is called when we reference the <literal>customerList</literal> context variable and its value is null, and then has no further part to play in the lifecycle of the value. An even more powerful pattern is the <emphasis>manager component pattern</emphasis>. In this case, we have a Seam component that is bound to a context variable, that manages the value of the context variable, while remaining invisible to clients."
-msgstr ""
+msgstr "In entrambi i casi il metodo factory viene chiamato quando si referenzia la variabile di contesto <literal>customerList</literal> ed il suo valore è null, e quindi non ha sono ulteriori parti in gioco nel ciclo di vita del valore. Un pattern ancora più potente è il <emphasis>pattern del componente manager</emphasis>. In questo caso c'è un componente Seam che è associato ad una variabile di contesto, e gestisce il valore di tale variabile, rimanendo invisibile ai client."
#. Tag: para
#: Concepts.xml:1005
#, no-c-format
msgid "A manager component is any component with an <literal>@Unwrap</literal> method. This method returns the value that will be visable to clients, and is called <emphasis>every time</emphasis> a context variable is referenced."
-msgstr ""
+msgstr "Un componente manager è un qualsiasi componente con un metodo <literal>@Unwrap</literal>. Questo metodo restituisce il valore che sarà visibile ai client, e viene chiamato <emphasis>ogni volta</emphasis> che viene referenziata una variabile di contesto."
#. Tag: programlisting
#: Concepts.xml:1013
@@ -1742,7 +1742,7 @@
#: Concepts.xml:1015
#, no-c-format
msgid "The manager component pattern is especially useful if we have an object where you need more control over the lifecycle of the component. For example, if you have a heavyweight object that needs a cleanup operation when the context ends you could <literal>@Unwrap</literal> the object, and perform cleanup in the <literal>@Destroy</literal> method of the manager component."
-msgstr ""
+msgstr "Il pattern del componente managerè utile specialmente se si ha un oggetto in cui serve un maggior controllo sul ciclo di vita. Per esempio, se si ha un oggetto pesante che necessita di un'operazione di cleanup quando termina il contesto, si potrebbere annotare l'oggetto con <literal>@Unwrap</literal> ed eseguire il cleanup nel metodo <literal>@Destroy</literal> del componente manager."
#. Tag: programlisting
#: Concepts.xml:1022
15 years, 6 months
Seam SVN: r10903 - modules/trunk/faces/src/main/java/org/jboss/seam/faces.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-12 08:05:36 -0400 (Tue, 12 May 2009)
New Revision: 10903
Modified:
modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java
Log:
fix compile errors
Modified: modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java 2009-05-12 12:02:44 UTC (rev 10902)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java 2009-05-12 12:05:36 UTC (rev 10903)
@@ -4,7 +4,7 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.seam.view.Selector;
+import org.jboss.seam.web.ManagedCookie;
/**
* Selector implementation for JSF environments
@@ -16,7 +16,7 @@
private static final long serialVersionUID = 7212365784926629129L;
@Override
- protected void clearCookieValue()
+ public void clearCookieValue()
{
Cookie cookie = getCookie();
if ( cookie!=null )
@@ -30,7 +30,7 @@
}
@Override
- protected Cookie getCookie()
+ public Cookie getCookie()
{
FacesContext ctx = FacesContext.getCurrentInstance();
if (ctx != null)
@@ -45,7 +45,7 @@
}
@Override
- protected void setCookieValueIfEnabled(String value)
+ public void setCookieValueIfEnabled(String value)
{
FacesContext ctx = FacesContext.getCurrentInstance();
15 years, 6 months
Seam SVN: r10902 - modules/trunk/parent.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-12 08:02:44 -0400 (Tue, 12 May 2009)
New Revision: 10902
Modified:
modules/trunk/parent/pom.xml
Log:
removed view module
Modified: modules/trunk/parent/pom.xml
===================================================================
--- modules/trunk/parent/pom.xml 2009-05-12 11:56:59 UTC (rev 10901)
+++ modules/trunk/parent/pom.xml 2009-05-12 12:02:44 UTC (rev 10902)
@@ -99,7 +99,6 @@
<module>../faces</module>
<module>../drools</module>
<module>../security</module>
- <module>../view</module>
</modules>
<dependencies>
15 years, 6 months
Seam SVN: r10901 - modules/trunk/security.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-12 07:56:59 -0400 (Tue, 12 May 2009)
New Revision: 10901
Modified:
modules/trunk/security/pom.xml
Log:
changed dependency
Modified: modules/trunk/security/pom.xml
===================================================================
--- modules/trunk/security/pom.xml 2009-05-12 11:55:44 UTC (rev 10900)
+++ modules/trunk/security/pom.xml 2009-05-12 11:56:59 UTC (rev 10901)
@@ -73,7 +73,7 @@
<dependency>
<groupId>${seam.groupId}</groupId>
- <artifactId>seam-view</artifactId>
+ <artifactId>seam-web</artifactId>
</dependency>
<!--
15 years, 6 months
Seam SVN: r10900 - in modules/trunk: faces and 2 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-05-12 07:55:44 -0400 (Tue, 12 May 2009)
New Revision: 10900
Added:
modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java
modules/trunk/web/src/main/java/org/jboss/seam/web/ManagedCookie.java
Removed:
modules/trunk/view/
Modified:
modules/trunk/faces/pom.xml
Log:
merge view with web module
Modified: modules/trunk/faces/pom.xml
===================================================================
--- modules/trunk/faces/pom.xml 2009-05-12 07:11:16 UTC (rev 10899)
+++ modules/trunk/faces/pom.xml 2009-05-12 11:55:44 UTC (rev 10900)
@@ -59,6 +59,11 @@
<groupId>${seam.groupId}</groupId>
<artifactId>seam-international</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>${seam.groupId}</groupId>
+ <artifactId>seam-web</artifactId>
+ </dependency>
<dependency>
<groupId>${webbeans.groupId}</groupId>
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/FacesManagedCookie.java 2009-05-12 11:55:44 UTC (rev 10900)
@@ -0,0 +1,61 @@
+package org.jboss.seam.faces;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.seam.view.Selector;
+
+/**
+ * Selector implementation for JSF environments
+ *
+ * @author Shane Bryzak
+ */
+public class FacesManagedCookie extends ManagedCookie
+{
+ private static final long serialVersionUID = 7212365784926629129L;
+
+ @Override
+ protected void clearCookieValue()
+ {
+ Cookie cookie = getCookie();
+ if ( cookie!=null )
+ {
+ HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
+ cookie.setValue(null);
+ cookie.setPath(getCookiePath());
+ cookie.setMaxAge(0);
+ response.addCookie(cookie);
+ }
+ }
+
+ @Override
+ protected Cookie getCookie()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ if (ctx != null)
+ {
+ return (Cookie) ctx.getExternalContext().getRequestCookieMap()
+ .get( getCookieName() );
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ @Override
+ protected void setCookieValueIfEnabled(String value)
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+
+ if ( isCookieEnabled() && ctx != null)
+ {
+ HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse();
+ Cookie cookie = new Cookie( getCookieName(), value );
+ cookie.setMaxAge( getCookieMaxAge() );
+ cookie.setPath(getCookiePath());
+ response.addCookie(cookie);
+ }
+ }
+}
Added: modules/trunk/web/src/main/java/org/jboss/seam/web/ManagedCookie.java
===================================================================
--- modules/trunk/web/src/main/java/org/jboss/seam/web/ManagedCookie.java (rev 0)
+++ modules/trunk/web/src/main/java/org/jboss/seam/web/ManagedCookie.java 2009-05-12 11:55:44 UTC (rev 10900)
@@ -0,0 +1,158 @@
+package org.jboss.seam.web;
+
+import java.io.Serializable;
+
+import javax.servlet.http.Cookie;
+
+/**
+ * Support for selector objects which remember their selection as a cookie
+ *
+ * @author Gavin King
+ * @author Shane Bryzak
+ */
+public abstract class ManagedCookie implements Serializable
+{
+ private static final long serialVersionUID = 8851522639722586279L;
+
+ /**
+ * 1 Year, in seconds
+ */
+ public static final int DEFAULT_MAX_AGE = 31536000;
+
+ /**
+ * Is the cookie enabled
+ */
+ private boolean cookieEnabled;
+
+ /**
+ * The maximum age of the cookie
+ */
+ private int cookieMaxAge = DEFAULT_MAX_AGE;
+
+ /**
+ * The path of the cookie
+ */
+ private String cookiePath= "/";
+
+ /**
+ * The name of the cookie
+ */
+ private String cookieName;
+
+ /**
+ * Is the cookie enabled?
+ *
+ * @return false by default
+ */
+ public boolean isCookieEnabled()
+ {
+ return cookieEnabled;
+ }
+
+ /**
+ * Sets the enabled status of the cookie
+ *
+ * @param cookieEnabled
+ */
+ public void setCookieEnabled(boolean cookieEnabled)
+ {
+ this.cookieEnabled = cookieEnabled;
+ }
+
+ /**
+ * The max age of the cookie
+ * @return 1 year by default
+ */
+ public int getCookieMaxAge()
+ {
+ return cookieMaxAge;
+ }
+
+ /**
+ * Sets the maximum age of the cookie
+ *
+ * @param cookieMaxAge The maximum age of the cookie, in seconds
+ */
+ public void setCookieMaxAge(int cookieMaxAge)
+ {
+ this.cookieMaxAge = cookieMaxAge;
+ }
+
+ /**
+ * Returns the path of the cookie.
+ *
+ * @return String The cookie path
+ */
+ public String getCookiePath()
+ {
+ return cookiePath;
+ }
+
+ /**
+ * Sets the path of the cookie.
+ *
+ * @param cookiePath The cookie path
+ */
+ public void setCookiePath(String cookiePath)
+ {
+ this.cookiePath = cookiePath;
+ }
+
+ /**
+ * Returns the name of the cookie.
+ *
+ * @return String The name of the cookie
+ */
+ public String getCookieName()
+ {
+ return cookieName;
+ }
+
+ /**
+ * Sets the cookie name.
+ *
+ * @param cookieName String The name of the cookie
+ */
+ public void setCookieName(String cookieName)
+ {
+ this.cookieName = cookieName;
+ }
+
+ /**
+ * Get the value of the cookie, if this selector is enabled
+ *
+ * @return String The value of the cookie if this selector is enabled, otherwise null.
+ */
+ public String getCookieValueIfEnabled()
+ {
+ return isCookieEnabled() ? getCookieValue() : null;
+ }
+
+ /**
+ * Returns the Cookie instance.
+ *
+ * @return Cookie The cookie instance.
+ */
+ public abstract Cookie getCookie();
+
+ /**
+ * Returns the cookie value.
+ *
+ * @return String The current value of the cookie.
+ */
+ public String getCookieValue()
+ {
+ Cookie cookie = getCookie();
+ return cookie == null ? null : cookie.getValue();
+ }
+
+ /**
+ * Clears the cookie value.
+ */
+ public abstract void clearCookieValue();
+
+ /**
+ * Sets the cookie value.
+ */
+ public abstract void setCookieValueIfEnabled(String value);
+}
\ No newline at end of file
15 years, 6 months
Seam SVN: r10899 - modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-12 03:11:16 -0400 (Tue, 12 May 2009)
New Revision: 10899
Modified:
modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeServiceLoaderTest.java
modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeTest.java
Log:
cleanup imports
Modified: modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeServiceLoaderTest.java
===================================================================
--- modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeServiceLoaderTest.java 2009-05-12 07:11:03 UTC (rev 10898)
+++ modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeServiceLoaderTest.java 2009-05-12 07:11:16 UTC (rev 10899)
@@ -1,13 +1,12 @@
package org.jboss.seam.bridge;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import javax.context.RequestScoped;
import javax.inject.manager.Manager;
+import org.jboss.seam.bridge.spi.ManagerProvider;
import org.jboss.seam.bridge.stubs.ManagerProviderStub;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.test.AbstractWebBeansTest;
@@ -43,12 +42,12 @@
@Test
public void testLoadValidManagerProvider()
{
- assertNotNull(ManagerBridge.getProvider());
- assertTrue(ManagerBridge.getProvider() instanceof ManagerProviderStub);
- assertSame(ManagerBridge.getProvider().getRootManager(), getCurrentManager());
- assertSame(ManagerBridge.getProvider().getCurrentManager(), getCurrentManager());
+ ManagerProvider provider = ManagerBridge.getProvider();
+ assertTrue(provider instanceof ManagerProviderStub);
+ assertSame(provider.getRootManager(), getCurrentManager());
+ assertSame(provider.getCurrentManager(), getCurrentManager());
Manager currentManager = getCurrentManager().setCurrent(RequestScoped.class);
- assertSame(ManagerBridge.getProvider().getCurrentManager(), currentManager);
+ assertSame(provider.getCurrentManager(), currentManager);
}
}
Modified: modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeTest.java
===================================================================
--- modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeTest.java 2009-05-12 07:11:03 UTC (rev 10898)
+++ modules/trunk/bridge-api/src/test/java/org/jboss/seam/bridge/ManagerBridgeTest.java 2009-05-12 07:11:16 UTC (rev 10899)
@@ -1,16 +1,15 @@
package org.jboss.seam.bridge;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import javax.context.RequestScoped;
import javax.inject.manager.Manager;
+import org.jboss.seam.bridge.spi.ManagerProvider;
+import org.jboss.seam.bridge.stubs.IncorrectManagerProviderResolverStub;
+import org.jboss.seam.bridge.stubs.ManagerProviderResolverStub;
import org.jboss.seam.bridge.stubs.ManagerProviderStub;
-import org.jboss.seam.bridge.stubs.ManagerProviderResolverStub;
-import org.jboss.seam.bridge.stubs.IncorrectManagerProviderResolverStub;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.BeforeMethod;
@@ -47,11 +46,12 @@
ManagerBridge bridge = new ManagerBridge();
bridge.setResolverClass(ManagerProviderResolverStub.class);
bridge.onManagerDeployed(getCurrentManager());
- assertTrue(ManagerBridge.getProvider() instanceof ManagerProviderStub);
- assertSame(ManagerBridge.getProvider().getRootManager(), getCurrentManager());
- assertSame(ManagerBridge.getProvider().getCurrentManager(), getCurrentManager());
+ ManagerProvider provider = ManagerBridge.getProvider();
+ assertTrue(provider instanceof ManagerProviderStub);
+ assertSame(provider.getRootManager(), getCurrentManager());
+ assertSame(provider.getCurrentManager(), getCurrentManager());
Manager currentManager = getCurrentManager().setCurrent(RequestScoped.class);
- assertSame(ManagerBridge.getProvider().getCurrentManager(), currentManager);
+ assertSame(provider.getCurrentManager(), currentManager);
}
/**
15 years, 6 months
Seam SVN: r10898 - in modules/trunk/webbeans-bridge: src and 15 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-12 03:11:03 -0400 (Tue, 12 May 2009)
New Revision: 10898
Added:
modules/trunk/webbeans-bridge/src/test/
modules/trunk/webbeans-bridge/src/test/java/
modules/trunk/webbeans-bridge/src/test/java/org/
modules/trunk/webbeans-bridge/src/test/java/org/jboss/
modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/
modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/
modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/webbeans/
modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/webbeans/WebBeansManagerBridgeTest.java
modules/trunk/webbeans-bridge/src/test/resources/
modules/trunk/webbeans-bridge/src/test/resources/org/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/packaging/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/
modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
modules/trunk/webbeans-bridge/src/test/resources/test-suite.xml
Modified:
modules/trunk/webbeans-bridge/pom.xml
Log:
add tests to verify the WebBeansManagerProvider is loaded properly
Modified: modules/trunk/webbeans-bridge/pom.xml
===================================================================
--- modules/trunk/webbeans-bridge/pom.xml 2009-05-12 07:00:44 UTC (rev 10897)
+++ modules/trunk/webbeans-bridge/pom.xml 2009-05-12 07:11:03 UTC (rev 10898)
@@ -15,29 +15,12 @@
<name>Seam Web Beans Bridge</name>
<description>An implementation of the Seam Bridge SPI to obtain a Web Beans Manager.</description>
- <build>
- <plugins>
-
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/resources/test-suite.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
- </plugin>
- -->
-
- </plugins>
- </build>
-
<dependencies>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -59,4 +42,20 @@
</dependencies>
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/test-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
</project>
Added: modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/webbeans/WebBeansManagerBridgeTest.java
===================================================================
--- modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/webbeans/WebBeansManagerBridgeTest.java (rev 0)
+++ modules/trunk/webbeans-bridge/src/test/java/org/jboss/seam/bridge/webbeans/WebBeansManagerBridgeTest.java 2009-05-12 07:11:03 UTC (rev 10898)
@@ -0,0 +1,47 @@
+package org.jboss.seam.bridge.webbeans;
+
+import static org.testng.Assert.assertSame;
+import static org.testng.Assert.assertTrue;
+
+import javax.context.RequestScoped;
+import javax.inject.manager.Manager;
+
+import org.jboss.seam.bridge.ManagerBridge;
+import org.jboss.seam.bridge.spi.ManagerProvider;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.webbeans.el.WebBeansELResolver;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ * This test method bootstraps the WebBeans Manager with the ManagerBridge registered to
+ * verify that the ServiceLoader properly detects the correct ManagerProvider
+ * from META-INF/services/org.jboss.seam.bridge.spi.ManagerProvider. There
+ * should only be one method in this test class.
+ *
+ * @author Dan Allen
+ */
+public
+@Artifact
+(a)Classes(ManagerBridge.class)
+class WebBeansManagerBridgeTest extends AbstractWebBeansTest
+{
+ /**
+ * Check that when Web Beans booted, the ManagerBridge was instantiated
+ * and that the ServiceLoader detected and instantiated the ManagerProvider
+ * instance.
+ */
+ @Test
+ public void testLoadValidManagerProvider()
+ {
+ ManagerProvider provider = ManagerBridge.getProvider();
+ assertTrue(provider instanceof WebBeansManagerProvider);
+ assertSame(provider.getRootManager(), getCurrentManager());
+ assertSame(provider.getCurrentManager(), getCurrentManager());
+ Manager currentManager = getCurrentManager().setCurrent(RequestScoped.class);
+ assertSame(provider.getCurrentManager(), currentManager);
+ assertTrue(provider.getELResolver() instanceof WebBeansELResolver);
+ }
+
+}
Added: modules/trunk/webbeans-bridge/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
===================================================================
Added: modules/trunk/webbeans-bridge/src/test/resources/test-suite.xml
===================================================================
--- modules/trunk/webbeans-bridge/src/test/resources/test-suite.xml (rev 0)
+++ modules/trunk/webbeans-bridge/src/test/resources/test-suite.xml 2009-05-12 07:11:03 UTC (rev 10898)
@@ -0,0 +1,8 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Seam - Web Beans Bridge Module Test Suite" verbose="1">
+ <test name="Seam - Web Beans Bridge Module - Unit Tests">
+ <packages>
+ <package name="org.jboss.seam.bridge.webbeans"/>
+ </packages>
+ </test>
+</suite>
15 years, 6 months