JBoss Portal SVN: r8184 - branches/JBoss_Portal_Branch_2_6.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 08:17:42 -0400 (Thu, 06 Sep 2007)
New Revision: 8184
Added:
branches/JBoss_Portal_Branch_2_6/core-identity/
Log:
Copyying from trunk to Branch_2_6
Copied: branches/JBoss_Portal_Branch_2_6/core-identity (from rev 8183, trunk/core-identity)
16 years, 9 months
JBoss Portal SVN: r8183 - in trunk/core-identity/src: main/org/jboss/portal/core/identity/ui/common and 4 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-06 08:06:46 -0400 (Thu, 06 Sep 2007)
New Revision: 8183
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
Log:
- UI enhancements
- internationalization
- minor fixes
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -28,7 +28,6 @@
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -44,10 +44,10 @@
*/
public class IdentityRoleBean
{
- /** . */
+ /** The identity role module */
private RoleModule roleModule;
- /** . */
+ /** The identity memebershipModule */
private MembershipModule membershipModule;
public RoleModule getRoleModule()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -46,16 +46,16 @@
public class IdentityUserBean
{
- /** . */
+ /** The identity user module */
private UserModule userModule;
- /** . */
+ /** The user profile module */
private UserProfileModule userProfileModule;
- /** . */
+ /** The core-identity meta data service */
private MetaDataServiceBean metaDataService;
- /** . */
+ /** the logger */
private static final Logger log = Logger.getLogger(IdentityUserBean.class);
public UserModule getUserModule()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -43,7 +43,7 @@
*/
public class MetaDataServiceBean implements DynamicBean
{
- /** . */
+ /** The map */
Map map = null;
/** . */
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -64,7 +64,6 @@
return list;
}
-
/**
* Generates a list of available themes
*
@@ -122,8 +121,6 @@
}
return compare;
}
-
}
-
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2007-09-06 12:06:46 UTC (rev 8183)
@@ -23,7 +23,6 @@
package org.jboss.portal.core.identity.ui.validators;
import java.util.ResourceBundle;
-import java.util.regex.Pattern;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -71,7 +70,7 @@
User u = userModule.findUserByUserName(username);
// User found so this nickname is already taken
- throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN") + username));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN") + u.getUserName()));
}
catch (NoSuchUserException e)
{
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-06 12:06:46 UTC (rev 8183)
@@ -46,13 +46,13 @@
</f:facet>
<h:outputText value="Pending" rendered="#{user.currentNode == 'validate_email'}"/>
<!-- #{user.currentNode == 'adminApproval'} -->
- <h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
+ <h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'admin_approval'}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_APPROVE}"/>
<f:param name="processId" value="#{user.processId}" />
<f:param name="action" value="approve" />
</h:commandLink>
<h:outputText value=" | " rendered="#{user.currentNode == 'admin_approval'}" />
- <h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
+ <h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'admin_approval'}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_REJECT}"/>
<f:param name="processId" value="#{user.processId}" />
<f:param name="action" value="reject" />
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-06 04:59:08 UTC (rev 8182)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-06 12:06:46 UTC (rev 8183)
@@ -42,10 +42,6 @@
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>EDIT</portlet-mode>
- </supports>
<portlet-info>
<title>User portlet</title>
<keywords>management,user</keywords>
@@ -54,7 +50,7 @@
<preference>
<!-- Use captcha verification -->
<name>captcha</name>
- <value>false</value>
+ <value>true</value>
</preference>
<preference>
<!--
16 years, 9 months
JBoss Portal SVN: r8182 - in trunk/cms/src/main/org/jboss/portal/cms: impl/interceptors and 1 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-09-06 00:59:08 -0400 (Thu, 06 Sep 2007)
New Revision: 8182
Modified:
trunk/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
Log:
JBPORTAL-1679 - New CMS content is not persisted after server restart when done with a user other than 'admin'
Modified: trunk/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java 2007-09-06 04:23:08 UTC (rev 8181)
+++ trunk/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java 2007-09-06 04:59:08 UTC (rev 8182)
@@ -1030,8 +1030,7 @@
Session session = hibernateSessionFactory.getCurrentSession();
try
{
- List rs = session.createQuery(blobSelectData).setCacheable(true)
- .setString(0, blobId).list();
+ List rs = session.createQuery(blobSelectData).setString(0, blobId).list();
Iterator iter = rs.iterator();
java.sql.Blob blob = (java.sql.Blob) iter.next();
InputStream is = blob.getBinaryStream();
@@ -1064,7 +1063,7 @@
try
{
- Query query = session.createQuery(blobSelect).setCacheable(true);
+ Query query = session.createQuery(blobSelect);
if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
{
@@ -1145,8 +1144,7 @@
Session session = hibernateSessionFactory.getCurrentSession();
try
{
- Query query = session.createQuery(nodeBinValSelect).setCacheable(
- true).setString(0, blobId);
+ Query query = session.createQuery(nodeBinValSelect).setString(0, blobId);
Object result = query.uniqueResult();
if (result != null)
{
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-09-06 04:23:08 UTC (rev 8181)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-09-06 04:59:08 UTC (rev 8182)
@@ -217,19 +217,7 @@
//perform access check
PortalPermission cmsPermission = new CMSPermission(securityContext);
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- boolean allowAccess = false;
- try
- {
- allowAccess = this.authorizationManager.checkPermission(cmsPermission);
- }
- finally
- {
- tx.commit();
- Tools.closeSession(session);
- }
-
+ boolean allowAccess = this.authorizationManager.checkPermission(cmsPermission);
if (allowAccess)
{
Object response = invocation.invokeNext();
@@ -270,12 +258,8 @@
*/
private Object applyFilter(Object response, PortalCMSSecurityContext securityContext)
{
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
Object filteredResponse = response;
-
JCRCommand command = (JCRCommand)securityContext.getAttribute("command");
- boolean success = true;
try
{
if (filteredResponse instanceof Folder)
@@ -335,22 +319,8 @@
}
catch (Exception e)
{
- success = false;
throw new RuntimeException(e);
- }
- finally
- {
- if(success)
- {
- tx.commit();
- }
- else
- {
- tx.rollback();
- }
- Tools.closeSession(session);
- }
-
+ }
return filteredResponse;
}
@@ -525,14 +495,8 @@
}
finally
{
- if (tx != null)
- {
- tx.rollback();
- }
- if (session != null)
- {
- session.close();
- }
+ tx.rollback();
+ session.close();
}
return role;
@@ -561,10 +525,7 @@
}
finally
{
- if (tx != null)
- {
- tx.rollback();
- }
+ tx.rollback();
Tools.closeSession(session);
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-09-06 04:23:08 UTC (rev 8181)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-09-06 04:59:08 UTC (rev 8182)
@@ -29,6 +29,7 @@
import org.hibernate.Query;
import org.hibernate.Session;
+import org.hibernate.Transaction;
import org.jboss.portal.cms.hibernate.state.Tools;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityServiceController;
@@ -47,390 +48,439 @@
/**
* Created on : Jan 23, 2007
+ *
* @author Sohil Shah - sohil.shah(a)jboss.com
- *
+ *
*/
-public class AuthorizationProviderImpl extends AbstractJBossService implements AuthorizationProvider
+public class AuthorizationProviderImpl extends AbstractJBossService implements
+ AuthorizationProvider
{
- private IdentityServiceController identityServiceController = null;
- private MembershipModule membershipModule = null;
- private UserModule userModule = null;
-
- /**
- *
- */
- public void startService() throws Exception
- {
- super.startService();
- this.membershipModule = (MembershipModule)identityServiceController.
- getIdentityContext().
- getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- this.userModule = (UserModule)identityServiceController.
- getIdentityContext().
- getObject(IdentityContext.TYPE_USER_MODULE);
- }
-
- //------AuthorizationDomain impl-----------------------------------------------------------------
- /**
- *
- */
- public DomainConfigurator getConfigurator()
- {
- return this;
- }
+ private IdentityServiceController identityServiceController = null;
- /**
- *
- */
- public PermissionFactory getPermissionFactory()
- {
- return null;
- }
+ private MembershipModule membershipModule = null;
- /**
- *
- */
- public PermissionRepository getPermissionRepository()
- {
- return null;
- }
+ private UserModule userModule = null;
- /**
- *
- */
- public String getType()
- {
- return this.getClass().getName();
- }
- //------DomainConfigurator impl------------------------------------------------------------------
- /**
- *
- */
- public void setSecurityBindings(String uri, Set securityBindings) throws SecurityConfigurationException
- {
- if(securityBindings != null)
- {
- for(Iterator itr=securityBindings.iterator();itr.hasNext();)
- {
- Permission securityBinding = (Permission)itr.next();
- if(securityBinding.getRoles()!=null || securityBinding.getUsers()!=null)
- {
- this.store(securityBinding,securityBinding.getRoles(),securityBinding.getUsers());
- }
- else
- {
- this.store(securityBinding);
- }
- }
- }
- }
-
- /**
- *
- */
- public void removeSecurityBindings(String uri) throws SecurityConfigurationException
- {
- Set permissions = this.getSecurityBindings(uri);
- this.remove(permissions);
- }
-
- /**
- *
- */
- public Set getSecurityBindings(String uri)
- {
- Set permissions = new HashSet();
-
- if(uri.startsWith("user://"))
- {
- String userId = uri.substring("user://".length());
- Collection cour = this.findPermissionsByUser(userId);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if(uri.startsWith("role://"))
- {
- String roleId = uri.substring("role://".length());
- Collection cour = this.findPermissionsByRole(roleId);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if(uri.startsWith("criteria://"))
- {
- String criteria = uri.substring("criteria://".length());
- int index = criteria.indexOf('/');
- String name = criteria.substring(0,index);
- String value = criteria.substring(index+1);
- Criteria input = new Criteria(name,value);
- Collection cour = this.findPermissionsByCriteria(input);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
-
- return permissions;
- }
- //---------URIFactory impl-----------------------------------------------------------------------------------------
- /**
- *
- */
- public String getUserURI(String userId)
- {
- return "user://"+userId;
- }
-
- /**
- *
- * @param roleId
- * @return
- */
- public String getRoleURI(String roleId)
- {
- return "role://"+roleId;
- }
-
- /**
- *
- * @param name
- * @param value
- * @return
- */
- public String getCriteriaURI(String name,String value)
- {
- return "criteria://"+name+"/"+value;
- }
-
- /**
- *
- */
- public MembershipModule getMembershipModule()
- {
- return this.membershipModule;
- }
- //--------------------------------------------------------------------------------------------------------------
- /**
- *
- */
- public IdentityServiceController getIdentityServiceController()
- {
- return identityServiceController;
- }
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+ this.membershipModule = (MembershipModule) identityServiceController
+ .getIdentityContext().getObject(
+ IdentityContext.TYPE_MEMBERSHIP_MODULE);
+ this.userModule = (UserModule) identityServiceController
+ .getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ }
- /**
- *
- * @param identityServiceController
- */
- public void setIdentityServiceController(
- IdentityServiceController identityServiceController)
- {
- this.identityServiceController = identityServiceController;
- }
- //--------------------------------------------------------------------------------------------------------------
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- * @param roles - Roles associated with this permission
- * @param users - Individual users associated with this permission
- */
- private void store(Permission permission,Collection roles,Collection users)
- {
- //setup the role association
- if(roles != null)
- {
- Set roleAssoc = new HashSet();
- for(Iterator itr=roles.iterator();itr.hasNext();)
+ // ------AuthorizationDomain
+ // impl-----------------------------------------------------------------
+ /**
+ *
+ */
+ public DomainConfigurator getConfigurator()
+ {
+ return this;
+ }
+
+ /**
+ *
+ */
+ public PermissionFactory getPermissionFactory()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public PermissionRepository getPermissionRepository()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String getType()
+ {
+ return this.getClass().getName();
+ }
+
+ // ------DomainConfigurator
+ // impl------------------------------------------------------------------
+ /**
+ *
+ */
+ public void setSecurityBindings(String uri, Set securityBindings)
+ throws SecurityConfigurationException
+ {
+ if (securityBindings != null)
+ {
+ for (Iterator itr = securityBindings.iterator(); itr.hasNext();)
+ {
+ Permission securityBinding = (Permission) itr.next();
+ if (securityBinding.getRoles() != null
+ || securityBinding.getUsers() != null)
{
- Role role = (Role)itr.next();
- PermRoleAssoc cour = new PermRoleAssoc();
- if(!(role instanceof AnonymousRole))
- {
- cour.setRoleId(role.getName());
- }
- else
- {
- cour.setRoleId(AuthorizationManager.Anonymous);
- }
- roleAssoc.add(cour);
+ this.store(securityBinding, securityBinding.getRoles(),
+ securityBinding.getUsers());
}
- permission.setRoleAssoc(roleAssoc);
- }
- else
- {
- permission.setRoleAssoc(null);
- }
-
-
- //setup the user association
- if(users != null)
- {
- Set userAssoc = new HashSet();
- for(Iterator itr=users.iterator();itr.hasNext();)
+ else
{
- User user = (User)itr.next();
- PermUserAssoc cour = new PermUserAssoc();
- cour.setUserId(user.getUserName());
- userAssoc.add(cour);
+ this.store(securityBinding);
}
- permission.setUserAssoc(userAssoc);
- }
- else
- {
- permission.setUserAssoc(null);
- }
-
- //persist this into the database
- this.store(permission);
- }
-
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- */
- private void store(Permission permission)
- {
- //persist this into the database
- Session session = Tools.getCurrentSession();
- session.saveOrUpdate(permission);
- }
-
- /**
- * Deletes the specified permissions from the database
- *
- * @param permissions
- */
- private void remove(Collection permissions)
- {
- Session session = Tools.getCurrentSession();
- if(permissions!=null)
- {
- for(Iterator itr=permissions.iterator();itr.hasNext();)
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void removeSecurityBindings(String uri)
+ throws SecurityConfigurationException
+ {
+ Set permissions = this.getSecurityBindings(uri);
+ this.remove(permissions);
+ }
+
+ /**
+ *
+ */
+ public Set getSecurityBindings(String uri)
+ {
+ Set permissions = new HashSet();
+
+ if (uri.startsWith("user://"))
+ {
+ String userId = uri.substring("user://".length());
+ Collection cour = this.findPermissionsByUser(userId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("role://"))
+ {
+ String roleId = uri.substring("role://".length());
+ Collection cour = this.findPermissionsByRole(roleId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("criteria://"))
+ {
+ String criteria = uri.substring("criteria://".length());
+ int index = criteria.indexOf('/');
+ String name = criteria.substring(0, index);
+ String value = criteria.substring(index + 1);
+ Criteria input = new Criteria(name, value);
+ Collection cour = this.findPermissionsByCriteria(input);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+
+ return permissions;
+ }
+
+ // ---------URIFactory
+ // impl-----------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public String getUserURI(String userId)
+ {
+ return "user://" + userId;
+ }
+
+ /**
+ *
+ * @param roleId
+ * @return
+ */
+ public String getRoleURI(String roleId)
+ {
+ return "role://" + roleId;
+ }
+
+ /**
+ *
+ * @param name
+ * @param value
+ * @return
+ */
+ public String getCriteriaURI(String name, String value)
+ {
+ return "criteria://" + name + "/" + value;
+ }
+
+ /**
+ *
+ */
+ public MembershipModule getMembershipModule()
+ {
+ return this.membershipModule;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ /**
+ *
+ * @param identityServiceController
+ */
+ public void setIdentityServiceController(
+ IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission -
+ * Permission to be persisted
+ * @param roles -
+ * Roles associated with this permission
+ * @param users -
+ * Individual users associated with this permission
+ */
+ private void store(Permission permission, Collection roles, Collection users)
+ {
+ // setup the role association
+ if (roles != null)
+ {
+ Set roleAssoc = new HashSet();
+ for (Iterator itr = roles.iterator(); itr.hasNext();)
+ {
+ Role role = (Role) itr.next();
+ PermRoleAssoc cour = new PermRoleAssoc();
+ if (!(role instanceof AnonymousRole))
{
- Permission permission = (Permission)itr.next();
- session.delete(permission);
+ cour.setRoleId(role.getName());
}
- }
- }
-
-
- /**
- * Returns all permissions associated with the specified user
- *
- * @param user
- * @return
- */
- private Collection findPermissionsByUser(String userId)
- {
- try
- {
- Collection permissions = new HashSet();
-
- //this is for db based identity management
- String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query userQuery = session.createQuery(lookupByUser);
- userQuery.setString(0,userId);
- userQuery.setCacheable(true);
- permissions.addAll(userQuery.list());
-
- if(this.userModule instanceof HibernateUserModuleImpl)
- {
- //in case of a database version, use the cache optmized way to lookup the permissions
- String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE " +
- "p.id=r.cms_perm_id AND " +
- "r.role_id=roles.jbp_name AND " +
- "m.jbp_rid=roles.jbp_rid AND " +
- "m.jbp_uid=users.jbp_uid AND " +
- "users.jbp_uname=?";
-
- //perform lookup based on role membership
- Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(Permission.class);
- roleQuery.setString(0,userId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
- }
- else
- {
- //in the case of LDAP use the IdentityModule
- //now find permissions for all the roles that this user belongs to
- Set belongedRoles = this.membershipModule.getRoles(this.userModule.findUserByUserName(userId));
- if(belongedRoles != null)
- {
- for(Iterator itr=belongedRoles.iterator();itr.hasNext();)
- {
- Role role = (Role)itr.next();
- Collection rolePermissions = this.findPermissionsByRole(role.getName());
- if(rolePermissions != null && !rolePermissions.isEmpty())
- {
- permissions.addAll(rolePermissions);
- }
- }
- }
- }
-
- return permissions;
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Returns all permissions associated with the specified role
- *
- * @param role
- * @return
- */
- private Collection findPermissionsByRole(String roleId)
- {
- Collection permissions = new HashSet();
-
- String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query roleQuery = session.createQuery(lookupByRole);
- roleQuery.setString(0,roleId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
-
-
- return permissions;
- }
-
- /**
- * Return all permissions that match the specified criteria
- *
- * @param criteria
- * @return
- */
- private Collection findPermissionsByCriteria(Criteria criteria)
- {
- Collection permissions = new HashSet();
-
- String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query criteriaQuery = session.createQuery(lookupByCriteria);
- criteriaQuery.setString(0,criteria.getName());
- criteriaQuery.setString(1,criteria.getValue());
- criteriaQuery.setCacheable(true);
- permissions.addAll(criteriaQuery.list());
-
-
- return permissions;
- }
+ else
+ {
+ cour.setRoleId(AuthorizationManager.Anonymous);
+ }
+ roleAssoc.add(cour);
+ }
+ permission.setRoleAssoc(roleAssoc);
+ }
+ else
+ {
+ permission.setRoleAssoc(null);
+ }
+
+ // setup the user association
+ if (users != null)
+ {
+ Set userAssoc = new HashSet();
+ for (Iterator itr = users.iterator(); itr.hasNext();)
+ {
+ User user = (User) itr.next();
+ PermUserAssoc cour = new PermUserAssoc();
+ cour.setUserId(user.getUserName());
+ userAssoc.add(cour);
+ }
+ permission.setUserAssoc(userAssoc);
+ }
+ else
+ {
+ permission.setUserAssoc(null);
+ }
+
+ // persist this into the database
+ this.store(permission);
+ }
+
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission -
+ * Permission to be persisted
+ */
+ private void store(Permission permission)
+ {
+ // persist this into the database
+ Session session = Tools.getCurrentSession();
+ session.saveOrUpdate(permission);
+ }
+
+ /**
+ * Deletes the specified permissions from the database
+ *
+ * @param permissions
+ */
+ private void remove(Collection permissions)
+ {
+ Session session = Tools.getCurrentSession();
+ if (permissions != null)
+ {
+ for (Iterator itr = permissions.iterator(); itr.hasNext();)
+ {
+ Permission permission = (Permission) itr.next();
+ session.delete(permission);
+ }
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified user
+ *
+ * @param user
+ * @return
+ */
+ private Collection findPermissionsByUser(String userId)
+ {
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ Collection permissions = new HashSet();
+
+ // this is for db based identity management
+ String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
+
+ // perform lookup by explicitly specified users
+ Query userQuery = session.createQuery(lookupByUser);
+ userQuery.setString(0, userId);
+ userQuery.setCacheable(true);
+ permissions.addAll(userQuery.list());
+
+ if (this.userModule instanceof HibernateUserModuleImpl)
+ {
+ // in case of a database version, use the cache optmized way to
+ // lookup the permissions
+ String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE "
+ + "p.id=r.cms_perm_id AND "
+ + "r.role_id=roles.jbp_name AND "
+ + "m.jbp_rid=roles.jbp_rid AND "
+ + "m.jbp_uid=users.jbp_uid AND " + "users.jbp_uname=?";
+
+ // perform lookup based on role membership
+ Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(
+ Permission.class);
+ roleQuery.setString(0, userId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+ }
+ else
+ {
+ // in the case of LDAP use the IdentityModule
+ // now find permissions for all the roles that this user belongs to
+ Set belongedRoles = this.membershipModule.getRoles(this.userModule
+ .findUserByUserName(userId));
+ if (belongedRoles != null)
+ {
+ for (Iterator itr = belongedRoles.iterator(); itr.hasNext();)
+ {
+ Role role = (Role) itr.next();
+ Collection rolePermissions = this.findPermissionsByRole(role
+ .getName());
+ if (rolePermissions != null && !rolePermissions.isEmpty())
+ {
+ permissions.addAll(rolePermissions);
+ }
+ }
+ }
+ }
+
+ return permissions;
+ }
+ catch (Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified role
+ *
+ * @param role
+ * @return
+ */
+ private Collection findPermissionsByRole(String roleId)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query roleQuery = session.createQuery(lookupByRole);
+ roleQuery.setString(0, roleId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+ }
+ catch(Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
+
+ /**
+ * Return all permissions that match the specified criteria
+ *
+ * @param criteria
+ * @return
+ */
+ private Collection findPermissionsByCriteria(Criteria criteria)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query criteriaQuery = session.createQuery(lookupByCriteria);
+ criteriaQuery.setString(0, criteria.getName());
+ criteriaQuery.setString(1, criteria.getValue());
+ criteriaQuery.setCacheable(true);
+ permissions.addAll(criteriaQuery.list());
+ }
+ catch(Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
}
16 years, 9 months
JBoss Portal SVN: r8181 - in branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms: impl/interceptors and 1 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-09-06 00:23:08 -0400 (Thu, 06 Sep 2007)
New Revision: 8181
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
Log:
JBPORTAL-1679 - New CMS content is not persisted after server restart when done with a user other than 'admin'
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java 2007-09-05 19:56:21 UTC (rev 8180)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/HibernatePersistenceManager.java 2007-09-06 04:23:08 UTC (rev 8181)
@@ -1030,8 +1030,7 @@
Session session = hibernateSessionFactory.getCurrentSession();
try
{
- List rs = session.createQuery(blobSelectData).setCacheable(true)
- .setString(0, blobId).list();
+ List rs = session.createQuery(blobSelectData).setString(0, blobId).list();
Iterator iter = rs.iterator();
java.sql.Blob blob = (java.sql.Blob) iter.next();
InputStream is = blob.getBinaryStream();
@@ -1064,7 +1063,7 @@
try
{
- Query query = session.createQuery(blobSelect).setCacheable(true);
+ Query query = session.createQuery(blobSelect);
if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
{
@@ -1145,8 +1144,7 @@
Session session = hibernateSessionFactory.getCurrentSession();
try
{
- Query query = session.createQuery(nodeBinValSelect).setCacheable(
- true).setString(0, blobId);
+ Query query = session.createQuery(nodeBinValSelect).setString(0, blobId);
Object result = query.uniqueResult();
if (result != null)
{
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-09-05 19:56:21 UTC (rev 8180)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-09-06 04:23:08 UTC (rev 8181)
@@ -217,19 +217,7 @@
//perform access check
PortalPermission cmsPermission = new CMSPermission(securityContext);
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
- boolean allowAccess = false;
- try
- {
- allowAccess = this.authorizationManager.checkPermission(cmsPermission);
- }
- finally
- {
- tx.commit();
- Tools.closeSession(session);
- }
-
+ boolean allowAccess = this.authorizationManager.checkPermission(cmsPermission);
if (allowAccess)
{
Object response = invocation.invokeNext();
@@ -270,12 +258,8 @@
*/
private Object applyFilter(Object response, PortalCMSSecurityContext securityContext)
{
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
Object filteredResponse = response;
-
JCRCommand command = (JCRCommand)securityContext.getAttribute("command");
- boolean success = true;
try
{
if (filteredResponse instanceof Folder)
@@ -335,22 +319,8 @@
}
catch (Exception e)
{
- success = false;
throw new RuntimeException(e);
- }
- finally
- {
- if(success)
- {
- tx.commit();
- }
- else
- {
- tx.rollback();
- }
- Tools.closeSession(session);
- }
-
+ }
return filteredResponse;
}
@@ -525,14 +495,8 @@
}
finally
{
- if (tx != null)
- {
- tx.rollback();
- }
- if (session != null)
- {
- session.close();
- }
+ tx.rollback();
+ session.close();
}
return role;
@@ -561,10 +525,7 @@
}
finally
{
- if (tx != null)
- {
- tx.rollback();
- }
+ tx.rollback();
Tools.closeSession(session);
}
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-09-05 19:56:21 UTC (rev 8180)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-09-06 04:23:08 UTC (rev 8181)
@@ -29,6 +29,7 @@
import org.hibernate.Query;
import org.hibernate.Session;
+import org.hibernate.Transaction;
import org.jboss.portal.cms.hibernate.state.Tools;
import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.IdentityServiceController;
@@ -47,390 +48,439 @@
/**
* Created on : Jan 23, 2007
+ *
* @author Sohil Shah - sohil.shah(a)jboss.com
- *
+ *
*/
-public class AuthorizationProviderImpl extends AbstractJBossService implements AuthorizationProvider
+public class AuthorizationProviderImpl extends AbstractJBossService implements
+ AuthorizationProvider
{
- private IdentityServiceController identityServiceController = null;
- private MembershipModule membershipModule = null;
- private UserModule userModule = null;
-
- /**
- *
- */
- public void startService() throws Exception
- {
- super.startService();
- this.membershipModule = (MembershipModule)identityServiceController.
- getIdentityContext().
- getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- this.userModule = (UserModule)identityServiceController.
- getIdentityContext().
- getObject(IdentityContext.TYPE_USER_MODULE);
- }
-
- //------AuthorizationDomain impl-----------------------------------------------------------------
- /**
- *
- */
- public DomainConfigurator getConfigurator()
- {
- return this;
- }
+ private IdentityServiceController identityServiceController = null;
- /**
- *
- */
- public PermissionFactory getPermissionFactory()
- {
- return null;
- }
+ private MembershipModule membershipModule = null;
- /**
- *
- */
- public PermissionRepository getPermissionRepository()
- {
- return null;
- }
+ private UserModule userModule = null;
- /**
- *
- */
- public String getType()
- {
- return this.getClass().getName();
- }
- //------DomainConfigurator impl------------------------------------------------------------------
- /**
- *
- */
- public void setSecurityBindings(String uri, Set securityBindings) throws SecurityConfigurationException
- {
- if(securityBindings != null)
- {
- for(Iterator itr=securityBindings.iterator();itr.hasNext();)
- {
- Permission securityBinding = (Permission)itr.next();
- if(securityBinding.getRoles()!=null || securityBinding.getUsers()!=null)
- {
- this.store(securityBinding,securityBinding.getRoles(),securityBinding.getUsers());
- }
- else
- {
- this.store(securityBinding);
- }
- }
- }
- }
-
- /**
- *
- */
- public void removeSecurityBindings(String uri) throws SecurityConfigurationException
- {
- Set permissions = this.getSecurityBindings(uri);
- this.remove(permissions);
- }
-
- /**
- *
- */
- public Set getSecurityBindings(String uri)
- {
- Set permissions = new HashSet();
-
- if(uri.startsWith("user://"))
- {
- String userId = uri.substring("user://".length());
- Collection cour = this.findPermissionsByUser(userId);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if(uri.startsWith("role://"))
- {
- String roleId = uri.substring("role://".length());
- Collection cour = this.findPermissionsByRole(roleId);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
- else if(uri.startsWith("criteria://"))
- {
- String criteria = uri.substring("criteria://".length());
- int index = criteria.indexOf('/');
- String name = criteria.substring(0,index);
- String value = criteria.substring(index+1);
- Criteria input = new Criteria(name,value);
- Collection cour = this.findPermissionsByCriteria(input);
- if(cour != null)
- {
- permissions.addAll(cour);
- }
- }
-
- return permissions;
- }
- //---------URIFactory impl-----------------------------------------------------------------------------------------
- /**
- *
- */
- public String getUserURI(String userId)
- {
- return "user://"+userId;
- }
-
- /**
- *
- * @param roleId
- * @return
- */
- public String getRoleURI(String roleId)
- {
- return "role://"+roleId;
- }
-
- /**
- *
- * @param name
- * @param value
- * @return
- */
- public String getCriteriaURI(String name,String value)
- {
- return "criteria://"+name+"/"+value;
- }
-
- /**
- *
- */
- public MembershipModule getMembershipModule()
- {
- return this.membershipModule;
- }
- //--------------------------------------------------------------------------------------------------------------
- /**
- *
- */
- public IdentityServiceController getIdentityServiceController()
- {
- return identityServiceController;
- }
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+ this.membershipModule = (MembershipModule) identityServiceController
+ .getIdentityContext().getObject(
+ IdentityContext.TYPE_MEMBERSHIP_MODULE);
+ this.userModule = (UserModule) identityServiceController
+ .getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ }
- /**
- *
- * @param identityServiceController
- */
- public void setIdentityServiceController(
- IdentityServiceController identityServiceController)
- {
- this.identityServiceController = identityServiceController;
- }
- //--------------------------------------------------------------------------------------------------------------
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- * @param roles - Roles associated with this permission
- * @param users - Individual users associated with this permission
- */
- private void store(Permission permission,Collection roles,Collection users)
- {
- //setup the role association
- if(roles != null)
- {
- Set roleAssoc = new HashSet();
- for(Iterator itr=roles.iterator();itr.hasNext();)
+ // ------AuthorizationDomain
+ // impl-----------------------------------------------------------------
+ /**
+ *
+ */
+ public DomainConfigurator getConfigurator()
+ {
+ return this;
+ }
+
+ /**
+ *
+ */
+ public PermissionFactory getPermissionFactory()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public PermissionRepository getPermissionRepository()
+ {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String getType()
+ {
+ return this.getClass().getName();
+ }
+
+ // ------DomainConfigurator
+ // impl------------------------------------------------------------------
+ /**
+ *
+ */
+ public void setSecurityBindings(String uri, Set securityBindings)
+ throws SecurityConfigurationException
+ {
+ if (securityBindings != null)
+ {
+ for (Iterator itr = securityBindings.iterator(); itr.hasNext();)
+ {
+ Permission securityBinding = (Permission) itr.next();
+ if (securityBinding.getRoles() != null
+ || securityBinding.getUsers() != null)
{
- Role role = (Role)itr.next();
- PermRoleAssoc cour = new PermRoleAssoc();
- if(!(role instanceof AnonymousRole))
- {
- cour.setRoleId(role.getName());
- }
- else
- {
- cour.setRoleId(AuthorizationManager.Anonymous);
- }
- roleAssoc.add(cour);
+ this.store(securityBinding, securityBinding.getRoles(),
+ securityBinding.getUsers());
}
- permission.setRoleAssoc(roleAssoc);
- }
- else
- {
- permission.setRoleAssoc(null);
- }
-
-
- //setup the user association
- if(users != null)
- {
- Set userAssoc = new HashSet();
- for(Iterator itr=users.iterator();itr.hasNext();)
+ else
{
- User user = (User)itr.next();
- PermUserAssoc cour = new PermUserAssoc();
- cour.setUserId(user.getUserName());
- userAssoc.add(cour);
+ this.store(securityBinding);
}
- permission.setUserAssoc(userAssoc);
- }
- else
- {
- permission.setUserAssoc(null);
- }
-
- //persist this into the database
- this.store(permission);
- }
-
- /**
- * Stores a permission and its associations into peristent storage
- *
- * @param permission - Permission to be persisted
- */
- private void store(Permission permission)
- {
- //persist this into the database
- Session session = Tools.getCurrentSession();
- session.saveOrUpdate(permission);
- }
-
- /**
- * Deletes the specified permissions from the database
- *
- * @param permissions
- */
- private void remove(Collection permissions)
- {
- Session session = Tools.getCurrentSession();
- if(permissions!=null)
- {
- for(Iterator itr=permissions.iterator();itr.hasNext();)
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public void removeSecurityBindings(String uri)
+ throws SecurityConfigurationException
+ {
+ Set permissions = this.getSecurityBindings(uri);
+ this.remove(permissions);
+ }
+
+ /**
+ *
+ */
+ public Set getSecurityBindings(String uri)
+ {
+ Set permissions = new HashSet();
+
+ if (uri.startsWith("user://"))
+ {
+ String userId = uri.substring("user://".length());
+ Collection cour = this.findPermissionsByUser(userId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("role://"))
+ {
+ String roleId = uri.substring("role://".length());
+ Collection cour = this.findPermissionsByRole(roleId);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+ else if (uri.startsWith("criteria://"))
+ {
+ String criteria = uri.substring("criteria://".length());
+ int index = criteria.indexOf('/');
+ String name = criteria.substring(0, index);
+ String value = criteria.substring(index + 1);
+ Criteria input = new Criteria(name, value);
+ Collection cour = this.findPermissionsByCriteria(input);
+ if (cour != null)
+ {
+ permissions.addAll(cour);
+ }
+ }
+
+ return permissions;
+ }
+
+ // ---------URIFactory
+ // impl-----------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public String getUserURI(String userId)
+ {
+ return "user://" + userId;
+ }
+
+ /**
+ *
+ * @param roleId
+ * @return
+ */
+ public String getRoleURI(String roleId)
+ {
+ return "role://" + roleId;
+ }
+
+ /**
+ *
+ * @param name
+ * @param value
+ * @return
+ */
+ public String getCriteriaURI(String name, String value)
+ {
+ return "criteria://" + name + "/" + value;
+ }
+
+ /**
+ *
+ */
+ public MembershipModule getMembershipModule()
+ {
+ return this.membershipModule;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ /**
+ *
+ * @param identityServiceController
+ */
+ public void setIdentityServiceController(
+ IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+ // --------------------------------------------------------------------------------------------------------------
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission -
+ * Permission to be persisted
+ * @param roles -
+ * Roles associated with this permission
+ * @param users -
+ * Individual users associated with this permission
+ */
+ private void store(Permission permission, Collection roles, Collection users)
+ {
+ // setup the role association
+ if (roles != null)
+ {
+ Set roleAssoc = new HashSet();
+ for (Iterator itr = roles.iterator(); itr.hasNext();)
+ {
+ Role role = (Role) itr.next();
+ PermRoleAssoc cour = new PermRoleAssoc();
+ if (!(role instanceof AnonymousRole))
{
- Permission permission = (Permission)itr.next();
- session.delete(permission);
+ cour.setRoleId(role.getName());
}
- }
- }
-
-
- /**
- * Returns all permissions associated with the specified user
- *
- * @param user
- * @return
- */
- private Collection findPermissionsByUser(String userId)
- {
- try
- {
- Collection permissions = new HashSet();
-
- //this is for db based identity management
- String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query userQuery = session.createQuery(lookupByUser);
- userQuery.setString(0,userId);
- userQuery.setCacheable(true);
- permissions.addAll(userQuery.list());
-
- if(this.userModule instanceof HibernateUserModuleImpl)
- {
- //in case of a database version, use the cache optmized way to lookup the permissions
- String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE " +
- "p.id=r.cms_perm_id AND " +
- "r.role_id=roles.jbp_name AND " +
- "m.jbp_rid=roles.jbp_rid AND " +
- "m.jbp_uid=users.jbp_uid AND " +
- "users.jbp_uname=?";
-
- //perform lookup based on role membership
- Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(Permission.class);
- roleQuery.setString(0,userId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
- }
- else
- {
- //in the case of LDAP use the IdentityModule
- //now find permissions for all the roles that this user belongs to
- Set belongedRoles = this.membershipModule.getRoles(this.userModule.findUserByUserName(userId));
- if(belongedRoles != null)
- {
- for(Iterator itr=belongedRoles.iterator();itr.hasNext();)
- {
- Role role = (Role)itr.next();
- Collection rolePermissions = this.findPermissionsByRole(role.getName());
- if(rolePermissions != null && !rolePermissions.isEmpty())
- {
- permissions.addAll(rolePermissions);
- }
- }
- }
- }
-
- return permissions;
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Returns all permissions associated with the specified role
- *
- * @param role
- * @return
- */
- private Collection findPermissionsByRole(String roleId)
- {
- Collection permissions = new HashSet();
-
- String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query roleQuery = session.createQuery(lookupByRole);
- roleQuery.setString(0,roleId);
- roleQuery.setCacheable(true);
- permissions.addAll(roleQuery.list());
-
-
- return permissions;
- }
-
- /**
- * Return all permissions that match the specified criteria
- *
- * @param criteria
- * @return
- */
- private Collection findPermissionsByCriteria(Criteria criteria)
- {
- Collection permissions = new HashSet();
-
- String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
-
- Session session = Tools.getCurrentSession();
-
- //perform lookup by explicitly specified users
- Query criteriaQuery = session.createQuery(lookupByCriteria);
- criteriaQuery.setString(0,criteria.getName());
- criteriaQuery.setString(1,criteria.getValue());
- criteriaQuery.setCacheable(true);
- permissions.addAll(criteriaQuery.list());
-
-
- return permissions;
- }
+ else
+ {
+ cour.setRoleId(AuthorizationManager.Anonymous);
+ }
+ roleAssoc.add(cour);
+ }
+ permission.setRoleAssoc(roleAssoc);
+ }
+ else
+ {
+ permission.setRoleAssoc(null);
+ }
+
+ // setup the user association
+ if (users != null)
+ {
+ Set userAssoc = new HashSet();
+ for (Iterator itr = users.iterator(); itr.hasNext();)
+ {
+ User user = (User) itr.next();
+ PermUserAssoc cour = new PermUserAssoc();
+ cour.setUserId(user.getUserName());
+ userAssoc.add(cour);
+ }
+ permission.setUserAssoc(userAssoc);
+ }
+ else
+ {
+ permission.setUserAssoc(null);
+ }
+
+ // persist this into the database
+ this.store(permission);
+ }
+
+ /**
+ * Stores a permission and its associations into peristent storage
+ *
+ * @param permission -
+ * Permission to be persisted
+ */
+ private void store(Permission permission)
+ {
+ // persist this into the database
+ Session session = Tools.getCurrentSession();
+ session.saveOrUpdate(permission);
+ }
+
+ /**
+ * Deletes the specified permissions from the database
+ *
+ * @param permissions
+ */
+ private void remove(Collection permissions)
+ {
+ Session session = Tools.getCurrentSession();
+ if (permissions != null)
+ {
+ for (Iterator itr = permissions.iterator(); itr.hasNext();)
+ {
+ Permission permission = (Permission) itr.next();
+ session.delete(permission);
+ }
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified user
+ *
+ * @param user
+ * @return
+ */
+ private Collection findPermissionsByUser(String userId)
+ {
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ Collection permissions = new HashSet();
+
+ // this is for db based identity management
+ String lookupByUser = "SELECT permission from Permission permission JOIN permission.userAssoc user WHERE user.userId=?";
+
+ // perform lookup by explicitly specified users
+ Query userQuery = session.createQuery(lookupByUser);
+ userQuery.setString(0, userId);
+ userQuery.setCacheable(true);
+ permissions.addAll(userQuery.list());
+
+ if (this.userModule instanceof HibernateUserModuleImpl)
+ {
+ // in case of a database version, use the cache optmized way to
+ // lookup the permissions
+ String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE "
+ + "p.id=r.cms_perm_id AND "
+ + "r.role_id=roles.jbp_name AND "
+ + "m.jbp_rid=roles.jbp_rid AND "
+ + "m.jbp_uid=users.jbp_uid AND " + "users.jbp_uname=?";
+
+ // perform lookup based on role membership
+ Query roleQuery = session.createSQLQuery(lookupByRole).addEntity(
+ Permission.class);
+ roleQuery.setString(0, userId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+ }
+ else
+ {
+ // in the case of LDAP use the IdentityModule
+ // now find permissions for all the roles that this user belongs to
+ Set belongedRoles = this.membershipModule.getRoles(this.userModule
+ .findUserByUserName(userId));
+ if (belongedRoles != null)
+ {
+ for (Iterator itr = belongedRoles.iterator(); itr.hasNext();)
+ {
+ Role role = (Role) itr.next();
+ Collection rolePermissions = this.findPermissionsByRole(role
+ .getName());
+ if (rolePermissions != null && !rolePermissions.isEmpty())
+ {
+ permissions.addAll(rolePermissions);
+ }
+ }
+ }
+ }
+
+ return permissions;
+ }
+ catch (Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+ }
+
+ /**
+ * Returns all permissions associated with the specified role
+ *
+ * @param role
+ * @return
+ */
+ private Collection findPermissionsByRole(String roleId)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByRole = "SELECT permission from Permission permission JOIN permission.roleAssoc role WHERE role.roleId=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query roleQuery = session.createQuery(lookupByRole);
+ roleQuery.setString(0, roleId);
+ roleQuery.setCacheable(true);
+ permissions.addAll(roleQuery.list());
+ }
+ catch(Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
+
+ /**
+ * Return all permissions that match the specified criteria
+ *
+ * @param criteria
+ * @return
+ */
+ private Collection findPermissionsByCriteria(Criteria criteria)
+ {
+ Collection permissions = new HashSet();
+
+ String lookupByCriteria = "SELECT permission from Permission permission JOIN permission.criteria criteria WHERE criteria.name=? AND criteria.value=?";
+
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ // perform lookup by explicitly specified users
+ Query criteriaQuery = session.createQuery(lookupByCriteria);
+ criteriaQuery.setString(0, criteria.getName());
+ criteriaQuery.setString(1, criteria.getValue());
+ criteriaQuery.setCacheable(true);
+ permissions.addAll(criteriaQuery.list());
+ }
+ catch(Exception e)
+ {
+ tx.rollback();
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ tx.commit();
+ Tools.closeSession(session);
+ }
+
+ return permissions;
+ }
}
16 years, 9 months
JBoss Portal SVN: r8180 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-05 15:56:21 -0400 (Wed, 05 Sep 2007)
New Revision: 8180
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
Log:
- JBPORTAL-1677: Split functionality into several pages (though everything is handled by instances.xhtml)
- JBPORTAL-1678: Do not show preferences link in portlet definitions list (was already done for instances).
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-09-05 19:56:04 UTC (rev 8179)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-09-05 19:56:21 UTC (rev 8180)
@@ -10,8 +10,8 @@
<ui:define name="content">
+<c:if test="#{empty instancemgr.selectedPlugin}">
<h:form>
-
<table id="instancesTable2" width="100%">
<thead class="portlet-section-header">
<tr>
@@ -63,51 +63,79 @@
</c:forEach>
</c:if>
</ul>
-
</h:form>
+</c:if>
- <c:if test="#{instancemgr.selectedPlugin != null}">
- <hr/>
-
- <c:if test="#{instancemgr.selectedPlugin == 'info'}">
- <c:choose>
- <c:when test="#{instancemgr.selectedInstance.portlet != null}">
- <h3>Portlet details
- </h3>
- <ui:include src="common/showPortletDetails.xhtml">
- <ui:param name="portlet" value="#{instancemgr.selectedInstance.portlet}"/>
- <ui:param name="portletmgr" value="#{portletmgr}"/>
- </ui:include>
- </c:when>
- <c:otherwise>
- <h3>Portlet details</h3>
- The associated portlet is not available
- </c:otherwise>
- </c:choose>
- </c:if>
-
- <c:if test="#{instancemgr.selectedPlugin == 'preferences'}">
- <h3>Editing preferences of #{instancemgr.selectedInstance.id}: </h3>
- <ui:include src="common/editPreferences.xhtml">
- <ui:param name="prefs" value="#{instancemgr.selectedPrefs}"/>
+<c:if test="#{instancemgr.selectedPlugin == 'info'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> portlet details
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <c:choose>
+ <c:when test="#{instancemgr.selectedInstance.portlet != null}">
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet" value="#{instancemgr.selectedInstance.portlet}"/>
+ <ui:param name="portletmgr" value="#{portletmgr}"/>
</ui:include>
- <h:form style="text-align:center;padding: 1em 0 1em 0">
- <h:commandButton value="Save" action="#{instancemgr.updatePrefs}" styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="#{instancemgr.cancelPrefs}" styleClass="portlet-form-button"/>
- </h:form>
- </c:if>
+ </c:when>
+ <c:otherwise>
+ The associated portlet is not available.
+ </c:otherwise>
+ </c:choose>
+</c:if>
- <c:if test="#{instancemgr.selectedPlugin == 'security'}">
- <h3>Editing security of #{instancemgr.selectedInstance.id}: </h3>
+<c:if test="#{instancemgr.selectedPlugin == 'preferences'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> preferences
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs" value="#{instancemgr.selectedPrefs}"/>
+ </ui:include>
+ <h:form>
+ <h:commandButton value="Save" action="#{instancemgr.updatePrefs}" styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="#{instancemgr.cancelPrefs}" styleClass="portlet-form-button"/>
+ </h:form>
+</c:if>
- <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
- <ui:param name="auth" value="#{instancemgr.auth}"/>
- </ui:decorate>
- </c:if>
+<c:if test="#{instancemgr.selectedPlugin == 'security'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> security settings
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
+ <ui:param name="auth" value="#{instancemgr.auth}"/>
+ </ui:decorate>
+</c:if>
- </c:if>
-
</ui:define>
</ui:composition>
</div>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 19:56:04 UTC (rev 8179)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 19:56:21 UTC (rev 8180)
@@ -25,6 +25,7 @@
</h:form>
<h:form>
+
<table width="100%">
<thead class="portlet-section-header">
<tr>
@@ -54,15 +55,17 @@
<td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
<td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
<td>
+ <h:panelGroup rendered="#{!empty portlet.info.preferences.keys}">
+ <h:commandLink action="#{portletmgr.selectPortlet}">
+ <f:param name="id" value="#{portlet.context.id}"/>
+ <f:param name="plugin" value="preferences"/>
+ Preferences
+ </h:commandLink> | </h:panelGroup>
<h:commandLink action="#{portletmgr.selectPortlet}">
<f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="preferences"/>
- Preferences
- </h:commandLink> | <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="createInstance"/>
- Create instance
- </h:commandLink>
+ <f:param name="plugin" value="createInstance"/>
+ Create instance
+ </h:commandLink>
</td>
</tr>
</c:forEach>
@@ -93,7 +96,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} details
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> details
</li>
</ul>
</h:form>
@@ -112,7 +115,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} preferences
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> preferences
</li>
</ul>
</h:form>
@@ -131,7 +134,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} instance creation
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> instance creation
</li>
</ul>
</h:form>
16 years, 9 months
JBoss Portal SVN: r8179 - branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-05 15:56:04 -0400 (Wed, 05 Sep 2007)
New Revision: 8179
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
Log:
- JBPORTAL-1677: Split functionality into several pages (though everything is handled by instances.xhtml)
- JBPORTAL-1678: Do not show preferences link in portlet definitions list (was already done for instances).
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-09-05 19:56:04 UTC (rev 8179)
@@ -10,8 +10,8 @@
<ui:define name="content">
+<c:if test="#{empty instancemgr.selectedPlugin}">
<h:form>
-
<table id="instancesTable2" width="100%">
<thead class="portlet-section-header">
<tr>
@@ -63,51 +63,79 @@
</c:forEach>
</c:if>
</ul>
-
</h:form>
+</c:if>
- <c:if test="#{instancemgr.selectedPlugin != null}">
- <hr/>
-
- <c:if test="#{instancemgr.selectedPlugin == 'info'}">
- <c:choose>
- <c:when test="#{instancemgr.selectedInstance.portlet != null}">
- <h3>Portlet details
- </h3>
- <ui:include src="common/showPortletDetails.xhtml">
- <ui:param name="portlet" value="#{instancemgr.selectedInstance.portlet}"/>
- <ui:param name="portletmgr" value="#{portletmgr}"/>
- </ui:include>
- </c:when>
- <c:otherwise>
- <h3>Portlet details</h3>
- The associated portlet is not available
- </c:otherwise>
- </c:choose>
- </c:if>
-
- <c:if test="#{instancemgr.selectedPlugin == 'preferences'}">
- <h3>Editing preferences of #{instancemgr.selectedInstance.id}: </h3>
- <ui:include src="common/editPreferences.xhtml">
- <ui:param name="prefs" value="#{instancemgr.selectedPrefs}"/>
+<c:if test="#{instancemgr.selectedPlugin == 'info'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> portlet details
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <c:choose>
+ <c:when test="#{instancemgr.selectedInstance.portlet != null}">
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet" value="#{instancemgr.selectedInstance.portlet}"/>
+ <ui:param name="portletmgr" value="#{portletmgr}"/>
</ui:include>
- <h:form style="text-align:center;padding: 1em 0 1em 0">
- <h:commandButton value="Save" action="#{instancemgr.updatePrefs}" styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="#{instancemgr.cancelPrefs}" styleClass="portlet-form-button"/>
- </h:form>
- </c:if>
+ </c:when>
+ <c:otherwise>
+ The associated portlet is not available.
+ </c:otherwise>
+ </c:choose>
+</c:if>
- <c:if test="#{instancemgr.selectedPlugin == 'security'}">
- <h3>Editing security of #{instancemgr.selectedInstance.id}: </h3>
+<c:if test="#{instancemgr.selectedPlugin == 'preferences'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> preferences
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs" value="#{instancemgr.selectedPrefs}"/>
+ </ui:include>
+ <h:form>
+ <h:commandButton value="Save" action="#{instancemgr.updatePrefs}" styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="#{instancemgr.cancelPrefs}" styleClass="portlet-form-button"/>
+ </h:form>
+</c:if>
- <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
- <ui:param name="auth" value="#{instancemgr.auth}"/>
- </ui:decorate>
- </c:if>
+<c:if test="#{instancemgr.selectedPlugin == 'security'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{instancemgr.selectInstance}">Portlet Instances</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ <span class="objectName">#{instancemgr.selectedInstance.id}</span> security settings
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
+ <ui:param name="auth" value="#{instancemgr.auth}"/>
+ </ui:decorate>
+</c:if>
- </c:if>
-
</ui:define>
</ui:composition>
</div>
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 19:56:04 UTC (rev 8179)
@@ -55,15 +55,17 @@
<td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
<td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
<td>
+ <h:panelGroup rendered="#{!empty portlet.info.preferences.keys}">
+ <h:commandLink action="#{portletmgr.selectPortlet}">
+ <f:param name="id" value="#{portlet.context.id}"/>
+ <f:param name="plugin" value="preferences"/>
+ Preferences
+ </h:commandLink> | </h:panelGroup>
<h:commandLink action="#{portletmgr.selectPortlet}">
<f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="preferences"/>
- Preferences
- </h:commandLink> | <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="createInstance"/>
- Create instance
- </h:commandLink>
+ <f:param name="plugin" value="createInstance"/>
+ Create instance
+ </h:commandLink>
</td>
</tr>
</c:forEach>
@@ -94,7 +96,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} details
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> details
</li>
</ul>
</h:form>
@@ -113,7 +115,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} preferences
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> preferences
</li>
</ul>
</h:form>
@@ -132,7 +134,7 @@
</li>
<li>></li>
<li class="selected">
- #{portletmgr.selectedPortlet.name.value} instance creation
+ <span class="objectName">#{portletmgr.selectedPortlet.name.value}</span> instance creation
</li>
</ul>
</h:form>
16 years, 9 months
JBoss Portal SVN: r8178 - in trunk/core-identity/src: main/org/jboss/portal/core/identity/services/captcha and 18 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-05 13:22:45 -0400 (Wed, 05 Sep 2007)
New Revision: 8178
Added:
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/
trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml
Removed:
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
trunk/core-identity/src/resources/resource-bundles/Identity.properties
Log:
- Internationalization and some UI improvements
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -41,7 +41,7 @@
public final static String jbp_identity_validate_email_process_name = "jbp_identity_validate_email";
/** jBPM nodes */
- public final static String JBPM_NODE_EMAIL_VALIDATION = "email_validation";
+ public final static String JBPM_NODE_EMAIL_VALIDATION = "validate_email";
public final static String JBPM_NODE_APPROVAL = "admin_approval";
public final static String JBPM_TRANSITION_VALIDATED = "validated";
public final static String JBPM_TRANSITION_REJECTED ="rejected";
@@ -71,11 +71,20 @@
public static final String VARIABLE_EMAIL = "email";
public static final String VARIABLE_USER = "user";
+ /** Email constants */
+ public static final String EMAIL_TO = "to";
+ public static final String EMAIL_FROM = "from";
+ public static final String EMAIL_DOMAIN = "emailDomain";
+ public static final String EMAIL_TEXT = "emailText";
+
/** Default language */
public static final String DEFAULT_LOCALE = "en";
/** Default role */
public static final String DEFAULT_ROLE = "User";
+ /** Bundle prefix for dynamic value localization */
+ public static final String DYNAMIC_VALUE_PREFIX = "IDENTIY_DYNAMIC_VALUE_";
+
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/captcha/JCaptchaService.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -39,12 +39,19 @@
*/
public class JCaptchaService
{
- /** . */
+ /** The captcha service */
private static ImageCaptchaService instance = new DefaultManageableImageCaptchaService();
public static Boolean validateResponseForID(String challengeId, String value)
{
- return instance.validateResponseForID(challengeId, value);
+ try
+ {
+ return instance.validateResponseForID(challengeId, value);
+ }
+ catch (Exception e)
+ {
+ return Boolean.FALSE;
+ }
}
public static byte[] getChallengeImage(String challengeId, Locale locale) throws ImageFormatException, IOException
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -167,12 +167,12 @@
this.templateLocation = templateLocation;
this.mailData = mailData;
this.locale = locale;
- this.mailData.put("emailDomain", emailDomain);
+ this.mailData.put(IdentityConstants.EMAIL_DOMAIN, emailDomain);
ResourceBundle bundle = ResourceBundle.getBundle("Identity", locale);
String subject = null;
- String to = (String) mailData.get("to");
+ String to = (String) mailData.get(IdentityConstants.EMAIL_TO);
if (IdentityConstants.ACTION_REGISTER_USER.equals(templateLocation))
{
@@ -192,7 +192,6 @@
}
// Generating message
- log.info("sending mail to: "+ to + " " +subject);
this.generateEmailText();
log.debug(this.emailText);
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -63,7 +63,7 @@
private final static String xmlLocation = "conf/identity-ui-configuration.xml";
/** XML schema location */
- private final static String schemaLocation = "conf/identity-ui-configuration.xsd";
+ private final static String schemaLocation = "conf/schema/identity-ui-configuration.xsd";
/** Core Identity configration */
private IdentityUIConfiguration configuration;
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -25,6 +25,7 @@
import javax.naming.InitialContext;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jbpm.graph.def.ActionHandler;
@@ -45,10 +46,17 @@
public void execute(ExecutionContext ectx) throws Exception
{
- // Getting user information
- UserContainer uc = (UserContainer) ectx.getContextInstance().getVariable("user");
- // Creating user
- this.getIdentityManagementService().createUser(uc.getUsername(), uc.getPassword(), uc.getProfileMap(), uc.getRoles());
+ try
+ {
+ // Getting user information
+ UserContainer uc = (UserContainer) ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+ // Creating user
+ this.getIdentityManagementService().createUser(uc.getUsername(), uc.getPassword(), uc.getProfileMap(), uc.getRoles());
+ }
+ catch (ClassCastException e)
+ {
+ log.error("error while creating user", e);
+ }
}
private IdentityUserManagementService getIdentityManagementService()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -252,11 +252,11 @@
{
if (approve)
{
- token.signal("approved");
+ token.signal(IdentityConstants.JBPM_TRANSITION_APPROVED);
}
else
{
- token.signal("rejected");
+ token.signal(IdentityConstants.JBPM_TRANSITION_REJECTED);
}
}
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -27,23 +27,14 @@
import java.util.HashMap;
import java.util.Locale;
-import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
-import javax.portlet.PortletURL;
import org.jboss.logging.Logger;
-import org.jboss.portal.api.node.PortalNodeURL;
import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.core.controller.command.mapper.CommandFactory;
-import org.jboss.portal.core.controller.command.mapper.URLFactory;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityMailService;
import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
-import org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portlet.JBossActionRequest;
-import org.jboss.portlet.JBossActionResponse;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
@@ -55,10 +46,10 @@
{
/** . */
private IdentityUserManagementService identityManagementService;
-
+
/** . */
private IdentityMailService identityMailService;
-
+
/** . */
private static Logger log = Logger.getLogger(SendValidationMailAction.class);
@@ -66,45 +57,53 @@
{
HashMap emailMap = new HashMap();
String hash = this.hashGen();
-
+
String action = (String) ectx.getContextInstance().getVariable(IdentityConstants.ACTION);
String email = (String) ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_EMAIL);
Locale locale = (Locale) ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_LOCALE);
-
- if ( locale == null)
+
+ if (locale == null)
{
locale = new Locale(IdentityConstants.DEFAULT_LOCALE);
}
-
- UserContainer uc = (UserContainer) ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
-
- // Register new user
- if (IdentityConstants.ACTION_REGISTER_USER.equals(action))
+
+ try
{
- emailMap.put("to", email);
- emailMap.put("username", uc.getUsername());
- emailMap.put("password", uc.getPassword());
+ UserContainer uc = (UserContainer) ectx.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+
+ // Register new user
+ if (IdentityConstants.ACTION_REGISTER_USER.equals(action))
+ {
+ emailMap.put(IdentityConstants.EMAIL_TO, email);
+ emailMap.put("username", uc.getUsername());
+ emailMap.put("password", uc.getPassword());
+ }
+ // Change email
+ else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
+ {
+ String emailTo = this.getIdentityManagementService().getCurrentEmail(uc.getUsername());
+ emailMap.put(IdentityConstants.EMAIL_TO, emailTo);
+ }
+ else
+ {
+ throw new RuntimeException("no actuin defined for SendValidationMail: " + action);
+ }
+
+ ectx.getContextInstance().setVariable(IdentityConstants.VALIDATION_HASH, hash);
+ // Building the validation URL
+ String portalURL = (String) ectx.getContextInstance().getVariable(IdentityConstants.VALIDATION_PORTAL_URL);
+ String activationLink = portalURL + "/" + IdentityConstants.VALIDATE_EMAIL + "/"
+ + ectx.getProcessInstance().getId() + "/" + hash;
+ emailMap.put("activationLink", activationLink);
+
+ this.getIdentityMailService().sendMail(action, emailMap, locale);
}
- // Change email
- else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
+ catch (ClassCastException e)
{
- String emailTo = this.getIdentityManagementService().getCurrentEmail(uc.getUsername());
- emailMap.put("to", emailTo);
+ log.error("error while sending validation mail", e);
}
- else
- {
- throw new RuntimeException("wrong Action");
- }
-
- ectx.getContextInstance().setVariable(IdentityConstants.VALIDATION_HASH, hash);
-
- String portalURL = (String) ectx.getContextInstance().getVariable(IdentityConstants.VALIDATION_PORTAL_URL);
- String activationLink = portalURL + "/" + IdentityConstants.VALIDATE_EMAIL + "/" + ectx.getProcessInstance().getId() + "/" + hash;
- emailMap.put("activationLink", activationLink);
+ }
- this.getIdentityMailService().sendMail(action, emailMap, locale);
- }
-
// generating a random hash
private String hashGen()
{
@@ -132,14 +131,15 @@
}
return null;
}
-
+
private IdentityMailService getIdentityMailService()
{
if (identityMailService == null)
{
try
{
- this.identityMailService = (IdentityMailService) new InitialContext().lookup("java:/portal/IdentityMailService");
+ this.identityMailService = (IdentityMailService) new InitialContext()
+ .lookup("java:/portal/IdentityMailService");
}
catch (Exception e)
{
@@ -148,14 +148,15 @@
}
return identityMailService;
}
-
+
private IdentityUserManagementService getIdentityManagementService()
{
if (identityManagementService == null)
{
try
{
- this.identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityUserManagementService");
+ this.identityManagementService = (IdentityUserManagementService) new InitialContext()
+ .lookup("java:/portal/IdentityUserManagementService");
}
catch (Exception e)
{
@@ -164,5 +165,5 @@
}
return identityManagementService;
}
-
+
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -214,23 +214,15 @@
if (processInstance != null)
{
Token token = processInstance.getRootToken();
- if (token != null && token.getNode().getName().equals("validate_email"))
+ if (token != null && token.getNode().getName().equals(IdentityConstants.JBPM_NODE_EMAIL_VALIDATION))
{
String hash = (String) processInstance.getContextInstance().getVariable(IdentityConstants.VALIDATION_HASH);
if (registrationHash.equals(hash) && ! processInstance.hasEnded())
{
String action = (String) processInstance.getContextInstance().getVariable(IdentityConstants.ACTION);
- // Processing email change request to transition changeEmail
- if(IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
- {
- token.signal("validated");
- success = IdentityConstants.VALIDATION_VALIDATED;
- }
- else
- {
- token.signal("validated");
- success = IdentityConstants.REGISTRATION_REGISTERED;
- }
+
+ token.signal(IdentityConstants.JBPM_TRANSITION_VALIDATED);
+ success = processInstance.getProcessDefinition().getName();
}
}
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -97,7 +97,10 @@
public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
{
- map.put((String) propertyName, value);
+ if (value != null && value instanceof String && ((String)value).trim().length() == 0)
+ map.put((String) propertyName, null);
+ else
+ map.put((String)propertyName, value);
return true;
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
@@ -36,6 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.workflow.RegistrationService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -125,11 +127,14 @@
this.metaDataService = metaDataService;
}
- public String register(ActionEvent ev)
+ public void register(ActionEvent ev)
{
+ String registrationStatus = "failed";
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ String adminSubscription = (String) ev.getComponent().getId();
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", ctx.getViewRoot().getLocale());
if (uiUser.getUsername() != null && uiUser.getPassword() != null)
{
- String adminSubscriptionMode = (String) ev.getComponent().getId();
try
{
Class registrationDateClass = uiUser.getAttribute().getType("registrationdate");
@@ -156,8 +161,8 @@
Locale wLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
String wURL = this.getPortalURL();
- String registrationStatus = null;
- if (adminSubscriptionMode != null && adminSubscriptionMode.equals("admin"))
+
+ if (adminSubscription != null && adminSubscription.equals("admin"))
{
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
wLocale, true);
@@ -167,25 +172,30 @@
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
wLocale, false);
}
- log.debug(registrationStatus);
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Could not register user."));
+ log.error("", e);
}
}
- else
- {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Missing required values."));
- }
-
/*
* Cleaning up
*/
this.uiUser = new IdentityUIUser();
- return "success";
+
+ if (registrationStatus.equals(IdentityConstants.REGISTRATION_PENDING) )
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_PENDING_TITLE")));
+ }
+ else if (registrationStatus.equals(IdentityConstants.REGISTRATION_REGISTERED))
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
+ }
+ else
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
+ }
}
private String getPortalURL()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -27,12 +27,14 @@
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityMailService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
@@ -112,13 +114,15 @@
{
this.passwordCharacters = passwordCharacters;
}
-
+
public String doomed()
{
User user = null;
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", FacesContext.getCurrentInstance().getViewRoot()
+ .getLocale());
// Used by the user management to reset passwords
- if (username == null )
+ if (username == null)
{
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext ectx = ctx.getExternalContext();
@@ -126,7 +130,7 @@
this.username = (String) params.get("currentUser");
}
- if (username != null && !username.equals(""))
+ if (username != null && username.trim().length() > 0)
{
try
{
@@ -134,36 +138,38 @@
}
catch (NoSuchUserException e)
{
- FacesContext.getCurrentInstance()
- .addMessage(null, new FacesMessage("no account with this username found."));
- return "lostPassword";
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_404")));
+ return "status";
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Failed to reset password."));
+ log.error("", e);
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_ERROR")));
return "status";
}
}
else
{
- return "lostPassword";
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_404")));
+ return "status";
}
if (user != null)
{
- Map mailMap = new HashMap();
+ try
+ {
+ String newPassword = this.genPassword(8);
- String newPassword = this.genPassword(8);
+ IdentityUIUser uiUser = new IdentityUIUser(user.getUserName());
+
+ Map mailMap = new HashMap();
+ mailMap.put(IdentityConstants.EMAIL_TO, (String) uiUser.getAttribute().getValue("email").getObject());
+ mailMap.put("username", user.getUserName());
+ mailMap.put("password", newPassword);
- IdentityUIUser uiUser = new IdentityUIUser(user.getUserName());
-
- mailMap.put("to", (String) uiUser.getAttribute().getValue("email").getObject());
- mailMap.put("username", user.getUserName());
- mailMap.put("password", newPassword);
-
- try
- {
// Update password
identityUserBean.updatePassword(user.getUserName(), newPassword);
// Sending email
@@ -172,36 +178,30 @@
}
catch (Exception e)
{
- e.printStackTrace();
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Failed to reset password."));
+ log.error("", e);
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_ERROR")));
return "status";
}
}
FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage("Email with new credentials successfully sent."));
+ new FacesMessage(bundle.getString("IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL")));
return "status";
}
- private String genPassword(int length)
+ private String genPassword(int length) throws NoSuchAlgorithmException
{
StringBuffer buffer = new StringBuffer();
- try
- {
- char[] characterMap = passwordCharacters.toCharArray();
- SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
+ char[] characterMap = passwordCharacters.toCharArray();
+ SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
- for (int i = 0; i <= length; i++)
- {
- byte[] bytes = new byte[512];
- secureRandom.nextBytes(bytes);
- double number = secureRandom.nextDouble();
- int b = ((int) (number * characterMap.length));
- buffer.append(characterMap[b]);
- }
- }
- catch (NoSuchAlgorithmException e)
+ for (int i = 0; i <= length; i++)
{
- log.error("No Such Algorithm exists ", e);
+ byte[] bytes = new byte[512];
+ secureRandom.nextBytes(bytes);
+ double number = secureRandom.nextDouble();
+ int b = ((int) (number * characterMap.length));
+ buffer.append(characterMap[b]);
}
return buffer.toString();
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.ResourceBundle;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
@@ -160,16 +161,31 @@
return StaticValues.getTimezone();
}
else {
+ // building dynamic value list
List list = new ArrayList();
Iterator i = uiComponent.getValues().keySet().iterator();
+
+ // if not required add a empty SelectItem
+ if(! uiComponent.isRequired())
+ list.add(new SelectItem(""));
+
while(i.hasNext())
{
String key = (String) i.next();
- list.add(new SelectItem(key, (String) uiComponent.getValues().get(key)));
+ String value = (String) uiComponent.getValues().get(key);
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", ctx.getViewRoot().getLocale());
+ try
+ {
+ value = bundle.getString(IdentityConstants.DYNAMIC_VALUE_PREFIX + key.toUpperCase());
+ }
+ catch (Exception e)
+ {
+ // just take the default
+ }
+ list.add(new SelectItem(key, value ));
}
return list;
}
-
}
if ( base instanceof PortletPreferences)
{
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-05 17:22:45 UTC (rev 8178)
@@ -53,6 +53,7 @@
public static List getTimezone()
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
for (int i = 0; i < UserPortletConstants.TIME_ZONE_OFFSETS.length; i++)
{
if (UserPortletConstants.TIME_ZONE_OFFSETS[i] != null)
@@ -73,6 +74,7 @@
public static List getTheme(FacesContext ctx)
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
PortletContext pctx = (PortletContext) ctx.getExternalContext().getContext();
ThemeService themeService = (ThemeService) pctx.getAttribute("ThemeService");
for (Iterator i = themeService.getThemes().iterator(); i.hasNext();)
@@ -93,6 +95,7 @@
public static List getLocale(FacesContext ctx)
{
List list = new ArrayList();
+ list.add(new SelectItem(""));
Locale currentLocale = ctx.getViewRoot().getLocale();
ArrayList locales = new ArrayList(LocaleManager.getLocales());
Collections.sort(locales, new LocaleComparator());
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -24,7 +24,7 @@
<identity-ui-configuration>
- <subscription-mode>jbp_identity_validation_workflow</subscription-mode>
+ <subscription-mode>jbp_identity_validation_approval_workflow</subscription-mode>
<overwrite-workflow>false</overwrite-workflow>
<email-domain>jboss.org</email-domain>
<email-from>no-reply(a)jboss.com</email-from>
@@ -67,10 +67,6 @@
</ui-component>
<ui-component name="interests">
<property-ref>portal.user.interests</property-ref>
- <values>
- <value key="test">testing</value>
- <value key="test2">testing2</value>
- </values>
</ui-component>
<ui-component name="icq">
<property-ref>portal.user.im.icq</property-ref>
Deleted: trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-09-05 17:22:45 UTC (rev 8178)
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, 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. ~
- ~ ~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
- elementFormDefault="qualified">
-
-<xsd:element name="identity-ui-configuration">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
- </xsd:appinfo>
- </xsd:annotation>
-
- <xsd:choice>
- <!-- User portlet and user management portlet preferences -->
- <xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
- <xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
- <xsd:element name="overwrite-workflow" type="xsd:boolean" default="false"/>
- <xsd:element name="email-domain" minOccurs="1" maxOccurs="1" type="xsd:string" default="example.com" />
- <xsd:element name="email-from" minOccurs="1" maxOccurs="1" type="xsd:string" default="no-reply(a)example.com" />
- <xsd:element name="password-generation-characters" minOccurs="1" maxOccurs="1" type="xsd:string"/>
- <xsd:element name="default-roles" type="defaultRoles" minOccurs="1" maxOccurs="1"/>
-
- <!-- user interface components -->
- <xsd:element name="ui-components">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="java.util.HashMap"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="ui-component" minOccurs="1" maxOccurs="unbounded" type="UIComponent" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <!-- end: user interface components -->
- </xsd:choice>
- </xsd:complexType>
-</xsd:element>
-
-<!-- restictions for subscription-modes -->
-
-<xsd:simpleType name="subscriptionMode">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="custom" />
- <xsd:enumeration value="automatic" />
- <xsd:enumeration value="jbp_identity_validation_workflow" />
- <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
- </xsd:restriction>
-</xsd:simpleType>
-
-<xsd:complexType name="defaultRoles">
- <xsd:sequence>
- <xsd:element name="role" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
-</xsd:complexType>
-
-<xsd:complexType name="validators">
- <xsd:sequence>
- <xsd:element name="validator" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
-</xsd:complexType>
-
-<xsd:complexType name="componentValues">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry nonNullValue="true"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:choice minOccurs="1" maxOccurs="1">
- <xsd:element name="value" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry/>
- <jbxb:characters>
- <jbxb:mapEntryValue/>
- </jbxb:characters>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="key" type="xsd:string">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntryKey/>
- </xsd:appinfo>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
-</xsd:complexType>
-
-<xsd:complexType name="UIComponent">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
- <xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <xsd:element name="validators" type="validators" />
- <xsd:element name="converter" type="xsd:string" />
- <xsd:element name="required" type="xsd:boolean" default="false"/>
- <xsd:element name="read-only" type="xsd:boolean" default="false" />
- <xsd:element name="values" type="componentValues">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="java.util.HashMap"/>
- </xsd:appinfo>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <!-- attribute name -->
- <xsd:attribute name="name" type="xsd:string" use="required" />
-</xsd:complexType>
-
-</xsd:schema>
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
+ <timer name="time_to_expire" duedate="25 hours" transition="timedOut" />
<transition name="validated" to="end">
<action class="org.jboss.portal.core.identity.services.workflow.impl.UpdateEmailAction"/>
</transition>
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
+ <timer name="time_to_expire" duedate="49 hours" transition="timedOut" />
<transition name="validated" to="admin_approval"/>
<transition name="timedOut" to="end"/>
</state>
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -10,7 +10,7 @@
</transition>
</start-state>
<state name="validate_email">
- <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
+ <timer name="time_to_expire" duedate="49 hours" transition="timedOut" />
<transition name="validated" to="end">
<action class="org.jboss.portal.core.identity.services.workflow.impl.CreateUserAction"/>
</transition>
Copied: trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd (from rev 8173, trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd)
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2007-09-05 17:22:45 UTC (rev 8178)
@@ -0,0 +1,146 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, 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. ~
+ ~ ~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ elementFormDefault="qualified">
+
+<xsd:element name="identity-ui-configuration">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+
+ <xsd:choice>
+ <!-- User portlet and user management portlet preferences -->
+ <xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
+ <xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
+ <xsd:element name="overwrite-workflow" type="xsd:boolean" default="false"/>
+ <xsd:element name="email-domain" minOccurs="1" maxOccurs="1" type="xsd:string" default="example.com" />
+ <xsd:element name="email-from" minOccurs="1" maxOccurs="1" type="xsd:string" default="no-reply(a)example.com" />
+ <xsd:element name="password-generation-characters" minOccurs="1" maxOccurs="1" type="xsd:string"/>
+ <xsd:element name="default-roles" type="defaultRoles" minOccurs="1" maxOccurs="1"/>
+
+ <!-- user interface components -->
+ <xsd:element name="ui-components">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ui-component" minOccurs="1" maxOccurs="unbounded" type="UIComponent" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <!-- end: user interface components -->
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
+<!-- restictions for subscription-modes -->
+
+<xsd:simpleType name="subscriptionMode">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="custom" />
+ <xsd:enumeration value="automatic" />
+ <xsd:enumeration value="jbp_identity_validation_workflow" />
+ <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:complexType name="defaultRoles">
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="validators">
+ <xsd:sequence>
+ <xsd:element name="validator" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry nonNullValue="true"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice minOccurs="1" maxOccurs="1">
+ <xsd:element name="value" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry/>
+ <jbxb:characters>
+ <jbxb:mapEntryValue/>
+ </jbxb:characters>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="key" type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntryKey/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="UIComponent">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice>
+ <xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
+ <xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="validators" type="validators" />
+ <xsd:element name="converter" type="xsd:string" />
+ <xsd:element name="required" type="xsd:boolean" default="false"/>
+ <xsd:element name="read-only" type="xsd:boolean" default="false" />
+ <xsd:element name="values" type="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+ <!-- attribute name -->
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+</xsd:complexType>
+
+</xsd:schema>
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/templates/lostPassword/emailTemplate.tpl 2007-09-05 17:22:45 UTC (rev 8178)
@@ -6,7 +6,7 @@
Username: ${username}
Password: ${password}
-It is highly recommended that you change the generated password at your next login.
+It is highly recommended that you change the generated password after your next login.
Best regards,
${emailDomain}
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -44,14 +44,14 @@
<f:facet name="header">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION}"/>
</f:facet>
- <h:outputText value="Pending" rendered="#{user.currentNode == 'emailValidation'}"/>
+ <h:outputText value="Pending" rendered="#{user.currentNode == 'validate_email'}"/>
<!-- #{user.currentNode == 'adminApproval'} -->
<h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_APPROVE}"/>
<f:param name="processId" value="#{user.processId}" />
<f:param name="action" value="approve" />
</h:commandLink>
- <h:outputText value=" | " rendered="#{user.currentNode == 'adminApproval'}" />
+ <h:outputText value=" | " rendered="#{user.currentNode == 'admin_approval'}" />
<h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_REJECT}"/>
<f:param name="processId" value="#{user.processId}" />
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -6,16 +6,10 @@
xmlns:c="http://java.sun.com/jstl/core">
<c:choose>
- <c:when test="#{portletRenderParameter.operation == 'validated'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/success.xhtml" />
- </c:when>
- <c:when test="#{portletRenderParameter.operation == 'validation_failed'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/failure.xhtml" />
- </c:when>
- <c:when test="#{portletRenderParameter.operation == 'registered'}">
- <ui:include src="/WEB-INF/jsf/validationStatus/register_success.xhtml" />
- </c:when>
- <c:otherwise>
+ <c:when test="#{portletRenderParameter.operation != null}">
+ <ui:include src="/WEB-INF/jsf/validationStatus/jbp_status.xhtml" />
+ </c:when>
+ <c:otherwise>
<c:choose>
<c:when test="#{facesContext.externalContext.remoteUser != null}">
<ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -8,7 +8,9 @@
<ui:composition template="/WEB-INF/jsf/lostPassword/lostTemplate.xhtml">
-<ui:define name="title" />
+<ui:define name="title">
+ <h:messages />
+</ui:define>
<ui:define name="content" />
</ui:composition>
</div>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -9,7 +9,7 @@
<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
<ui:define name="title">
- #{bundle.IDENTITY_REGISTER_SUCCESS_TITLE}
+ <h:messages />
</ui:define>
<ui:define name="content" />
</ui:composition>
Deleted: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -1,21 +0,0 @@
-<div
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_FAILED}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/jbp_status.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -0,0 +1,50 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <f:loadBundle var="bundle" basename="Identity" />
+
+ <div style="height: 200px; padding-top: 30px; vertical-align:top; text-align: center;">
+
+ <b>
+ <c:choose>
+ <c:when test="#{portletRenderParameter.operation == 'validation_failed'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_FAILED}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation == 'jbp_identity_validate_email'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_VALIDATED}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation == 'jbp_identity_validation_workflow'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation == 'jbp_identity_validation_approval_workflow'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL}" />
+ </c:when>
+ <c:when test="#{portletRenderParameter.operation == 'custom'}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM}" />
+ </c:when>
+ </c:choose>
+ </b>
+
+ <ul>
+ <li>
+ <a href="#{metadataservice.portalContextPath}">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
+ </a>
+ </li>
+ <c:if test="#{portletRenderParameter.operation == 'jbp_identity_validation_workflow'}">
+ <!-- login link -->
+ <li>
+ <a href="#{metadataservice.portalContextPath}/auth">
+ <h:outputText value="#{bundle.IDENTITY_VERIFICATION_LOGIN}" />
+ </a>
+ </li>
+ </c:if>
+ </ul>
+ </div>
+
+</div>
\ No newline at end of file
Deleted: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -1,26 +0,0 @@
-<div
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- <li>
- <a href="#{metadataservice.portalContextPath}/auth">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_LOGIN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Deleted: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -1,21 +0,0 @@
-<div
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:c="http://java.sun.com/jstl/core"
- class="identity-ui">
-
- <f:loadBundle var="bundle" basename="Identity" />
-
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_STATUS_SUCCESS}" />
-
- <ul>
- <li>
- <a href="#{metadataservice.portalContextPath}">
- <h:outputText value="#{bundle.IDENTITY_VERIFICATION_RETURN}" />
- </a>
- </li>
- </ul>
-
-</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-05 17:22:45 UTC (rev 8178)
@@ -54,7 +54,7 @@
<preference>
<!-- Use captcha verification -->
<name>captcha</name>
- <value>true</value>
+ <value>false</value>
</preference>
<preference>
<!--
@@ -62,7 +62,7 @@
requires correct mail service configuration
-->
<name>lostPassword</name>
- <value>false</value>
+ <value>true</value>
</preference>
</portlet-preferences>
</portlet>
Modified: trunk/core-identity/src/resources/resource-bundles/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05 14:39:22 UTC (rev 8177)
+++ trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05 17:22:45 UTC (rev 8178)
@@ -33,11 +33,16 @@
IDENTITY_REGISTER_TITLE=Basic user information
IDENTITY_REGISTER_TITLE_CONFIRM=Confirmation
IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirm Password
-IDENTITY_REGISTER_SUCCESS_TITLE=Your account has been sucessfully created.
+IDENTITY_REGISTER_SUCCESS_TITLE=Your account has been successfully created. You may want to login now.
+IDENTITY_REGISTER_PENDING_TITLE=An e-mail has been sent to your e-mail address to verify your registration.
IDENTITY_LOST_PASSWORD_TITLE=Forgot your login data?
IDENTITY_LOST_PASSWORD_DESCRIPTION=Please enter your username to reset your password
+IDENTITY_LOST_PASSWORD_ERROR=Failed to reset password.
+IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL=You will receive an e-mail with your new password.
+IDENTITY_LOST_PASSWORD_STATUS_404=No account found.
+
IDENTITY_EDIT_PASSWORD_TITLE=Change your password
IDENTITY_EDIT_PASSWORD_CURRENT=Current password
IDENTITY_EDIT_CHANGE_PASSWORD=Change password
@@ -124,9 +129,12 @@
IDENTITY_VERIFICATION_RETURN=Return to portal
IDENTITY_VERIFICATION_LOGIN=Login
IDENTITY_VERIFICATION_STATUS_FAILED=Can not validate the e-mail address.
-IDENTITY_VERIFICATION_STATUS_SUCCESS=E-Mail address validated.
-IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=E-Mail address validated account waiting for approval.
+IDENTITY_VERIFICATION_STATUS_VALIDATED=E-Mail address validated.
+IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=Your account has been activaed. You may log in now.
+IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL=Your e-mail address has been verified, but your account needs to be approved by the administrator.
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Your e-mail address has been verified.
+IDENTITY_VALIDATION_ERROR_REGISTRATION=Failed to register user.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Sorry - This username is already taken.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Error while validating username.
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=The passwords doesn't match.
@@ -134,3 +142,7 @@
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Invalid E-Mail address.
IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Invalid password
IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Captcha incorrect
+
+# Example usage for dynamic values
+#IDENTIY_DYNAMIC_VALUE_TEST=test label
+#IDENTIY_DYNAMIC_VALUE_TEST2=test label2
\ No newline at end of file
16 years, 9 months
JBoss Portal SVN: r8177 - trunk/workflow/src/resources/portal-workflow-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-05 10:39:22 -0400 (Wed, 05 Sep 2007)
New Revision: 8177
Modified:
trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
Log:
uncommented ApprovePublishServlet
commented jbpm Threads Servlet
Modified: trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-05 13:39:15 UTC (rev 8176)
+++ trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-05 14:39:22 UTC (rev 8177)
@@ -27,7 +27,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <!--
+
<servlet>
<servlet-name>ApprovePublishServlet</servlet-name>
<servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
@@ -40,23 +40,21 @@
<servlet-name>ApprovePublishServlet</servlet-name>
<url-pattern>/reject/*</url-pattern>
</servlet-mapping>
- -->
- <!-- The JbpmThreadsServlet -->
+
+ <!-- The JbpmThreadsServlet
<servlet>
<servlet-name>JbpmThreadsServlet</servlet-name>
<servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class>
<load-on-startup>1</load-on-startup>
- <!--
<init-param>
<param-name>jbpm.configuration.resource</param-name>
<param-value>conf/hibernate/workflow/hibernate.cfg.xml</param-value>
</init-param>
</servlet>
- -->
<servlet-mapping>
<servlet-name>JbpmThreadsServlet</servlet-name>
<url-pattern>/threads</url-pattern>
</servlet-mapping>
-
+ -->
</web-app>
16 years, 9 months
JBoss Portal SVN: r8176 - branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-09-05 09:39:15 -0400 (Wed, 05 Sep 2007)
New Revision: 8176
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
Log:
JBPORTAL-1572 - gadgets directory read failed due to timeout - unable to read category
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05 12:54:43 UTC (rev 8175)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05 13:39:15 UTC (rev 8176)
@@ -150,11 +150,16 @@
//
GGQueryEntry tmp = new GGQueryEntry(query);
GGQueryEntry entry = (GGQueryEntry)searches.putIfAbsent(query, tmp);
- if (entry == null)
+
+
+ // Check if query wasn't performed yet or if it is empty (probably failed)
+
+ if (entry == null || !entry.getResult().entries().hasNext())
{
entry = tmp;
entry.retrieve();
}
+
GGQueryResult result = entry.getResult();
//
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05 12:54:43 UTC (rev 8175)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05 13:39:15 UTC (rev 8176)
@@ -40,6 +40,7 @@
import javax.xml.parsers.DocumentBuilder;
import java.net.URL;
import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
@@ -140,9 +141,13 @@
//
return new GGQueryResult(entries);
}
+ catch (SocketTimeoutException e)
+ {
+ log.error("Query for google gadgets in directory failed due to timeout. Try to increase connectionTimeout initial parameter; ", e);
+ }
catch (Exception e)
{
- e.printStackTrace();
+ log.error("Gadgets query failed: ", e);
}
//
16 years, 9 months
JBoss Portal SVN: r8175 - in trunk/workflow/src/resources: portal-workflow-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-05 08:54:43 -0400 (Wed, 05 Sep 2007)
New Revision: 8175
Modified:
trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
Log:
- added scheduler for jBPM
- added jBPM ThreadServlet for using the timer
Modified: trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-05 12:52:20 UTC (rev 8174)
+++ trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-05 12:54:43 UTC (rev 8175)
@@ -47,7 +47,8 @@
<![CDATA[
<jbpm-configuration>
<jbpm-context>
- <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory"/>
+ <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
+ <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
</jbpm-context>
<string name="resource.hibernate.cfg.xml" value="conf/hibernate/workflow/hibernate.cfg.xml"/>
<string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
Modified: trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-05 12:52:20 UTC (rev 8174)
+++ trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-05 12:54:43 UTC (rev 8175)
@@ -26,11 +26,11 @@
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
+ version="2.4">
+ <!--
<servlet>
<servlet-name>ApprovePublishServlet</servlet-name>
<servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
- <!--load-on-startup>0</load-on-startup-->
</servlet>
<servlet-mapping>
<servlet-name>ApprovePublishServlet</servlet-name>
@@ -39,5 +39,24 @@
<servlet-mapping>
<servlet-name>ApprovePublishServlet</servlet-name>
<url-pattern>/reject/*</url-pattern>
- </servlet-mapping>
+ </servlet-mapping>
+ -->
+ <!-- The JbpmThreadsServlet -->
+ <servlet>
+ <servlet-name>JbpmThreadsServlet</servlet-name>
+ <servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ <!--
+ <init-param>
+ <param-name>jbpm.configuration.resource</param-name>
+ <param-value>conf/hibernate/workflow/hibernate.cfg.xml</param-value>
+ </init-param>
+ </servlet>
+ -->
+ <servlet-mapping>
+ <servlet-name>JbpmThreadsServlet</servlet-name>
+ <url-pattern>/threads</url-pattern>
+ </servlet-mapping>
+
+
</web-app>
16 years, 9 months