Seam SVN: r7476 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/feeds.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-02-26 01:58:34 -0500 (Tue, 26 Feb 2008)
New Revision: 7476
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/feeds/WikiCommentFeedEntryManager.java
Log:
JBSEAM-2673, use given name as feedentry name for anonymous user comments
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/feeds/WikiCommentFeedEntryManager.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/feeds/WikiCommentFeedEntryManager.java 2008-02-26 06:31:00 UTC (rev 7475)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/feeds/WikiCommentFeedEntryManager.java 2008-02-26 06:58:34 UTC (rev 7476)
@@ -20,7 +20,7 @@
fe.setLink(wikiURLRenderer.renderURL(comment, true));
fe.setTitle(getFeedEntryTitle(comment));
- fe.setAuthor(comment.getCreatedBy().getFullname());
+ fe.setAuthor(comment.getCreatedBy().getFullname() != null ? comment.getCreatedBy().getFullname() : comment.getFromUserName());
fe.setUpdatedDate(fe.getPublishedDate());
// Do NOT use text/html, the fabulous Sun "Rome" software will
@@ -36,7 +36,7 @@
fe.setLink(wikiURLRenderer.renderURL(comment, true));
fe.setTitle(Messages.instance().get("lacewiki.label.comment.FeedEntryTitlePrefix") + " " + comment.getSubject());
- fe.setAuthor(comment.getCreatedBy().getFullname());
+ fe.setAuthor(comment.getCreatedBy().getFullname() != null ? comment.getCreatedBy().getFullname() : comment.getFromUserName());
fe.setUpdatedDate(comment.getLastModifiedOn());
fe.setDescriptionValue(getCommentDescription(comment));
16 years, 9 months
Seam SVN: r7475 - in trunk/examples/wiki/src: test/org/jboss/seam/wiki/test/editing and 1 other directory.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-02-26 01:31:00 -0500 (Tue, 26 Feb 2008)
New Revision: 7475
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/BasicNodeOperations.java
Log:
JBSEAM-2671, too much document content didn't trigger validation
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2008-02-26 02:09:39 UTC (rev 7474)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2008-02-26 06:31:00 UTC (rev 7475)
@@ -22,6 +22,7 @@
import org.jboss.seam.wiki.core.renderer.MacroWikiTextRenderer;
import org.jboss.seam.wiki.core.model.*;
import org.jboss.seam.wiki.preferences.Preferences;
+import org.hibernate.validator.Length;
import static javax.faces.application.FacesMessage.SEVERITY_INFO;
import java.util.*;
@@ -331,6 +332,8 @@
/* -------------------------- Public Features ------------------------------ */
+ // TODO: We need to duplicate this here, otherwise it will only validated on persist(): http://jira.jboss.com/jira/browse/JBSEAM-2671
+ @Length(min = 0, max = 32768)
public String getFormContent() {
// Load the document content and resolve links
if (formContent == null) syncInstanceToFormContent(getParentNode());
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/BasicNodeOperations.java
===================================================================
--- trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/BasicNodeOperations.java 2008-02-26 02:09:39 UTC (rev 7474)
+++ trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/BasicNodeOperations.java 2008-02-26 06:31:00 UTC (rev 7475)
@@ -10,13 +10,12 @@
import org.hibernate.Session;
import org.hibernate.ejb.HibernateEntityManagerFactory;
import org.jboss.seam.core.Conversation;
+import org.jboss.seam.faces.Redirect;
import org.jboss.seam.wiki.core.action.DirectoryHome;
import org.jboss.seam.wiki.core.action.DocumentHome;
import org.jboss.seam.wiki.core.model.WikiDirectory;
import org.jboss.seam.wiki.core.model.WikiDocument;
-import org.jboss.seam.wiki.core.model.WikiNode;
import org.jboss.seam.wiki.test.util.DBUnitSeamTest;
-import org.jboss.seam.faces.Redirect;
import org.testng.annotations.Test;
public class BasicNodeOperations extends DBUnitSeamTest {
@@ -55,7 +54,6 @@
assert dirHome.getChildDocuments().size() == 1;
assert dirHome.getMenuItems().size() == 0;
assert dirHome.getAvailableMenuItems().size() == 0;
- assert dirHome.getChildNodes().size() == 1;
}
}.run();
@@ -138,6 +136,31 @@
}
@Test
+ public void createDocumentTooMuchContent() throws Exception {
+
+ final String conversationId = new NonFacesRequest("/docEdit_d.xhtml") {
+ protected void beforeRequest() {
+ setParameter("parentDirectoryId", "3");
+ }
+ }.run();
+
+ new FacesRequest("/docEdit_d.xhtml") {
+
+ protected void beforeRequest() {
+ setParameter("cid", conversationId);
+ }
+
+ protected void processValidations() throws Exception {
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i <= 40000; i++) builder.append("a");
+ validateValue("#{documentHome.formContent}", builder.toString());
+ assert isValidationFailure();
+ }
+
+ }.run();
+ }
+
+ @Test
public void setDefaultDocument() throws Exception {
final String conversationId = new NonFacesRequest("/dirEdit_d.xhtml") {
16 years, 9 months
Seam SVN: r7474 - in trunk/examples/remoting/helloworld: src/org/jboss/seam/example/remoting and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-02-25 21:09:39 -0500 (Mon, 25 Feb 2008)
New Revision: 7474
Removed:
trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloLocal.java
Modified:
trunk/examples/remoting/helloworld/
trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloAction.java
trunk/examples/remoting/helloworld/view/helloworld.xhtml
Log:
simplified
Property changes on: trunk/examples/remoting/helloworld
___________________________________________________________________
Name: svn:ignore
+ build
exploded-archives
dist
Modified: trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloAction.java
===================================================================
--- trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloAction.java 2008-02-26 02:01:32 UTC (rev 7473)
+++ trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloAction.java 2008-02-26 02:09:39 UTC (rev 7474)
@@ -1,13 +1,12 @@
package org.jboss.seam.example.remoting;
-import javax.ejb.Stateless;
-
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.remoting.WebRemote;
-@Stateless
@Name("helloAction")
-public class HelloAction implements HelloLocal {
- public String sayHello(String name) {
- return "Hello, " + name;
- }
+public class HelloAction {
+ @WebRemote
+ public String sayHello(String name) {
+ return "Hello, " + name;
+ }
}
\ No newline at end of file
Deleted: trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloLocal.java
===================================================================
--- trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloLocal.java 2008-02-26 02:01:32 UTC (rev 7473)
+++ trunk/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/HelloLocal.java 2008-02-26 02:09:39 UTC (rev 7474)
@@ -1,11 +0,0 @@
-package org.jboss.seam.example.remoting;
-
-import javax.ejb.Local;
-import org.jboss.seam.annotations.remoting.WebRemote;
-
-@Local
-public interface HelloLocal {
- @WebRemote
- public String sayHello(String name);
-}
-
Modified: trunk/examples/remoting/helloworld/view/helloworld.xhtml
===================================================================
--- trunk/examples/remoting/helloworld/view/helloworld.xhtml 2008-02-26 02:01:32 UTC (rev 7473)
+++ trunk/examples/remoting/helloworld/view/helloworld.xhtml 2008-02-26 02:09:39 UTC (rev 7474)
@@ -19,19 +19,12 @@
<s:remote include="helloAction"/>
- <script type="text/javascript">
- //<![CDATA[
-
+ <script type="text/javascript">
function sayHello() {
var name = prompt("What is your name?");
- Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
+ var callback = function(result) { alert(result); };
+ Seam.Component.getInstance("helloAction").sayHello(name, callback);
}
-
- function sayHelloCallback(result) {
- alert(result);
- }
-
- // ]]>
</script>
<button onclick="javascript:sayHello()">Say Hello</button>
16 years, 9 months
Seam SVN: r7473 - trunk/examples.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-02-25 21:01:32 -0500 (Mon, 25 Feb 2008)
New Revision: 7473
Modified:
trunk/examples/build.xml
Log:
remoting jar must go in .ear/lib for annotations to work
Modified: trunk/examples/build.xml
===================================================================
--- trunk/examples/build.xml 2008-02-26 01:22:27 UTC (rev 7472)
+++ trunk/examples/build.xml 2008-02-26 02:01:32 UTC (rev 7473)
@@ -519,7 +519,6 @@
<fileset refid="seam.ioc.jar" />
<fileset refid="seam.mail.jar" />
<fileset refid="seam.pdf.jar" />
- <fileset refid="seam.remoting.jar" />
<fileset refid="seam.ui.jar" />
<fileset refid="facelets.jar" />
<fileset refid="urlrewrite.jar" />
@@ -566,7 +565,7 @@
<!-- Build the exploded ear -->
<target name="ear">
<copy todir="${ear.dir}">
- <fileset refid="seam.jar" />
+ <fileset refid="seam.jar" />
<fileset refid="ear.extras" />
<fileset refid="ear.resources" />
</copy>
@@ -589,6 +588,7 @@
<fileset refid="wicket-extensions.jar" />
<fileset refid="wicket-datetime.jar" />
<fileset refid="seam.wicket.jar" />
+ <fileset refid="seam.remoting.jar" />
<mapper type="flatten" />
</copy>
</target>
16 years, 9 months
Seam SVN: r7472 - in trunk/src/main/org/jboss/seam/security: jaas and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-02-25 20:22:27 -0500 (Mon, 25 Feb 2008)
New Revision: 7472
Removed:
trunk/src/main/org/jboss/seam/security/management/SecurityContext.java
Modified:
trunk/src/main/org/jboss/seam/security/RuleBasedPermissionResolver.java
trunk/src/main/org/jboss/seam/security/jaas/SeamLoginModule.java
trunk/src/main/org/jboss/seam/security/management/IdentityManager.java
Log:
separate identity stores for users and roles, remove wrapper class from working memory
Modified: trunk/src/main/org/jboss/seam/security/RuleBasedPermissionResolver.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/RuleBasedPermissionResolver.java 2008-02-25 21:57:31 UTC (rev 7471)
+++ trunk/src/main/org/jboss/seam/security/RuleBasedPermissionResolver.java 2008-02-26 01:22:27 UTC (rev 7472)
@@ -29,7 +29,6 @@
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.management.JpaIdentityStore;
-import org.jboss.seam.security.management.SecurityContext;
import org.jboss.seam.security.management.UserAccount;
@Name("org.jboss.seam.security.ruleBasedPermissionResolver")
@@ -241,9 +240,7 @@
if (Contexts.isEventContextActive() && Contexts.isSessionContextActive() &&
Contexts.getEventContext().isSet(JpaIdentityStore.AUTHENTICATED_USER))
{
- SecurityContext context = new SecurityContext();
- context.setUserAccount((UserAccount) Contexts.getEventContext().get(JpaIdentityStore.AUTHENTICATED_USER));
- getSecurityContext().insert(context);
+ getSecurityContext().insert(Contexts.getEventContext().get(JpaIdentityStore.AUTHENTICATED_USER));
}
}
}
Modified: trunk/src/main/org/jboss/seam/security/jaas/SeamLoginModule.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/jaas/SeamLoginModule.java 2008-02-25 21:57:31 UTC (rev 7471)
+++ trunk/src/main/org/jboss/seam/security/jaas/SeamLoginModule.java 2008-02-26 01:22:27 UTC (rev 7472)
@@ -117,7 +117,7 @@
// Otherwise if identity management is enabled, use it.
IdentityManager identityManager = IdentityManager.instance();
- if (identityManager != null && identityManager.getIdentityStore() != null)
+ if (identityManager != null && identityManager.isEnabled())
{
Identity identity = Identity.instance();
Modified: trunk/src/main/org/jboss/seam/security/management/IdentityManager.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/IdentityManager.java 2008-02-25 21:57:31 UTC (rev 7471)
+++ trunk/src/main/org/jboss/seam/security/management/IdentityManager.java 2008-02-26 01:22:27 UTC (rev 7472)
@@ -38,7 +38,8 @@
private static final LogProvider log = Logging.getLogProvider(IdentityManager.class);
- private IdentityStore identityStore;
+ private IdentityStore userIdentityStore;
+ private IdentityStore roleIdentityStore;
@Create
public void create()
@@ -48,13 +49,23 @@
protected void initIdentityStore()
{
- if (identityStore == null)
+ if (userIdentityStore == null)
{
- identityStore = (IdentityStore) Component.getInstance(IDENTITY_STORE_COMPONENT_NAME, true);
+ userIdentityStore = (IdentityStore) Component.getInstance(IDENTITY_STORE_COMPONENT_NAME, true);
}
- if (identityStore == null)
+ if (roleIdentityStore == null)
{
+ roleIdentityStore = (IdentityStore) Component.getInstance(IDENTITY_STORE_COMPONENT_NAME, true);
+ }
+
+ if (roleIdentityStore == null && userIdentityStore != null)
+ {
+ roleIdentityStore = userIdentityStore;
+ }
+
+ if (userIdentityStore == null || roleIdentityStore == null)
+ {
log.warn("no identity store available - please install an IdentityStore with the name '" +
IDENTITY_STORE_COMPONENT_NAME + "' if identity management is required.");
}
@@ -81,78 +92,78 @@
public boolean createUser(String name, String password)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_CREATE);
- return identityStore.createUser(name, password);
+ return userIdentityStore.createUser(name, password);
}
public boolean deleteUser(String name)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_DELETE);
- return identityStore.deleteUser(name);
+ return userIdentityStore.deleteUser(name);
}
public boolean enableUser(String name)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.enableUser(name);
+ return userIdentityStore.enableUser(name);
}
public boolean disableUser(String name)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.disableUser(name);
+ return userIdentityStore.disableUser(name);
}
public boolean changePassword(String name, String password)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.changePassword(name, password);
+ return userIdentityStore.changePassword(name, password);
}
public boolean isUserEnabled(String name)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_READ);
- return identityStore.isUserEnabled(name);
+ return userIdentityStore.isUserEnabled(name);
}
public boolean grantRole(String name, String role)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.grantRole(name, role);
+ return roleIdentityStore.grantRole(name, role);
}
public boolean revokeRole(String name, String role)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_UPDATE);
- return identityStore.revokeRole(name, role);
+ return roleIdentityStore.revokeRole(name, role);
}
public boolean createRole(String role)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_CREATE);
- return identityStore.createRole(role);
+ return roleIdentityStore.createRole(role);
}
public boolean deleteRole(String role)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_DELETE);
- return identityStore.deleteRole(role);
+ return roleIdentityStore.deleteRole(role);
}
public boolean userExists(String name)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_READ);
- return identityStore.userExists(name);
+ return userIdentityStore.userExists(name);
}
public boolean roleExists(String name)
{
- return identityStore.roleExists(name);
+ return roleIdentityStore.roleExists(name);
}
public List<String> listUsers()
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_READ);
- List<String> users = identityStore.listUsers();
+ List<String> users = userIdentityStore.listUsers();
Collections.sort(users, new Comparator<String>() {
public int compare(String value1, String value2) {
@@ -166,7 +177,7 @@
public List<String> listUsers(String filter)
{
Identity.instance().checkPermission(ACCOUNT_PERMISSION_NAME, PERMISSION_READ);
- List<String> users = identityStore.listUsers(filter);
+ List<String> users = userIdentityStore.listUsers(filter);
Collections.sort(users, new Comparator<String>() {
public int compare(String value1, String value2) {
@@ -179,7 +190,7 @@
public List<String> listRoles()
{
- List<String> roles = identityStore.listRoles();
+ List<String> roles = roleIdentityStore.listRoles();
Collections.sort(roles, new Comparator<String>() {
public int compare(String value1, String value2) {
@@ -192,27 +203,42 @@
public List<String> getGrantedRoles(String name)
{
- return identityStore.getGrantedRoles(name);
+ return roleIdentityStore.getGrantedRoles(name);
}
public List<String> getImpliedRoles(String name)
{
- return identityStore.getImpliedRoles(name);
+ return roleIdentityStore.getImpliedRoles(name);
}
public boolean authenticate(String username, String password)
{
- return identityStore.authenticate(username, password);
+ return userIdentityStore.authenticate(username, password);
}
- public IdentityStore getIdentityStore()
+ public IdentityStore getUserIdentityStore()
{
- return identityStore;
+ return userIdentityStore;
}
- public void setIdentityStore(IdentityStore identityStore)
+ public void setIdentityStore(IdentityStore userIdentityStore)
{
- this.identityStore = identityStore;
+ this.userIdentityStore = userIdentityStore;
}
+ public IdentityStore getRoleIdentityStore()
+ {
+ return roleIdentityStore;
+ }
+
+ public void setRoleIdentityStore(IdentityStore roleIdentityStore)
+ {
+ this.roleIdentityStore = roleIdentityStore;
+ }
+
+ public boolean isEnabled()
+ {
+ return userIdentityStore != null && roleIdentityStore != null;
+ }
+
}
Deleted: trunk/src/main/org/jboss/seam/security/management/SecurityContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/SecurityContext.java 2008-02-25 21:57:31 UTC (rev 7471)
+++ trunk/src/main/org/jboss/seam/security/management/SecurityContext.java 2008-02-26 01:22:27 UTC (rev 7472)
@@ -1,21 +0,0 @@
-package org.jboss.seam.security.management;
-
-/**
- * A wrapper that is inserted into the working memory for rule-based permissions.
- *
- * @author Shane Bryzak
- */
-public class SecurityContext
-{
- private UserAccount userAccount;
-
- public UserAccount getUserAccount()
- {
- return userAccount;
- }
-
- public void setUserAccount(UserAccount userAccount)
- {
- this.userAccount = userAccount;
- }
-}
16 years, 9 months
Seam SVN: r7471 - trunk/ui/src/main/java/org/jboss/seam/ui/facelet.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-02-25 16:57:31 -0500 (Mon, 25 Feb 2008)
New Revision: 7471
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java
Log:
Oops, fix examples.
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java 2008-02-24 12:28:29 UTC (rev 7470)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java 2008-02-25 21:57:31 UTC (rev 7471)
@@ -27,7 +27,7 @@
@Name("org.jboss.seam.ui.facelet.faceletsJBossLogging")
@Scope(APPLICATION)
-@Install(classDependencies={"com.sun.facelets.Facelet", "org.jboss.logging.Logger", "org.apache.log4j.Logger"}, precedence=BUILT_IN)
+@Install(classDependencies={"com.sun.facelets.Facelet", "org.jboss.logging.Logger", "org.apache.log4j.Logger", "org.jboss.seam.interop.jul.Log4JConversionFilter"}, precedence=BUILT_IN)
@Startup
@BypassInterceptors
public class FaceletsJBossLogging
16 years, 9 months
Seam SVN: r7470 - in trunk/examples/wiki/view: themes/default/img and 2 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-02-24 07:28:29 -0500 (Sun, 24 Feb 2008)
New Revision: 7470
Added:
trunk/examples/wiki/view/themes/default/img/menu_down.gif
trunk/examples/wiki/view/themes/default/img/menu_left.gif
trunk/examples/wiki/view/themes/default/img/menu_right.gif
trunk/examples/wiki/view/themes/default/img/menu_up.gif
trunk/examples/wiki/view/themes/inrelationto/img/menu_down.gif
trunk/examples/wiki/view/themes/inrelationto/img/menu_left.gif
trunk/examples/wiki/view/themes/inrelationto/img/menu_right.gif
trunk/examples/wiki/view/themes/inrelationto/img/menu_up.gif
trunk/examples/wiki/view/themes/sfwkorg/img/menu_down.gif
trunk/examples/wiki/view/themes/sfwkorg/img/menu_left.gif
trunk/examples/wiki/view/themes/sfwkorg/img/menu_right.gif
trunk/examples/wiki/view/themes/sfwkorg/img/menu_up.gif
Modified:
trunk/examples/wiki/view/plugins/faqBrowser/faqControls.xhtml
Log:
JBSEAM-2586, new icons for FAQ browser
Modified: trunk/examples/wiki/view/plugins/faqBrowser/faqControls.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/faqBrowser/faqControls.xhtml 2008-02-22 21:09:18 UTC (rev 7469)
+++ trunk/examples/wiki/view/plugins/faqBrowser/faqControls.xhtml 2008-02-24 12:28:29 UTC (rev 7470)
@@ -42,13 +42,13 @@
reRender="faqQuestions, faqQuestionsControl, faqCategoryLink, messageBoxContainer"
status="globalStatus"
rendered="#{not faqBrowser.directorySelected and not empty faqBrowser.tree and faqBrowser.tree.wrappedChildren.size() > 0}">
- <h:graphicImage value="#{themePath}/img/down.gif" width="18" height="18"/>
+ <h:graphicImage value="#{themePath}/img/menu_down.gif" width="18" height="18"/>
</a:commandLink>
<a:commandLink action="#{faqBrowser.hideQuestions}" tabindex="1"
reRender="faqQuestions, faqQuestionsControl, faqCategoryLink, messageBoxContainer"
status="globalStatus"
rendered="#{faqBrowser.directorySelected and not empty faqBrowser.tree and faqBrowser.tree.wrappedChildren.size() > 0}">
- <h:graphicImage value="#{themePath}/img/up.gif" width="18" height="18"/>
+ <h:graphicImage value="#{themePath}/img/menu_up.gif" width="18" height="18"/>
</a:commandLink>
</s:span>
Added: trunk/examples/wiki/view/themes/default/img/menu_down.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/menu_down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/default/img/menu_left.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/menu_left.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/default/img/menu_right.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/menu_right.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/default/img/menu_up.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/menu_up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/inrelationto/img/menu_down.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/inrelationto/img/menu_down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/inrelationto/img/menu_left.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/inrelationto/img/menu_left.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/inrelationto/img/menu_right.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/inrelationto/img/menu_right.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/inrelationto/img/menu_up.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/inrelationto/img/menu_up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/sfwkorg/img/menu_down.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/menu_down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/sfwkorg/img/menu_left.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/menu_left.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/sfwkorg/img/menu_right.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/menu_right.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/sfwkorg/img/menu_up.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/menu_up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
Seam SVN: r7469 - trunk/src/ioc/org/jboss/seam/ioc/spring.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-02-22 16:09:18 -0500 (Fri, 22 Feb 2008)
New Revision: 7469
Modified:
trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
Log:
JBSEAM-2662
Modified: trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-02-22 15:48:20 UTC (rev 7468)
+++ trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-02-22 21:09:18 UTC (rev 7469)
@@ -25,6 +25,7 @@
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
+import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
@@ -267,7 +268,7 @@
@Override
public void afterCompletion(int status)
{
- sync.afterCompletion(status);
+ sync.afterCompletion(convertSpringStatus(status));
}
@Override
@@ -275,5 +276,16 @@
{
sync.beforeCompletion();
}
+
+ private int convertSpringStatus(int springStatus) {
+ switch(springStatus) {
+ case TransactionSynchronization.STATUS_COMMITTED :
+ return Status.STATUS_COMMITTED;
+ case TransactionSynchronization.STATUS_ROLLED_BACK :
+ return Status.STATUS_ROLLEDBACK;
+ default :
+ return Status.STATUS_UNKNOWN;
+ }
+ }
}
}
16 years, 9 months
Seam SVN: r7468 - trunk/ui/src/main/java/org/jboss/seam/ui/facelet.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-02-22 10:48:20 -0500 (Fri, 22 Feb 2008)
New Revision: 7468
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java
Log:
oops, it's the examples that are broken, not the build
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java 2008-02-22 13:04:03 UTC (rev 7467)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsJBossLogging.java 2008-02-22 15:48:20 UTC (rev 7468)
@@ -14,7 +14,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-//import org.jboss.seam.interop.jul.Log4JConversionFilter;
+import org.jboss.seam.interop.jul.Log4JConversionFilter;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.util.Reflections;
@@ -71,7 +71,7 @@
Filter conversionFilter = null;
try
{
- //conversionFilter = new Log4JConversionFilter();
+ conversionFilter = new Log4JConversionFilter();
}
catch (Exception e)
{
16 years, 9 months
Seam SVN: r7467 - in branches/Seam_1_2_1_AP/src: main/org/jboss/seam/jsf and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-02-22 08:04:03 -0500 (Fri, 22 Feb 2008)
New Revision: 7467
Added:
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/MethodExpressionHelper.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/OptionalParameterMethodExpression.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/ParamMethodExpression.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamExpressionFactory.java
Modified:
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/core/Expressions.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamApplication12.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamELFunctionMapper.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/EL.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELMethodBinding.java
branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELValueBinding.java
branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamFaceletViewHandler.java
Log:
fix of JBAPP-631 issue, Pete rewrote the EL integration to mirror that used in Seam2 - which can be done now that we are targeting JSF2
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/core/Expressions.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/core/Expressions.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/core/Expressions.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -4,7 +4,6 @@
import static org.jboss.seam.InterceptionType.NEVER;
import static org.jboss.seam.annotations.Install.BUILT_IN;
import static org.jboss.seam.util.EL.EL_CONTEXT;
-import static org.jboss.seam.util.EL.EXPRESSION_FACTORY;
import java.io.Serializable;
@@ -20,6 +19,7 @@
import org.jboss.seam.annotations.Intercept;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.jsf.SeamExpressionFactory;
import org.jboss.seam.util.UnifiedELMethodBinding;
/**
@@ -107,7 +107,7 @@
{
if (cachedValueExpression==null)
{
- cachedValueExpression = EXPRESSION_FACTORY.createValueExpression(EL_CONTEXT, expression, Object.class);
+ cachedValueExpression = SeamExpressionFactory.INSTANCE.createValueExpression(EL_CONTEXT, expression, Object.class);
}
return cachedValueExpression;
}
Added: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/MethodExpressionHelper.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/MethodExpressionHelper.java (rev 0)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/MethodExpressionHelper.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -0,0 +1,248 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.jsf;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.ValueExpression;
+
+import org.jboss.seam.actionparam.MethodExpressionParser;
+
+/**
+ * This is a helper class for the ParamMethodExpression.
+ *
+ * @author Stan Silvert
+ */
+class MethodExpressionHelper implements Serializable
+{
+
+ private String expWithParams;
+ private boolean isStringLiteral = false;
+
+ private MethodExpressionParser parser;
+
+ // The wrapped expression
+ private MethodExpression methodExp;
+
+ // used for equals and hashCode
+ private boolean expressionInitializedInCtor = false;
+ private String hashString;
+
+
+ MethodExpressionHelper(ELContext elContext,
+ MethodExpressionParser parser)
+ {
+ this.expWithParams = parser.getUnparsedExpression();
+ this.parser = parser;
+
+ if ( MethodExpressionParser.isStringLiteral(expWithParams) )
+ {
+ setMethodExpression(elContext, new Class[0]);
+ this.isStringLiteral = true;
+ this.expressionInitializedInCtor = true;
+ return;
+ }
+
+ // if there are no params, we can go ahead and create the expression
+ if ( parser.getParams().length == 0 )
+ {
+ setMethodExpression(elContext, new Class[0]);
+ this.expressionInitializedInCtor = true;
+ }
+ }
+
+ boolean isLiteralText()
+ {
+ return this.isStringLiteral;
+ }
+
+ MethodInfo getMethodInfo(ELContext elContext)
+ {
+ if (this.methodExp == null)
+ {
+ return new PartialMethodInfo(parser.getMethodName());
+ }
+
+ return this.methodExp.getMethodInfo(elContext);
+ }
+
+ Object invokeTheExpression(ELContext elContext)
+ {
+ if (this.methodExp == null)
+ {
+ setMethodExpression(elContext, findParamTypes(elContext));
+ }
+
+ Object[] evaluatedParams = evaluateParams(elContext);
+ return this.methodExp.invoke(elContext, evaluatedParams);
+ }
+
+ MethodExpression getExpression()
+ {
+ return this.methodExp;
+ }
+
+ // evaluate each param as a value expression and return the array of results
+ private Object[] evaluateParams(ELContext elContext)
+ {
+ String[] params = parser.getParams();
+
+ Object[] results = new Object[params.length];
+
+ for (int i=0; i < results.length; i++)
+ {
+ String param = params[i].trim();
+
+ if ( MethodExpressionParser.isQuotedString(param) )
+ {
+ // strip quotes
+ results[i] = param.substring(1, param.length() - 1);
+ continue;
+ }
+
+ ValueExpression ve = SeamExpressionFactory.INSTANCE
+ .createValueExpression(elContext, "#{" + param + "}", Object.class);
+ results[i] = ve.getValue(elContext);
+ }
+
+ return results;
+ }
+
+ // finds a public method that matches the method
+ // name and number of params
+ private Class[] findParamTypes(ELContext elContext)
+ {
+ if (parser.getParams().length == 0) return new Class[0];
+
+ String expression = "#{" + parser.getBaseExpression() + "}";
+ ValueExpression ve = SeamExpressionFactory.INSTANCE.
+ createValueExpression(elContext, expression, Object.class);
+ Object obj = ve.getValue(elContext);
+ Method[] publicMethods = obj.getClass().getMethods();
+
+ Method methodMatch = null;
+
+ for (int i=0; i < publicMethods.length; i++)
+ {
+ if (methodMatches(publicMethods[i]))
+ {
+ if (methodMatch != null)
+ {
+ throw new ELException("More than one method matched " +
+ this.expWithParams + ". Method name or number of params must be unique.");
+ }
+
+ methodMatch = publicMethods[i];
+ }
+ }
+
+ if (methodMatch == null)
+ {
+ throw new ELException("No method found for expression " +
+ this.expWithParams +
+ ". Method name and number of params must match.");
+ }
+
+ return methodMatch.getParameterTypes();
+ }
+
+ // To match, method must return a String, match method name, and match
+ // number of params
+ private boolean methodMatches(Method method)
+ {
+ return method.getName().equals(parser.getMethodName()) &&
+ (method.getParameterTypes().length == parser.getParams().length);
+ }
+
+ private void setMethodExpression(ELContext elContext, Class[] paramTypes)
+ {
+ // note: returnType is always a String because this is an action method
+ this.methodExp = SeamExpressionFactory.INSTANCE.
+ createMethodExpression(elContext,
+ parser.getCombinedExpression(),
+ String.class,
+ paramTypes);
+ }
+
+ private String getHashString()
+ {
+ if (this.hashString == null)
+ {
+ this.hashString = parser.getBaseExpression() + "." +
+ parser.getMethodName() + "." +
+ parser.getParams().length;
+ }
+
+ return this.hashString;
+ }
+
+ @Override
+ public boolean equals(Object object)
+ {
+ if (this == object) return true;
+
+ if (this.expressionInitializedInCtor)
+ {
+ return this.methodExp.equals(object);
+ }
+
+ if (!(object instanceof MethodExpressionHelper)) return false;
+ MethodExpressionHelper exp = (MethodExpressionHelper)object;
+
+ return getHashString().equals(exp.getHashString());
+ }
+
+ @Override
+ public int hashCode() {
+ if (this.expressionInitializedInCtor)
+ {
+ return this.methodExp.hashCode();
+ }
+
+ return getHashString().hashCode();
+ }
+
+ /**
+ * Limited MethodInfo implementation that can be used when the param types are
+ * not yet known.
+ */
+ private static class PartialMethodInfo extends MethodInfo
+ {
+ private PartialMethodInfo(String methodName)
+ {
+ super(methodName, Object.class, new Class[0]);
+ }
+
+ @Override
+ public Class<?>[] getParamTypes()
+ {
+ throw new IllegalStateException("paramTypes unknown until MethodExpression is invoked.");
+ }
+ }
+}
+
Property changes on: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/MethodExpressionHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/OptionalParameterMethodExpression.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/OptionalParameterMethodExpression.java (rev 0)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/OptionalParameterMethodExpression.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -0,0 +1,75 @@
+/**
+ *
+ */
+package org.jboss.seam.jsf;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.MethodNotFoundException;
+
+public class OptionalParameterMethodExpression extends MethodExpression
+ {
+
+ private MethodExpression withParam;
+ private MethodExpression withNoParam;
+
+ public OptionalParameterMethodExpression(MethodExpression withParam, MethodExpression withNoParam)
+ {
+ this.withParam = withParam;
+ this.withNoParam = withNoParam;
+ }
+
+ @Override
+ public MethodInfo getMethodInfo(ELContext ctx)
+ {
+ return withParam.getMethodInfo(ctx);
+ }
+
+ @Override
+ public Object invoke(ELContext ctx, Object[] args)
+ {
+ try
+ {
+ return withParam.invoke(ctx, args);
+ }
+ catch (MethodNotFoundException mnfe)
+ {
+ try
+ {
+ return withNoParam.invoke(ctx, new Object[0]);
+ }
+ catch (MethodNotFoundException mnfe2)
+ {
+ throw mnfe;
+ }
+ }
+ }
+
+ @Override
+ public String getExpressionString()
+ {
+ return withParam.getExpressionString();
+ }
+
+ @Override
+ public boolean isLiteralText()
+ {
+ return withParam.isLiteralText();
+ }
+
+ @Override
+ public boolean equals(Object object)
+ {
+ if ( !(object instanceof OptionalParameterMethodExpression) ) return false;
+ OptionalParameterMethodExpression other = (OptionalParameterMethodExpression) object;
+ return withParam.equals(other.withParam);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return withParam.hashCode();
+ }
+
+}
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/OptionalParameterMethodExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/ParamMethodExpression.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/ParamMethodExpression.java (rev 0)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/ParamMethodExpression.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.jsf;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.MethodNotFoundException;
+import javax.el.PropertyNotFoundException;
+
+import org.jboss.seam.actionparam.MethodExpressionParser;
+
+/**
+ * TODO: make this into a StateHolder?
+ *
+ * @author Stan Silvert
+ */
+public class ParamMethodExpression extends MethodExpression
+{
+
+ private MethodExpressionHelper helper;
+ private String expString;
+
+ public ParamMethodExpression(MethodExpressionParser parser,
+ ELContext elContext)
+ {
+ this.expString = parser.getUnparsedExpression();
+ this.helper = new MethodExpressionHelper(elContext, parser);
+ }
+
+ @Override
+ public MethodInfo getMethodInfo(ELContext elContext) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException
+ {
+ return this.helper.getMethodInfo(elContext);
+ }
+
+ @Override
+ public Object invoke(ELContext elContext, Object[] params) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException
+ {
+ // note that the params are ignored - they were cached by the helper
+ return this.helper.invokeTheExpression(elContext);
+ }
+
+ @Override
+ public boolean isLiteralText()
+ {
+ return this.helper.isLiteralText();
+ }
+
+ @Override
+ public String getExpressionString()
+ {
+ return this.expString;
+ }
+
+ @Override
+ public boolean equals(Object object)
+ {
+ if (this == object) return true;
+ if (!(object instanceof ParamMethodExpression)) return false;
+ ParamMethodExpression actionExpression = (ParamMethodExpression)object;
+
+ return this.helper.equals(actionExpression.helper);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return this.helper.hashCode();
+ }
+}
Property changes on: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/ParamMethodExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamApplication12.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamApplication12.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamApplication12.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -73,14 +73,7 @@
public ExpressionFactory getExpressionFactory()
{
- try
- {
- return (ExpressionFactory) getExpressionFactoryMethod.invoke(application);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
+ return SeamExpressionFactory.INSTANCE;
}
public Object evaluateExpressionGet(FacesContext context, String expression,
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamELFunctionMapper.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamELFunctionMapper.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamELFunctionMapper.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -4,6 +4,8 @@
import java.util.HashMap;
import java.util.Map;
+import javax.el.FunctionMapper;
+
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.SecurityFunctions;
@@ -31,13 +33,28 @@
new Class[] { String.class });
}
+ private FunctionMapper functionMapper;
+
+ public SeamELFunctionMapper(FunctionMapper functionMapper)
+ {
+ this.functionMapper = functionMapper;
+ }
+
@Override
public Method resolveFunction(String prefix, String localName)
{
if (SEAM_EL_PREFIX.equals(prefix))
+ {
return methodCache.get(localName);
+ }
+ else if (functionMapper != null)
+ {
+ return functionMapper.resolveFunction(prefix, localName);
+ }
else
- return super.resolveFunction(prefix, localName);
+ {
+ return null;
+ }
}
private static void cacheMethod(String localName, Class cls, String name, Class[] params)
Added: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamExpressionFactory.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamExpressionFactory.java (rev 0)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamExpressionFactory.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.jsf;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.el.FunctionMapper;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+import javax.faces.event.FacesEvent;
+
+import org.jboss.seam.actionparam.MethodExpressionParser;
+import org.jboss.seam.util.EL;
+
+/**
+ * This ExpressionFactory replaces the one normally used in Facelets. It
+ * recognizes if an EL expression is using params. If so, it will return a
+ * special implementation of MethodExpression or ValueExpression to handle it.
+ *
+ * @author Stan Silvert
+ */
+public class SeamExpressionFactory extends ExpressionFactory
+{
+
+ public static final ExpressionFactory INSTANCE = new SeamExpressionFactory(EL.EXPRESSION_FACTORY);
+
+ private final ExpressionFactory expressionFactory;
+
+ public SeamExpressionFactory(ExpressionFactory expressionFactory)
+ {
+ this.expressionFactory = expressionFactory;
+ }
+
+ public SeamExpressionFactory()
+ {
+ this.expressionFactory = EL.EXPRESSION_FACTORY;
+ }
+
+ /**
+ * Wrap the base ELContext, adding Seam's FunctionMapper.
+ *
+ * Thus, any expressions with s:hasRole, s:hasPermission
+ * must be evaluated either via Facelets/JSP (since they
+ * are declared in the tld/taglib.xml or via the
+ * Expressions component.
+ *
+ * @param context the JSF ELContext
+ */
+ private static ELContext decorateELContext(final ELContext context)
+ {
+ return new ELContext()
+ {
+
+ @Override
+ public ELResolver getELResolver()
+ {
+ return context.getELResolver();
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper()
+ {
+ return new SeamELFunctionMapper(context.getFunctionMapper());
+ }
+
+ @Override
+ public VariableMapper getVariableMapper()
+ {
+ return context.getVariableMapper();
+ }
+
+ };
+ }
+
+ @Override
+ public Object coerceToType(Object obj, Class targetType)
+ {
+ return expressionFactory.coerceToType(obj, targetType);
+ }
+
+ @Override
+ public MethodExpression createMethodExpression(ELContext elContext,
+ String expression,
+ Class returnType,
+ Class[] paramTypes)
+ {
+ MethodExpressionParser parser = new MethodExpressionParser(expression);
+ if ( parser.isParamExpression() )
+ {
+ return new ParamMethodExpression(parser, elContext);
+ }
+ else if ( paramTypes.length==1 && FacesEvent.class.isAssignableFrom( paramTypes[0] ) )
+ {
+ //so that JSF action listeners don't have to declare
+ //the totally frickin useless ActionEvent parameter
+ return new OptionalParameterMethodExpression(
+ expressionFactory.createMethodExpression(decorateELContext(elContext), expression, returnType, paramTypes),
+ expressionFactory.createMethodExpression(decorateELContext(elContext), expression, returnType, new Class[0])
+ );
+ }
+ else
+ {
+ return expressionFactory.createMethodExpression(decorateELContext(elContext), expression, returnType, paramTypes);
+ }
+ }
+
+ @Override
+ public ValueExpression createValueExpression(Object instance, Class expectedType)
+ {
+ return expressionFactory.createValueExpression(instance, expectedType);
+ }
+
+ @Override
+ public ValueExpression createValueExpression(ELContext elContext,
+ String expression,
+ Class expectedType)
+ {
+ return expressionFactory.createValueExpression(decorateELContext(elContext), expression, expectedType);
+ }
+
+}
+
Property changes on: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/jsf/SeamExpressionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/EL.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/EL.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/EL.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -11,10 +11,10 @@
import javax.el.ResourceBundleELResolver;
import javax.el.VariableMapper;
-import org.jboss.seam.jsf.SeamELFunctionMapper;
import org.jboss.seam.jsf.SeamELResolver;
import com.sun.el.ExpressionFactoryImpl;
+import com.sun.el.lang.FunctionMapperImpl;
import com.sun.el.lang.VariableMapperImpl;
public class EL
@@ -40,6 +40,9 @@
return new ELContext()
{
+ private final VariableMapper variableMapper = new VariableMapperImpl();
+ private final FunctionMapper functionMapper = new FunctionMapperImpl();
+
@Override
public ELResolver getELResolver()
{
@@ -49,13 +52,13 @@
@Override
public FunctionMapper getFunctionMapper()
{
- return new SeamELFunctionMapper();
+ return functionMapper;
}
@Override
public VariableMapper getVariableMapper()
{
- return new VariableMapperImpl();
+ return variableMapper;
}
};
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELMethodBinding.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELMethodBinding.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELMethodBinding.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -1,7 +1,6 @@
package org.jboss.seam.util;
import static org.jboss.seam.util.EL.EL_CONTEXT;
-import static org.jboss.seam.util.EL.EXPRESSION_FACTORY;
import javax.el.MethodExpression;
import javax.faces.context.FacesContext;
@@ -9,13 +8,15 @@
import javax.faces.el.MethodBinding;
import javax.faces.el.MethodNotFoundException;
+import org.jboss.seam.jsf.SeamExpressionFactory;
+
public class UnifiedELMethodBinding extends MethodBinding
{
private MethodExpression me;
public UnifiedELMethodBinding(String expression, Class[] args)
{
- me = EXPRESSION_FACTORY.createMethodExpression(EL_CONTEXT, expression, Object.class, args);
+ me = SeamExpressionFactory.INSTANCE.createMethodExpression(EL_CONTEXT, expression, Object.class, args);
}
@Override
Modified: branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELValueBinding.java
===================================================================
--- branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELValueBinding.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/main/org/jboss/seam/util/UnifiedELValueBinding.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -1,7 +1,6 @@
package org.jboss.seam.util;
import static org.jboss.seam.util.EL.EL_CONTEXT;
-import static org.jboss.seam.util.EL.EXPRESSION_FACTORY;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
@@ -9,13 +8,15 @@
import javax.faces.el.PropertyNotFoundException;
import javax.faces.el.ValueBinding;
+import org.jboss.seam.jsf.SeamExpressionFactory;
+
public class UnifiedELValueBinding extends ValueBinding
{
private ValueExpression ve;
public UnifiedELValueBinding(String expression)
{
- ve = EXPRESSION_FACTORY.createValueExpression(EL_CONTEXT, expression, Object.class);
+ ve = SeamExpressionFactory.INSTANCE.createValueExpression(EL_CONTEXT, expression, Object.class);
}
@Override
Modified: branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamFaceletViewHandler.java
===================================================================
--- branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamFaceletViewHandler.java 2008-02-22 07:52:48 UTC (rev 7466)
+++ branches/Seam_1_2_1_AP/src/ui/org/jboss/seam/ui/facelet/SeamFaceletViewHandler.java 2008-02-22 13:04:03 UTC (rev 7467)
@@ -35,7 +35,7 @@
*/
public class SeamFaceletViewHandler extends FaceletViewHandler
{
- private static final String SEAM_EXPRESSION_FACTORY = "org.jboss.seam.ui.facelet.SeamExpressionFactory";
+ private static final String SEAM_EXPRESSION_FACTORY = "org.jboss.seam.jsf.SeamExpressionFactory";
public SeamFaceletViewHandler(ViewHandler parent)
{
16 years, 9 months