JBoss Portal SVN: r8174 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget/google/provider and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-09-05 08:52:20 -0400 (Wed, 05 Sep 2007)
New Revision: 8174
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java
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
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
Log:
JBPORTAL-1535 - Make GG xml retrieval timeout parameterizable
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-09-05 12:45:05 UTC (rev 8173)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-09-05 12:52:20 UTC (rev 8174)
@@ -45,7 +45,7 @@
URL url = tcl.getResource("google/queryresult1.xml");
assertNotNull(url);
GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
- GGQueryResult result = builder.build();
+ GGQueryResult result = builder.build(5000);
assertNotNull(result);
Iterator i = result.entries();
assertNotNull(i);
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:45:05 UTC (rev 8173)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05 12:52:20 UTC (rev 8174)
@@ -64,7 +64,7 @@
private ExecutorService executor;
/** . */
- private int connectionTimeout = 500;
+ private int connectionTimeout = 5000;
/** . */
private static final Collection CATEGORIES = Collections.unmodifiableList(new CollectionBuilder()
@@ -280,7 +280,7 @@
public Object call() throws MalformedURLException
{
- return new GGQueryResultBuilder(query, getConnectionTimeout()).build();
+ return new GGQueryResultBuilder(query).build(getConnectionTimeout());
}
}
}
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:45:05 UTC (rev 8173)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05 12:52:20 UTC (rev 8174)
@@ -66,7 +66,7 @@
/** . */
private final URL url;
- public GGQueryResultBuilder(GGQuery query, int connectionTimeout) throws MalformedURLException
+ public GGQueryResultBuilder(GGQuery query) throws MalformedURLException
{
if (query == null)
{
@@ -85,7 +85,7 @@
this.url = url;
}
- public GGQueryResult build()
+ public GGQueryResult build(int connectionTimeout)
{
try
{
@@ -93,7 +93,7 @@
byte[] bytes;
if ("http".equals(url.getProtocol()))
{
- bytes = URLTools.performGET(url, 5000, 5000);
+ bytes = URLTools.performGET(url, connectionTimeout, connectionTimeout);
}
else
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05 12:45:05 UTC (rev 8173)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05 12:52:20 UTC (rev 8174)
@@ -35,7 +35,7 @@
<init-param>
<description>Connection timeout when retreiving gadgets from google directory</description>
<name>connectionTimeout</name>
- <value>500</value>
+ <value>5000</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
18 years, 8 months
JBoss Portal SVN: r8173 - in trunk/core-identity: src/main/org/jboss/portal/core/identity/services and 23 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-05 08:45:05 -0400 (Wed, 05 Sep 2007)
New Revision: 8173
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/
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/.classpath
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactory.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.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/impl/IdentityUserManagementServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfiguration.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.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/metadata/UIComponentConfiguration.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/RegistrationService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/UserContainer.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/ValidateEmailService.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/UpdateEmailAction.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/IdentityUIUser.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.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/EditProfileAction.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/admin/RoleManagementBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.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/PortletDelegatingPropertyResolver.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletVariableResolver.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
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.xsd
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-war/WEB-INF/faces-config.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/deleteRole.xhtml
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/registerRoles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.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/profile/changeEmail.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
trunk/core-identity/src/resources/resource-bundles/Identity.properties
Log:
- changed jBPM process definitions
- modified the workflow services
- improved the metadata usage and services
- finished the validation and registration process
Modified: trunk/core-identity/.classpath
===================================================================
--- trunk/core-identity/.classpath 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/.classpath 2007-09-05 12:45:05 UTC (rev 8173)
@@ -32,7 +32,6 @@
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-saaj.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jbosssx.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-transaction.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jmx-invoker-adaptor-client.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jnp-client.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jnpserver.jar"/>
@@ -46,5 +45,7 @@
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/jstl.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/myfaces-impl.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/theme"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactory.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactory.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactory.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -23,7 +23,7 @@
package org.jboss.portal.core.identity.services;
import org.jboss.portal.core.controller.command.mapper.CommandFactory;
-import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -31,6 +31,7 @@
*/
public interface IdentityCommandFactory extends CommandFactory
{
- PortalObjectId getTargetWindowId();
+ public void setInstanceId(String instanceId);
+ public void setValidateEmailService(ValidateEmailService validateEmailService);
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -28,29 +28,54 @@
*/
public class IdentityConstants
{
+ /** The command factory url */
+ public static final String VALIDATE_EMAIL = "validateEmail";
+
+ /** Salt */
public static final String HASH_SALT = "fuDrupRunEP2BRuspADr";
+ /** Automatic subscription mode */
public static final String SUBSCRIPTION_MODE_AUTOMATIC = "automatic";
- /** . */
+
+ /** jBPM validate email process */
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_APPROVAL = "admin_approval";
+ public final static String JBPM_TRANSITION_VALIDATED = "validated";
+ public final static String JBPM_TRANSITION_REJECTED ="rejected";
+ public final static String JBPM_TRANSITION_APPROVED = "approved";
- /*
- * Available actions
- */
+ /** Static predefined component values */
+ public static final String COMPONENT_VALUE_LOCALE = "org.jboss.portal.core.identity.locale";
+ public static final String COMPONENT_VALUE_THEME = "org.jboss.portal.core.identity.theme";
+ public static final String COMPONENT_VALUE_TIMEZONE = "org.jboss.portal.core.identity.timezone";
+
+ /** Available actions */
public static final String ACTION = "action";
public static final String ACTION_REGISTER_USER = "register";
public static final String ACTION_CHANGE_EMAIL = "changeEmail";
public static final String ACTION_LOST_PASSWORD = "lostPassword";
- public static final String REGISTRATION_REGISTERED = "REGISTERED";
- public static final String REGISTRATION_PENDING ="PENDING";
+ /** Registration and validation status */
+ public static final String REGISTRATION_REGISTERED = "registered";
+ public static final String REGISTRATION_PENDING = "registration_pending";
+ public static final String VALIDATION_FAILED = "validation_failed";
+ public static final String VALIDATION_VALIDATED = "validated";
+ /** jBPM process variables */
+ public static final String VALIDATION_PORTAL_URL = "portalURL";
public static final String VALIDATION_HASH = "validationHash";
public static final String VARIABLE_LOCALE = "locale";
public static final String VARIABLE_EMAIL = "email";
public static final String VARIABLE_USER = "user";
+ /** Default language */
public static final String DEFAULT_LOCALE = "en";
+ /** Default role */
+ public static final String DEFAULT_ROLE = "User";
+
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,17 +22,13 @@
******************************************************************************/
package org.jboss.portal.core.identity.services.impl;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.core.identity.services.IdentityCommandFactory;
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
-import org.jboss.portal.core.model.instance.command.render.RenderPortletInstanceCommand;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.server.ServerInvocation;
@@ -42,37 +38,29 @@
*/
public class IdentityCommandFactoryService extends AbstractCommandFactory implements IdentityCommandFactory
{
+ /** Portlet instance */
+ private String instanceId;
- /** . */
- protected String targetWindowRef = null;
-
- /** . */
- protected PortalObjectId targetWindowId;
-
- /** . */
+ /** jBPM email validation service */
protected ValidateEmailService validateEmailService = null;
- public PortalObjectId getTargetWindowId()
+ public void setInstanceId(String instanceId)
{
- return targetWindowId;
+ this.instanceId = instanceId;
}
- public ValidateEmailService getValidateEmailService()
- {
- return validateEmailService;
- }
-
public void setValidateEmailService(ValidateEmailService validateEmailService)
{
this.validateEmailService = validateEmailService;
}
-
+
public ControllerCommand doMapping(ControllerContext controllerContext, ServerInvocation invocation, String host,
String contextPath, String requestPath)
{
- PortletParametersStateString renderParameters = new PortletParametersStateString();
+ PortletParametersStateString renderParameters = new PortletParametersStateString();
+ String operation = IdentityConstants.VALIDATION_FAILED;
- if (requestPath != null)
+ if (requestPath != null && requestPath.length() > 1)
{
// Remove starting /
@@ -85,23 +73,17 @@
String bpmId = aRequest[0];
String hash = aRequest[1];
// Validating email
- validateEmailService.validateEmail(bpmId, hash);
+ String status = validateEmailService.validateEmail(bpmId, hash);
+ // Passing status to portlet render parameters
+ operation = status;
-
-// this.targetWindowId = PortalObjectId.parse("default.default.CoreIdentityUserPortletWindow", PortalObjectPath.LEGACY_FORMAT);
-
}
-/**
- else
- {
- this.targetWindowId = PortalObjectId.parse("default.default.CoreIdentityUserPortletWindow",
- PortalObjectPath.LEGACY_FORMAT);
- }
-*/
}
// Perform a render URL on the target window
- return new RenderPortletInstanceCommand("CoreIdentityUserPortletInstance", null );
- // InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW, WindowState.NORMAL, renderParameters);
+
+ renderParameters.setValue("operation", operation);
+ InvokePortletInstanceRenderCommand ipirc = new InvokePortletInstanceRenderCommand(instanceId, renderParameters);
+ return ipirc;
}
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -33,11 +33,11 @@
import java.util.Map;
import java.util.ResourceBundle;
-import javax.naming.InitialContext;
-
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.services.metadata.IdentityUIConfiguration;
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
import org.jboss.portal.core.modules.MailModule;
import org.jboss.portal.jems.as.JNDI;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -53,26 +53,29 @@
public class IdentityMailServiceImpl extends AbstractJBossService implements IdentityMailService
{
- /** . */
+ /** Template mail data */
private Map mailData = new HashMap();
- /** . */
+ /** Requested locale */
private Locale locale;
- /** . */
+ /** The e-mail text */
private String emailText = null;
- /** . */
- private String emailDomain = "TODO emailDomain";
+ /** The e-mail domain */
+ private String emailDomain = null;
- /** . */
- private String emailFrom = "no-reply(a)todo.com";
+ /** E-Mail from */
+ private String emailFrom = null;
- /** . */
+ /** Template location */
private String templateLocation;
- /** . */
+ /** The mail module */
private MailModule mailModule;
+
+ /** The core-identity configuration service */
+ private IdentityUIConfigurationService identityUIConfigurationService;
/** . */
private static final Logger log = Logger.getLogger(IdentityMailServiceImpl.class);
@@ -87,6 +90,10 @@
{
super.startService();
+ IdentityUIConfiguration cf =this.identityUIConfigurationService.getConfiguration();
+ this.emailDomain = cf.getEmailDomain();
+ this.emailFrom = cf.getEmailFrom();
+
if (this.jndiName != null)
{
jndiBinding = new JNDI.Binding(jndiName, this);
@@ -135,6 +142,16 @@
this.mailModule = mailModule;
}
+ public IdentityUIConfigurationService getIdentityUIConfigurationService()
+ {
+ return identityUIConfigurationService;
+ }
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
+
public String getJNDIName()
{
return this.jndiName;
@@ -175,11 +192,13 @@
}
// Generating message
+ log.info("sending mail to: "+ to + " " +subject);
this.generateEmailText();
+ log.debug(this.emailText);
+
+ // Sending mail
+ this.getMailModule().send(emailFrom, to , subject, emailText);
- // Sending mail
- // this.getMailModule.send(emailFrom, to , subject, emailText);
- log.debug(subject + to + this.emailText);
}
private void generateEmailText() throws IOException, TemplateException
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityUserManagementServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityUserManagementServiceImpl.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityUserManagementServiceImpl.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,14 +22,14 @@
******************************************************************************/
package org.jboss.portal.core.identity.services.impl;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.naming.InitialContext;
-
+import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
import org.jboss.portal.identity.IdentityContext;
@@ -50,22 +50,22 @@
*/
public class IdentityUserManagementServiceImpl extends AbstractJBossService implements IdentityUserManagementService
{
- /** . */
+ /** The identity user module */
private UserModule userModule;
- /** . */
+ /** The identity role module */
private RoleModule roleModule;
- /** . */
+ /** The identity user profile module */
private UserProfileModule userProfileModule;
- /** . */
+ /** The identity membership module */
private MembershipModule membershipModule;
- /** . */
+ /** The identity service controller */
private IdentityServiceController identityServiceController;
- /** . */
+ /** The core-identity configuration service */
private IdentityUIConfigurationService identityUIConfigurationService;
/** . */
@@ -80,6 +80,7 @@
try
{
+ // Loading required modules
userModule = (UserModule) identityServiceController.getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
roleModule = (RoleModule) identityServiceController.getIdentityContext().getObject(IdentityContext.TYPE_ROLE_MODULE);
userProfileModule = (UserProfileModule) identityServiceController.getIdentityContext().getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
@@ -245,6 +246,13 @@
{
roles = this.identityUIConfigurationService.getConfiguration().getDefaultRoles();
}
+ // If roles are still not available
+ if (roles == null || (roles != null && roles.size() == 0 ))
+ {
+ roles = new ArrayList();
+ roles.add(IdentityConstants.DEFAULT_ROLE);
+ log.error("no default roles spezified - please check your configuration");
+ }
if (roles != null && roles.size() > 0)
{ // Checking existing roles
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfiguration.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfiguration.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfiguration.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -23,6 +23,7 @@
package org.jboss.portal.core.identity.services.metadata;
import java.util.List;
+import java.util.Map;
import org.jboss.portal.core.identity.services.IdentityConstants;
@@ -32,29 +33,29 @@
*/
public class IdentityUIConfiguration
{
- /** . */
- String subscriptionMode;
+ /** UserPortlet subscription mode */
+ private String subscriptionMode;
- /** . */
- String adminSubscriptionMode = "automatic";
+ /** UserManagementPortlet subscription mode */
+ private String adminSubscriptionMode = "automatic";
- /** . */
- boolean overwriteWorkflow = false;
+ /** Overwrite existing workflow */
+ private boolean overwriteWorkflow = false;
- /** . */
- String emailDomain;
+ /** E-Mail domain */
+ private String emailDomain;
- /** . */
- String emailFrom;
+ /** E-Mail from */
+ private String emailFrom;
- /** . */
- List defaultRoles;
+ /** List of default roles */
+ private List defaultRoles;
- /** . */
- String passwordGenerationCharacters;
+ /** Characters used for generating a random password */
+ private String passwordGenerationCharacters;
- /** . */
- List uiComponents;
+ /** Map of available UI-Components */
+ private Map uiComponents;
public String getSubscriptionMode()
{
@@ -126,12 +127,12 @@
this.passwordGenerationCharacters = passwordGenerationCharacters;
}
- public List getUiComponents()
+ public Map getUiComponents()
{
return uiComponents;
}
- public void setUiComponents(List uiComponents)
+ public void setUiComponents(Map uiComponents)
{
this.uiComponents = uiComponents;
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -33,7 +33,21 @@
public interface IdentityUIConfigurationService
{
+ /**
+ *
+ * Core-Identity configuration
+ *
+ * @return IdentityUIConfiguration
+ */
IdentityUIConfiguration getConfiguration();
+
+ /**
+ *
+ * jBPM Workflow Service
+ *
+ * @return WorkflowService
+ * @throws NamingException
+ */
WorkflowService getWorkflowService() throws NamingException;
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -25,18 +25,29 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.Map;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.core.identity.services.IdentityConstants;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.info.PropertyInfo;
import org.jboss.portal.jems.as.JNDI;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.workflow.service.WorkflowService;
+import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBeforeSetParentCallback;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnmarshallingContext;
import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
import org.jbpm.JbpmContext;
import org.jbpm.graph.def.ProcessDefinition;
@@ -48,18 +59,24 @@
public class IdentityUIConfigurationServiceImpl extends AbstractJBossService implements IdentityUIConfigurationService
{
- /** . */
+ /** XML configuration location */
+ 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 xmlLocation = "conf/identity-ui-configuration.xml";
-
- /** . */
+ /** Core Identity configration */
private IdentityUIConfiguration configuration;
- /** . */
+ /** jBPM Workflow service */
private WorkflowService workflowService;
+ /** Identity service controller */
+ private IdentityServiceController identityServiceController;
+
+ /** Identity user profile */
+ private UserProfileModule userProfileModule;
+
/** . */
private JNDI.Binding jndiBinding;
@@ -73,11 +90,8 @@
try
{
// Creating IdentityUIConfiguration
- SchemaBinding schema = XsdBinder.bind(getURL(schemaLocation).toString());
- schema.setIgnoreUnresolvedFieldOrClass(false);
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- this.configuration = (IdentityUIConfiguration) unmarshaller.unmarshal(getResource(xmlLocation), schema);
-
+ this.configuration = this.createConfiguration();
+
// Loading Workflow if subscriptionmodes != automatic
if (this.configuration.enableWorkflow())
{
@@ -86,10 +100,11 @@
String emailValidationProcess = IdentityConstants.jbp_identity_validate_email_process_name;
if (subscriptionMode != null && adminSubscriptionMode != null && emailValidationProcess != null)
{
+ // automatically load email validation process
+ this.createJBPMContext(emailValidationProcess);
+
this.createJBPMContext(subscriptionMode);
this.createJBPMContext(adminSubscriptionMode);
- // automatically load email validation process
- this.createJBPMContext(emailValidationProcess);
}
else
{
@@ -139,12 +154,44 @@
{
return this.configuration;
}
-
+
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
-
+
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ public void setIdentityServiceController(IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+ public UserProfileModule getUserProfileModule()
+ {
+ if (userProfileModule == null)
+ {
+ try
+ {
+ this.userProfileModule = (UserProfileModule) identityServiceController.getIdentityContext().getObject(
+ IdentityContext.TYPE_USER_PROFILE_MODULE);
+ }
+ catch (IdentityException e)
+ {
+ log.error("failed to load UserProfileModule", e);
+ }
+ }
+ return this.userProfileModule;
+ }
+
+ public void setUserProfileModule(UserProfileModule userProfileModule)
+ {
+ this.userProfileModule = userProfileModule;
+ }
+
public WorkflowService getWorkflowService() throws NamingException
{
if (workflowService == null)
@@ -153,19 +200,19 @@
{
workflowService = (WorkflowService) new InitialContext().lookup("java:/portal/Workflow");
}
- catch(Exception e)
+ catch (Exception e)
{
// OK - if not using jBPM
if (this.configuration.enableWorkflow())
{
- throw new RuntimeException(e);
+ throw new RuntimeException("failed to load WorkflowService", e);
}
}
}
return workflowService;
}
- private void createJBPMContext(String processName) throws Exception
+ private void createJBPMContext(String processName) throws NamingException
{
if (!IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(processName))
{
@@ -192,6 +239,82 @@
}
}
+ private IdentityUIConfiguration createConfiguration() throws IOException, JBossXBException
+ {
+ SchemaBinding schema = XsdBinder.bind(getURL(schemaLocation).toString());
+ schema.setIgnoreUnresolvedFieldOrClass(false);
+
+ TermBeforeSetParentCallback componentCallback = new TermBeforeSetParentCallback()
+ {
+ public Object beforeSetParent(Object o, UnmarshallingContext ctx)
+ {
+ UIComponentConfiguration uiComponent = null;
+ ElementBinding eb = (ElementBinding) ctx.getParticle().getTerm();
+ String localPart = eb.getQName().getLocalPart();
+ if ("ui-component".equals(localPart))
+ {
+ uiComponent = (UIComponentConfiguration) o;
+ try
+ {
+ // Getting property reference
+ PropertyInfo propertyInfo = getUserProfileModule().getProfileInfo().getPropertyInfo(
+ uiComponent.getPropertyRef());
+ uiComponent.setPropertyInfo(propertyInfo);
+ }
+ catch (IdentityException e)
+ {
+ log.error("cannot resolve property: " + uiComponent.getPropertyRef(), e);
+ uiComponent = null;
+ }
+ }
+ return uiComponent;
+ }
+ };
+
+ // Adding callback method for ui-components
+ TypeBinding cb = schema.getType(new javax.xml.namespace.QName("UIComponent"));
+ cb.setBeforeSetParentCallback(componentCallback);
+
+ TermBeforeSetParentCallback valueCallback = new TermBeforeSetParentCallback()
+ {
+ public Object beforeSetParent(Object o, UnmarshallingContext ctx)
+ {
+
+ ElementBinding eb = (ElementBinding) ctx.getParticle().getTerm();
+ String localPart = eb.getQName().getLocalPart();
+ Map m = (Map) o;
+ if ("values".equals(localPart))
+ {
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) ctx.getParentValue();
+ if ( m.containsKey(IdentityConstants.COMPONENT_VALUE_LOCALE) )
+ {
+ uiComponent.setPredefinedMapValues(IdentityConstants.COMPONENT_VALUE_LOCALE);
+ m.remove(IdentityConstants.COMPONENT_VALUE_LOCALE);
+ }
+ else if ( m.containsKey(IdentityConstants.COMPONENT_VALUE_THEME))
+ {
+ uiComponent.setPredefinedMapValues(IdentityConstants.COMPONENT_VALUE_THEME);
+ m.remove(IdentityConstants.COMPONENT_VALUE_THEME);
+ }
+ else if ( m.containsKey(IdentityConstants.COMPONENT_VALUE_TIMEZONE))
+ {
+ uiComponent.setPredefinedMapValues(IdentityConstants.COMPONENT_VALUE_TIMEZONE);
+ m.remove(IdentityConstants.COMPONENT_VALUE_TIMEZONE);
+ }
+ }
+ return m;
+ }
+ };
+
+ // Adding callback method for ui-component values
+ TypeBinding vb = schema.getType(new javax.xml.namespace.QName("componentValues"));
+ vb.setBeforeSetParentCallback(valueCallback);
+
+ // Unmarshalling && creating configuration
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ return (IdentityUIConfiguration) unmarshaller.unmarshal(getResource(xmlLocation), schema);
+ }
+
private InputStream getResource(String path) throws IOException
{
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/UIComponentConfiguration.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/UIComponentConfiguration.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/UIComponentConfiguration.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -23,49 +23,48 @@
package org.jboss.portal.core.identity.services.metadata;
import java.util.List;
+import java.util.Map;
-import javax.naming.InitialContext;
-
import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portal.identity.info.PropertyInfo;
/**
+ *
+ * Core-Identity configuration class
+ *
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
public class UIComponentConfiguration
{
- /** . */
- private UserProfileModule userProfileModule;
-
- /** . */
+ /** Identity property reference */
private String propertyRef;
-
- /** . */
- String localizationBundle;
- /** . */
+ /** UI reference name */
private String name;
- /** . */
+ /** List of validators */
private List validators;
- /** . */
+ /** The converter */
private String converter;
- /** . */
+ /** Required flag */
private boolean required;
-
- /** . */
+
+ /** ReadOnly flag */
private boolean readOnly;
+
+ /** Property values */
+ private Map values;
- /** . */
- private List values;
-
- /** . */
+ /** Reference for predefined values */
+ private String predefinedMapValues;
+
+ /** Identity PropertyInfo */
private PropertyInfo propertyInfo;
+
public String getPropertyRef()
{
return propertyRef;
@@ -73,26 +72,9 @@
public void setPropertyRef(String identifier) throws IdentityException
{
- this.propertyInfo = this.getUserProfileModule().getProfileInfo().getPropertyInfo(identifier);
- if (this.propertyInfo == null )
- {
- throw new IdentityException("Property not found");
- }
this.propertyRef = identifier;
- // not needed any more
- this.userProfileModule = null;
}
- public String getLocalizationBundle()
- {
- return localizationBundle;
- }
-
- public void setLocalizationBundle(String localizationBundle)
- {
- this.localizationBundle = localizationBundle;
- }
-
public String getName()
{
return name;
@@ -102,7 +84,7 @@
{
this.name = name;
}
-
+
// returns the first validator
public String getValidator()
{
@@ -150,37 +132,40 @@
{
this.converter = converter;
}
-
- public List getValues()
+
+ public Map getValues()
{
return values;
}
- public void setValues(List values)
+ public void setValues(Map values)
{
this.values = values;
}
- public Class getPropertyClass() throws ClassNotFoundException
+ public PropertyInfo getPropertyInfo()
{
- // Returns the Class of the Property
- return ClassLoader.getSystemClassLoader().loadClass(this.propertyInfo.getType());
+ return propertyInfo;
}
+
+ public void setPropertyInfo(PropertyInfo propertyInfo)
+ {
+ this.propertyInfo = propertyInfo;
+ }
+
+ public String getPredefinedMapValues()
+ {
+ return predefinedMapValues;
+ }
- private UserProfileModule getUserProfileModule()
+ public void setPredefinedMapValues(String predefinedMapValues)
{
- if (userProfileModule == null)
- {
- try
- {
- userProfileModule = (UserProfileModule) new InitialContext().lookup("java:/portal/UserProfileModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return userProfileModule;
+ this.predefinedMapValues = predefinedMapValues;
}
+
+ public Class getPropertyClass() throws ClassNotFoundException
+ {
+ // Returns the Class of the Property
+ return ClassLoader.getSystemClassLoader().loadClass(this.propertyInfo.getType());
+ }
}
-
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/RegistrationService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/RegistrationService.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/RegistrationService.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -32,15 +32,15 @@
*/
public interface RegistrationService
{
- /** . */
- String registerUser(String username, String password, Map profileMap, List roles, Locale locale, boolean adminFlag);
+
+ String registerUser(String portalURL, String username, String password, Map profileMap, List roles, Locale locale, boolean adminFlag);
- /** . */
String approve(String id, boolean approve);
- /** . */
- List getPendingUsers();
+ List getPendingUsers(String nodeName);
+ boolean checkUsername(String username);
+
int getPendingCount();
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/UserContainer.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/UserContainer.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/UserContainer.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -34,22 +34,25 @@
*/
public class UserContainer implements Serializable
{
- /** . */
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7703409026217713647L;
+
+ /** The jBPM process id */
private String processId;
- /** . */
+ /** The identity userName */
private String username;
- /** . */
+ /** The password */
private String password;
- /** . */
+ /** The profile Map */
private Map profileMap;
- /** . */
+ /** The assigned roles */
private List roles;
- /** . */
+ /** The current node */
private String currentNode;
public UserContainer(User user)
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/ValidateEmailService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/ValidateEmailService.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/ValidateEmailService.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -32,9 +32,11 @@
*/
public interface ValidateEmailService
{
+
+ String changeEmail(String url, User user, String email, Locale locale);
- boolean validateEmail(String processId, String registrationHash);
+ String validateEmail(String processId, String registrationHash);
- String changeEmail(User user, String email, Locale locale);
+
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -37,19 +37,18 @@
public class CreateUserAction implements ActionHandler
{
- /** . */
+ /** The core-identity user management service */
private IdentityUserManagementService identityManagementService;
- /** . */
+ /** The logger */
private static Logger log = Logger.getLogger(CreateUserAction.class);
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());
-
- log.debug("creating User: "+ uc.getUsername() );
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -28,7 +28,6 @@
import java.util.Locale;
import java.util.Map;
-import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.logging.Logger;
@@ -45,6 +44,7 @@
import org.jboss.portal.workflow.service.WorkflowService;
import org.jbpm.JbpmContext;
import org.jbpm.db.GraphSession;
+import org.jbpm.graph.def.Node;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
@@ -56,38 +56,39 @@
public class RegistrationServiceImpl extends AbstractJBossService implements RegistrationService
{
- /** . */
- private static final Logger log = Logger.getLogger(RegistrationServiceImpl.class);
+ /** The UserPortlet subscription mode */
+ private String subscriptionMode = null;
- /** . */
+ /** The UserManagementPortlet subscription mode */
+ private String adminSubscriptionMode = null;
+
+ /** The core-identity configuration service */
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
+ /** The core-identity user management service */
+ private IdentityUserManagementService identityUserManagementService;
+
+ /** The jBPM workflow service */
private WorkflowService workflowService = null;
- /** . */
- private String subscriptionMode = null;
-
- /** . */
- private String adminSubscriptionMode = null;
+ /** The logger */
+ private static final Logger log = Logger.getLogger(RegistrationServiceImpl.class);
/** . */
private JNDI.Binding jndiBinding;
/** . */
private String jndiName = null;
-
- /** . */
- private IdentityUIConfigurationService identityUIConfigurationService;
-
- /** . */
- private IdentityUserManagementService identityManagementService;
public void startService() throws Exception
{
super.startService();
-
- IdentityUIConfiguration cf = this.identityUIConfigurationService.getConfiguration();
+
+ // Getting subscription modes
+ IdentityUIConfiguration cf = this.identityUIConfigurationService.getConfiguration();
this.subscriptionMode = cf.getSubscriptionMode();
this.adminSubscriptionMode = cf.getAdminSubscriptionMode();
-
+
if (this.jndiName != null)
{
jndiBinding = new JNDI.Binding(jndiName, this);
@@ -120,18 +121,16 @@
this.workflowService = workflowService;
}
- /** @return */
public String getJNDIName()
{
return this.jndiName;
}
- /** @param jndiName */
public void setJNDIName(String jndiName)
{
this.jndiName = jndiName;
}
-
+
public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
{
this.identityUIConfigurationService = identityUIConfigurationService;
@@ -142,53 +141,56 @@
return identityUIConfigurationService;
}
- public IdentityUserManagementService getIdentityManagementService()
+ public IdentityUserManagementService getIdentityUserManagementService()
{
- if (identityManagementService == null)
- {
- try
- {
- identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return identityManagementService;
+ return identityUserManagementService;
}
- public void setIdentityManagementService(IdentityUserManagementService identityManagementService)
+ public void setIdentityUserManagementService(IdentityUserManagementService identityManagementService)
{
- this.identityManagementService = identityManagementService;
+ this.identityUserManagementService = identityManagementService;
}
- public String registerUser(String username, String password, Map profileMap, List roles, Locale locale, boolean adminFlag)
+ public String registerUser(String url, String username, String password, Map profileMap, List roles, Locale locale,
+ boolean adminFlag)
{
-
- if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow())
+
+ if (adminFlag)
{
- // create user if workflow is disabled
- this.getIdentityManagementService().createUser(username, password, profileMap, roles);
- return IdentityConstants.REGISTRATION_REGISTERED;
- }
- else
+ if (adminSubscriptionMode == null
+ || IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(adminSubscriptionMode))
+ {
+ // Admin - automatic subscription
+ this.getIdentityUserManagementService().createUser(username, password, profileMap, roles);
+ return IdentityConstants.REGISTRATION_REGISTERED;
+ }
+ else
+ {
+ // Admin - jBPM subscription
+ UserContainer user = new UserContainer(username, password, profileMap, roles);
+ this.registerUserWorkflow(url, user, locale, this.adminSubscriptionMode);
+ return IdentityConstants.REGISTRATION_PENDING;
+ }
+ }
+ else
{
- // choosing between subscription-mode and admin-subcription-mode
- UserContainer user = new UserContainer(username, password, profileMap, roles);
- if (adminFlag)
+ if (subscriptionMode == null || IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(subscriptionMode))
{
- this.registerUserWorkflow(user, locale, this.adminSubscriptionMode);
+ // User - automatic subscription
+ this.getIdentityUserManagementService().createUser(username, password, profileMap, roles);
+ return IdentityConstants.REGISTRATION_REGISTERED;
}
else
{
- this.registerUserWorkflow(user, locale, this.subscriptionMode);
+ // User - jBPM subscription
+ UserContainer user = new UserContainer(username, password, profileMap, roles);
+ this.registerUserWorkflow(url, user, locale, this.subscriptionMode);
+ return IdentityConstants.REGISTRATION_PENDING;
}
- return IdentityConstants.REGISTRATION_PENDING;
}
}
- public void registerUserWorkflow(UserContainer user, Locale locale, String processName)
+ private void registerUserWorkflow(String url, UserContainer user, Locale locale, String processName)
{
JbpmContext jbpmContext = null;
ProcessInstance processInstance = null;
@@ -201,13 +203,14 @@
Token token = processInstance.getRootToken();
// Setting required attributes for the workflow
+ processInstance.getContextInstance().setVariable(IdentityConstants.VALIDATION_PORTAL_URL, url);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_USER, user);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_EMAIL,
user.getProfileMap().get(User.INFO_USER_EMAIL_REAL));
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_LOCALE, locale);
processInstance.getContextInstance().setVariable(IdentityConstants.ACTION,
IdentityConstants.ACTION_REGISTER_USER);
-
+
token.signal();
success = true;
}
@@ -234,7 +237,7 @@
{
return IdentityConstants.REGISTRATION_REGISTERED;
}
-
+
JbpmContext jbpmContext = null;
try
{
@@ -245,7 +248,7 @@
if (processInstance != null)
{
Token token = processInstance.getRootToken();
- if (token.getNode().getName().equals("adminApproval"))
+ if (token.getNode().getName().equals(IdentityConstants.JBPM_NODE_APPROVAL))
{
if (approve)
{
@@ -272,34 +275,37 @@
public int getPendingCount()
{
int count = 0;
- if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow()
- && !this.subscriptionMode.equals(IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC))
- {
- return count;
- }
-
JbpmContext jbpmContext = null;
try
{
- jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
-
- GraphSession graphSession = jbpmContext.getGraphSession();
- ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.subscriptionMode);
- List processInstances = graphSession.findProcessInstances(processDef.getId());
-
- if (processInstances != null)
+ List userProcessInstances = this.getProcessInstances(jbpmContext, this.subscriptionMode);
+ if (userProcessInstances != null && userProcessInstances.size() > 0)
{
- Iterator i = processInstances.iterator();
+ Iterator i = userProcessInstances.iterator();
while (i.hasNext())
{
ProcessInstance instance = (ProcessInstance) i.next();
- count = !instance.hasEnded() ? count + 1 : count;
+ Node node = instance.getRootToken().getNode();
+ if (IdentityConstants.JBPM_NODE_APPROVAL.equals(node.getName()))
+ count = !instance.hasEnded() ? count + 1 : count;
}
}
+ List adminProcessInstances = this.getProcessInstances(jbpmContext, this.adminSubscriptionMode);
+ if (adminProcessInstances != null && adminProcessInstances.size() > 0)
+ {
+ Iterator i = adminProcessInstances.iterator();
+ while (i.hasNext())
+ {
+ ProcessInstance instance = (ProcessInstance) i.next();
+ Node node = instance.getRootToken().getNode();
+ if (IdentityConstants.JBPM_NODE_APPROVAL.equals(node.getName()))
+ count = !instance.hasEnded() ? count + 1 : count;
+ }
+ }
}
- catch (Exception e)
+ catch (NamingException e)
{
- log.error("", e);
+ log.error("failed to get pending users count", e);
}
finally
{
@@ -308,55 +314,149 @@
return count;
}
- public List getPendingUsers()
+ public List getPendingUsers(String nodeName)
{
List queue = new ArrayList();
- // If workflow is enabled && USER subscriptionMode is not automatic
- if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow()
- && !this.subscriptionMode.equals(IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC))
- {
- return queue;
- }
-
JbpmContext jbpmContext = null;
try
{
- jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
+ List userProcessInstances = this.getProcessInstances(jbpmContext, this.subscriptionMode);
+ if (userProcessInstances != null && userProcessInstances.size() > 0)
+ {
+ queue.addAll(this.getPendingUser(userProcessInstances, nodeName));
+ }
- GraphSession graphSession = jbpmContext.getGraphSession();
- ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.subscriptionMode);
- List processInstances = graphSession.findProcessInstances(processDef.getId());
+ List adminProcessInstances = this.getProcessInstances(jbpmContext, this.adminSubscriptionMode);
+ if (adminProcessInstances != null && adminProcessInstances.size() > 0)
+ {
+ queue.addAll(this.getPendingUser(adminProcessInstances, nodeName));
+ }
+ }
+ catch (NamingException e)
+ {
+ log.error("failed to get pending users", e);
+ }
+ finally
+ {
+ IOTools.safeClose(jbpmContext);
+ }
+ return queue;
+ }
- if (processInstances != null)
+ private List getPendingUser(List processInstances, String nodeName)
+ {
+ List queue = new ArrayList();
+ if (processInstances != null)
+ {
+ Iterator i = processInstances.iterator();
+ while (i.hasNext())
{
- Iterator i = processInstances.iterator();
- while (i.hasNext())
+ ProcessInstance instance = (ProcessInstance) i.next();
+ if (!instance.hasEnded())
{
- ProcessInstance instance = (ProcessInstance) i.next();
- if (!instance.hasEnded())
+ Node node = instance.getRootToken().getNode();
+ Object obj = instance.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+
+ // Filter by node
+ if (nodeName != null && nodeName.equals(node.getName()))
{
- Object obj = instance.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
if (obj instanceof UserContainer)
{
// Filling pending user List
UserContainer user = (UserContainer) obj;
user.setProcessId(String.valueOf(instance.getId()));
- user.setCurrentNode(instance.getRootToken().getNode().getName());
+ user.setCurrentNode(node.getName());
queue.add(user);
}
}
+ else if (nodeName == null)
+ {
+ if (obj instanceof UserContainer)
+ {
+ // Filling pending user List
+ UserContainer user = (UserContainer) obj;
+ user.setProcessId(String.valueOf(instance.getId()));
+ user.setCurrentNode(node.getName());
+ queue.add(user);
+ }
+ }
}
}
}
- catch (Exception e)
+ return queue;
+ }
+
+ public boolean checkUsername(String username)
+ {
+ JbpmContext jbpmContext = null;
+ try
{
- log.error("", e);
+ List userProcessInstances = this.getProcessInstances(jbpmContext, this.subscriptionMode);
+ List adminProcessInstances = this.getProcessInstances(jbpmContext, this.adminSubscriptionMode);
+
+ if (userProcessInstances != null && userProcessInstances.size() > 0)
+ {
+ if (this.checkUsername(userProcessInstances, username))
+ return true;
+ }
+
+ if (adminProcessInstances != null && adminProcessInstances.size() > 0)
+ {
+ if (this.checkUsername(adminProcessInstances, username))
+ return true;
+ }
}
+ catch (NamingException e)
+ {
+ log.error("failed to check username", e);
+ }
finally
{
IOTools.safeClose(jbpmContext);
}
- return queue;
+ return false;
}
+ private boolean checkUsername(List processInstances, String username)
+ {
+ boolean usernameTaken = false;
+ if (processInstances != null)
+ {
+ Iterator i = processInstances.iterator();
+ while (i.hasNext())
+ {
+ ProcessInstance instance = (ProcessInstance) i.next();
+ if (!instance.hasEnded())
+ {
+ Object obj = instance.getContextInstance().getVariable(IdentityConstants.VARIABLE_USER);
+ if (obj instanceof UserContainer)
+ {
+ UserContainer user = (UserContainer) obj;
+ if (username != null && username.equals(user.getUsername()))
+ {
+ usernameTaken = true;
+ }
+ }
+ }
+ }
+ }
+ return usernameTaken;
+ }
+
+ private List getProcessInstances(JbpmContext jbpmContext, String processName) throws NamingException
+ {
+ List processInstances = new ArrayList();
+ if (!IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(processName))
+ {
+ if (jbpmContext == null)
+ {
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
+ }
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition(processName);
+ processInstances = graphSession.findProcessInstances(processDefinition.getId());
+ }
+ return processInstances;
+ }
+
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -27,14 +27,23 @@
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;
@@ -88,8 +97,9 @@
}
ectx.getContextInstance().setVariable(IdentityConstants.VALIDATION_HASH, hash);
- // TODO - build url
- String activationLink = "validateEmail/" + ectx.getProcessInstance().getId() + "/" + 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);
@@ -145,7 +155,7 @@
{
try
{
- this.identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ this.identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityUserManagementService");
}
catch (Exception e)
{
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/UpdateEmailAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/UpdateEmailAction.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/UpdateEmailAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -58,7 +58,7 @@
{
try
{
- identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityUserManagementService");
}
catch (Exception e)
{
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -24,8 +24,6 @@
import java.util.Locale;
-import javax.naming.InitialContext;
-
import org.jboss.logging.Logger;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.core.identity.services.IdentityConstants;
@@ -47,21 +45,23 @@
*/
public class ValidateEmailServiceImpl extends AbstractJBossService implements ValidateEmailService
{
- /** . */
- private static final Logger log = Logger.getLogger(ValidateEmailService.class);
+
- /** . */
+ /** The e-mail validation process name */
private String processName = IdentityConstants.jbp_identity_validate_email_process_name;
- /** . */
- private WorkflowService workflowService = null;
-
- /** . */
+ /** The core-identity configuration service */
private IdentityUIConfigurationService identityUIConfigurationService;
- /** . */
- private IdentityUserManagementService identityManagementService;
+ /** The core-identity user management service */
+ private IdentityUserManagementService identityUserManagementService;
+ /** The workflow service */
+ private WorkflowService workflowService = null;
+
+ /** The logger */
+ private static final Logger log = Logger.getLogger(ValidateEmailService.class);
+
/** . */
private JNDI.Binding jndiBinding;
@@ -100,7 +100,11 @@
}
catch (Exception e)
{
- throw new RuntimeException(e);
+ // OK if workflow is disabled
+ if (identityUIConfigurationService.getConfiguration().enableWorkflow())
+ {
+ throw new RuntimeException(e);
+ }
}
}
return this.workflowService;
@@ -111,13 +115,11 @@
this.workflowService = workflowService;
}
- /** @return */
public String getJNDIName()
{
return this.jndiName;
}
- /** @param jndiName */
public void setJNDIName(String jndiName)
{
this.jndiName = jndiName;
@@ -133,37 +135,31 @@
this.identityUIConfigurationService = identityUIConfigurationService;
}
- public IdentityUserManagementService getIdentityManagementService()
+ public IdentityUserManagementService getIdentityUserManagementService()
{
- if (identityManagementService == null)
- {
- try
- {
- identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return identityManagementService;
+ return identityUserManagementService;
}
- public String changeEmail(User user, String email, Locale locale)
+ public void setIdentityUserManagementService(IdentityUserManagementService identityUserManagementService)
{
+ this.identityUserManagementService = identityUserManagementService;
+ }
+
+ public String changeEmail(String url, User user, String email, Locale locale)
+ {
if (! this.identityUIConfigurationService.getConfiguration().enableWorkflow())
{
- this.getIdentityManagementService().updateEmail(user.getUserName(), email);
+ this.getIdentityUserManagementService().updateEmail(user.getUserName(), email);
return IdentityConstants.REGISTRATION_REGISTERED;
}
else
{
- this.changeEmailWorkflow(user, email, locale);
+ this.changeEmailWorkflow(url, user, email, locale);
return IdentityConstants.REGISTRATION_PENDING;
}
}
- public void changeEmailWorkflow(User user, String email, Locale locale)
+ public void changeEmailWorkflow(String url, User user, String email, Locale locale)
{
JbpmContext jbpmContext = null;
ProcessInstance processInstance = null;
@@ -175,6 +171,7 @@
processInstance = jbpmContext.newProcessInstance(this.processName);
Token token = processInstance.getRootToken();
+ processInstance.getContextInstance().setVariable(IdentityConstants.VALIDATION_PORTAL_URL, url);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_USER, new UserContainer(user));
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_EMAIL, email);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_LOCALE, locale);
@@ -199,9 +196,9 @@
}
}
- public boolean validateEmail(String id, String registrationHash)
+ public String validateEmail(String id, String registrationHash)
{
- boolean success = false;
+ String success = IdentityConstants.VALIDATION_FAILED;
if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow())
{
return success;
@@ -226,14 +223,14 @@
// Processing email change request to transition changeEmail
if(IdentityConstants.ACTION_CHANGE_EMAIL.equals(action))
{
- token.signal("changeEmail");
+ token.signal("validated");
+ success = IdentityConstants.VALIDATION_VALIDATED;
}
- // Processing other requests to end state with ok
else
{
- token.signal("ok");
+ token.signal("validated");
+ success = IdentityConstants.REGISTRATION_REGISTERED;
}
- success = true;
}
}
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -37,15 +37,15 @@
public class DynamicUserAttribute implements DynamicBean
{
- /** . */
- private HashMap map;
-
- /** . */
+ /** The username */
private String username;
- /** . */
+ /** The managed user bean */
private IdentityUserBean identityUserBean;
-
+
+ /** The hash map contains all the user attributes */
+ private HashMap map;
+
public DynamicUserAttribute()
{
this.map = new HashMap();
@@ -76,7 +76,7 @@
}
}
- public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
+ public PropertyValue getValue(Object propertyName)
{
Object propertyValue = map.get((String) propertyName);
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -29,13 +29,13 @@
public class IdentityUIUser
{
- /** . */
+ /** The username */
private String username;
- /** . */
+ /** The password */
private String password;
- /** . */
+ /** The dynamic user attributes */
private DynamicUserAttribute attribute;
public IdentityUIUser()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIRole.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -29,13 +29,13 @@
public class UIRole
{
- /** . */
+ /** The role id */
private Object id;
- /** . */
+ /** The role name */
private String name;
- /** . */
+ /** The role display name */
private String displayName;
public String getDisplayName()
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -28,18 +28,22 @@
import java.util.Locale;
import java.util.Map;
-
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;
+import org.jboss.portal.api.node.PortalNodeURL;
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;
import org.jboss.portal.core.identity.ui.common.MetaDataServiceBean;
import org.jboss.portal.identity.User;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -52,20 +56,17 @@
private List roles = new ArrayList();
/** . */
- //private List defaultRoles = null;
-
- /** . */
private IdentityUIUser uiUser = new IdentityUIUser();
/** . */
private RegistrationService registrationService;
-
+
/** . */
private IdentityUserBean identityUserBean;
-
+
/** . */
private MetaDataServiceBean metaDataService;
-
+
/** . */
private static final Logger log = Logger.getLogger(CreateUserAction.class);
@@ -88,10 +89,9 @@
{
this.roles = roles;
}
-
+
public void setDefaultRoles(List roles)
{
- //this.defaultRoles = roles;
this.roles = roles;
}
@@ -133,7 +133,7 @@
try
{
Class registrationDateClass = uiUser.getAttribute().getType("registrationdate");
-
+
if (registrationDateClass.equals(Date.class))
{
uiUser.getAttribute().setValue("registrationdate", new Date());
@@ -147,25 +147,27 @@
log.warn(User.INFO_USER_REGISTRATION_DATE + " property is mapped in not supported type: "
+ registrationDateClass.toString());
}
-
+
// Variables for RegisterService
String wUsername = uiUser.getUsername();
String wPassword = uiUser.getPassword();
List wRoles = roles;
Map wProfileMap = this.identityUserBean.getProfileMap(uiUser.getAttribute().getProfileAttributes());
Locale wLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-
- // TODO enable admin subscription mode
+ String wURL = this.getPortalURL();
+ String registrationStatus = null;
if (adminSubscriptionMode != null && adminSubscriptionMode.equals("admin"))
{
- String registrationStatus = this.registrationService.registerUser(wUsername, wPassword, wProfileMap, wRoles, wLocale, true);
+ registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
+ wLocale, true);
}
else
{
- String registrationStatus = this.registrationService.registerUser(wUsername, wPassword, wProfileMap, wRoles, wLocale, false);
+ registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
+ wLocale, false);
}
- // log.debug(registrationStatus);
+ log.debug(registrationStatus);
}
catch (Exception e)
@@ -183,9 +185,23 @@
* Cleaning up
*/
this.uiUser = new IdentityUIUser();
-
return "success";
}
-
+ private String getPortalURL()
+ {
+ ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
+ JBossActionRequest request = (JBossActionRequest) ectx.getRequest();
+ JBossActionResponse response = (JBossActionResponse) ectx.getResponse();
+ ServerInvocationContext invocationContext = request.getControllerContext().getServerInvocation().getServerContext();
+ PortalNode n = request.getPortalNode();
+ PortalNodeURL url = response.createRenderURL(n);
+ url.setRelative(false);
+ String portalURL = url.toString();
+ String a = invocationContext.getPortalContextPath();
+ int contextPathIndex = portalURL.indexOf(a);
+ String cleanPortalURL = portalURL.substring(0, contextPathIndex);
+ cleanPortalURL = cleanPortalURL + a;
+ return cleanPortalURL;
+ }
}
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-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,18 +22,25 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
+import java.util.Locale;
import java.util.Map;
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;
+import org.jboss.portal.api.node.PortalNodeURL;
import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.User;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -151,21 +158,7 @@
public String updateProfile()
{
try
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- ExternalContext ectx = ctx.getExternalContext();
- String checkUser = ectx.getRemoteUser();
- // Checking if password needs to updated
- // TODO get Metadata required length
- if (uiUser.getPassword() != null && uiUser.getPassword().trim().length() > 6 )
- {
- log.error("hilffe - update -"+ uiUser.getPassword());
- }
- else
- {
- log.error("hilffe - " + checkUser);
- }
-
+ {
User user = identityUserBean.findUserByUserName(this.currentUser);
// Adding dynamically set properties
identityUserBean.updateProfile(user, uiUser.getAttribute().getProfileAttributes());
@@ -191,17 +184,26 @@
{
// Update password
this.identityUserBean.updatePassword(this.currentUser, this.password);
-
}
catch (Exception e)
{
- e.printStackTrace();
+ log.error("error while updating password", e);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error"));
}
}
return "start";
}
+ public String adminChangePassword()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext ectx = ctx.getExternalContext();
+ Map params = ectx.getRequestParameterMap();
+ this.currentUser = (String) params.get("currentUser");
+
+ return "adminChangePassword";
+ }
+
public String changeEmail()
{
if (this.email != null)
@@ -211,17 +213,34 @@
User user = this.identityUserBean.findUserByUserName(this.currentUser);
// TODO status page
- // TODO locale
- String validationStatus = this.validateEmailService.changeEmail(user, email, null);
+ Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
+ String portalURL = this.getPortalURL();
+ String validationStatus = this.validateEmailService.changeEmail(portalURL, user, email, locale);
log.debug(validationStatus);
}
catch (Exception e)
{
- e.printStackTrace();
+ log.error("error while changing email", e);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error"));
}
}
return "start";
}
+ private String getPortalURL()
+ {
+ ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
+ JBossActionRequest request = (JBossActionRequest) ectx.getRequest();
+ JBossActionResponse response = (JBossActionResponse) ectx.getResponse();
+ ServerInvocationContext invocationContext = request.getControllerContext().getServerInvocation().getServerContext();
+ PortalNode n = request.getPortalNode();
+ PortalNodeURL url = response.createRenderURL(n);
+ url.setRelative(false);
+ String portalURL = url.toString();
+ String a = invocationContext.getPortalContextPath();
+ int contextPathIndex = portalURL.indexOf(a);
+ String cleanPortalURL = portalURL.substring(0, contextPathIndex);
+ cleanPortalURL = cleanPortalURL + a;
+ return cleanPortalURL;
+ }
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordAction.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -145,9 +145,6 @@
return "status";
}
}
- /**
- * TODO else if - get user by email address
- */
else
{
return "lostPassword";
@@ -161,17 +158,17 @@
IdentityUIUser uiUser = new IdentityUIUser(user.getUserName());
- // TODO - get right Values
mailMap.put("to", (String) uiUser.getAttribute().getValue("email").getObject());
mailMap.put("username", user.getUserName());
mailMap.put("password", newPassword);
try
{
- // TODO enable update Password
- // identityUserBean.updatePassword(user.getUserName(), newPassword);
- // TODO set Locale
- identityMailService.sendMail("lostPassword", mailMap, new Locale("en"));
+ // Update password
+ identityUserBean.updatePassword(user.getUserName(), newPassword);
+ // Sending email
+ Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
+ identityMailService.sendMail("lostPassword", mailMap, locale);
}
catch (Exception e)
{
@@ -204,7 +201,7 @@
}
catch (NoSuchAlgorithmException e)
{
- log.error("No Such Algorithm exists " + e);
+ log.error("No Such Algorithm exists ", e);
}
return buffer.toString();
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -56,7 +56,7 @@
private int page = 1;
/** . */
- private int limit = 10;
+ private String limit = "10";
/** . */
private String userNameFilter = new String();
@@ -87,12 +87,12 @@
this.page = page;
}
- public int getLimit()
+ public String getLimit()
{
return limit;
}
- public void setLimit(int limit)
+ public void setLimit(String limit)
{
this.limit = limit;
}
@@ -165,8 +165,9 @@
List roleMembers = new ArrayList();
try
{
- int offset = page > 0 ? ((page -1 ) * limit) : 0;
- int limit1 = limit + 1;
+ int intLimit = Integer.valueOf(limit).intValue();
+ int offset = page > 0 ? ((page - 1) * intLimit) : 0;
+ int limit1 = intLimit + 1;
members = identityRoleBean.getMembershipModule().findRoleMembers(this.currentRole, offset, limit1, userNameFilter);
}
catch (Exception e)
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -31,9 +31,9 @@
import javax.faces.context.FacesContext;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
-import javax.faces.model.SelectItem;
import org.jboss.logging.Logger;
+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.IdentityRoleBean;
@@ -59,13 +59,16 @@
private int page = 1;
/** . */
- private int limit = 10;
+ private String limit = "10";
/** . */
private int userCount = 0;
/** . */
private List roles = new ArrayList();
+
+ /** . */
+ private String displayNode = IdentityConstants.JBPM_NODE_APPROVAL;
/** . */
private IdentityUIUser uiUser;
@@ -115,14 +118,14 @@
this.page = page;
}
- public int getLimit()
+ public String getLimit()
{
return limit;
}
- public void setLimit(SelectItem limit)
+ public void setLimit(String limit)
{
- this.limit = Integer.valueOf((String) limit.getValue()).intValue();
+ this.limit = limit;
}
public List getRoles()
@@ -150,6 +153,16 @@
return identityUserBean;
}
+ public String getDisplayNode()
+ {
+ return displayNode;
+ }
+
+ public void setDisplayNode(String displayNode)
+ {
+ this.displayNode = displayNode;
+ }
+
public void setIdentityUserBean(IdentityUserBean identityUserBean)
{
this.identityUserBean = identityUserBean;
@@ -181,8 +194,9 @@
{
try
{
- int offset = page > 0 ? ((page - 1) * limit) : 0;
- int limit1 = limit + 1;
+ int intLimit = Integer.valueOf(limit).intValue();
+ int offset = page > 0 ? ((page - 1) * intLimit) : 0;
+ int limit1 = intLimit + 1;
this.userList = new ListDataModel(identityUserBean.findUsersFilteredByUserName(searchString, offset, limit1));
}
catch (IllegalArgumentException e)
@@ -269,7 +283,7 @@
{
List list = new ArrayList();
if ( this.registrationService != null)
- list = this.registrationService.getPendingUsers();
+ list = this.registrationService.getPendingUsers(displayNode);
return list;
}
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-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -161,10 +161,10 @@
user.updatePassword(password);
}
- public Class getPropertyType(String propertyName) throws IdentityException
+ public Class getPropertyType(String propertyName) throws IdentityException, ClassNotFoundException
{
UIComponentConfiguration uiComponent = (UIComponentConfiguration) this.metaDataService.getValue(propertyName).getObject();
- return uiComponent.getClass();
+ return uiComponent.getPropertyClass();
}
public Object getUserProperty(String username, String propertyName) throws IllegalArgumentException, NoSuchUserException, IdentityException
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-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,19 +22,20 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.common;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
+import java.util.Map;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.portal.common.util.Tools;
import org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration;
import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
import org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portlet.JBossRenderRequest;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -43,7 +44,7 @@
public class MetaDataServiceBean implements DynamicBean
{
/** . */
- HashMap map = null;
+ Map map = null;
/** . */
private IdentityUIConfigurationService identityUIConfigurationService;
@@ -53,18 +54,18 @@
try
{
this.identityUIConfigurationService = (IdentityUIConfigurationService) new InitialContext().lookup("java:/portal/IdentityUIConfigurationService");
+ IdentityUIConfiguration cf = identityUIConfigurationService.getConfiguration();
+ this.map = cf.getUiComponents();
}
catch (NamingException e)
{
- // FIXME
throw new RuntimeException(e);
}
- this.createMap();
}
public Class getType(Object propertyName) throws IllegalArgumentException
{
- return Object.class;
+ return UIComponentConfiguration.class;
}
public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
@@ -78,18 +79,12 @@
return true;
}
- private void createMap()
+ public String getPortalContextPath()
{
- this.map = new HashMap();
- IdentityUIConfiguration cf = identityUIConfigurationService.getConfiguration();
- List componentList = cf.getUiComponents();
- Iterator i = componentList.iterator();
-
- while (i.hasNext())
- {
- UIComponentConfiguration uiComponent = (UIComponentConfiguration) i.next();
- map.put(uiComponent.getName(), uiComponent);
- }
+ ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
+ JBossRenderRequest request = (JBossRenderRequest) ectx.getRequest();
+ ServerInvocationContext invocationContext = request.getControllerContext().getServerInvocation().getServerContext();
+ return invocationContext.getPortalContextPath();
}
}
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletDelegatingPropertyResolver.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -23,18 +23,26 @@
package org.jboss.portal.core.identity.ui.faces;
import java.lang.reflect.Field;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
+import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.PropertyNotFoundException;
import javax.faces.el.PropertyResolver;
+import javax.faces.model.SelectItem;
import javax.portlet.PortletPreferences;
import javax.portlet.ReadOnlyException;
import org.jboss.logging.Logger;
import org.jboss.portal.common.reflect.Modifier;
+import org.jboss.portal.core.identity.services.IdentityConstants;
+import org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration;
+import org.jboss.portal.core.identity.ui.faces.components.StaticValues;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.decorator.BeanDecorator;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
@@ -135,6 +143,34 @@
public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException
{
+ if ( base instanceof UIComponentConfiguration && ((String)property).equals("values"))
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) base;
+ if (IdentityConstants.COMPONENT_VALUE_LOCALE.equals(uiComponent.getPredefinedMapValues()))
+ {
+ return StaticValues.getLocale(ctx);
+ }
+ else if (IdentityConstants.COMPONENT_VALUE_THEME.equals(uiComponent.getPredefinedMapValues()))
+ {
+ return StaticValues.getTheme(ctx);
+ }
+ else if (IdentityConstants.COMPONENT_VALUE_TIMEZONE.equals(uiComponent.getPredefinedMapValues()))
+ {
+ return StaticValues.getTimezone();
+ }
+ else {
+ List list = new ArrayList();
+ Iterator i = uiComponent.getValues().keySet().iterator();
+ while(i.hasNext())
+ {
+ String key = (String) i.next();
+ list.add(new SelectItem(key, (String) uiComponent.getValues().get(key)));
+ }
+ return list;
+ }
+
+ }
if ( base instanceof PortletPreferences)
{
PortletPreferences preferences = (PortletPreferences) base;
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletVariableResolver.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletVariableResolver.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/PortletVariableResolver.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -54,6 +54,9 @@
/** . */
private final static String PORTLET_APPLICATION_SCOPE = "portletApplicationScope";
+
+ /** . */
+ private final static String PORTLET_RENDER_PARAMETER = "portletRenderParameter";
/** . */
private final static String PORTLET_PREFERENCE_VALUE = "portletPreferenceValue";
@@ -84,6 +87,10 @@
{
return ectx.getApplicationMap();
}
+ else if (PORTLET_RENDER_PARAMETER.equals(variable))
+ {
+ return getRenderValueMap(ectx);
+ }
else if (PORTLET_PREFERENCE_VALUE.equals(variable))
{
return getValueMap(ectx);
@@ -114,4 +121,22 @@
return map;
}
+ private Map getRenderValueMap(ExternalContext ectx)
+ {
+ Map map = new HashMap();
+ PortletRequest request = (PortletRequest) ectx.getRequest();
+ Enumeration en = request.getParameterNames();
+
+ while (en.hasMoreElements())
+ {
+ String key = (String) en.nextElement();
+ String value = request.getParameter(key);
+ if (value != null)
+ {
+ map.put(key, value);
+ }
+ }
+ return map;
+ }
+
}
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/faces/components/StaticValues.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -0,0 +1,126 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.ui.faces.components;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.portlet.PortletContext;
+
+import org.jboss.portal.common.i18n.LocaleManager;
+import org.jboss.portal.core.ui.portlet.user.UserPortletConstants;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ThemeInfo;
+import org.jboss.portal.theme.ThemeService;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class StaticValues
+{
+ /**
+ * Generates a list of time zones
+ *
+ * @return List <SelectItem>
+ */
+ public static List getTimezone()
+ {
+ List list = new ArrayList();
+ for (int i = 0; i < UserPortletConstants.TIME_ZONE_OFFSETS.length; i++)
+ {
+ if (UserPortletConstants.TIME_ZONE_OFFSETS[i] != null)
+ {
+ list.add(new SelectItem(""+ i, UserPortletConstants.TIME_ZONE_OFFSETS[i]));
+ }
+ }
+ return list;
+ }
+
+
+ /**
+ * Generates a list of available themes
+ *
+ * @param FacesContext
+ * @return List <SelectItem>
+ */
+ public static List getTheme(FacesContext ctx)
+ {
+ List list = new ArrayList();
+ PortletContext pctx = (PortletContext) ctx.getExternalContext().getContext();
+ ThemeService themeService = (ThemeService) pctx.getAttribute("ThemeService");
+ for (Iterator i = themeService.getThemes().iterator(); i.hasNext();)
+ {
+ PortalTheme theme = (PortalTheme)i.next();
+ ThemeInfo info = theme.getThemeInfo();
+ list.add(new SelectItem(info.getRegistrationId().toString(), info.getAppId() + "." + info.getName()));
+ }
+ return list;
+ }
+
+ /**
+ * Generates a list of locale
+ *
+ * @param FacesContext
+ * @return List <SelectItem>
+ */
+ public static List getLocale(FacesContext ctx)
+ {
+ List list = new ArrayList();
+ Locale currentLocale = ctx.getViewRoot().getLocale();
+ ArrayList locales = new ArrayList(LocaleManager.getLocales());
+ Collections.sort(locales, new LocaleComparator());
+
+ for (Iterator i = locales.iterator(); i.hasNext();)
+ {
+ Locale locale = (Locale)i.next();
+ list.add(new SelectItem(locale.toString(), locale.getDisplayName(currentLocale)));
+ }
+ return list;
+ }
+
+ private static class LocaleComparator implements Comparator
+ {
+
+ public int compare(Object arg0, Object arg1)
+ {
+ Locale locale1 = (Locale)arg0;
+ Locale locale2 = (Locale)arg1;
+ int compare = locale1.getDisplayLanguage().compareTo(locale2.getDisplayLanguage());
+ if (compare == 0)
+ {
+ compare = locale1.getDisplayCountry().compareTo(locale2.getDisplayCountry());
+ }
+ return compare;
+ }
+
+ }
+
+}
+
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CaptchaValidator.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.validators;
+import java.util.ResourceBundle;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -40,6 +42,7 @@
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
Boolean tester = Boolean.FALSE;
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", context.getViewRoot().getLocale());
PortletRequest portletRequest = (PortletRequest) context.getExternalContext().getRequest();
String captchaId = portletRequest.getRequestedSessionId();
@@ -47,7 +50,7 @@
if ( tester.equals(Boolean.FALSE))
{
- throw new ValidatorException(new FacesMessage("captcha incorrect."));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT")));
}
}
}
\ No newline at end of file
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.validators;
+import java.util.ResourceBundle;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -50,9 +52,12 @@
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", context.getViewRoot().getLocale());
PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
userModule = (UserModule) portletContext.getAttribute("UserModule");
this.currentUser = context.getExternalContext().getRemoteUser();
+
+
try
{
user = userModule.findUserByUserName(this.currentUser);
@@ -60,12 +65,12 @@
}
catch (Exception e)
{
- throw new ValidatorException(new FacesMessage("Password cannot be validated."));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR")));
}
if (user == null || (!user.validatePassword((String) value)))
{
- throw new ValidatorException(new FacesMessage("Password is not valid."));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD")));
}
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,6 +22,7 @@
******************************************************************************/
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;
@@ -40,6 +41,7 @@
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", context.getViewRoot().getLocale());
if (value != null)
{
if (!(value instanceof String))
@@ -49,7 +51,7 @@
if (!Pattern.matches(EMAIL_VALIDATION, (String) value))
{
- throw new ValidatorException(new FacesMessage("Invalid EMail Address"));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_INVALID_EMAIL")));
}
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.validators;
+import java.util.ResourceBundle;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlInputSecret;
@@ -37,20 +39,21 @@
{
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", context.getViewRoot().getLocale());
UIComponent passwordComponent = component.findComponent("password");
if (passwordComponent != null && passwordComponent instanceof HtmlInputSecret)
{
String password = (String) ((HtmlInputSecret) passwordComponent).getValue();
- if (value == null || !password.equals((String) value))
+ if (value == null || password == null || !password.equals((String) value))
{
- throw new ValidatorException(new FacesMessage("The passwords don't match."));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH")));
}
}
else
{
- throw new ValidatorException(new FacesMessage("Passwords cannot be checked."));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR")));
}
}
}
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-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,6 +22,7 @@
******************************************************************************/
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;
@@ -30,6 +31,7 @@
import javax.faces.validator.ValidatorException;
import javax.portlet.PortletContext;
+import org.jboss.portal.core.identity.services.workflow.RegistrationService;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.User;
@@ -42,41 +44,46 @@
public class UsernameValidator implements Validator
{
- /** . */
- private static final String NICKNAME_VALIDATION = "^[a-zA-Z]([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)";
-
- /** . */
+ /** The username regex */
+ // private static final String NICKNAME_VALIDATION = "^[a-zA-Z]([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)";
+ /** The user module */
private UserModule userModule;
+ /** The registration service */
+ private RegistrationService registrationService;
+
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
String username = (String) value;
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", context.getViewRoot().getLocale());
PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
userModule = (UserModule) portletContext.getAttribute("UserModule");
+ registrationService = (RegistrationService) portletContext.getAttribute("RegistrationService");
- if (username.length() >= 5 && (Pattern.matches(NICKNAME_VALIDATION, username)))
+ // if (username.length() >= 5 && (Pattern.matches(NICKNAME_VALIDATION, username)))
+ try
{
- try
+ // checking jBPM context
+ if (registrationService.checkUsername(username))
{
- User u = userModule.findUserByUserName(username);
- throw new ValidatorException(new FacesMessage("This username is already in use:"+ u.getUserName()));
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN") + username));
}
- catch (NoSuchUserException e)
- {
- // No user found - proceed
- }
- catch (IllegalArgumentException e)
- {
- throw new ValidatorException(new FacesMessage("Error while checking username (IllegalArgumentException)."));
- }
- catch (IdentityException e)
- {
- throw new ValidatorException(new FacesMessage("Error while checking username (IdentityException)."));
- }
+
+ 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));
}
- else
+ catch (NoSuchUserException e)
{
- throw new ValidatorException(new FacesMessage("Invalid Username."));
+ // No user found - proceed
}
+ catch (IllegalArgumentException e)
+ {
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ }
+ catch (IdentityException e)
+ {
+ throw new ValidatorException(new FacesMessage(bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ }
}
}
Modified: trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -30,35 +30,55 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <attribute name="InstanceId">CoreIdentityUserPortletInstance</attribute>
<depends
optional-attribute-name="ValidateEmailService"
proxy-type="attribute">portal:service=ValidateEmailService,type=IdentityUI
</depends>
</mbean>
-
- <mbean
- code="org.jboss.portal.core.identity.services.impl.IdentityMailServiceImpl"
- name="portal:service=IdentityMailService,type=Mail"
+
+ <mbean
+ code="org.jboss.portal.core.model.instance.InstanceURLFactory"
+ name="portal:urlFactory=IdentityUI"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="MailModule" proxy-type="attribute">portal:service=Module,type=Mail</depends>
- <attribute name="JNDIName">java:portal/IdentityMailService</attribute>
- </mbean>
-
+ <attribute name="InstanceId">CoreIdentityUserPortletInstance</attribute>
+ <attribute name="Path">/validateEmail</attribute>
+ <depends
+ optional-attribute-name="Factory"
+ proxy-type="attribute">portal:urlFactory=Delegating</depends>
+ </mbean>
+
<mbean
code="org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationServiceImpl"
name="portal:service=IdentityUIConfigurationService,type=IdentityUI"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+ </depends>
<depends optional-attribute-name="WorkflowService" proxy-type="attribute">
portal:service=Workflow,type=WorkflowService
</depends>
<attribute name="JNDIName">java:portal/IdentityUIConfigurationService</attribute>
</mbean>
-
+
<mbean
+ code="org.jboss.portal.core.identity.services.impl.IdentityMailServiceImpl"
+ name="portal:service=IdentityMailService,type=Mail"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="MailModule" proxy-type="attribute">portal:service=Module,type=Mail</depends>
+ <depends optional-attribute-name="IdentityUIConfigurationService" proxy-type="attribute">
+ portal:service=IdentityUIConfigurationService,type=IdentityUI
+ </depends>
+ <attribute name="JNDIName">java:portal/IdentityMailService</attribute>
+ </mbean>
+
+ <mbean
code="org.jboss.portal.core.identity.services.impl.IdentityUserManagementServiceImpl"
name="portal:service=IdentityUserManagementService,type=IdentityUI"
xmbean-dd=""
@@ -76,9 +96,15 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
<depends optional-attribute-name="IdentityUIConfigurationService" proxy-type="attribute">
portal:service=IdentityUIConfigurationService,type=IdentityUI
</depends>
+ <depends optional-attribute-name="IdentityUserManagementService" proxy-type="attribute">
+ portal:service=IdentityUserManagementService,type=IdentityUI
+ </depends>
<attribute name="JNDIName">java:portal/RegistrationService</attribute>
</mbean>
@@ -88,9 +114,15 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
<depends optional-attribute-name="IdentityUIConfigurationService" proxy-type="attribute">
portal:service=IdentityUIConfigurationService,type=IdentityUI
</depends>
+ <depends optional-attribute-name="IdentityUserManagementService" proxy-type="attribute">
+ portal:service=IdentityUserManagementService,type=IdentityUI
+ </depends>
<attribute name="JNDIName">java:portal/ValidateEmailService</attribute>
</mbean>
@@ -108,18 +140,5 @@
optional-attribute-name="DelegateFactory"
proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
</mbean>
-
-<!--
- <mbean
- code="org.jboss.portal.core.identity.services.IdentityURLFactory"
- name="portal:urlFactory=IdentityUI"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="Path">/validateEmail</attribute>
- <depends
- optional-attribute-name="Factory"
- proxy-type="attribute">portal:urlFactory=Delegating</depends>
- </mbean>
- -->
+
</server>
\ No newline at end of file
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -24,7 +24,7 @@
<identity-ui-configuration>
- <subscription-mode>jbp_identity_validation_approval_workflow</subscription-mode>
+ <subscription-mode>jbp_identity_validation_workflow</subscription-mode>
<overwrite-workflow>false</overwrite-workflow>
<email-domain>jboss.org</email-domain>
<email-from>no-reply(a)jboss.com</email-from>
@@ -67,7 +67,10 @@
</ui-component>
<ui-component name="interests">
<property-ref>portal.user.interests</property-ref>
- <required>false</required>
+ <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>
@@ -81,7 +84,6 @@
<property-ref>portal.user.im.msnm</property-ref>
<required>false</required>
</ui-component>
-
<ui-component name="yim">
<property-ref>portal.user.im.yim</property-ref>
<required>false</required>
@@ -100,11 +102,15 @@
</ui-component>
<ui-component name="timezone">
<property-ref>portal.user.time-zone-offset</property-ref>
- <required>false</required>
+ <values>
+ <value key="org.jboss.portal.core.identity.timezone" />
+ </values>
</ui-component>
<ui-component name="theme">
<property-ref>portal.user.theme</property-ref>
- <required>false</required>
+ <values>
+ <value key="org.jboss.portal.core.identity.theme" />
+ </values>
</ui-component>
<ui-component name="securityquestion">
<property-ref>portal.user.security.question</property-ref>
@@ -115,7 +121,6 @@
<required>false</required>
</ui-component>
- <!-- read only :) -->
<ui-component name="email">
<property-ref>user.business-info.online.email</property-ref>
<validators>
@@ -125,7 +130,9 @@
</ui-component>
<ui-component name="locale">
<property-ref>portal.user.locale</property-ref>
- <required>false</required>
+ <values>
+ <value key="org.jboss.portal.core.identity.locale" />
+ </values>
</ui-component>
<ui-component name="registrationdate">
<property-ref>portal.user.registration-date</property-ref>
Modified: 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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-09-05 12:45:05 UTC (rev 8173)
@@ -39,44 +39,22 @@
<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" />
- <xsd:element name="email-from" minOccurs="1" maxOccurs="1" type="xsd:string" />
+ <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.ArrayList"/>
+ <jbxb:class impl="java.util.HashMap"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="ui-component" minOccurs="1" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration"/>
- </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:choice>
- <!-- attribute name -->
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
+ <xsd:sequence>
+ <xsd:element name="ui-component" minOccurs="1" maxOccurs="unbounded" type="UIComponent" />
+ </xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- end: user interface components -->
@@ -88,6 +66,7 @@
<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" />
@@ -106,4 +85,62 @@
</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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validate_email.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -10,13 +10,11 @@
</transition>
</start-state>
<state name="validate_email">
- <create-timer name="time_to_expire" duedate="5 minutes" transition="timedOut" />
- <transition name="ok" to="validated"/>
- <transition name="timedOut" to="expired"/>
- <transition name="changeEmail" to="validated">
+ <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
+ <transition name="validated" to="end">
<action class="org.jboss.portal.core.identity.services.workflow.impl.UpdateEmailAction"/>
</transition>
+ <transition name="timedOut" to="expired"/>
</state>
- <end-state name="validated"/>
- <end-state name="expired"/>
+ <end-state name="end"/>
</process-definition>
\ No newline at end of file
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_approval_workflow.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -5,18 +5,16 @@
<process-definition name="jbp_identity_validation_approval_workflow">
<start-state>
- <transition to="emailValidation"/>
+ <transition to="validate_email">
+ <action class="org.jboss.portal.core.identity.services.workflow.impl.SendValidationMailAction"/>
+ </transition>
</start-state>
- <process-state name="emailValidation">
- <sub-process name="jbp_identity_validate_email"/>
- <variable name="user" access="read" mapped-name="user"/>
- <variable name="email" access="read" mapped-name="email"/>
- <variable name="locale" access="read" mapped-name="locale"/>
- <variable name="action" access="read" mapped-name="action"/>
- <transition name="validated" to="adminApproval"/>
- <transition name="expired" to="end"/>
- </process-state>
- <state name="adminApproval">
+ <state name="validate_email">
+ <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
+ <transition name="validated" to="admin_approval"/>
+ <transition name="timedOut" to="end"/>
+ </state>
+ <state name="admin_approval">
<transition name="approved" to="end">
<action class="org.jboss.portal.core.identity.services.workflow.impl.CreateUserAction"/>
</transition>
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/processes/jbp_identity_validation_workflow.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -5,18 +5,16 @@
<process-definition name="jbp_identity_validation_workflow">
<start-state>
- <transition to="emailValidation"/>
+ <transition to="validate_email">
+ <action class="org.jboss.portal.core.identity.services.workflow.impl.SendValidationMailAction"/>
+ </transition>
</start-state>
- <process-state name="emailValidation">
- <sub-process name="jbp_identity_validate_email"/>
- <variable name="user" access="read" mapped-name="user"/>
- <variable name="email" access="read" mapped-name="email"/>
- <variable name="locale" access="read" mapped-name="locale"/>
- <variable name="action" access="read" mapped-name="action"/>
+ <state name="validate_email">
+ <timer name="time_to_expire" duedate="1 minute" transition="timedOut" />
<transition name="validated" to="end">
- <action class="org.jboss.portal.core.identity.services.workflow.impl.CreateUserAction"/>
+ <action class="org.jboss.portal.core.identity.services.workflow.impl.CreateUserAction"/>
</transition>
- <transition name="expired" to="end"/>
- </process-state>
+ <transition name="timedOut" to="end"/>
+ </state>
<end-state name="end"/>
</process-definition>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -234,7 +234,7 @@
<to-view-id>/WEB-INF/jsf/register/register.xhtml</to-view-id>
</navigation-case>
<navigation-case>
- <from-outcome>success</from-outcome>
+ <from-outcome>registered</from-outcome>
<to-view-id>/WEB-INF/jsf/register/success.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
@@ -305,13 +305,20 @@
</navigation-case>
</navigation-rule>
<navigation-rule>
- <from-view-id>/WEB-INF/jsf/admin/index.xhtml</from-view-id>
+ <from-view-id>/WEB-INF/jsf/admin/user/searchUsers.xhtml</from-view-id>
<navigation-case>
<from-outcome>deleteUser</from-outcome>
<to-view-id>/WEB-INF/jsf/admin/user/deleteUser.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/editProfile.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>adminChangePassword</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/user/changePassword.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
<from-view-id>/WEB-INF/jsf/admin/*</from-view-id>
<navigation-case>
<from-action>#{editprofilemgr.editProfile}</from-action>
@@ -353,7 +360,7 @@
<to-view-id>/WEB-INF/jsf/admin/register.xhtml</to-view-id>
</navigation-case>
<navigation-case>
- <from-outcome>success</from-outcome>
+ <from-outcome>registered</from-outcome>
<to-view-id>/WEB-INF/jsf/admin/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -73,6 +73,11 @@
<service-ref>:service=Module,type=Membership</service-ref>
</service>
<service>
+ <service-name>ThemeService</service-name>
+ <service-class>org.jboss.portal.theme.ThemeService</service-class>
+ <service-ref>:service=ThemeService</service-ref>
+ </service>
+ <service>
<service-name>IdentityUIConfigurationService</service-name>
<service-class>org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService</service-class>
<service-ref>:service=IdentityUIConfigurationService,type=IdentityUI</service-ref>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -9,7 +9,8 @@
<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
<ui:define name="title">
- assign roles for user #{useradministrationbean.uiUser.username}
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ASSIGN_ROLE_TO_USER}" />
+ <h:outputText value="#{assignrolemgr.uiUser.username}" />
</ui:define>
<ui:define name="content">
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -13,16 +13,22 @@
<h:form>
<ul>
<li><h:commandLink value="#{bundle.IDENTITY_MANAGEMENT_SEARCH_USER}" action="searchUsers"/></li>
- <li><h:commandLink value="Show pending registrations" action="showPendingUsers"/></li>
+
+ <c:if test="#{useradministrationbean.pendingCount > 0}">
+ <li><h:commandLink value="Show pending registrations" action="showPendingUsers"/></li>
+ </c:if>
+
<li><h:commandLink value="#{bundle.IDENTITY_MANAGEMENT_CREATE_USER}" action="createUser"/></li>
</ul>
</h:form>
<hr/>
<h:panelGrid columns="2">
- <h:outputText value="Registered Users"/>
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS}"/>
<h:outputText value="#{useradministrationbean.userCount}" />
- <h:outputText value="Pending Registrations" />
- <h:outputText value="#{useradministrationbean.pendingCount}" />
+ <c:if test="#{useradministrationbean.pendingCount > 0}">
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_COUNT_PENDING_USERS}" />
+ <h:outputText value="#{useradministrationbean.pendingCount}" />
+ </c:if>
</h:panelGrid>
</ui:define>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/deleteRole.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/deleteRole.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/deleteRole.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -9,7 +9,9 @@
<ui:composition template="/WEB-INF/jsf/admin/roles/roleTemplate.xhtml">
-<ui:define name="title">#{bundle.IDENTITY_REGISTER_TITLE_CONFIRM_DELETE}</ui:define>
+<ui:define name="title">
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_TITLE_CONFIRM_DELETE}" />
+</ui:define>
<ui:define name="content">
<h:form>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/changePassword.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -0,0 +1,40 @@
+<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">
+
+<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
+
+
+<ui:define name="title">
+ <h:outputText value="#{bundle.IDENTITY_EDIT_CHANGE_PASSWORD_FOR_USER}" />
+ <h:outputText value="#{editprofilemgr.currentUser}" />
+</ui:define>
+<ui:define name="content">
+
+ <h:form>
+ <h:panelGrid columns="3" cellpadding="3">
+
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:inputSecret id="password" required="true" value="#{editprofilemgr.password}">
+ <f:validateLength minimum="6"/>
+ </h:inputSecret>
+ <h:message for="password"/>
+
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
+ <h:inputSecret id="passwordCheck" required="true">
+ <f:validator validatorId="PasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="passwordCheck"/>
+ </h:panelGrid>
+
+ <hr/>
+ <h:commandButton value="Submit" action="#{editprofilemgr.changePassword}" styleClass="portlet-form-button"/>
+</h:form>
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -8,48 +8,52 @@
<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
-<ui:define name="title">Pending registrations</ui:define>
+<ui:define name="title">
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_REGISTRATIONS}" />
+</ui:define>
<ui:define name="content">
<h:form>
<h:dataTable value="#{useradministrationbean.pendingUsers}" var="user" rowClasses="portlet-section-body,portlet-section-alternate" headerClass="portlet-section-header" width="100%">
<h:column>
<f:facet name="header">
- <h:outputText value="id"/>
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_BPM_ID}"/>
</f:facet>
<h:outputText value="#{user.processId}"/>
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="username"/>
+ <h:outputText value="#{bundle.IDENTITY_USERNAME}"/>
</f:facet>
<h:outputText value="#{user.username}"/>
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="email"/>
+ <h:outputText value="#{bundle.IDENTITY_EMAIL}"/>
</f:facet>
<h:outputText value="#{user.email}"/>
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="registration date"/>
+ <h:outputText value="#{bundle.IDENTITY_REIGSTRATION_DATE}"/>
</f:facet>
- <h:outputText value="#{user.registrationDate}"/>
+ <h:outputText value="#{user.registrationDate}">
+ <f:convertDateTime dateStyle="medium" type="both" />
+ </h:outputText>
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="status"/>
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ACTION}"/>
</f:facet>
<h:outputText value="Pending" rendered="#{user.currentNode == 'emailValidation'}"/>
<!-- #{user.currentNode == 'adminApproval'} -->
<h:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
- <h:outputText value="approve"/>
+ <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:commandLink action="#{useradministrationbean.approveRegistration}" rendered="#{user.currentNode == 'adminApproval'}">
- <h:outputText value="reject"/>
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_PENDING_REJECT}"/>
<f:param name="processId" value="#{user.processId}" />
<f:param name="action" value="reject" />
</h:commandLink>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -9,7 +9,8 @@
<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
<ui:define name="title">
- assign roles for user #{userregistermgr.uiUser.username}
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ASSIGN_ROLE_TO_USER}" />
+ <h:outputText value="#{userregistermgr.uiUser.username}" />
</ui:define>
<ui:define name="content">
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/resetPassword.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -9,7 +9,8 @@
<ui:composition template="/WEB-INF/jsf/admin/user/userTemplate.xhtml">
<ui:define name="title">
- reset password for user #{editprofilemgr.uiUser.username}
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER} " />
+ <h:outoutText value="#{editprofilemgr.uiUser.username}" />
</ui:define>
<ui:define name="content">
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -16,12 +16,13 @@
<h:panelGrid columns="4">
<h:inputText id="searchString" value="#{useradministrationbean.searchString}" />
<h:commandButton id ="search" value="#{bundle.IDENTITY_MANAGEMENT_SEARCH_USER}" action="#{useradministrationbean.searchUsers}" styleClass="portlet-form-button"/>
+
<h:selectOneMenu id="limit" value="#{useradministrationbean.limit}">
<f:selectItem id="limit1" itemValue="10" />
<f:selectItem id="limit2" itemValue="20" />
<f:selectItem id="limit5" itemValue="50" />
<f:selectItem id="limit10" itemValue="100" />
- </h:selectOneMenu>
+ </h:selectOneMenu>
<h:message for="limit" />
</h:panelGrid>
</h:form>
@@ -36,6 +37,14 @@
</h:column>
<h:column>
<f:facet name="header">
+ <h:outputText value="#{bundle.IDENTITY_EMAIL}"/>
+ </f:facet>
+ <a href="mailto:#{uiUser.attribute.email}">
+ <h:outputText value="#{uiUser.attribute.email}"/>
+ </a>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
<h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
</f:facet>
<h:outputText value="#{uiUser.attribute.givenname}"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -18,17 +18,19 @@
<h:outputText id="password">******</h:outputText>
</h:panelGrid>
<br/>
- <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE_ASSIGNED}" rendered="#{show_roles == true}"/>
- <h:dataTable id="roleslist" value="#{manager.roles}" var="role" rendered="#{show_roles == true}">
+ <c:if test="#{show_roles == true}">
+ <!-- assigned roles -->
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE_ASSIGNED}" />
+ <h:dataTable id="roleslist" value="#{manager.roles}" var="role">
<h:column>
<h:outputText value="#{role}"/>
</h:column>
</h:dataTable>
-
+ </c:if>
<h:messages />
<hr/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_EDIT}" action="revise" styleClass="portlet-form-button"/>
- <h:commandButton id="#{subscriptionMode}" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" actionListener="#{manager.register}" styleClass="portlet-form-button"/>
+ <h:commandButton id="#{subscriptionMode}" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" actionListener="#{manager.register}" action="registered" styleClass="portlet-form-button"/>
</h:form>
</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -7,96 +7,173 @@
class="identity-ui">
<h:form>
+ <h:panelGrid columns="3" cellpadding="3">
<c:choose>
<c:when test="#{adminMode == true}">
- <h:panelGrid columns="3">
+
<h:outputText value="#{bundle.IDENTITY_USERNAME}"/>
<h:outputText id="username" value="#{manager.uiUser.username}"/>
<h:message for="username"/>
- <h:outputText for="#{metadataservice.email.name}" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:outputText value="#{bundle.IDENTITY_EMAIL}"/>
<h:inputText id="#{metadataservice.email.name}" value="#{manager.uiUser.attribute.email}" required="#{metadataservice.email.required}">
<f:validator validatorId="#{metadataservice.email.validator}"/>
</h:inputText>
<h:message for="#{metadataservice.email.name}"/>
- <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
- <h:commandLink action="resetPassword">
- <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD}" />
- <f:param name="currentUser" value="#{manager.uiUser.username}" />
- </h:commandLink>
- <h:message for="password"/>
- </h:panelGrid>
+ <c:choose>
+ <c:when test="#{portletPreferenceValue.resetPassword == true}">
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:commandLink action="resetPassword">
+ <h:outputText value="#{bundle.IDENTITY_MANAGEMENT_RESET_PASSWORD}" />
+ <f:param name="currentUser" value="#{manager.uiUser.username}" />
+ </h:commandLink>
+ <h:panelGroup />
+ </c:when>
+ <c:otherwise>
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:commandLink action="#{manager.adminChangePassword}">
+ <h:outputText value="#{bundle.IDENTITY_EDIT_CHANGE_PASSWORD}" />
+ <f:param name="currentUser" value="#{manager.uiUser.username}" />
+ </h:commandLink>
+ <h:panelGroup />
+ </c:otherwise>
+ </c:choose>
</c:when>
<c:otherwise>
- <h:panelGrid columns="2">
- <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
+
+ <h:outputText value="#{bundle.IDENTITY_USERNAME}"/>
<h:outputText id="username" value="#{manager.uiUser.username}"/>
+ <h:panelGroup />
- <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:outputText value="#{bundle.IDENTITY_EMAIL}"/>
<h:outputText id="email" value="#{manager.uiUser.attribute.email}"/>
- </h:panelGrid>
+ <h:panelGroup />
</c:otherwise>
</c:choose>
+
+ <h:panelGroup/>
+ <h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_GENERAL}" />
+ </li>
+ </ul>
+ </h:panelGroup>
+ <h:panelGroup/>
+
+ <h:outputText value="#{bundle.IDENTITY_TIMEZONE}"/>
+ <h:selectOneMenu id="timezone" value="#{manager.uiUser.attribute.timezone}">
+ <f:selectItems value="#{metadataservice.timezone.values}" />
+ </h:selectOneMenu>
+ <h:message for="timezone" />
+ <h:outputText value="#{bundle.IDENTITY_THEME}"/>
+ <h:selectOneMenu id="theme" value="#{manager.uiUser.attribute.theme}">
+ <f:selectItems value="#{metadataservice.theme.values}" />
+ </h:selectOneMenu>
+ <h:message for="theme" />
+
+ <h:outputText value="#{bundle.IDENTITY_LOCALE}"/>
+ <h:selectOneMenu id="locale" value="#{manager.uiUser.attribute.locale}">
+ <f:selectItems value="#{metadataservice.locale.values}" />
+ </h:selectOneMenu>
+ <h:message for="locale" />
+
+ <h:panelGroup/>
+ <h:panelGroup>
<ul class="topnav">
- <li id="currentTab">Personal Information</li>
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_PERSONAL}" />
+ </li>
</ul>
+ </h:panelGroup>
+ <h:panelGroup/>
- <h:panelGrid columns="3" cellpadding="3">
- <h:outputText for="givenname" value="#{bundle.IDENTITY_GIVENNAME}"/>
+ <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
<h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"/>
<h:message for="givenname" />
- <h:outputText for="lastname" value="#{bundle.IDENTITY_FAMILYNAME}"/>
+ <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
<h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}"/>
<h:message for="lastname"/>
- <h:outputText for="homepage" value="#{bundle.IDENTITY_HOMEPAGE}"/>
- <h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}"/>
- <h:message for="homepage"/>
- </h:panelGrid>
+ <h:outputText value="#{bundle.IDENTITY_LOCATION}"/>
+ <h:inputText id="location" value="#{manager.uiUser.attribute.location}"/>
+ <h:message for="location"/>
+ <h:panelGroup/>
+ <h:panelGroup>
<ul class="topnav">
- <li id="currentTab">Instant Message Identities</li>
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_INSTANT}" />
+ </li>
</ul>
+ </h:panelGroup>
+ <h:panelGroup/>
- <h:panelGrid columns="3" cellpadding="3">
- <h:outputText for="skype" value="#{bundle.IDENTITY_SKYPE}"/>
+ <h:outputText value="#{bundle.IDENTITY_SKYPE}"/>
<h:inputText id="skype" value="#{manager.uiUser.attribute.skype}"/>
<h:message for="skype"/>
- <h:outputText for="icq" value="#{bundle.IDENTITY_ICQ}"/>
+ <h:outputText value="#{bundle.IDENTITY_ICQ}"/>
<h:inputText id="icq" value="#{manager.uiUser.attribute.icq}"/>
<h:message for="icq"/>
- <h:outputText for="aim" value="#{bundle.IDENTITY_AIM}"/>
+ <h:outputText value="#{bundle.IDENTITY_AIM}"/>
<h:inputText id="aim" value="#{manager.uiUser.attribute.aim}"/>
<h:message for="aim"/>
- <h:outputText for="msnm" value="#{bundle.IDENTITY_MSNM}"/>
+ <h:outputText value="#{bundle.IDENTITY_MSNM}"/>
<h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}"/>
<h:message for="msnm"/>
- </h:panelGrid>
-
+
+ <h:outputText value="#{bundle.IDENTITY_YIM}"/>
+ <h:inputText id="yim" value="#{manager.uiUser.attribute.yim}"/>
+ <h:message for="yim"/>
+
+ <h:outputText value="#{bundle.IDENTITY_XMMP}"/>
+ <h:inputText id="xmmp" value="#{manager.uiUser.attribute.xmmp}"/>
+ <h:message for="xmmp"/>
+
+ <h:panelGroup/>
+ <h:panelGroup>
<ul class="topnav">
- <li id="currentTab">Additional User Information</li>
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL}" />
+ </li>
</ul>
-
- <h:panelGrid columns="3" cellpadding="3">
- <h:outputText for="location" value="#{bundle.IDENTITY_LOCATION}"/>
- <h:inputText id="location" value="#{manager.uiUser.attribute.location}"/>
- <h:message for="location"/>
+ </h:panelGroup>
+ <h:panelGroup/>
- <h:outputText for="occupation" value="#{bundle.IDENTITY_OCCUPATION}"/>
+ <h:outputText value="#{bundle.IDENTITY_HOMEPAGE}"/>
+ <h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}"/>
+ <h:message for="homepage"/>
+
+ <h:outputText value="#{bundle.IDENTITY_OCCUPATION}"/>
<h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}"/>
<h:message for="occupation"/>
- <h:outputText for="interests" value="#{bundle.IDENTITY_INTERESTS}"/>
- <h:inputText id="interests" value="#{manager.uiUser.attribute.interests}"/>
+ <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
+ <h:inputText id="interests" value="#{manager.uiUser.attribute.interests}" />
<h:message for="interests"/>
+ <h:outputText value="#{bundle.IDENTITY_SIGNATURE}"/>
+ <h:panelGroup>
+ <h:inputTextarea id="signature" value="#{manager.uiUser.attribute.signature}" cols="50" rows="5" /><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE}" />
+ </h:panelGroup>
+ <h:message for="signature"/>
+
+ <h:outputText value="#{bundle.IDENTITY_EXTRA}"/>
+ <h:panelGroup>
+ <h:inputTextarea id="extra" value="#{manager.uiUser.attribute.extra}" cols="50" rows="5" /><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_EXTRA}" />
+ </h:panelGroup>
+ <h:message for="extra"/>
+
</h:panelGrid>
+
<hr/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{manager.updateProfile}" styleClass="portlet-form-button"/>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -34,7 +34,7 @@
</h:panelGrid>
<c:if test="#{portletPreferenceValue.captcha == true}">
<hr/>
- <h:graphicImage id="captchaimage" url="/jcaptcha" />
+ <h:graphicImage url="/jcaptcha" />
<h:panelGrid columns="3">
<h:outputText value="#{bundle.IDENTITY_REGISTER_VERIFY_CAPTCHA}" />
<h:inputText id="validateCaptcha" value="" required="true">
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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -6,11 +6,24 @@
xmlns:c="http://java.sun.com/jstl/core">
<c:choose>
- <c:when test="#{facesContext.externalContext.remoteUser != null}">
- <ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
+ <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>
- <ui:include src="/WEB-INF/jsf/register/overview.xhtml"/>
+ <c:choose>
+ <c:when test="#{facesContext.externalContext.remoteUser != null}">
+ <ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
+ </c:when>
+ <c:otherwise>
+ <ui:include src="/WEB-INF/jsf/register/overview.xhtml"/>
+ </c:otherwise>
+ </c:choose>
</c:otherwise>
</c:choose>
<h:messages />
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -22,7 +22,9 @@
</h:form>
<h:form>
- <h4>Change your email address</h4>
+ <h4>
+ <h:outputText value="#{bundle.IDENTITY_EDIT_EMAIL_TITLE}"/>
+ </h4>
<h:panelGrid columns="3" cellpadding="3">
<h:outputText for="currentPassword" value="#{bundle.IDENTITY_EDIT_PASSWORD_CURRENT}"/>
<h:inputSecret id="currentPassword" value="currentPassword" required="true">
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -24,19 +24,19 @@
<h:form>
<h4>#{bundle.IDENTITY_EDIT_PASSWORD_TITLE}</h4>
<h:panelGrid columns="3" cellpadding="3">
- <h:outputText for="currentPassword" value="#{bundle.IDENTITY_EDIT_PASSWORD_CURRENT}"/>
+ <h:outputText value="#{bundle.IDENTITY_EDIT_PASSWORD_CURRENT}"/>
<h:inputSecret id="currentPassword" value="currentPassword" required="true">
<f:validator validatorId="CurrentPasswordValidator"/>
</h:inputSecret>
<h:message for="currentPassword" />
- <h:outputText for="password" value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
<h:inputSecret id="password" required="true" value="#{editprofilemgr.password}">
<f:validateLength minimum="6"/>
</h:inputSecret>
<h:message for="password"/>
- <h:outputText for="passwordCheck" value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
<h:inputSecret id="passwordCheck" required="true">
<f:validator validatorId="PasswordValidator"/>
</h:inputSecret>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -23,7 +23,7 @@
</ul>
</h:form>
- <h4>User profile</h4>
+ <h4><h:outputText value="#{bundle.IDENTITY_VIEW_PROFILE_TITLE}" /></h4>
<h:panelGrid columns="2">
<h:outputText value="#{bundle.IDENTITY_USERNAME}:"/>
@@ -37,5 +37,9 @@
<h:outputText value="#{bundle.IDENTITY_FAMILYNAME}:"/>
<h:outputText value="#{editprofilemgr.uiUser.attribute.familyname}"/>
+
+ <h:outputText value="#{bundle.IDENTITY_LOCATION}:"/>
+ <h:outputText value="#{editprofilemgr.uiUser.attribute.location}"/>
+
</h:panelGrid>
</div>
Added: 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 (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/failure.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -0,0 +1,21 @@
+<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/register_success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/register_success.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -0,0 +1,26 @@
+<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
Added: 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 (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/validationStatus/success.xhtml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -0,0 +1,21 @@
+<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 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -89,5 +89,15 @@
<title>User management portlet</title>
<keywords>management,admin</keywords>
</portlet-info>
+ <portlet-preferences>
+ <preference>
+ <!--
+ Use reset password in user management
+ requires correct mail service configuration
+ -->
+ <name>resetPassword</name>
+ <value>false</value>
+ </preference>
+ </portlet-preferences>
</portlet>
</portlet-app>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2007-09-05 12:45:05 UTC (rev 8173)
@@ -91,5 +91,4 @@
<servlet-name>jcaptcha</servlet-name>
<url-pattern>/jcaptcha</url-pattern>
</servlet-mapping>
-
</web-app>
Modified: trunk/core-identity/src/resources/resource-bundles/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05 12:25:45 UTC (rev 8172)
+++ trunk/core-identity/src/resources/resource-bundles/Identity.properties 2007-09-05 12:45:05 UTC (rev 8173)
@@ -41,6 +41,7 @@
IDENTITY_EDIT_PASSWORD_TITLE=Change your password
IDENTITY_EDIT_PASSWORD_CURRENT=Current password
IDENTITY_EDIT_CHANGE_PASSWORD=Change password
+IDENTITY_EDIT_CHANGE_PASSWORD_FOR_USER=Change password for user:
IDENTITY_EDIT_EMAIL_TITLE=Change your email address
IDENTITY_EDIT_EMAIL_NEW=New email address
@@ -75,6 +76,14 @@
IDENTITY_REIGSTRATION_DATE=Registration Date
IDENTITY_ENABLED=Enabled
+IDENTITY_CATEGORY_GENERAL=General Preferences
+IDENTITY_CATEGORY_PERSONAL=Personal Information
+IDENTITY_CATEGORY_INSTANT=Instant Message Identities
+IDENTITY_CATEGORY_ADDITIONAL=Additional Information
+
+IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE=(Signature of 255 characters max)
+IDENTITY_CATEGORY_ADDITIONAL_EXTRA=(255 characters max.)
+
IDENTITY_MANAGEMENT_ACTION=Actions
IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE=Edit user
IDENTITY_MANAGEMENT_ACTION_ROLES=Roles
@@ -93,13 +102,35 @@
IDENTITY_MANAGEMENT_DISABLE=Disable
IDENTITY_MANAGEMENT_ENABLE=Enable
IDENTITY_MANAGEMENT_RESET_PASSWORD=Reset password
+IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER=Reset password for user:
IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=The user will get a random password sent by email.
+IDENTITY_MANAGEMENT_ASSIGN_ROLE_TO_USER=Assign roles to user:
+IDENTITY_MANAGEMENT_COUNT_PENDING_USERS=Pending users
+IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS=Registered users
+
+IDENTITY_MANAGEMENT_PENDING_REGISTRATIONS=Pending registrations
+IDENTITY_MANAGEMENT_PENDING_BPM_ID=Id
+IDENTITY_MANAGEMENT_PENDING_APPROVE=approve
+IDENTITY_MANAGEMENT_PENDING_REJECT=reject
+
IDENTITY_REGISTER_VERIFY_CAPTCHA=Verify captcha
-
IDENTITY_REGISTER_TITLE_CONFIRM_DELETE=Confirmation: Delete Object
IDENTITY_REGISTER_CONFIRMATIONEMAIL=Confirm your subscription
-
IDENTITY_MAIL_SUBJECT_LOST_PASSWORD=Reset your password
IDENTITY_MAIL_SUBJECT_REGISTER=Confirm registration
-IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL=Confirm email address
\ No newline at end of file
+IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL=Confirm email address
+
+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_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.
+IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Error while validating password.
+IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Invalid E-Mail address.
+IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Invalid password
+IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Captcha incorrect
18 years, 8 months
JBoss Portal SVN: r8172 - trunk/core/src/resources/portal-core-sar/conf/identity.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-05 08:25:45 -0400 (Wed, 05 Sep 2007)
New Revision: 8172
Modified:
trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
Log:
changed some properties to optional instead of mandatory usage
Modified: trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2007-09-05 10:46:01 UTC (rev 8171)
+++ trunk/core/src/resources/portal-core-sar/conf/identity/profile-config.xml 2007-09-05 12:25:45 UTC (rev 8172)
@@ -46,7 +46,7 @@
<name>user.name.given</name>
<type>java.lang.String</type>
<access-mode>read-write</access-mode>
- <usage>mandatory</usage>
+ <usage>optional</usage>
<display-name xml:lang="en">Given Name</display-name>
<description xml:lang="en">The user given name</description>
<mapping>
@@ -60,7 +60,7 @@
<name>user.name.family</name>
<type>java.lang.String</type>
<access-mode>read-write</access-mode>
- <usage>mandatory</usage>
+ <usage>optional</usage>
<display-name xml:lang="en">Family name</display-name>
<description xml:lang="en">The user family name</description>
<mapping>
@@ -91,7 +91,7 @@
<name>portal.user.email.fake</name>
<type>java.lang.String</type>
<access-mode>read-write</access-mode>
- <usage>mandatory</usage>
+ <usage>optional</usage>
<display-name xml:lang="en">Fake email</display-name>
<description xml:lang="en">The user fake email</description>
<mapping>
@@ -105,7 +105,7 @@
<name>portal.user.registration-date</name>
<type>java.util.Date</type>
<access-mode>read-write</access-mode>
- <usage>mandatory</usage>
+ <usage>optional</usage>
<display-name xml:lang="en">Registration date</display-name>
<description xml:lang="en">Registration date of user</description>
<mapping>
@@ -119,7 +119,7 @@
<name>portal.user.email.view-real</name>
<type>java.lang.Boolean</type>
<access-mode>read-write</access-mode>
- <usage>mandatory</usage>
+ <usage>optional</usage>
<display-name xml:lang="en">View real email</display-name>
<description xml:lang="en">Is user real email displayed in public</description>
<mapping>
18 years, 8 months
JBoss Portal SVN: r8171 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget/google/provider and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-09-05 06:46:01 -0400 (Wed, 05 Sep 2007)
New Revision: 8171
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
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
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
Log:
JBPORTAL-1535 - Make GG xml retrieval timeout parameterizable
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-09-05 02:41:25 UTC (rev 8170)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetPortlet.java 2007-09-05 10:46:01 UTC (rev 8171)
@@ -44,20 +44,37 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class WidgetPortlet extends GenericPortlet
{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(WidgetPortlet.class);
+ public final static String INIT_PARAM_CONNECTION_TIMEOUT = "connectionTimeout";
+
/** . */
private final PortletMode EDIT_CONTENT = new PortletMode("edit_content");
/** . */
private GGProvider provider = new GGProvider();
+
public void init() throws PortletException
{
provider.start();
+ String timeout = getPortletConfig().getInitParameter(INIT_PARAM_CONNECTION_TIMEOUT);
+ if (timeout != null && timeout.length() > 0)
+ {
+ try
+ {
+ provider.setConnectionTimeout(Integer.parseInt(timeout));
+ }
+ catch (NumberFormatException e)
+ {
+ log.error("Failed to parse connectionTimeout init parameter - should be integer number: ", e);
+ }
+ }
}
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 02:41:25 UTC (rev 8170)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05 10:46:01 UTC (rev 8171)
@@ -45,6 +45,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class GGProvider
@@ -63,6 +64,9 @@
private ExecutorService executor;
/** . */
+ private int connectionTimeout = 500;
+
+ /** . */
private static final Collection CATEGORIES = Collections.unmodifiableList(new CollectionBuilder()
.add(new GGWidgetCategoryInfo("all", "Popular"))
.add(new GGWidgetCategoryInfo("news", "News"))
@@ -169,6 +173,17 @@
return widgets;
}
+
+ public int getConnectionTimeout()
+ {
+ return connectionTimeout;
+ }
+
+ public void setConnectionTimeout(int connectionTimeout)
+ {
+ this.connectionTimeout = connectionTimeout;
+ }
+
private class GGWidgetEntry implements Callable
{
@@ -265,7 +280,7 @@
public Object call() throws MalformedURLException
{
- return new GGQueryResultBuilder(query).build();
+ return new GGQueryResultBuilder(query, getConnectionTimeout()).build();
}
}
}
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 02:41:25 UTC (rev 8170)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05 10:46:01 UTC (rev 8171)
@@ -52,6 +52,7 @@
* @todo make the timeouts parameterizable
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class GGQueryResultBuilder
@@ -65,7 +66,7 @@
/** . */
private final URL url;
- public GGQueryResultBuilder(GGQuery query) throws MalformedURLException
+ public GGQueryResultBuilder(GGQuery query, int connectionTimeout) throws MalformedURLException
{
if (query == null)
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05 02:41:25 UTC (rev 8170)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/portlet.xml 2007-09-05 10:46:01 UTC (rev 8171)
@@ -32,6 +32,11 @@
<portlet-name>GoogleWidgetPortlet</portlet-name>
<display-name>Google Widget Portlet</display-name>
<portlet-class>org.jboss.portal.widget.WidgetPortlet</portlet-class>
+ <init-param>
+ <description>Connection timeout when retreiving gadgets from google directory</description>
+ <name>connectionTimeout</name>
+ <value>500</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
18 years, 8 months
JBoss Portal SVN: r8170 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-04 22:41:25 -0400 (Tue, 04 Sep 2007)
New Revision: 8170
Removed:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
Log:
- JBPORTAL-1671: Split functionality into several pages (though everything is handled by portlets.xhtml), removed now useless showPortletInfo.xhtml.
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05 02:26:05 UTC (rev 8169)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05 02:41:25 UTC (rev 8170)
@@ -24,7 +24,6 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
-import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.Portlet;
@@ -61,7 +60,7 @@
/** . */
private static final Logger log = Logger.getLogger(PortletManagerBean.class);
-
+
/** . */
private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
@@ -276,22 +275,22 @@
{
if (portlets == null)
{
- portlets = new ArrayList();
- List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
-
+ portlets = new ArrayList();
+ List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+
// Remove content editors
nextPortlet:
- for (Iterator i = tmpPortlets.iterator();i.hasNext();)
+ for (Iterator i = tmpPortlets.iterator(); i.hasNext();)
{
Portlet portlet = (Portlet)i.next();
PortletInfo info = portlet.getInfo();
- for (Iterator j = info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ for (Iterator j = info.getCapabilities().getAllModes().iterator(); j.hasNext();)
{
ModeInfo modeInfo = (ModeInfo)j.next();
if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
{
- continue nextPortlet;
+ continue nextPortlet;
}
}
//
@@ -356,33 +355,42 @@
selectedPlugin = (String)ctx.getExternalContext().getRequestParameterMap().get("plugin");
selectedFrom = 0;
- try
+ if (selectedPortletId != null && selectedPortletId.length() != 0)
{
- // Get portlet
- PortletContext portletCtx = PortletContext.createPortletContext(selectedPortletId);
- FederatedPortlet portlet = (FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
+ try
+ {
+ // Get portlet
+ PortletContext portletCtx = PortletContext.createPortletContext(selectedPortletId);
+ FederatedPortlet portlet = (FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
- //
- selectedPortletInvokerId = portlet.getFederatedId();
+ //
+ selectedPortletInvokerId = portlet.getFederatedId();
- // Get sorted portlets
- List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
- Collections.sort(portlets, comparator);
+ // Get sorted portlets
+ List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ Collections.sort(portlets, comparator);
- // Find the portlet index in the list
- for (int i = 0; i < portlets.size(); i++)
- {
- Portlet current = (Portlet)portlets.get(i);
- if (portlet.getContext().getId().equals(current.getContext().getId()))
+ // Find the portlet index in the list
+ for (int i = 0; i < portlets.size(); i++)
{
- selectedFrom = (i / paginationSize) * paginationSize;
- break;
+ Portlet current = (Portlet)portlets.get(i);
+ if (portlet.getContext().getId().equals(current.getContext().getId()))
+ {
+ selectedFrom = (i / paginationSize) * paginationSize;
+ break;
+ }
}
}
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
}
- catch (PortletInvokerException e)
+ else
{
- e.printStackTrace();
+ // make sure that nothing is selected portlet-wise
+ selectedPortletId = null;
+ selectedPortlet = null;
}
// It may be called from the instance stuff so we need to returns portlet
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05 02:41:25 UTC (rev 8170)
@@ -3,12 +3,13 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
class="admin-ui">
-
+
<!-- Common nav -->
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects" action="objects"
+ actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li id="currentTab">Portlet Instances</li>
<li>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</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 02:26:05 UTC (rev 8169)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 02:41:25 UTC (rev 8170)
@@ -7,94 +7,145 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:pfc="http://www.jboss.com/portal/facelet/common">
- <ui:composition template="portletsTemplate.xhtml">
+<ui:composition template="portletsTemplate.xhtml">
- <ui:define name="content">
+<ui:define name="content">
- <h:form>
- <h:outputLabel for="menu">
- <h:outputText value="Portlet provider: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:selectOneMenu id="menu" styleClass="portlet-form-field" value="#{portletmgr.selectedPortletInvokerId}">
- <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Change" styleClass="portlet-form-button"/>
- </h:form>
+<c:if test="#{empty portletmgr.selectedPlugin}">
+ <h:form>
+ <h:outputLabel for="menu">
+ <h:outputText value="View portlets provided by the portlet provider named: "
+ styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:selectOneMenu id="menu" styleClass="portlet-form-field"
+ value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="View portlets" styleClass="portlet-form-button"/>
+ </h:form>
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header">
- <tr>
- <th>Name</th>
- <th>Description</th>
- <th>Remote</th>
- <th>Remotable</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{portletmgr.selectedPortlets}" var="portlet" varStatus="status">
- <tr
- class="#{portlet.context.id == portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
- <td>
- <h:commandLink
- action="#{portletmgr.selectPortlet}"
- title="#{portlet.context.id}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="manager"/>
- <h:outputText
- rendered="#{not empty portlet.name.value}">#{portlet.name.value}</h:outputText>
- <h:outputText title="#{portlet.context.id}" rendered="#{empty portlet.name.value}">#{portlet.context.id}</h:outputText>
- </h:commandLink>
- </td>
- <td>#{portlet.description.value}</td>
- <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
- <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
- <td>
- <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="manager"/>
- Info
- </h:commandLink> | <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="preferences"/>
- Preferences
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <ul class="pagination">
- <c:if test="#{portletmgr.portletCount > portletmgr.paginationSize}">
- <c:forEach begin="0" end="#{(portletmgr.portletCount - 1) / portletmgr.paginationSize}" step="1"
- var="index">
- <li class="#{index == (portletmgr.selectedFrom / portletmgr.paginationSize)? 'selected' : ''}">
- <h:commandLink action="#{portletmgr.selectFrom}">
- <f:param name="from" value="#{index * portletmgr.paginationSize}"/>
- <h:outputText value="#{index * portletmgr.paginationSize}"/>
- </h:commandLink>
- </li>
- </c:forEach>
- </c:if>
- </ul>
- </h:form>
-
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <c:if test="#{portletmgr.selectedPlugin == 'manager'}">
- <hr/>
- <h3>Portlet details</h3>
- <ui:include src="showPortletInfo.xhtml"/>
- </c:if>
- <c:if test="#{portletmgr.selectedPlugin == 'preferences'}">
- <hr/>
- <h3>Portlet preferences</h3>
- <ui:include src="common/editPreferences.xhtml">
- <ui:param name="prefs" value="#{portletmgr.selectedPreferences}"/>
- </ui:include>
- </c:if>
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Name</th>
+ <th>Description</th>
+ <th>Remote</th>
+ <th>Remotable</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portletmgr.selectedPortlets}" var="portlet" varStatus="status">
+ <tr
+ class="#{portlet.context.id == portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
+ <td>
+ <h:commandLink
+ action="#{portletmgr.selectPortlet}"
+ title="#{portlet.context.id}">
+ <f:param name="id" value="#{portlet.context.id}"/>
+ <f:param name="plugin" value="manager"/>
+ <h:outputText
+ rendered="#{not empty portlet.name.value}">#{portlet.name.value}</h:outputText>
+ <h:outputText title="#{portlet.context.id}" rendered="#{empty portlet.name.value}">#{portlet.context.id}</h:outputText>
+ </h:commandLink>
+ </td>
+ <td>#{portlet.description.value}</td>
+ <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
+ <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
+ <td>
+ <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>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:if test="#{portletmgr.portletCount > portletmgr.paginationSize}">
+ <c:forEach begin="0" end="#{(portletmgr.portletCount - 1) / portletmgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == (portletmgr.selectedFrom / portletmgr.paginationSize)? 'selected' : ''}">
+ <h:commandLink action="#{portletmgr.selectFrom}">
+ <f:param name="from" value="#{index * portletmgr.paginationSize}"/>
+ #{index * portletmgr.paginationSize}
+ </h:commandLink>
+ </li>
+ </c:forEach>
</c:if>
+ </ul>
+ </h:form>
+</c:if>
- </ui:define>
- </ui:composition>
+<c:if test="#{portletmgr.selectedPlugin == 'manager'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} details
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet" value="#{portletmgr.selectedPortlet}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'preferences'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} preferences
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs" value="#{portletmgr.selectedPreferences}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'createInstance'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} instance creation
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <h:form id="add_instance_form" styleClass="createObjectForm">
+ <span class="portlet-font">Create an instance named: </span>
+ <h:inputText id="instanceId" value="#{createInstanceAction.instanceId}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{createInstanceAction.execute}" value="Create instance"
+ styleClass="portlet-form-button"/>
+ <h:message for="instanceId" errorClass="portlet-msg-error"/>
+ </h:form>
+</c:if>
+
+</ui:define>
+</ui:composition>
</div>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05 02:41:25 UTC (rev 8170)
@@ -8,7 +8,8 @@
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects" action="objects"
+ actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li>
<h:commandLink value="Portlet Instances" action="instances"/>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</div>
Deleted: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05 02:41:25 UTC (rev 8170)
@@ -1,29 +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">
- <br/>
-
- <!-- Portlet details -->
-
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <ui:include src="common/showPortletDetails.xhtml">
- <ui:param name="portlet" value="#{portletmgr.selectedPortlet}"/>
- </ui:include>
- </c:if>
-
- <!-- Instance creation -->
-
- <hr/>
- <h:form id="add_instance_form" styleClass="createObjectForm">
- <span class="portlet-font">Create an instance named: </span>
- <h:inputText id="instanceId" value="#{createInstanceAction.instanceId}" styleClass="portlet-form-input-field"
- required="true"/>
- <h:commandButton action="#{createInstanceAction.execute}" value="Create instance"
- styleClass="portlet-form-button"/>
- <h:message for="instanceId" errorClass="portlet-msg-error"/>
- </h:form>
-
-</div>
18 years, 8 months
JBoss Portal SVN: r8169 - in branches/JBoss_Portal_Branch_2_6/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-04 22:26:05 -0400 (Tue, 04 Sep 2007)
New Revision: 8169
Removed:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
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/portletsTemplate.xhtml
Log:
- JBPORTAL-1671: Split functionality into several pages (though everything is handled by portlets.xhtml), removed now useless showPortletInfo.xhtml.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05 02:24:28 UTC (rev 8168)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-09-05 02:26:05 UTC (rev 8169)
@@ -24,7 +24,6 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
-import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.Portlet;
@@ -61,7 +60,7 @@
/** . */
private static final Logger log = Logger.getLogger(PortletManagerBean.class);
-
+
/** . */
private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
@@ -276,22 +275,22 @@
{
if (portlets == null)
{
- portlets = new ArrayList();
- List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
-
+ portlets = new ArrayList();
+ List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+
// Remove content editors
nextPortlet:
- for (Iterator i = tmpPortlets.iterator();i.hasNext();)
+ for (Iterator i = tmpPortlets.iterator(); i.hasNext();)
{
Portlet portlet = (Portlet)i.next();
PortletInfo info = portlet.getInfo();
- for (Iterator j = info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ for (Iterator j = info.getCapabilities().getAllModes().iterator(); j.hasNext();)
{
ModeInfo modeInfo = (ModeInfo)j.next();
if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
{
- continue nextPortlet;
+ continue nextPortlet;
}
}
//
@@ -356,33 +355,42 @@
selectedPlugin = (String)ctx.getExternalContext().getRequestParameterMap().get("plugin");
selectedFrom = 0;
- try
+ if (selectedPortletId != null && selectedPortletId.length() != 0)
{
- // Get portlet
- PortletContext portletCtx = PortletContext.createPortletContext(selectedPortletId);
- FederatedPortlet portlet = (FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
+ try
+ {
+ // Get portlet
+ PortletContext portletCtx = PortletContext.createPortletContext(selectedPortletId);
+ FederatedPortlet portlet = (FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
- //
- selectedPortletInvokerId = portlet.getFederatedId();
+ //
+ selectedPortletInvokerId = portlet.getFederatedId();
- // Get sorted portlets
- List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
- Collections.sort(portlets, comparator);
+ // Get sorted portlets
+ List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ Collections.sort(portlets, comparator);
- // Find the portlet index in the list
- for (int i = 0; i < portlets.size(); i++)
- {
- Portlet current = (Portlet)portlets.get(i);
- if (portlet.getContext().getId().equals(current.getContext().getId()))
+ // Find the portlet index in the list
+ for (int i = 0; i < portlets.size(); i++)
{
- selectedFrom = (i / paginationSize) * paginationSize;
- break;
+ Portlet current = (Portlet)portlets.get(i);
+ if (portlet.getContext().getId().equals(current.getContext().getId()))
+ {
+ selectedFrom = (i / paginationSize) * paginationSize;
+ break;
+ }
}
}
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
}
- catch (PortletInvokerException e)
+ else
{
- e.printStackTrace();
+ // make sure that nothing is selected portlet-wise
+ selectedPortletId = null;
+ selectedPortlet = null;
}
// It may be called from the instance stuff so we need to returns portlet
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05 02:24:28 UTC (rev 8168)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
@@ -3,12 +3,13 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
class="admin-ui">
-
+
<!-- Common nav -->
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects" action="objects"
+ actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li id="currentTab">Portlet Instances</li>
<li>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</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 02:24:28 UTC (rev 8168)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
@@ -7,93 +7,146 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:pfc="http://www.jboss.com/portal/facelet/common">
- <ui:composition template="portletsTemplate.xhtml">
+<ui:composition template="portletsTemplate.xhtml">
- <ui:define name="content">
+<ui:define name="content">
- <h:form>
- <h:outputLabel for="menu">
- <h:outputText value="Portlet provider: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:selectOneMenu id="menu" styleClass="portlet-form-field" value="#{portletmgr.selectedPortletInvokerId}">
- <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Change" styleClass="portlet-form-button"/>
- </h:form>
+<c:if test="#{empty portletmgr.selectedPlugin}">
+ <h:form>
+ <h:outputLabel for="menu">
+ <h:outputText value="View portlets provided by the portlet provider named: "
+ styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:selectOneMenu id="menu" styleClass="portlet-form-field"
+ value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="View portlets" styleClass="portlet-form-button"/>
+ </h:form>
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header">
- <tr>
- <th>Name</th>
- <th>Description</th>
- <th>Remote</th>
- <th>Remotable</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{portletmgr.selectedPortlets}" var="portlet" varStatus="status">
- <tr
- class="#{portlet.context.id == portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
- <td>
- <h:commandLink
- action="#{portletmgr.selectPortlet}"
- title="#{portlet.context.id}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="manager"/>
- <h:outputText
- rendered="#{not empty portlet.name.value}">#{portlet.name.value}</h:outputText>
- <h:outputText title="#{portlet.context.id}" rendered="#{empty portlet.name.value}">#{portlet.context.id}</h:outputText>
- </h:commandLink>
- </td>
- <td>#{portlet.description.value}</td>
- <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
- <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
- <td>
- <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="manager"/>
- Info
- </h:commandLink> | <h:commandLink action="#{portletmgr.selectPortlet}">
- <f:param name="id" value="#{portlet.context.id}"/>
- <f:param name="plugin" value="preferences"/>
- Preferences
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <ul class="pagination">
- <c:if test="#{portletmgr.portletCount > portletmgr.paginationSize}">
- <c:forEach begin="0" end="#{(portletmgr.portletCount - 1) / portletmgr.paginationSize}" step="1"
- var="index">
- <li class="#{index == (portletmgr.selectedFrom / portletmgr.paginationSize)? 'selected' : ''}">
- <h:commandLink action="#{portletmgr.selectFrom}"><f:param name="from"
- value="#{index * portletmgr.paginationSize}"/><h:outputText
- value="#{index * portletmgr.paginationSize}"/></h:commandLink>
- </li>
- </c:forEach>
- </c:if>
- </ul>
- </h:form>
+ <h:form>
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <c:if test="#{portletmgr.selectedPlugin == 'manager'}">
- <hr/>
- <h3>Portlet details</h3>
- <ui:include src="showPortletInfo.xhtml"/>
- </c:if>
- <c:if test="#{portletmgr.selectedPlugin == 'preferences'}">
- <hr/>
- <h3>Portlet preferences</h3>
- <ui:include src="common/editPreferences.xhtml">
- <ui:param name="prefs" value="#{portletmgr.selectedPreferences}"/>
- </ui:include>
- </c:if>
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Name</th>
+ <th>Description</th>
+ <th>Remote</th>
+ <th>Remotable</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portletmgr.selectedPortlets}" var="portlet" varStatus="status">
+ <tr
+ class="#{portlet.context.id == portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
+ <td>
+ <h:commandLink
+ action="#{portletmgr.selectPortlet}"
+ title="#{portlet.context.id}">
+ <f:param name="id" value="#{portlet.context.id}"/>
+ <f:param name="plugin" value="manager"/>
+ <h:outputText
+ rendered="#{not empty portlet.name.value}">#{portlet.name.value}</h:outputText>
+ <h:outputText title="#{portlet.context.id}" rendered="#{empty portlet.name.value}">#{portlet.context.id}</h:outputText>
+ </h:commandLink>
+ </td>
+ <td>#{portlet.description.value}</td>
+ <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remote}"/></td>
+ <td><h:selectBooleanCheckbox disabled="true" value="#{portlet.remotable}"/></td>
+ <td>
+ <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>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:if test="#{portletmgr.portletCount > portletmgr.paginationSize}">
+ <c:forEach begin="0" end="#{(portletmgr.portletCount - 1) / portletmgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == (portletmgr.selectedFrom / portletmgr.paginationSize)? 'selected' : ''}">
+ <h:commandLink action="#{portletmgr.selectFrom}">
+ <f:param name="from" value="#{index * portletmgr.paginationSize}"/>
+ #{index * portletmgr.paginationSize}
+ </h:commandLink>
+ </li>
+ </c:forEach>
</c:if>
+ </ul>
+ </h:form>
+</c:if>
- </ui:define>
- </ui:composition>
+<c:if test="#{portletmgr.selectedPlugin == 'manager'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} details
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet" value="#{portletmgr.selectedPortlet}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'preferences'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} preferences
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs" value="#{portletmgr.selectedPreferences}"/>
+ </ui:include>
+</c:if>
+
+<c:if test="#{portletmgr.selectedPlugin == 'createInstance'}">
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <li>
+ <h:commandLink action="#{portletmgr.selectPortlet}">Portlet Definitions</h:commandLink>
+ </li>
+ <li>></li>
+ <li class="selected">
+ #{portletmgr.selectedPortlet.name.value} instance creation
+ </li>
+ </ul>
+ </h:form>
+ <br/>
+ <h:form id="add_instance_form" styleClass="createObjectForm">
+ <span class="portlet-font">Create an instance named: </span>
+ <h:inputText id="instanceId" value="#{createInstanceAction.instanceId}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{createInstanceAction.execute}" value="Create instance"
+ styleClass="portlet-form-button"/>
+ <h:message for="instanceId" errorClass="portlet-msg-error"/>
+ </h:form>
+</c:if>
+
+</ui:define>
+</ui:composition>
</div>
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05 02:24:28 UTC (rev 8168)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
@@ -8,7 +8,8 @@
<h:form>
<ul class="topnav">
<li>
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
+ <h:commandLink value="Portal Objects" action="objects"
+ actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
<li>
<h:commandLink value="Portlet Instances" action="instances"/>
@@ -19,11 +20,12 @@
</li>
</ul>
</h:form>
-
+
<!-- Status message -->
- <h:message id="status" for="status"/>
+ <h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<!-- Content -->
<ui:insert name="content">Content</ui:insert>
-
+
</div>
Deleted: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05 02:24:28 UTC (rev 8168)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-09-05 02:26:05 UTC (rev 8169)
@@ -1,29 +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">
- <br/>
-
- <!-- Portlet details -->
-
- <c:if test="#{portletmgr.selectedPortlet != null}">
- <ui:include src="common/showPortletDetails.xhtml">
- <ui:param name="portlet" value="#{portletmgr.selectedPortlet}"/>
- </ui:include>
- </c:if>
-
- <!-- Instance creation -->
-
- <hr/>
- <h:form id="add_instance_form" styleClass="createObjectForm">
- <span class="portlet-font">Create an instance named: </span>
- <h:inputText id="instanceId" value="#{createInstanceAction.instanceId}" styleClass="portlet-form-input-field"
- required="true"/>
- <h:commandButton action="#{createInstanceAction.execute}" value="Create instance"
- styleClass="portlet-form-button"/>
- <h:message for="instanceId" errorClass="portlet-msg-error"/>
- </h:form>
-
-</div>
18 years, 8 months
JBoss Portal SVN: r8168 - 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-04 22:24:28 -0400 (Tue, 04 Sep 2007)
New Revision: 8168
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
Log:
- Do not display > before the root object.
- Fixed improper showing of operation on all objects of the path instead of just the last one.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-09-05 02:24:20 UTC (rev 8167)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-09-05 02:24:28 UTC (rev 8168)
@@ -26,9 +26,9 @@
<h:form>
<ul class="objectpath">
<c:forEach items="#{portalobjectmgr.selectedObjectPath}" var="node">
- <li>
- >
- </li>
+ <c:if test="#{node.type != PortalObject.TYPE_CONTEXT}">
+ <li>></li>
+ </c:if>
<li class="#{node.id == portalobjectmgr.selectedObject.id ? 'selected' : ''}">
<h:commandLink action="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{node.id}"/>
@@ -37,7 +37,8 @@
<c:otherwise><span class="objectName">#{node.name}</span> #{node.typeName}</c:otherwise>
</c:choose>
</h:commandLink>
- <h:outputText value=" #{portalObjectScreen}" rendered="#{portalObjectScreen != null}"/>
+ <h:outputText value=" #{portalObjectScreen}"
+ rendered="#{portalObjectScreen != null and node.id == portalobjectmgr.selectedObject.id}"/>
</li>
</c:forEach>
</ul>
18 years, 8 months
JBoss Portal SVN: r8167 - 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-04 22:24:20 -0400 (Tue, 04 Sep 2007)
New Revision: 8167
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
Log:
- Do not display > before the root object.
- Fixed improper showing of operation on all objects of the path instead of just the last one.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-09-05 02:17:28 UTC (rev 8166)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-09-05 02:24:20 UTC (rev 8167)
@@ -26,9 +26,9 @@
<h:form>
<ul class="objectpath">
<c:forEach items="#{portalobjectmgr.selectedObjectPath}" var="node">
- <li>
- >
- </li>
+ <c:if test="#{node.type != PortalObject.TYPE_CONTEXT}">
+ <li>></li>
+ </c:if>
<li class="#{node.id == portalobjectmgr.selectedObject.id ? 'selected' : ''}">
<h:commandLink action="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{node.id}"/>
@@ -37,7 +37,8 @@
<c:otherwise><span class="objectName">#{node.name}</span> #{node.typeName}</c:otherwise>
</c:choose>
</h:commandLink>
- <h:outputText value=" #{portalObjectScreen}" rendered="#{portalObjectScreen != null}"/>
+ <h:outputText value=" #{portalObjectScreen}"
+ rendered="#{portalObjectScreen != null and node.id == portalobjectmgr.selectedObject.id}"/>
</li>
</c:forEach>
</ul>
18 years, 8 months
JBoss Portal SVN: r8166 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-04 22:17:28 -0400 (Tue, 04 Sep 2007)
New Revision: 8166
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
Log:
- JBPORTAL-1676: Do not display preference table if there are no preferences.
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-09-05 02:17:13 UTC (rev 8165)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-09-05 02:17:28 UTC (rev 8166)
@@ -1,98 +1,106 @@
<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">
+ 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">
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header" style="text-align:left;">
- <tr>
- <th>Key</th>
- <th>Name</th>
- <th>ReadOnly</th>
- <c:if test="#{prefs.mutable}">
- <th>Value</th>
- </c:if>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{prefs.entries}" var="pref" varStatus="status">
- <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <c:choose>
- <c:when test="#{prefs.mutable and pref.readOnly == false}">
- <h:commandLink
- rendered="#{pref.readOnly == false}"
- action="#{pref.select}">#{pref.name}</h:commandLink>
- </c:when>
- <c:otherwise>#{pref.name}</c:otherwise>
- </c:choose>
- </td>
- <td>
- <h:outputText value="#{pref.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox disabled="true" value="#{pref.readOnly}"/>
- </td>
+<c:choose>
+ <c:when test="#{not empty prefs.entries}">
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header" style="text-align:left;">
+ <tr>
+ <th>Key</th>
+ <th>Name</th>
+ <th>ReadOnly</th>
<c:if test="#{prefs.mutable}">
+ <th>Value</th>
+ </c:if>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{prefs.entries}" var="pref" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
<td>
- <h:outputText value="#{pref.value}"/>
+ <c:choose>
+ <c:when test="#{prefs.mutable and pref.readOnly == false}">
+ <h:commandLink
+ rendered="#{pref.readOnly == false}"
+ action="#{pref.select}">#{pref.name}</h:commandLink>
+ </c:when>
+ <c:otherwise>#{pref.name}</c:otherwise>
+ </c:choose>
</td>
- </c:if>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </h:form>
-
- <c:if test="#{prefs.selectedEntry != null}">
- <h:form style="padding: 1em 0 1em 0">
- <fieldset style="border: 1px solid;">
- <legend>Edit existing values</legend>
- <table>
- <tbody>
- <c:forEach items="#{prefs.selectedEntry.indices}" var="index" varStatus="status">
- <tr>
+ <td>
+ <h:outputText value="#{pref.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox disabled="true" value="#{pref.readOnly}"/>
+ </td>
+ <c:if test="#{prefs.mutable}">
<td>
- <h:outputLabel for="row_#{status.index}">
- <h:outputText value="Value #{status.index}: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
+ <h:outputText value="#{pref.value}"/>
</td>
- <td>
- <h:inputText value="#{prefs.selectedEntry[index]}" styleClass="portlet-form-input-field"/>
- </td>
- <td>
- <h:commandButton
- id="row_#{status.index}"
- actionListener="#{prefs.selectedEntry.deleteLine}"
- value="Delete"
- styleClass="portlet-form-button"/>
- </td>
- </tr>
- </c:forEach>
+ </c:if>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ </h:form>
+ </c:when>
+ <c:otherwise>
+ <p>No defined preferences for this portlet.</p>
+ </c:otherwise>
+</c:choose>
+
+<c:if test="#{prefs.selectedEntry != null}">
+ <h:form style="padding: 1em 0 1em 0">
+ <fieldset style="border: 1px solid;">
+ <legend>Edit existing values</legend>
+ <table>
+ <tbody>
+ <c:forEach items="#{prefs.selectedEntry.indices}" var="index" varStatus="status">
<tr>
- <td colspan="3">
- <h:commandButton value="Update" styleClass="portlet-form-button"/>
+ <td>
+ <h:outputLabel for="row_#{status.index}">
+ <h:outputText value="Value #{status.index}: " styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
</td>
+ <td>
+ <h:inputText value="#{prefs.selectedEntry[index]}" styleClass="portlet-form-input-field"/>
+ </td>
+ <td>
+ <h:commandButton
+ id="row_#{status.index}"
+ actionListener="#{prefs.selectedEntry.deleteLine}"
+ value="Delete"
+ styleClass="portlet-form-button"/>
+ </td>
</tr>
- </tbody>
- </table>
- </fieldset>
- </h:form>
+ </c:forEach>
+ <tr>
+ <td colspan="3">
+ <h:commandButton value="Update" styleClass="portlet-form-button"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ </h:form>
- <h:form>
- <fieldset style="border: 1px solid;">
- <legend>Append a value</legend>
- <h:outputLabel for="new_value">
- <h:outputText value="New value: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:inputText id="new_value" value="#{prefs.selectedEntry.line}" styleClass="portlet-form-input-field"/>
- <h:commandButton action="#{prefs.selectedEntry.appendLine}" value="Append" styleClass="portlet-form-button"/>
- </fieldset>
- </h:form>
+ <h:form>
+ <fieldset style="border: 1px solid;">
+ <legend>Append a value</legend>
+ <h:outputLabel for="new_value">
+ <h:outputText value="New value: " styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:inputText id="new_value" value="#{prefs.selectedEntry.line}" styleClass="portlet-form-input-field"/>
+ <h:commandButton action="#{prefs.selectedEntry.appendLine}" value="Append"
+ styleClass="portlet-form-button"/>
+ </fieldset>
+ </h:form>
- </c:if>
+</c:if>
</div>
18 years, 8 months
JBoss Portal SVN: r8165 - branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-04 22:17:13 -0400 (Tue, 04 Sep 2007)
New Revision: 8165
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
Log:
- JBPORTAL-1676: Do not display preference table if there are no preferences.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-09-05 02:14:32 UTC (rev 8164)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-09-05 02:17:13 UTC (rev 8165)
@@ -1,98 +1,106 @@
<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">
+ 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">
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header" style="text-align:left;">
- <tr>
- <th>Key</th>
- <th>Name</th>
- <th>ReadOnly</th>
- <c:if test="#{prefs.mutable}">
- <th>Value</th>
- </c:if>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{prefs.entries}" var="pref" varStatus="status">
- <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <c:choose>
- <c:when test="#{prefs.mutable and pref.readOnly == false}">
- <h:commandLink
- rendered="#{pref.readOnly == false}"
- action="#{pref.select}">#{pref.name}</h:commandLink>
- </c:when>
- <c:otherwise>#{pref.name}</c:otherwise>
- </c:choose>
- </td>
- <td>
- <h:outputText value="#{pref.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox disabled="true" value="#{pref.readOnly}"/>
- </td>
+<c:choose>
+ <c:when test="#{not empty prefs.entries}">
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header" style="text-align:left;">
+ <tr>
+ <th>Key</th>
+ <th>Name</th>
+ <th>ReadOnly</th>
<c:if test="#{prefs.mutable}">
+ <th>Value</th>
+ </c:if>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{prefs.entries}" var="pref" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' : 'portlet-section-alternate'}">
<td>
- <h:outputText value="#{pref.value}"/>
+ <c:choose>
+ <c:when test="#{prefs.mutable and pref.readOnly == false}">
+ <h:commandLink
+ rendered="#{pref.readOnly == false}"
+ action="#{pref.select}">#{pref.name}</h:commandLink>
+ </c:when>
+ <c:otherwise>#{pref.name}</c:otherwise>
+ </c:choose>
</td>
- </c:if>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </h:form>
-
- <c:if test="#{prefs.selectedEntry != null}">
- <h:form style="padding: 1em 0 1em 0">
- <fieldset style="border: 1px solid;">
- <legend>Edit existing values</legend>
- <table>
- <tbody>
- <c:forEach items="#{prefs.selectedEntry.indices}" var="index" varStatus="status">
- <tr>
+ <td>
+ <h:outputText value="#{pref.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox disabled="true" value="#{pref.readOnly}"/>
+ </td>
+ <c:if test="#{prefs.mutable}">
<td>
- <h:outputLabel for="row_#{status.index}">
- <h:outputText value="Value #{status.index}: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
+ <h:outputText value="#{pref.value}"/>
</td>
- <td>
- <h:inputText value="#{prefs.selectedEntry[index]}" styleClass="portlet-form-input-field"/>
- </td>
- <td>
- <h:commandButton
- id="row_#{status.index}"
- actionListener="#{prefs.selectedEntry.deleteLine}"
- value="Delete"
- styleClass="portlet-form-button"/>
- </td>
- </tr>
- </c:forEach>
+ </c:if>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ </h:form>
+ </c:when>
+ <c:otherwise>
+ <p>No defined preferences for this portlet.</p>
+ </c:otherwise>
+</c:choose>
+
+<c:if test="#{prefs.selectedEntry != null}">
+ <h:form style="padding: 1em 0 1em 0">
+ <fieldset style="border: 1px solid;">
+ <legend>Edit existing values</legend>
+ <table>
+ <tbody>
+ <c:forEach items="#{prefs.selectedEntry.indices}" var="index" varStatus="status">
<tr>
- <td colspan="3">
- <h:commandButton value="Update" styleClass="portlet-form-button"/>
+ <td>
+ <h:outputLabel for="row_#{status.index}">
+ <h:outputText value="Value #{status.index}: " styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
</td>
+ <td>
+ <h:inputText value="#{prefs.selectedEntry[index]}" styleClass="portlet-form-input-field"/>
+ </td>
+ <td>
+ <h:commandButton
+ id="row_#{status.index}"
+ actionListener="#{prefs.selectedEntry.deleteLine}"
+ value="Delete"
+ styleClass="portlet-form-button"/>
+ </td>
</tr>
- </tbody>
- </table>
- </fieldset>
- </h:form>
+ </c:forEach>
+ <tr>
+ <td colspan="3">
+ <h:commandButton value="Update" styleClass="portlet-form-button"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ </h:form>
- <h:form>
- <fieldset style="border: 1px solid;">
- <legend>Append a value</legend>
- <h:outputLabel for="new_value">
- <h:outputText value="New value: " styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:inputText id="new_value" value="#{prefs.selectedEntry.line}" styleClass="portlet-form-input-field"/>
- <h:commandButton action="#{prefs.selectedEntry.appendLine}" value="Append" styleClass="portlet-form-button"/>
- </fieldset>
- </h:form>
+ <h:form>
+ <fieldset style="border: 1px solid;">
+ <legend>Append a value</legend>
+ <h:outputLabel for="new_value">
+ <h:outputText value="New value: " styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:inputText id="new_value" value="#{prefs.selectedEntry.line}" styleClass="portlet-form-input-field"/>
+ <h:commandButton action="#{prefs.selectedEntry.appendLine}" value="Append"
+ styleClass="portlet-form-button"/>
+ </fieldset>
+ </h:form>
- </c:if>
+</c:if>
</div>
18 years, 8 months