JBoss Portal SVN: r12950 - modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-03-05 11:30:09 -0500 (Thu, 05 Mar 2009)
New Revision: 12950
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml
Log:
default admin user is 'admin'
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml 2009-03-05 12:16:15 UTC (rev 12949)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml 2009-03-05 16:30:09 UTC (rev 12950)
@@ -337,7 +337,7 @@
</option>
<option>
<name>adminUsers</name>
- <value>Admin</value>
+ <value>admin</value>
</option>
<option>
<name>adminRoles</name>
17 years, 2 months
JBoss Portal SVN: r12949 - branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-03-05 07:16:15 -0500 (Thu, 05 Mar 2009)
New Revision: 12949
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java
Log:
- Improved wording.
- Minor re-formatting.
Modified: branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java 2009-03-04 23:19:11 UTC (rev 12948)
+++ branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java 2009-03-05 12:16:15 UTC (rev 12949)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -24,11 +24,11 @@
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
+import org.jboss.portlet.JBossPortlet;
import org.jboss.portlet.JBossRenderRequest;
-import org.jboss.portlet.JBossPortlet;
import org.jboss.portlet.JBossRenderResponse;
-import org.jboss.portlet.JBossActionRequest;
-import org.jboss.portlet.JBossActionResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletSecurityException;
@@ -64,7 +64,7 @@
PrintWriter writer = resp.getWriter();
//
- for (Enumeration<String> e = getPortletConfig().getPublicRenderParameterNames();e.hasMoreElements();)
+ for (Enumeration<String> e = getPortletConfig().getPublicRenderParameterNames(); e.hasMoreElements();)
{
String parameterName = e.nextElement();
@@ -74,9 +74,9 @@
//
writer.println("<div class=\"portlet-font\">Page parameters can be bound to coordination aliases. Out of the box, the request parameters" +
- " are themselves bound to page parameters. Setting a value below, will modify the URL by adding a request parameter.<br/>" +
- "This can be particulary intersting to use URL request parameters to set values usable by a portlet.</div>");
-
+ " are themselves bound to page parameters. Setting a value below, will modify the URL by adding a request parameter.<br/>" +
+ "This can be particulary interesting to pass values that can then be used by portlets.</div>");
+
//
writer.println("<form action=\"" + resp.createActionURL() + "\" method=\"POST\"><table>");
writer.println("<tr><td>Page parameter name:</td><td><input type=\"text\" name=\"name\" width=\"36\" value=\"\"/></td></tr>");
17 years, 2 months
JBoss Portal SVN: r12948 - modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-03-04 18:19:11 -0500 (Wed, 04 Mar 2009)
New Revision: 12948
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2283
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml 2009-03-04 23:17:50 UTC (rev 12947)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/standardidentity-config.xml 2009-03-04 23:19:11 UTC (rev 12948)
@@ -334,6 +334,14 @@
<option>
<name>defaultAdminRole</name>
<value>Admin</value>
+ </option>
+ <option>
+ <name>adminUsers</name>
+ <value>Admin</value>
+ </option>
+ <option>
+ <name>adminRoles</name>
+ <value>Admin</value>
</option>
</option-group>
<option-group>
17 years, 2 months
JBoss Portal SVN: r12947 - in modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src: main/org/jboss/portal/identity/service and 3 other directories.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-03-04 18:17:50 -0500 (Wed, 04 Mar 2009)
New Revision: 12947
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/RoleModule.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/UserModule.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/RoleModuleService.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/db-config.xml
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2283
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/IdentityConfiguration.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -99,7 +99,9 @@
public static final String SEARCH_SCOPE = "searchScope";
+ public static final String ADMIN_ROLES = "adminRoles";
+ public static final String ADMIN_USERS = "adminUsers";
public Set getValues(String optionGroup, String option);
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/RoleModule.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/RoleModule.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/RoleModule.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -97,6 +97,13 @@
* @return the roles
*/
Set findRoles() throws IdentityException;
+
+ /**
+ * Get all the administrator roles
+ *
+ * @return the role names
+ */
+ Set<String> getAdminRoles() throws IdentityException;
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/UserModule.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/UserModule.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/UserModule.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -100,4 +100,11 @@
* @return the number of users
*/
int getUserCount() throws IdentityException, IllegalArgumentException;
+
+ /**
+ * Get all the administrator roles
+ *
+ * @return the role names
+ */
+ Set<String> getAdminUsers() throws IdentityException;
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/RoleModuleService.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/RoleModuleService.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/RoleModuleService.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -21,9 +21,12 @@
*/
package org.jboss.portal.identity.service;
-import org.jboss.portal.identity.RoleModule;
+import java.util.Set;
+
+import org.jboss.portal.identity.IdentityConfiguration;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.event.RoleCreatedEvent;
import org.jboss.portal.identity.event.RoleDestroyedEvent;
import org.jboss.portal.identity.event.RoleUpdatedEvent;
@@ -60,5 +63,15 @@
RoleUpdatedEvent event = new RoleUpdatedEvent(roleId, roleName, displayName);
getIdentityEventBroadcaster().fireEvent(event);
}
+
+ public Set<String> getAdminRoles() throws IdentityException
+ {
+ Set<String> adminRoles = (Set<String>)getIdentityConfiguration().getOptions(IdentityConfiguration.GROUP_COMMON).get(IdentityConfiguration.ADMIN_ROLES);
+ if (adminRoles == null)
+ {
+ throw new IdentityException("Configuration option missing: " + IdentityConfiguration.ADMIN_ROLES);
+ }
+ return adminRoles;
+ }
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/service/UserModuleService.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -21,9 +21,12 @@
*/
package org.jboss.portal.identity.service;
-import org.jboss.portal.identity.UserModule;
+import java.util.Set;
+
+import org.jboss.portal.identity.IdentityConfiguration;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.event.IdentityEvent;
import org.jboss.portal.identity.event.UserCreatedEvent;
import org.jboss.portal.identity.event.UserDestroyedEvent;
@@ -52,5 +55,15 @@
IdentityEvent event = new UserDestroyedEvent(userId, userName);
getIdentityEventBroadcaster().fireEvent(event);
}
+
+ public Set<String> getAdminUsers() throws IdentityException
+ {
+ Set<String> adminUsers = (Set<String>)getIdentityConfiguration().getOptions(IdentityConfiguration.GROUP_COMMON).get(IdentityConfiguration.ADMIN_USERS);
+ if (adminUsers == null)
+ {
+ throw new IdentityException("Configuration option missing: " + IdentityConfiguration.ADMIN_USERS);
+ }
+ return adminUsers;
+ }
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -21,15 +21,19 @@
*/
package org.jboss.portal.test.identity.db;
+import junit.framework.TestSuite;
+
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.ProfileMap;
+import org.jboss.portal.identity.User;
import org.jboss.portal.identity.db.HibernateUserImpl;
-import org.jboss.portal.identity.*;
+import org.jboss.portal.identity.service.MembershipModuleService;
+import org.jboss.portal.identity.service.RoleModuleService;
import org.jboss.portal.identity.service.UserModuleService;
import org.jboss.portal.identity.service.UserProfileModuleService;
-import org.jboss.portal.identity.service.MembershipModuleService;
-import org.jboss.portal.identity.service.RoleModuleService;
import org.jboss.portal.test.identity.IdentityTest;
import org.jboss.portal.test.identity.TestServiceLoader;
-import junit.framework.TestSuite;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -205,4 +209,30 @@
{
utc.testStaticProperty();
}
+
+ public void testGetAdminUsers() throws Exception
+ {
+ try
+ {
+ userModule.getAdminUsers();
+ }
+ catch (IdentityException e)
+ {
+ fail();
+ }
+
+ }
+
+ public void testGetAdminRoles() throws Exception
+ {
+ try
+ {
+ roleModule.getAdminRoles();
+ }
+ catch (IdentityException e)
+ {
+ fail();
+ }
+
+ }
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -259,4 +259,17 @@
}
+
+ public void testGetAdminRoles() throws Exception
+ {
+ try
+ {
+ roleModule.getAdminRoles();
+ }
+ catch (IdentityException e)
+ {
+ fail();
+ }
+
+ }
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java 2009-03-04 23:17:50 UTC (rev 12947)
@@ -1,28 +1,29 @@
package org.jboss.portal.test.identity.ldap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
import junit.framework.TestSuite;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.SimpleLayout;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
import org.jboss.portal.identity.UserProfileModule;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.ldap.LDAPUserImpl;
import org.jboss.portal.test.identity.TestServiceLoader;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -194,4 +195,17 @@
}
+
+ public void testGetAdminUsers() throws Exception
+ {
+ try
+ {
+ userModule.getAdminUsers();
+ }
+ catch (IdentityException e)
+ {
+ fail();
+ }
+
+ }
}
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/db-config.xml
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/db-config.xml 2009-03-04 18:45:19 UTC (rev 12946)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/resources/test/config/db-config.xml 2009-03-04 23:17:50 UTC (rev 12947)
@@ -65,5 +65,5 @@
<config/>
</module>
</modules>
- <options/>
+<!-- <options/> -->
</identity-configuration>
17 years, 2 months
JBoss Portal SVN: r12946 - in modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer: portlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-04 13:45:19 -0500 (Wed, 04 Mar 2009)
New Revision: 12946
Modified:
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/container/PortletDeployment.java
modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java
Log:
Add missing undeploy functionality for portlets.
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/container/PortletDeployment.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/container/PortletDeployment.java 2009-03-04 18:05:27 UTC (rev 12945)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/container/PortletDeployment.java 2009-03-04 18:45:19 UTC (rev 12946)
@@ -49,5 +49,7 @@
*/
public void deployPortlets(ServletContext servletContext, URL url, ClassLoader classLoader, String contextPath,
JBossPortletAppMetaData jbossAppMD, PortletApplication10MetaData portletAppMD) throws DeploymentException;
+
+ public void undeployPortlets(URL webappURL);
}
Modified: modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java
===================================================================
--- modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java 2009-03-04 18:05:27 UTC (rev 12945)
+++ modules/deployer/trunk/deployer/src/main/java/org/jboss/portal/deployer/portlet/PortletDeployer.java 2009-03-04 18:45:19 UTC (rev 12946)
@@ -86,7 +86,8 @@
@Override
public void internalUndeploy(DeploymentUnit unit)
{
- System.out.println("INTERNALUNDEPLOY : " + unit.getName());
+ WebApplication webapp = unit.getAttachment(WebApplication.class);
+ this.deployment.undeployPortlets(webapp.getURL());
}
}
17 years, 2 months
JBoss Portal SVN: r12945 - in tags/JBoss_Portal_2_7_2: core-samples/src/main/org/jboss/portal/core/samples/basic and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-03-04 13:05:27 -0500 (Wed, 04 Mar 2009)
New Revision: 12945
Modified:
tags/JBoss_Portal_2_7_2/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
tags/JBoss_Portal_2_7_2/core/src/resources/portal-server-war/login.jsp
tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/listener/SessionListener.java
Log:
- Synchronization with trunk:
+ JBPORTAL-2329: Fixed the portlet so that it works in an AJAX context... We need a workaround for the way Form.serialize
works in Prototype when a form has multiple submit inputs.
+ JBPORTAL-2227 - browser credential fix and hopefully selenium compatible
+ Fixed potential NPE when session is destroyed.
Modified: tags/JBoss_Portal_2_7_2/core/src/resources/portal-server-war/login.jsp
===================================================================
--- tags/JBoss_Portal_2_7_2/core/src/resources/portal-server-war/login.jsp 2009-03-04 16:39:24 UTC (rev 12944)
+++ tags/JBoss_Portal_2_7_2/core/src/resources/portal-server-war/login.jsp 2009-03-04 18:05:27 UTC (rev 12945)
@@ -39,7 +39,7 @@
<link rel="stylesheet" href="/portal-core/css/login.css" type="text/css"/>
</head>
-<body onload="JBossPortal.login.setFocusOnLoginForm();JBossPortal.login.displayStatus();JBossPortal.login.validate();">
+<body onload="JBossPortal.login.setFocusOnLoginForm();JBossPortal.login.displayStatus();setTimeout('JBossPortal.login.validate()',10);">
<div class="login-container">
Modified: tags/JBoss_Portal_2_7_2/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
===================================================================
--- tags/JBoss_Portal_2_7_2/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-04 16:39:24 UTC (rev 12944)
+++ tags/JBoss_Portal_2_7_2/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-04 18:05:27 UTC (rev 12945)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -44,7 +44,8 @@
{
String name = req.getParameter("name");
String value = req.getParameter("value");
- boolean portletScope = req.getParameter("portlet") != null;
+ String scope = req.getParameter("scope");
+ boolean portletScope = "portlet".equals(scope);
if (name != null && value != null)
{
req.getPortletSession().setAttribute(name, value, portletScope ? PortletSession.PORTLET_SCOPE : PortletSession.APPLICATION_SCOPE);
@@ -85,11 +86,19 @@
}
//
- writer.println("<form action=\"" + purl.toString() + "\" method=\"post\">");
+ writer.println("<script type='text/javascript'>\n" +
+ "function processForm(value) {" +
+ "var form = document.getElementById('sessionForm');\n" +
+ "var hidden = document.getElementById('sessionHidden');\n" +
+ "hidden.value = value;\n" +
+ "form.submit();}\n" +
+ "</script>");
+ writer.println("<form id='sessionForm' action=\"" + purl.toString() + "\" method=\"post\">");
writer.println("<input type=\"text\" name=\"name\"/>");
writer.println("<input type=\"text\" name=\"value\"/>");
- writer.println("<input type=\"submit\" name=\"portlet\" value=\"Add to portlet scope\"/>");
- writer.println("<input type=\"submit\" name=\"application\" value=\"Add to application scope\"/>");
+ writer.println("<input type=\"button\" name=\"portlet\" value=\"Add to portlet scope\" onclick=\"processForm('portlet')\"/>");
+ writer.println("<input type=\"button\" name=\"application\" value=\"Add to application scope\" onclick=\"processForm('application')\"/>");
+ writer.println("<input id='sessionHidden' name='scope' type='hidden'/>");
writer.println("</form><br/>");
//
Modified: tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/listener/SessionListener.java
===================================================================
--- tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/listener/SessionListener.java 2009-03-04 16:39:24 UTC (rev 12944)
+++ tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/listener/SessionListener.java 2009-03-04 18:05:27 UTC (rev 12945)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,18 +22,10 @@
******************************************************************************/
package org.jboss.portal.server.listener;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.portal.server.aspects.server.SignOutInterceptor.Invalidation;
+import org.jboss.portal.web.ServletContainer;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -47,16 +39,22 @@
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.server.aspects.server.SignOutInterceptor.Invalidation;
-import org.jboss.portal.web.ServletContainer;
-
/**
- * This listener listens to the main portal session events.
- * When the portal session timesout, all web applications' sessions referenced
- * by org.jboss.portal.server.aspects.server.SignOutInterceptor are destroyed
+ * This listener listens to the main portal session events. When the portal session timesout, all web applications'
+ * sessions referenced by org.jboss.portal.server.aspects.server.SignOutInterceptor are destroyed
+ *
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
@@ -67,10 +65,10 @@
/** . */
private Logger log = Logger.getLogger(SessionListener.class);
-
+
/** . */
private static final String KEY = "org.jboss.portal.session.contexts";
-
+
public void sessionCreated(HttpSessionEvent arg0)
{
// Nothing to do
@@ -79,50 +77,51 @@
public void sessionDestroyed(HttpSessionEvent arg0)
{
Set<String> contexts = (Set<String>)arg0.getSession().getAttribute(KEY);
-
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName objectName = null;
- ServletContainer servletContainer = null;
- try
+ if (contexts != null)
{
- objectName = new ObjectName("portal:service=ServletContainerFactory");
- servletContainer = (ServletContainer)server.getAttribute(objectName, "ServletContainer");
- }
- catch (Exception e1)
- {
- log.error("Error while destroying portlet webapp sessions");
- }
-
- // Iterate over all the context that have been used
- for (Iterator<String> i = contexts.iterator(); i.hasNext();)
- {
- String dispatchContextName = (String)i.next();
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName objectName = null;
+ ServletContainer servletContainer = null;
- // Get the context
- ServletContext dispatchContext = arg0.getSession().getServletContext().getContext(dispatchContextName);
-
- // The context could be null if the web app has been removed after the web app has been tracked
- if (dispatchContext != null)
+ try
{
- try
+ objectName = new ObjectName("portal:service=ServletContainerFactory");
+ servletContainer = (ServletContainer)server.getAttribute(objectName, "ServletContainer");
+ }
+ catch (Exception e1)
+ {
+ log.error("Error while destroying portlet webapp sessions");
+ }
+
+ // Iterate over all the context that have been used
+ for (String dispatchContextName : contexts)
+ {
+ // Get the context
+ ServletContext dispatchContext = arg0.getSession().getServletContext().getContext(dispatchContextName);
+
+ // The context could be null if the web app has been removed after the web app has been tracked
+ if (dispatchContext != null)
{
- // Execute the command that invalidates the session
- servletContainer.include(dispatchContext, new TestHttpServletRequest(arg0.getSession()), new TestHttpServletResponse(), invalidator, null);
+ try
+ {
+ // Execute the command that invalidates the session
+ servletContainer.include(dispatchContext, new TestHttpServletRequest(arg0.getSession()), new TestHttpServletResponse(), invalidator, null);
+ }
+ catch (Exception e)
+ {
+ log.error("An error occured when trying to invalidate the sessions");
+ }
}
- catch (Exception e)
- {
- log.error("An error occured when trying to invalidate the sessions");
- }
}
}
}
-
+
// request
private static class TestHttpServletRequest implements HttpServletRequest
{
private Map attributes;
-
+
private HttpSession session;
public TestHttpServletRequest(HttpSession session)
17 years, 2 months
JBoss Portal SVN: r12944 - branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-03-04 11:39:24 -0500 (Wed, 04 Mar 2009)
New Revision: 12944
Modified:
branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
Log:
- Started work on more generic solution to JBPORTAL-2329. Can't get it work... :(
Modified: branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-04 16:38:25 UTC (rev 12943)
+++ branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-04 16:39:24 UTC (rev 12944)
@@ -21,6 +21,53 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
+/*var currentSubmit = null;
+
+ function decorateSubmits()
+ {
+ var submits = $$('input[type=submit]');
+ for(var i = 0; i < submits.length; i++)
+ {
+ var submit = submits[i];
+ var oldonclick = submit.onclick;
+
+ if(typeof oldonclick != 'function')
+ {
+ submit.onclick = function()
+ {
+ currentSubmit = this.name;
+ };
+ }
+ else
+ {
+ submit.onclick = function ()
+ {
+ oldonclick();
+ currentSubmit = this.name;
+ };
+ }
+ }
+ }
+
+
+ function addLoadEvent(func)
+ {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function')
+ {
+ window.onload = func;
+ }
+ else
+ {
+ window.onload = function()
+ {
+ oldonload();
+ func();
+ };
+ }
+ }
+ addLoadEvent(decorateSubmits());*/
+
function sendData(action, windowId, fromPos, fromRegionId, toPos, toRegionId)
{
var options = {
@@ -41,7 +88,7 @@
onLoading: function(t)
{
}
- }
+ };
new Ajax.Request(server_base_url + "/ajax", options);
}
@@ -166,6 +213,8 @@
options.enctype = enctype;
options.asynchronous = false;
options.method = "post"
+ // TODO: inject currentSubmit value in serialization instead of only getting the value of the first submit input
+ // see http://groups.google.com/group/prototype-core/browse_thread/thread/b3ced6...
options.postBody = Form.serialize(current);
}
}
17 years, 2 months
JBoss Portal SVN: r12943 - branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server/listener.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-03-04 11:38:25 -0500 (Wed, 04 Mar 2009)
New Revision: 12943
Modified:
branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server/listener/SessionListener.java
Log:
- Fix potential NPE when session is destroyed.
Modified: branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server/listener/SessionListener.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server/listener/SessionListener.java 2009-03-04 16:37:26 UTC (rev 12942)
+++ branches/JBoss_Portal_Branch_2_7/server/src/main/org/jboss/portal/server/listener/SessionListener.java 2009-03-04 16:38:25 UTC (rev 12943)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,18 +22,10 @@
******************************************************************************/
package org.jboss.portal.server.listener;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.portal.server.aspects.server.SignOutInterceptor.Invalidation;
+import org.jboss.portal.web.ServletContainer;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -47,16 +39,22 @@
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.server.aspects.server.SignOutInterceptor.Invalidation;
-import org.jboss.portal.web.ServletContainer;
-
/**
- * This listener listens to the main portal session events.
- * When the portal session timesout, all web applications' sessions referenced
- * by org.jboss.portal.server.aspects.server.SignOutInterceptor are destroyed
+ * This listener listens to the main portal session events. When the portal session timesout, all web applications'
+ * sessions referenced by org.jboss.portal.server.aspects.server.SignOutInterceptor are destroyed
+ *
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
@@ -67,10 +65,10 @@
/** . */
private Logger log = Logger.getLogger(SessionListener.class);
-
+
/** . */
private static final String KEY = "org.jboss.portal.session.contexts";
-
+
public void sessionCreated(HttpSessionEvent arg0)
{
// Nothing to do
@@ -79,50 +77,51 @@
public void sessionDestroyed(HttpSessionEvent arg0)
{
Set<String> contexts = (Set<String>)arg0.getSession().getAttribute(KEY);
-
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName objectName = null;
- ServletContainer servletContainer = null;
- try
+ if (contexts != null)
{
- objectName = new ObjectName("portal:service=ServletContainerFactory");
- servletContainer = (ServletContainer)server.getAttribute(objectName, "ServletContainer");
- }
- catch (Exception e1)
- {
- log.error("Error while destroying portlet webapp sessions");
- }
-
- // Iterate over all the context that have been used
- for (Iterator<String> i = contexts.iterator(); i.hasNext();)
- {
- String dispatchContextName = (String)i.next();
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName objectName = null;
+ ServletContainer servletContainer = null;
- // Get the context
- ServletContext dispatchContext = arg0.getSession().getServletContext().getContext(dispatchContextName);
-
- // The context could be null if the web app has been removed after the web app has been tracked
- if (dispatchContext != null)
+ try
{
- try
+ objectName = new ObjectName("portal:service=ServletContainerFactory");
+ servletContainer = (ServletContainer)server.getAttribute(objectName, "ServletContainer");
+ }
+ catch (Exception e1)
+ {
+ log.error("Error while destroying portlet webapp sessions");
+ }
+
+ // Iterate over all the context that have been used
+ for (String dispatchContextName : contexts)
+ {
+ // Get the context
+ ServletContext dispatchContext = arg0.getSession().getServletContext().getContext(dispatchContextName);
+
+ // The context could be null if the web app has been removed after the web app has been tracked
+ if (dispatchContext != null)
{
- // Execute the command that invalidates the session
- servletContainer.include(dispatchContext, new TestHttpServletRequest(arg0.getSession()), new TestHttpServletResponse(), invalidator, null);
+ try
+ {
+ // Execute the command that invalidates the session
+ servletContainer.include(dispatchContext, new TestHttpServletRequest(arg0.getSession()), new TestHttpServletResponse(), invalidator, null);
+ }
+ catch (Exception e)
+ {
+ log.error("An error occured when trying to invalidate the sessions");
+ }
}
- catch (Exception e)
- {
- log.error("An error occured when trying to invalidate the sessions");
- }
}
}
}
-
+
// request
private static class TestHttpServletRequest implements HttpServletRequest
{
private Map attributes;
-
+
private HttpSession session;
public TestHttpServletRequest(HttpSession session)
17 years, 2 months
JBoss Portal SVN: r12942 - branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-03-04 11:37:26 -0500 (Wed, 04 Mar 2009)
New Revision: 12942
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
Log:
- JBPORTAL-2329: Fixed the portlet so that it works in an AJAX context... We need a workaround for the way Form.serialize
works in Prototype when a form has multiple submit inputs.
See http://groups.google.com/group/prototype-core/browse_thread/thread/b3ced6... for more details.
Modified: branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-04 15:42:59 UTC (rev 12941)
+++ branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-04 16:37:26 UTC (rev 12942)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -44,7 +44,8 @@
{
String name = req.getParameter("name");
String value = req.getParameter("value");
- boolean portletScope = req.getParameter("portlet") != null;
+ String scope = req.getParameter("scope");
+ boolean portletScope = "portlet".equals(scope);
if (name != null && value != null)
{
req.getPortletSession().setAttribute(name, value, portletScope ? PortletSession.PORTLET_SCOPE : PortletSession.APPLICATION_SCOPE);
@@ -85,11 +86,19 @@
}
//
- writer.println("<form action=\"" + purl.toString() + "\" method=\"post\">");
+ writer.println("<script type='text/javascript'>\n" +
+ "function processForm(value) {" +
+ "var form = document.getElementById('sessionForm');\n" +
+ "var hidden = document.getElementById('sessionHidden');\n" +
+ "hidden.value = value;\n" +
+ "form.submit();}\n" +
+ "</script>");
+ writer.println("<form id='sessionForm' action=\"" + purl.toString() + "\" method=\"post\">");
writer.println("<input type=\"text\" name=\"name\"/>");
writer.println("<input type=\"text\" name=\"value\"/>");
- writer.println("<input type=\"submit\" name=\"portlet\" value=\"Add to portlet scope\"/>");
- writer.println("<input type=\"submit\" name=\"application\" value=\"Add to application scope\"/>");
+ writer.println("<input type=\"button\" name=\"portlet\" value=\"Add to portlet scope\" onclick=\"processForm('portlet')\"/>");
+ writer.println("<input type=\"button\" name=\"application\" value=\"Add to application scope\" onclick=\"processForm('application')\"/>");
+ writer.println("<input id='sessionHidden' name='scope' type='hidden'/>");
writer.println("</form><br/>");
//
17 years, 2 months
JBoss Portal SVN: r12941 - branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2009-03-04 10:42:59 -0500 (Wed, 04 Mar 2009)
New Revision: 12941
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp
Log:
JBPORTAL-2227 - browser credential fix and hopefully selenium compatible
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp 2009-03-04 15:31:13 UTC (rev 12940)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-server-war/login.jsp 2009-03-04 15:42:59 UTC (rev 12941)
@@ -39,7 +39,7 @@
<link rel="stylesheet" href="/portal-core/css/login.css" type="text/css"/>
</head>
-<body onload="JBossPortal.login.setFocusOnLoginForm();JBossPortal.login.displayStatus();">
+<body onload="JBossPortal.login.setFocusOnLoginForm();JBossPortal.login.displayStatus();setTimeout('JBossPortal.login.validate()',10);">
<div class="login-container">
@@ -91,9 +91,5 @@
</div>
</div>
-<script type="text/javascript">
- //for browser saved credentials
- setTimeout('JBossPortal.login.validate()',10);
-</script>
</body>
</html>
17 years, 2 months