JBoss Portal SVN: r8111 - 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-08-30 14:30:03 -0400 (Thu, 30 Aug 2007)
New Revision: 8111
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
Log:
- JBPORTAL-1655: Made more explicit.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-08-30 18:30:03 UTC (rev 8111)
@@ -7,12 +7,14 @@
<ui:composition template="/WEB-INF/jsf/objectTemplate.xhtml">
<ui:param name="portalObjectScreen" value="Rename"/>
<ui:define name="content">
- <h3>Renaming:</h3>
+ <h3>Rename <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
<h:form id="renameForm">
- <h:inputText id="newName" value="#{renameAction.newName}"/>
- <h:message for="newName"/>
- <br />
- <h:commandButton value="Update" action="#{renameAction.execute}" styleClass="portlet-form-button"/>
+ <p>Rename the <h:outputText value=" #{portalobjectmgr.selectedObject.name} "/>
+ <h:outputText value="#{portalobjectmgr.selectedObjectType}"/> to:
+ <h:inputText id="newName" value="#{renameAction.newName}"/>
+ <h:message for="newName"/>
+ <h:commandButton value="Rename" action="#{renameAction.execute}" styleClass="portlet-form-button"/>
+ </p>
</h:form>
</ui:define>
</ui:composition>
16 years, 8 months
JBoss Portal SVN: r8110 - in trunk/core-identity: src/main/org/jboss/portal/core/identity/services and 16 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-30 13:58:41 -0400 (Thu, 30 Aug 2007)
New Revision: 8110
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityUserManagementService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/
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/
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/resources/portal-identity-sar/conf/identity-ui-configuration.xml
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd
Removed:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityMailServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/IdentityManagementService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/IdentityManagementServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
Modified:
trunk/core-identity/build.xml
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.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/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/actions/CreateUserAction.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/IdentityRoleBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.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/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.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/registerConfirm.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/register/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/startTemplate.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
Log:
- adding xml based metadata for configuration
Modified: trunk/core-identity/build.xml
===================================================================
--- trunk/core-identity/build.xml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/build.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -88,8 +88,9 @@
&libraries;
<path id="library.classpath">
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="jboss.cache.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jboss.cache.classpath"/>
<path refid="freemarker.freemarker.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
@@ -212,6 +213,7 @@
<fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>
<fileset dir="${commons.el.lib}" includes="commons-el.jar"/>
<fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
+ <fileset dir="${apache.lang.lib}" includes="commons-lang.jar"/>
<fileset dir="${apache.digester.lib}" includes="commons-digester.jar"/>
</copy>
<copy todir="${build.resources}/portal-identity-war">
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -1,104 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.services;
-
-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.workflow.ValidateEmailService;
-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.portlet.PortletParametersStateString;
-import org.jboss.portal.server.ServerInvocation;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class IdentityCommandFactoryService extends AbstractCommandFactory implements IdentityCommandFactory
-{
-
- /** . */
- protected String targetWindowRef = null;
-
- /** . */
- protected PortalObjectId targetWindowId;
-
- /** . */
- protected ValidateEmailService validateEmailService = null;
-
- public PortalObjectId getTargetWindowId()
- {
- return targetWindowId;
- }
-
- 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();
-
- if (requestPath != null)
- {
-
- // Remove starting /
- String rPath = requestPath.trim().substring(1, requestPath.length());
- String[] aRequest = rPath.split("/");
- int aLength = aRequest.length;
-
- if (aLength == 2)
- {
- // TODO - UTF-8 decode
- String bpmId = aRequest[0];
- String hash = aRequest[1];
-
- validateEmailService.validateEmail(bpmId, hash);
-
- // TODO
- 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 InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW, WindowState.NORMAL, renderParameters);
- }
-
-}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityConstants.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -29,6 +29,10 @@
public class IdentityConstants
{
public static final String HASH_SALT = "fuDrupRunEP2BRuspADr";
+
+ public static final String SUBSCRIPTION_MODE_AUTOMATIC = "automatic";
+ /** . */
+ public final static String jbp_identity_validate_email_process_name = "jbp_identity_validate_email";
/*
* Available actions
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityMailServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityMailServiceImpl.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityMailServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -1,220 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.services;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringWriter;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import javax.naming.InitialContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.core.modules.MailModule;
-import org.jboss.portal.jems.as.JNDI;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class IdentityMailServiceImpl extends AbstractJBossService implements IdentityMailService
-{
-
- /** . */
- private Map mailData = new HashMap();
-
- /** . */
- private Locale locale;
-
- /** . */
- private String emailText = null;
-
- /** . */
- private String emailDomain = "TODO emailDomain";
-
- /** . */
- private String emailFrom = "no-reply(a)todo.com";
-
- /** . */
- private String templateLocation;
-
- /** . */
- private MailModule mailModule;
-
- /** . */
- private static final Logger log = Logger.getLogger(IdentityMailServiceImpl.class);
-
- /** . */
- private JNDI.Binding jndiBinding;
-
- /** . */
- private String jndiName = null;
-
- /** . */
- public void startService() throws Exception
- {
- super.startService();
-
- if (this.jndiName != null)
- {
- jndiBinding = new JNDI.Binding(jndiName, this);
- jndiBinding.bind();
- }
- }
-
- public void stopService() throws Exception
- {
- super.stopService();
-
- if (jndiBinding != null)
- {
- jndiBinding.unbind();
- jndiBinding = null;
- }
- }
-
- public String getEmailDomain()
- {
- return emailDomain;
- }
-
- public void setEmailDomain(String emailDomain)
- {
- this.emailDomain = emailDomain;
- }
-
- public String getEmailFrom()
- {
- return emailFrom;
- }
-
- public void setEmailFrom(String emailFrom)
- {
- this.emailFrom = emailFrom;
- }
-
- public MailModule getMailModule()
- {
- if (this.mailModule == null)
- {
- try
- {
- this.mailModule = (MailModule) new InitialContext().lookup("java:/portal/MailModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return mailModule;
- }
-
- public void setMailModule(MailModule mailModule)
- {
- this.mailModule = mailModule;
- }
-
- public String getJNDIName()
- {
- return this.jndiName;
- }
-
- public void setJNDIName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public void sendMail(String templateLocation, Map mailData, Locale locale) throws IOException, TemplateException
- {
- this.templateLocation = templateLocation;
- this.mailData = mailData;
- this.locale = locale;
- this.mailData.put("emailDomain", emailDomain);
-
- ResourceBundle bundle = ResourceBundle.getBundle("Identity", locale);
-
- String subject = null;
- String to = (String) mailData.get("to");
-
- if (IdentityConstants.ACTION_REGISTER_USER.equals(templateLocation))
- {
- subject = bundle.getString("IDENTITY_MAIL_SUBJECT_REGISTER");
- }
- else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(templateLocation))
- {
- subject = bundle.getString("IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL");
- }
- else if (IdentityConstants.ACTION_LOST_PASSWORD.equals(templateLocation))
- {
- subject = bundle.getString("IDENTITY_MAIL_SUBJECT_LOST_PASSWORD");
- }
- else
- {
- throw new IllegalArgumentException("unknown template.");
- }
-
- // Generating message
- this.generateEmailText();
-
- // Sending mail
- // this.getMailModule.send(emailFrom, to , subject, emailText);
- log.debug(subject + to + this.emailText);
- }
-
- private void generateEmailText() throws IOException, TemplateException
- {
- ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- URL config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate_" + locale.getLanguage() + "_" + locale.getCountry() + ".tpl");
- if (config == null)
- {
- config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate_" + locale.getLanguage() + ".tpl");
- }
- if (config == null)
- {
- config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate.tpl");
- }
- if (config == null)
- {
- throw new FileNotFoundException("Cannot load a suitable emailTemplate.tpl in conf/templates/"
- + this.templateLocation);
- }
- InputStream in = config.openStream();
- Template tpl = new Template("emailTemplate", new InputStreamReader(in), new Configuration());
- StringWriter out = new StringWriter();
- tpl.process(this.mailData, out);
- out.close();
-
- this.emailText = out.toString();
- }
-}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityUserManagementService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityUserManagementService.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityUserManagementService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.services;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface IdentityUserManagementService
+{
+ boolean createUser(String username, String password, Map profileMap, List roles);
+
+ public String getCurrentEmail(String username);
+
+ public boolean updateEmail(String username, String email);
+
+}
+
Copied: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java (from rev 8071, trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityCommandFactoryService.java)
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityCommandFactoryService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.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.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.portlet.PortletParametersStateString;
+import org.jboss.portal.server.ServerInvocation;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityCommandFactoryService extends AbstractCommandFactory implements IdentityCommandFactory
+{
+
+ /** . */
+ protected String targetWindowRef = null;
+
+ /** . */
+ protected PortalObjectId targetWindowId;
+
+ /** . */
+ protected ValidateEmailService validateEmailService = null;
+
+ public PortalObjectId getTargetWindowId()
+ {
+ return targetWindowId;
+ }
+
+ 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();
+
+ if (requestPath != null)
+ {
+
+ // Remove starting /
+ String rPath = requestPath.trim().substring(1, requestPath.length());
+ String[] aRequest = rPath.split("/");
+ int aLength = aRequest.length;
+
+ if (aLength == 2)
+ {
+ String bpmId = aRequest[0];
+ String hash = aRequest[1];
+ // Validating email
+ validateEmailService.validateEmail(bpmId, hash);
+
+
+// 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);
+ }
+
+}
Copied: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java (from rev 8071, trunk/core-identity/src/main/org/jboss/portal/core/identity/services/IdentityMailServiceImpl.java)
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityMailServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,210 @@
+/******************************************************************************
+ * 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.services.impl;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Locale;
+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.modules.MailModule;
+import org.jboss.portal.jems.as.JNDI;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityMailServiceImpl extends AbstractJBossService implements IdentityMailService
+{
+
+ /** . */
+ private Map mailData = new HashMap();
+
+ /** . */
+ private Locale locale;
+
+ /** . */
+ private String emailText = null;
+
+ /** . */
+ private String emailDomain = "TODO emailDomain";
+
+ /** . */
+ private String emailFrom = "no-reply(a)todo.com";
+
+ /** . */
+ private String templateLocation;
+
+ /** . */
+ private MailModule mailModule;
+
+ /** . */
+ private static final Logger log = Logger.getLogger(IdentityMailServiceImpl.class);
+
+ /** . */
+ private JNDI.Binding jndiBinding;
+
+ /** . */
+ private String jndiName = null;
+
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+ }
+
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (jndiBinding != null)
+ {
+ jndiBinding.unbind();
+ jndiBinding = null;
+ }
+ }
+
+ public String getEmailDomain()
+ {
+ return emailDomain;
+ }
+
+ public void setEmailDomain(String emailDomain)
+ {
+ this.emailDomain = emailDomain;
+ }
+
+ public String getEmailFrom()
+ {
+ return emailFrom;
+ }
+
+ public void setEmailFrom(String emailFrom)
+ {
+ this.emailFrom = emailFrom;
+ }
+
+ public MailModule getMailModule()
+ {
+ return mailModule;
+ }
+
+ public void setMailModule(MailModule mailModule)
+ {
+ this.mailModule = mailModule;
+ }
+
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public void sendMail(String templateLocation, Map mailData, Locale locale) throws IOException, TemplateException
+ {
+ this.templateLocation = templateLocation;
+ this.mailData = mailData;
+ this.locale = locale;
+ this.mailData.put("emailDomain", emailDomain);
+
+ ResourceBundle bundle = ResourceBundle.getBundle("Identity", locale);
+
+ String subject = null;
+ String to = (String) mailData.get("to");
+
+ if (IdentityConstants.ACTION_REGISTER_USER.equals(templateLocation))
+ {
+ subject = bundle.getString("IDENTITY_MAIL_SUBJECT_REGISTER");
+ }
+ else if (IdentityConstants.ACTION_CHANGE_EMAIL.equals(templateLocation))
+ {
+ subject = bundle.getString("IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL");
+ }
+ else if (IdentityConstants.ACTION_LOST_PASSWORD.equals(templateLocation))
+ {
+ subject = bundle.getString("IDENTITY_MAIL_SUBJECT_LOST_PASSWORD");
+ }
+ else
+ {
+ throw new IllegalArgumentException("unknown template.");
+ }
+
+ // Generating message
+ this.generateEmailText();
+
+ // Sending mail
+ // this.getMailModule.send(emailFrom, to , subject, emailText);
+ log.debug(subject + to + this.emailText);
+ }
+
+ private void generateEmailText() throws IOException, TemplateException
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ URL config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate_" + locale.getLanguage() + "_" + locale.getCountry() + ".tpl");
+ if (config == null)
+ {
+ config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate_" + locale.getLanguage() + ".tpl");
+ }
+ if (config == null)
+ {
+ config = tcl.getResource("conf/templates/" + this.templateLocation + "/emailTemplate.tpl");
+ }
+ if (config == null)
+ {
+ throw new FileNotFoundException("Cannot load a suitable emailTemplate.tpl in conf/templates/"
+ + this.templateLocation);
+ }
+ InputStream in = config.openStream();
+ Template tpl = new Template("emailTemplate", new InputStreamReader(in), new Configuration());
+ StringWriter out = new StringWriter();
+ tpl.process(this.mailData, out);
+ out.close();
+
+ this.emailText = out.toString();
+ }
+}
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/impl/IdentityUserManagementServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,271 @@
+/******************************************************************************
+ * 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.services.impl;
+
+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.IdentityUserManagementService;
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.jems.as.JNDI;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityUserManagementServiceImpl extends AbstractJBossService implements IdentityUserManagementService
+{
+ /** . */
+ private UserModule userModule;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private UserProfileModule userProfileModule;
+
+ /** . */
+ private MembershipModule membershipModule;
+
+ /** . */
+ private IdentityServiceController identityServiceController;
+
+ /** . */
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
+ /** . */
+ private JNDI.Binding jndiBinding;
+
+ /** . */
+ private String jndiName = null;
+
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ try
+ {
+ 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);
+ membershipModule = (MembershipModule) identityServiceController.getIdentityContext().getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+ }
+ catch(IdentityException e)
+ {
+ super.stopService();
+ throw new RuntimeException(e);
+ }
+
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+ }
+
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (jndiBinding != null)
+ {
+ jndiBinding.unbind();
+ jndiBinding = null;
+ }
+ }
+
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ public void setIdentityServiceController(IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+ public UserModule getUserModule()
+ {
+ return userModule;
+ }
+
+ public void setUserModule(UserModule userModule)
+ {
+ this.userModule = userModule;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public UserProfileModule getUserProfileModule()
+ {
+ return userProfileModule;
+ }
+
+ public void setUserProfileModule(UserProfileModule userProfileModule)
+ {
+ this.userProfileModule = userProfileModule;
+ }
+
+ public MembershipModule getMembershipModule()
+ {
+ return membershipModule;
+ }
+
+ public void setMembershipModule(MembershipModule membershipModule)
+ {
+ this.membershipModule = membershipModule;
+ }
+
+ public IdentityUIConfigurationService getIdentityUIConfigurationService()
+ {
+ return identityUIConfigurationService;
+ }
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
+
+ public boolean createUser(String username, String password, Map profileMap, List roles)
+ {
+ try
+ {
+ User user = this.getUserModule().createUser(username, password);
+ Set roleSet = this.checkRoles(roles);
+
+ // Enable the user
+ profileMap.put(User.INFO_USER_ENABLED, Boolean.TRUE);
+
+ Iterator i = profileMap.keySet().iterator();
+ while (i.hasNext())
+ {
+ String key = (String) i.next();
+ Object value = profileMap.get(key);
+ this.getUserProfileModule().setProperty(user, key, value);
+ }
+
+ this.getMembershipModule().assignRoles(user, roleSet);
+ return true;
+ }
+ catch (Exception e)
+ {
+ log.error("Error when creating user", e);
+ }
+
+ return false;
+ }
+
+ public String getCurrentEmail(String username)
+ {
+ try
+ {
+ User user = this.getUserModule().findUserByUserName(username);
+ return (String) this.getUserProfileModule().getProperty(user, User.INFO_USER_EMAIL_REAL);
+ }
+ catch (Exception e)
+ {
+ log.error("failed to retrieve current email address", e);
+ }
+ return null;
+ }
+
+ public boolean updateEmail(String username, String email)
+ {
+ try
+ {
+ User user = this.getUserModule().findUserByUserName(username);
+ this.getUserProfileModule().setProperty(user, User.INFO_USER_EMAIL_REAL, email);
+ return true;
+ }
+ catch (Exception e)
+ {
+ log.error("failed to update email", e);
+ }
+ return false;
+ }
+
+ private Set checkRoles(List roles) throws IllegalArgumentException, IdentityException
+ {
+ Set roleSet = new HashSet();
+ // Set default roles if required
+ if (roles == null || (roles != null && roles.size() == 0 ))
+ {
+ roles = this.identityUIConfigurationService.getConfiguration().getDefaultRoles();
+ }
+
+ if (roles != null && roles.size() > 0)
+ { // Checking existing roles
+ Iterator i = roles.iterator();
+
+ while (i.hasNext())
+ {
+ String roleName = (String) i.next();
+ Role role = this.getRoleModule().findRoleByName(roleName);
+
+ if (role == null)
+ {
+ // Create new role ?
+ }
+ else
+ {
+ roleSet.add(role);
+ }
+ }
+ }
+ return roleSet;
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfiguration.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.services.metadata;
+
+import java.util.List;
+
+import org.jboss.portal.core.identity.services.IdentityConstants;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityUIConfiguration
+{
+ /** . */
+ String subscriptionMode;
+
+ /** . */
+ String adminSubscriptionMode = "automatic";
+
+ /** . */
+ boolean overwriteWorkflow = false;
+
+ /** . */
+ String emailDomain;
+
+ /** . */
+ String emailFrom;
+
+ /** . */
+ List defaultRoles;
+
+ /** . */
+ String passwordGenerationCharacters;
+
+ /** . */
+ List uiComponents;
+
+ public String getSubscriptionMode()
+ {
+ return subscriptionMode;
+ }
+
+ public void setSubscriptionMode(String subscriptionMode)
+ {
+ this.subscriptionMode = subscriptionMode;
+ }
+
+ public String getAdminSubscriptionMode()
+ {
+ return adminSubscriptionMode;
+ }
+
+ public void setAdminSubscriptionMode(String adminSubscriptionMode)
+ {
+ this.adminSubscriptionMode = adminSubscriptionMode;
+ }
+
+ public boolean isOverwriteWorkflow()
+ {
+ return overwriteWorkflow;
+ }
+
+ public void setOverwriteWorkflow(boolean overwriteWorkflow)
+ {
+ this.overwriteWorkflow = overwriteWorkflow;
+ }
+
+ public String getEmailDomain()
+ {
+ return emailDomain;
+ }
+
+ public void setEmailDomain(String emailDomain)
+ {
+ this.emailDomain = emailDomain;
+ }
+
+ public String getEmailFrom()
+ {
+ return emailFrom;
+ }
+
+ public void setEmailFrom(String emailFrom)
+ {
+ this.emailFrom = emailFrom;
+ }
+
+ public List getDefaultRoles()
+ {
+ return defaultRoles;
+ }
+
+ public void setDefaultRoles(List defaultRoles)
+ {
+ this.defaultRoles = defaultRoles;
+ }
+
+ public String getPasswordGenerationCharacters()
+ {
+ return passwordGenerationCharacters;
+ }
+
+ public void setPasswordGenerationCharacters(String passwordGenerationCharacters)
+ {
+ this.passwordGenerationCharacters = passwordGenerationCharacters;
+ }
+
+ public List getUiComponents()
+ {
+ return uiComponents;
+ }
+
+ public void setUiComponents(List uiComponents)
+ {
+ this.uiComponents = uiComponents;
+ }
+
+ public boolean enableWorkflow()
+ {
+ // If subscriptionModes != automatic == true
+ if (this.subscriptionMode.equals(IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC)
+ && this.adminSubscriptionMode.equals(IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
+
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.services.metadata;
+
+import javax.naming.NamingException;
+
+import org.jboss.portal.workflow.service.WorkflowService;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface IdentityUIConfigurationService
+{
+
+ IdentityUIConfiguration getConfiguration();
+ WorkflowService getWorkflowService() throws NamingException;
+}
+
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,205 @@
+/******************************************************************************
+ * 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.services.metadata;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+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.jems.as.JNDI;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.service.WorkflowService;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityUIConfigurationServiceImpl extends AbstractJBossService implements IdentityUIConfigurationService
+{
+
+ /** . */
+ private final static String schemaLocation = "conf/identity-ui-configuration.xsd";
+
+ /** . */
+ private final static String xmlLocation = "conf/identity-ui-configuration.xml";
+
+ /** . */
+ private IdentityUIConfiguration configuration;
+
+ /** . */
+ private WorkflowService workflowService;
+
+ /** . */
+ private JNDI.Binding jndiBinding;
+
+ /** . */
+ private String jndiName = null;
+
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ 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);
+
+ // Loading Workflow if subscriptionmodes != automatic
+ if (this.configuration.enableWorkflow())
+ {
+ String subscriptionMode = this.configuration.getSubscriptionMode();
+ String adminSubscriptionMode = this.configuration.getAdminSubscriptionMode();
+ String emailValidationProcess = IdentityConstants.jbp_identity_validate_email_process_name;
+ if (subscriptionMode != null && adminSubscriptionMode != null && emailValidationProcess != null)
+ {
+ this.createJBPMContext(subscriptionMode);
+ this.createJBPMContext(adminSubscriptionMode);
+ // automatically load email validation process
+ this.createJBPMContext(emailValidationProcess);
+ }
+ else
+ {
+ throw new RuntimeException("processName cannot be null.");
+ }
+ }
+ else
+ {
+ log.info("not starting jBPM workflow.");
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Error while starting service: ", e);
+ super.stopService();
+ }
+
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+ }
+
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (jndiBinding != null)
+ {
+ jndiBinding.unbind();
+ jndiBinding = null;
+ }
+ }
+
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public IdentityUIConfiguration getConfiguration()
+ {
+ return this.configuration;
+ }
+
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
+ public WorkflowService getWorkflowService() throws NamingException
+ {
+ if (workflowService == null)
+ {
+ try
+ {
+ workflowService = (WorkflowService) new InitialContext().lookup("java:/portal/Workflow");
+ }
+ catch(Exception e)
+ {
+ // OK - if not using jBPM
+ if (this.configuration.enableWorkflow())
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ return workflowService;
+ }
+
+ private void createJBPMContext(String processName) throws Exception
+ {
+ if (!IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(processName))
+ {
+ String fileName = "conf/processes/" + processName + ".xml";
+
+ JbpmContext jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
+
+ ProcessDefinition processDefinition = jbpmContext.getGraphSession().findLatestProcessDefinition(processName);
+ if (processDefinition == null)
+ {
+ processDefinition = ProcessDefinition.parseXmlResource(fileName);
+ jbpmContext.deployProcessDefinition(processDefinition);
+ }
+ else
+ {
+ if (this.configuration.isOverwriteWorkflow())
+ {
+ ProcessDefinition fromConfig = ProcessDefinition.parseXmlResource(fileName);
+ jbpmContext.deployProcessDefinition(fromConfig);
+ }
+ }
+ // Closing JbpmContext
+ IOTools.safeClose(jbpmContext);
+ }
+ }
+
+ private InputStream getResource(String path) throws IOException
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(path);
+ return url.openStream();
+ }
+
+ private URL getURL(String path) throws IOException
+ {
+ return Thread.currentThread().getContextClassLoader().getResource(path);
+ }
+}
Added: 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 (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/UIComponentConfiguration.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,186 @@
+/******************************************************************************
+ * 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.services.metadata;
+
+import java.util.List;
+
+import javax.naming.InitialContext;
+
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.info.PropertyInfo;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UIComponentConfiguration
+{
+ /** . */
+ private UserProfileModule userProfileModule;
+
+ /** . */
+ private String propertyRef;
+
+ /** . */
+ String localizationBundle;
+
+ /** . */
+ private String name;
+
+ /** . */
+ private List validators;
+
+ /** . */
+ private String converter;
+
+ /** . */
+ private boolean required;
+
+ /** . */
+ private boolean readOnly;
+
+ /** . */
+ private List values;
+
+ /** . */
+ private PropertyInfo propertyInfo;
+
+ public String getPropertyRef()
+ {
+ return propertyRef;
+ }
+
+ 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;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ // returns the first validator
+ public String getValidator()
+ {
+ return (String) validators.get(0);
+ }
+
+ public List getValidators()
+ {
+ return validators;
+ }
+
+ public void setValidators(List validators)
+ {
+ this.validators = validators;
+ }
+
+ public boolean isRequired()
+ {
+ // If profile-info is mandatory always return true
+ return this.propertyInfo.getUsage().equals("mandatory") ? true : required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ public boolean isReadOnly()
+ {
+ // If profile-info is read-only always return true
+ return this.propertyInfo.getAccessMode().equals("read-only") ? true : readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public String getConverter()
+ {
+ return converter;
+ }
+
+ public void setConverter(String converter)
+ {
+ this.converter = converter;
+ }
+
+ public List getValues()
+ {
+ return values;
+ }
+
+ public void setValues(List values)
+ {
+ this.values = values;
+ }
+
+ public Class getPropertyClass() throws ClassNotFoundException
+ {
+ // Returns the Class of the Property
+ return ClassLoader.getSystemClassLoader().loadClass(this.propertyInfo.getType());
+ }
+
+ private UserProfileModule getUserProfileModule()
+ {
+ if (userProfileModule == null)
+ {
+ try
+ {
+ userProfileModule = (UserProfileModule) new InitialContext().lookup("java:/portal/UserProfileModule");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return userProfileModule;
+ }
+}
+
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/IdentityManagementService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/IdentityManagementService.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/IdentityManagementService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -1,41 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.services.workflow;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public interface IdentityManagementService
-{
- boolean createUser(String username, String password, Map profileMap, List roles);
-
- public String getCurrentEmail(String username);
-
- public boolean updateEmail(String username, String email);
-
-}
-
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/RegistrationService.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -33,7 +33,7 @@
public interface RegistrationService
{
/** . */
- String registerUser(String username, String password, Map profileMap, List roles, Locale locale);
+ String registerUser(String username, String password, Map profileMap, List roles, Locale locale, boolean adminFlag);
/** . */
String approve(String id, boolean approve);
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/CreateUserAction.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -25,7 +25,7 @@
import javax.naming.InitialContext;
import org.jboss.logging.Logger;
-import org.jboss.portal.core.identity.services.workflow.IdentityManagementService;
+import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
@@ -38,7 +38,7 @@
{
/** . */
- private IdentityManagementService identityManagementService;
+ private IdentityUserManagementService identityManagementService;
/** . */
private static Logger log = Logger.getLogger(CreateUserAction.class);
@@ -52,13 +52,13 @@
log.debug("creating User: "+ uc.getUsername() );
}
- private IdentityManagementService getIdentityManagementService()
+ private IdentityUserManagementService getIdentityManagementService()
{
if (this.identityManagementService == null)
{
try
{
- this.identityManagementService = (IdentityManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ this.identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityUserManagementService");
}
catch (Exception e)
{
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/IdentityManagementServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/IdentityManagementServiceImpl.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/IdentityManagementServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -1,288 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.services.workflow.impl;
-
-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.workflow.IdentityManagementService;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.jems.as.JNDI;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class IdentityManagementServiceImpl extends AbstractJBossService implements IdentityManagementService
-{
- /** . */
- private UserModule userModule;
-
- /** . */
- private RoleModule roleModule;
-
- /** . */
- private UserProfileModule userProfileModule;
-
- /** . */
- private MembershipModule membershipModule;
-
- /** . */
- private JNDI.Binding jndiBinding;
-
- /** . */
- private String jndiName = null;
-
- /** . */
- private InitialContext initialContext;
-
- public void startService() throws Exception
- {
- super.startService();
-
- this.initialContext = new InitialContext();
-
- if (this.jndiName != null)
- {
- jndiBinding = new JNDI.Binding(jndiName, this);
- jndiBinding.bind();
- }
- }
-
- public void stopService() throws Exception
- {
- super.stopService();
-
- if (jndiBinding != null)
- {
- jndiBinding.unbind();
- jndiBinding = null;
- }
- }
-
- public String getJNDIName()
- {
- return this.jndiName;
- }
-
- public void setJNDIName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public UserModule getUserModule()
- {
- if (userModule == null)
- {
- try
- {
- userModule = (UserModule) initialContext.lookup("java:/portal/UserModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return userModule;
- }
-
- public void setUserModule(UserModule userModule)
- {
- this.userModule = userModule;
- }
-
- public RoleModule getRoleModule()
- {
- if (roleModule == null)
- {
- try
- {
- roleModule = (RoleModule) initialContext.lookup("java:/portal/RoleModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return roleModule;
- }
-
- public void setRoleModule(RoleModule roleModule)
- {
- this.roleModule = roleModule;
- }
-
- public UserProfileModule getUserProfileModule()
- {
- if (userProfileModule == null)
- {
- try
- {
- userProfileModule = (UserProfileModule) initialContext.lookup("java:/portal/UserProfileModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return userProfileModule;
- }
-
- public void setUserProfileModule(UserProfileModule userProfileModule)
- {
- this.userProfileModule = userProfileModule;
- }
-
- public MembershipModule getMembershipModule()
- {
- if (membershipModule == null)
- {
- try
- {
- membershipModule = (MembershipModule) initialContext.lookup("java:/portal/MembershipModule");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- return membershipModule;
- }
-
- public void setMembershipModule(MembershipModule membershipModule)
- {
- this.membershipModule = membershipModule;
- }
-
- public boolean createUser(String username, String password, Map profileMap, List roles)
- {
- try
- {
- User user = this.getUserModule().createUser(username, password);
- Set roleSet = this.checkRoles(roles);
-
- // Enable the user
- profileMap.put(User.INFO_USER_ENABLED, Boolean.TRUE);
-
- Iterator i = profileMap.keySet().iterator();
- while (i.hasNext())
- {
- String key = (String) i.next();
- Object value = profileMap.get(key);
- this.getUserProfileModule().setProperty(user, key, value);
- }
-
- this.getMembershipModule().assignRoles(user, roleSet);
- return true;
- }
- catch (Exception e)
- {
- log.error("Error when creating user", e);
- }
-
- return false;
- }
-
- public String getCurrentEmail(String username)
- {
- try
- {
- User user = this.getUserModule().findUserByUserName(username);
- return (String) this.getUserProfileModule().getProperty(user, User.INFO_USER_EMAIL_REAL);
- }
- catch (Exception e)
- {
- log.error("failed to retrieve current email address", e);
- }
- return null;
- }
-
- public boolean updateEmail(String username, String email)
- {
- try
- {
- User user = this.getUserModule().findUserByUserName(username);
- this.getUserProfileModule().setProperty(user, User.INFO_USER_EMAIL_REAL, email);
- return true;
- }
- catch (Exception e)
- {
- log.error("failed to update email", e);
- }
- return false;
- }
-
- private Set checkRoles(List roles) throws IllegalArgumentException, IdentityException
- {
- Set roleSet = new HashSet();
- if (roles != null && roles.size() > 0)
- { // Checking existing roles
- Iterator i = roles.iterator();
-
- while (i.hasNext())
- {
- String roleName = (String) i.next();
- Role role = this.getRoleModule().findRoleByName(roleName);
-
- if (role == null)
- {
- // Create new role ?
- }
- else
- {
- roleSet.add(role);
- }
- }
- return roleSet;
- }
- else
- {
- // TODO default Role
- Role role = this.getRoleModule().findRoleByName("User");
-
- if (role != null)
- {
- roleSet.add(role);
- }
- else
- {
- throw new IllegalArgumentException();
- }
-
- return roleSet;
- }
- }
-
-}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/RegistrationServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -22,19 +22,23 @@
******************************************************************************/
package org.jboss.portal.core.identity.services.workflow.impl;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
import org.jboss.logging.Logger;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.core.identity.services.IdentityConstants;
+import org.jboss.portal.core.identity.services.IdentityUserManagementService;
+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.workflow.RegistrationService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
-import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
import org.jboss.portal.identity.User;
import org.jboss.portal.jems.as.JNDI;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -59,67 +63,36 @@
private WorkflowService workflowService = null;
/** . */
- private String processName = "jbp_identity_validation_approval_workflow";
-
+ private String subscriptionMode = null;
+
/** . */
- private boolean overwrite = false;
+ private String adminSubscriptionMode = null;
/** . */
- private String processFile = "conf/processes/" + processName + ".xml";
-
- /** . */
private JNDI.Binding jndiBinding;
/** . */
private String jndiName = null;
-
+
/** . */
- private ValidateEmailService validateEmailService;
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
+ /** . */
+ private IdentityUserManagementService identityManagementService;
public void startService() throws Exception
{
super.startService();
-
+
+ IdentityUIConfiguration cf = this.identityUIConfigurationService.getConfiguration();
+ this.subscriptionMode = cf.getSubscriptionMode();
+ this.adminSubscriptionMode = cf.getAdminSubscriptionMode();
+
if (this.jndiName != null)
{
jndiBinding = new JNDI.Binding(jndiName, this);
jndiBinding.bind();
}
-
- InputStream is = null;
- JbpmContext jbpmContext = null;
- try
- {
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
-
- ProcessDefinition processDefinition = jbpmContext.getGraphSession().findLatestProcessDefinition(
- this.processName);
- if (processDefinition == null)
- {
- processDefinition = ProcessDefinition.parseXmlResource(processFile);
- jbpmContext.deployProcessDefinition(processDefinition);
- }
- else
- {
- ProcessDefinition fromConfig = ProcessDefinition.parseXmlResource(processFile);
- if (this.overwrite)
- {
- jbpmContext.deployProcessDefinition(fromConfig);
- }
- }
- }
- catch (Exception e)
- {
- //
- this.stopService();
- //
- throw e;
- }
- finally
- {
- IOTools.safeClose(is);
- IOTools.safeClose(jbpmContext);
- }
}
public void stopService() throws Exception
@@ -133,13 +106,15 @@
}
}
- /** @return */
- public WorkflowService getWorkflowService()
+ public WorkflowService getWorkflowService() throws NamingException
{
+ if (this.workflowService == null)
+ {
+ this.workflowService = identityUIConfigurationService.getWorkflowService();
+ }
return this.workflowService;
}
- /** @param workflowService */
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
@@ -156,31 +131,76 @@
{
this.jndiName = jndiName;
}
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
- public ValidateEmailService getValidateEmailService()
+ public IdentityUIConfigurationService getIdentityUIConfigurationService()
{
- return validateEmailService;
+ return identityUIConfigurationService;
}
- public void setValidateEmailService(ValidateEmailService validateEmailService)
+ public IdentityUserManagementService getIdentityManagementService()
{
- this.validateEmailService = validateEmailService;
+ if (identityManagementService == null)
+ {
+ try
+ {
+ identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return identityManagementService;
}
- public String registerUser(String username, String password, Map profileMap, List roles, Locale locale)
+ public void setIdentityManagementService(IdentityUserManagementService identityManagementService)
{
+ this.identityManagementService = identityManagementService;
+ }
+
+ public String registerUser(String username, String password, Map profileMap, List roles, Locale locale, boolean adminFlag)
+ {
+
+ if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow())
+ {
+ // create user if workflow is disabled
+ this.getIdentityManagementService().createUser(username, password, profileMap, roles);
+ return IdentityConstants.REGISTRATION_REGISTERED;
+ }
+ else
+ {
+ // choosing between subscription-mode and admin-subcription-mode
+ UserContainer user = new UserContainer(username, password, profileMap, roles);
+ if (adminFlag)
+ {
+ this.registerUserWorkflow(user, locale, this.adminSubscriptionMode);
+ }
+ else
+ {
+ this.registerUserWorkflow(user, locale, this.subscriptionMode);
+ }
+ return IdentityConstants.REGISTRATION_PENDING;
+ }
+ }
+
+ public void registerUserWorkflow(UserContainer user, Locale locale, String processName)
+ {
JbpmContext jbpmContext = null;
ProcessInstance processInstance = null;
- // String registrationHash = this.hashGen(); - done at send email action
boolean success = false;
+
try
{
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
- processInstance = jbpmContext.newProcessInstance(this.processName);
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
+ processInstance = jbpmContext.newProcessInstance(processName);
Token token = processInstance.getRootToken();
// Setting required attributes for the workflow
- UserContainer user = new UserContainer(username, password, profileMap, roles);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_USER, user);
processInstance.getContextInstance().setVariable(IdentityConstants.VARIABLE_EMAIL,
user.getProfileMap().get(User.INFO_USER_EMAIL_REAL));
@@ -194,8 +214,8 @@
catch (Exception e)
{
success = false;
- log.error("Exception in Workflow", e);
- // throw new WorkflowException(e);
+ log.error("Exception in Workflow");
+ throw new RuntimeException(e);
}
finally
{
@@ -205,16 +225,21 @@
}
IOTools.safeClose(jbpmContext);
}
- return IdentityConstants.REGISTRATION_PENDING;
}
public String approve(String id, boolean approve)
{
+ // return registered if workflow is disabled
+ if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow())
+ {
+ return IdentityConstants.REGISTRATION_REGISTERED;
+ }
+
JbpmContext jbpmContext = null;
try
{
long processId = Long.valueOf(id).longValue();
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
ProcessInstance processInstance = jbpmContext.getProcessInstance(processId);
if (processInstance != null)
@@ -247,13 +272,19 @@
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.workflowService.getJbpmConfiguration().createJbpmContext();
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
GraphSession graphSession = jbpmContext.getGraphSession();
- ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.processName);
+ ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.subscriptionMode);
List processInstances = graphSession.findProcessInstances(processDef.getId());
if (processInstances != null)
@@ -280,13 +311,20 @@
public List getPendingUsers()
{
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.workflowService.getJbpmConfiguration().createJbpmContext();
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
GraphSession graphSession = jbpmContext.getGraphSession();
- ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.processName);
+ ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.subscriptionMode);
List processInstances = graphSession.findProcessInstances(processDef.getId());
if (processInstances != null)
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/SendValidationMailAction.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -33,7 +33,7 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.core.identity.services.IdentityMailService;
-import org.jboss.portal.core.identity.services.workflow.IdentityManagementService;
+import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
@@ -45,7 +45,7 @@
public class SendValidationMailAction implements ActionHandler
{
/** . */
- private IdentityManagementService identityManagementService;
+ private IdentityUserManagementService identityManagementService;
/** . */
private IdentityMailService identityMailService;
@@ -139,13 +139,13 @@
return identityMailService;
}
- private IdentityManagementService getIdentityManagementService()
+ private IdentityUserManagementService getIdentityManagementService()
{
if (identityManagementService == null)
{
try
{
- this.identityManagementService = (IdentityManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ this.identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/UpdateEmailAction.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -26,7 +26,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.core.identity.services.IdentityConstants;
-import org.jboss.portal.core.identity.services.workflow.IdentityManagementService;
+import org.jboss.portal.core.identity.services.IdentityUserManagementService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
@@ -39,7 +39,7 @@
{
/** . */
- private IdentityManagementService identityManagementService;
+ private IdentityUserManagementService identityManagementService;
/** . */
private static Logger log = Logger.getLogger(CreateUserAction.class);
@@ -52,13 +52,13 @@
this.getIdentityManagementService().updateEmail(uc.getUsername(), email);
}
- private IdentityManagementService getIdentityManagementService()
+ private IdentityUserManagementService getIdentityManagementService()
{
if (identityManagementService == null)
{
try
{
- identityManagementService = (IdentityManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/workflow/impl/ValidateEmailServiceImpl.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -22,12 +22,15 @@
******************************************************************************/
package org.jboss.portal.core.identity.services.workflow.impl;
-import java.io.InputStream;
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;
+import org.jboss.portal.core.identity.services.IdentityUserManagementService;
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
import org.jboss.portal.core.identity.services.workflow.UserContainer;
import org.jboss.portal.core.identity.services.workflow.ValidateEmailService;
import org.jboss.portal.identity.User;
@@ -35,7 +38,6 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.workflow.service.WorkflowService;
import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
@@ -47,20 +49,20 @@
{
/** . */
private static final Logger log = Logger.getLogger(ValidateEmailService.class);
+
+ /** . */
+ private String processName = IdentityConstants.jbp_identity_validate_email_process_name;
/** . */
private WorkflowService workflowService = null;
/** . */
- private String processName = "jbp_identity_validate_email";
-
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
/** . */
- private String processFile = "conf/processes/" + processName + ".xml";
-
+ private IdentityUserManagementService identityManagementService;
+
/** . */
- private boolean overwrite = false;
-
- /** . */
private JNDI.Binding jndiBinding;
/** . */
@@ -75,42 +77,6 @@
jndiBinding = new JNDI.Binding(jndiName, this);
jndiBinding.bind();
}
-
- InputStream is = null;
- JbpmContext jbpmContext = null;
- try
- {
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
-
- ProcessDefinition processDefinition = jbpmContext.getGraphSession().findLatestProcessDefinition(
- this.processName);
- if (processDefinition == null)
- {
- processDefinition = ProcessDefinition.parseXmlResource(processFile);
- jbpmContext.deployProcessDefinition(processDefinition);
- }
- else
- {
- ProcessDefinition fromConfig = ProcessDefinition.parseXmlResource(processFile);
- if (this.overwrite)
- {
- jbpmContext.deployProcessDefinition(fromConfig);
- }
- }
- }
- catch (Exception e)
- {
- //
- this.stopService();
-
- //
- throw e;
- }
- finally
- {
- IOTools.safeClose(is);
- IOTools.safeClose(jbpmContext);
- }
}
public void stopService() throws Exception
@@ -124,13 +90,22 @@
}
}
- /** @return */
public WorkflowService getWorkflowService()
{
+ if ( workflowService == null)
+ {
+ try
+ {
+ workflowService = (WorkflowService) identityUIConfigurationService.getWorkflowService();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
return this.workflowService;
}
- /** @param workflowService */
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
@@ -148,18 +123,55 @@
this.jndiName = jndiName;
}
- /*
- * Create new changeEmail request
- */
+ public IdentityUIConfigurationService getIdentityUIConfigurationService()
+ {
+ return identityUIConfigurationService;
+ }
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
+
+ public IdentityUserManagementService getIdentityManagementService()
+ {
+ if (identityManagementService == null)
+ {
+ try
+ {
+ identityManagementService = (IdentityUserManagementService) new InitialContext().lookup("java:/portal/IdentityManagementService");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return identityManagementService;
+ }
+
public String changeEmail(User user, String email, Locale locale)
{
+ if (! this.identityUIConfigurationService.getConfiguration().enableWorkflow())
+ {
+ this.getIdentityManagementService().updateEmail(user.getUserName(), email);
+ return IdentityConstants.REGISTRATION_REGISTERED;
+ }
+ else
+ {
+ this.changeEmailWorkflow(user, email, locale);
+ return IdentityConstants.REGISTRATION_PENDING;
+ }
+ }
+
+ public void changeEmailWorkflow(User user, String email, Locale locale)
+ {
JbpmContext jbpmContext = null;
ProcessInstance processInstance = null;
// String registrationHash = this.hashGen(); - generated when sending email
boolean success = false;
try
{
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
processInstance = jbpmContext.newProcessInstance(this.processName);
Token token = processInstance.getRootToken();
@@ -185,18 +197,21 @@
}
IOTools.safeClose(jbpmContext);
}
- // TODO
- return IdentityConstants.REGISTRATION_PENDING;
}
public boolean validateEmail(String id, String registrationHash)
{
+ boolean success = false;
+ if (!this.identityUIConfigurationService.getConfiguration().enableWorkflow())
+ {
+ return success;
+ }
+
JbpmContext jbpmContext = null;
- boolean success = false;
try
{
long processId = Long.valueOf(id).longValue();
- jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+ jbpmContext = this.getWorkflowService().getJbpmConfiguration().createJbpmContext();
ProcessInstance processInstance = jbpmContext.getProcessInstance(processId);
if (processInstance != null)
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -1,104 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.identity.ui;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class UIAttribute
-{
- /** . */
- private String identifier;
-
- /** . */
- private String name;
-
- /** . */
- private String validator;
-
- /** . */
- private String converter;
-
- /** . */
- private boolean required;
-
- public UIAttribute(String identifier, String name)
- {
- this.identifier = identifier;
- this.name = name;
- this.validator = null;
- this.converter = null;
- this.required = false;
- }
-
- public String getIdentifier()
- {
- return identifier;
- }
-
- public void setIdentifier(String identifier)
- {
- this.identifier = identifier;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getValidator()
- {
- return validator;
- }
-
- public void setValidator(String validator)
- {
- this.validator = validator;
- }
-
- public boolean isRequired()
- {
- return required;
- }
-
- public void setRequired(boolean required)
- {
- this.required = required;
- }
-
- public String getConverter()
- {
- return converter;
- }
-
- public void setConverter(String converter)
- {
- this.converter = converter;
- }
-}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -30,12 +30,15 @@
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.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;
/**
@@ -49,6 +52,9 @@
private List roles = new ArrayList();
/** . */
+ //private List defaultRoles = null;
+
+ /** . */
private IdentityUIUser uiUser = new IdentityUIUser();
/** . */
@@ -58,6 +64,9 @@
private IdentityUserBean identityUserBean;
/** . */
+ private MetaDataServiceBean metaDataService;
+
+ /** . */
private static final Logger log = Logger.getLogger(CreateUserAction.class);
public IdentityUIUser getUiUser()
@@ -79,6 +88,12 @@
{
this.roles = roles;
}
+
+ public void setDefaultRoles(List roles)
+ {
+ //this.defaultRoles = roles;
+ this.roles = roles;
+ }
public IdentityUserBean getIdentityUserBean()
{
@@ -100,12 +115,21 @@
this.registrationService = registrationService;
}
- public String register()
+ public MetaDataServiceBean getMetaDataService()
{
+ return metaDataService;
+ }
+
+ public void setMetaDataService(MetaDataServiceBean metaDataService)
+ {
+ this.metaDataService = metaDataService;
+ }
+
+ public String register(ActionEvent ev)
+ {
if (uiUser.getUsername() != null && uiUser.getPassword() != null)
{
- log.debug("Creating user account: " + uiUser.getUsername());
-
+ String adminSubscriptionMode = (String) ev.getComponent().getId();
try
{
Class registrationDateClass = uiUser.getAttribute().getType("registrationdate");
@@ -131,9 +155,18 @@
Map wProfileMap = this.identityUserBean.getProfileMap(uiUser.getAttribute().getProfileAttributes());
Locale wLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
- String registrationStatus = this.registrationService.registerUser(wUsername, wPassword, wProfileMap, wRoles, wLocale);
- log.debug(registrationStatus);
+ // TODO enable admin subscription mode
+ if (adminSubscriptionMode != null && adminSubscriptionMode.equals("admin"))
+ {
+ String registrationStatus = this.registrationService.registerUser(wUsername, wPassword, wProfileMap, wRoles, wLocale, true);
+ }
+ else
+ {
+ String registrationStatus = this.registrationService.registerUser(wUsername, wPassword, wProfileMap, wRoles, wLocale, false);
+ }
+ // log.debug(registrationStatus);
+
}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -31,6 +31,7 @@
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.workflow.RegistrationService;
@@ -70,7 +71,7 @@
private IdentityUIUser uiUser;
/** . */
- private String searchString;
+ private String searchString = null;
/** . */
private IdentityUserBean identityUserBean;
@@ -86,7 +87,7 @@
public UserAdministrationBean()
{
- this.userList = new ListDataModel();
+ // this.userList = new ListDataModel();
}
public DataModel getUserList()
@@ -119,9 +120,9 @@
return limit;
}
- public void setLimit(int limit)
+ public void setLimit(SelectItem limit)
{
- this.limit = limit;
+ this.limit = Integer.valueOf((String) limit.getValue()).intValue();
}
public List getRoles()
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityRoleBean.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -50,9 +50,6 @@
/** . */
private MembershipModule membershipModule;
- /** . */
- private String defaultRole;
-
public RoleModule getRoleModule()
{
return roleModule;
@@ -73,16 +70,6 @@
this.membershipModule = membershipModule;
}
- public String getDefaultRole()
- {
- return defaultRole;
- }
-
- public void setDefaultRole(String defaultRole)
- {
- this.defaultRole = defaultRole;
- }
-
public void assignRoles(User user, List roles) throws IllegalArgumentException, IdentityException
{
Set roleSet = this.checkRoles(roles);
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -31,8 +31,8 @@
import java.util.Set;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
-import org.jboss.portal.core.identity.ui.UIAttribute;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.User;
@@ -101,10 +101,10 @@
{
String key = (String) i.next();
Object value = attributeMap.get(key);
- UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(key).getObject();
- if ( uiAttribute != null)
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) this.metaDataService.getValue(key).getObject();
+ if ( uiComponent != null)
{
- profileMap.put(uiAttribute.getIdentifier(), value);
+ profileMap.put(uiComponent.getPropertyRef(), value);
}
}
return profileMap;
@@ -163,22 +163,14 @@
public Class getPropertyType(String propertyName) throws IdentityException
{
- UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(propertyName).getObject();
- String type = userProfileModule.getProfileInfo().getPropertyInfo(uiAttribute.getIdentifier()).getType();
- try
- {
- return ClassLoader.getSystemClassLoader().loadClass(type);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) this.metaDataService.getValue(propertyName).getObject();
+ return uiComponent.getClass();
}
public Object getUserProperty(String username, String propertyName) throws IllegalArgumentException, NoSuchUserException, IdentityException
{
User user = this.findUserByUserName(username);
- UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(propertyName).getObject();
- return this.userProfileModule.getProperty(user, uiAttribute.getIdentifier());
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) this.metaDataService.getValue(propertyName).getObject();
+ return this.userProfileModule.getProperty(user, uiComponent.getPropertyRef());
}
}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-08-30 17:58:41 UTC (rev 8110)
@@ -23,12 +23,18 @@
package org.jboss.portal.core.identity.ui.common;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
-import org.jboss.portal.common.p3p.P3PConstants;
-import org.jboss.portal.core.identity.ui.UIAttribute;
+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.identity.User;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -37,83 +43,53 @@
public class MetaDataServiceBean implements DynamicBean
{
/** . */
- HashMap map = new HashMap();
+ HashMap map = null;
+
+ /** . */
+ private IdentityUIConfigurationService identityUIConfigurationService;
public MetaDataServiceBean()
{
-
- UIAttribute uiEmail = new UIAttribute(P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, "email");
- uiEmail.setValidator("EmailValidator");
- uiEmail.setRequired(true);
-
- UIAttribute uiGivenName = new UIAttribute(P3PConstants.INFO_USER_NAME_GIVEN, "givenname");
- UIAttribute uiFamilyName = new UIAttribute(P3PConstants.INFO_USER_NAME_FAMILY, "familyname");
- UIAttribute uiSkype = new UIAttribute(User.INFO_USER_IM_SKYPE, "skype");
- UIAttribute uiLocation = new UIAttribute(User.INFO_USER_LOCATION, "location");
- UIAttribute uiOccupation = new UIAttribute(User.INFO_USER_OCCUPATION, "occupation");
- UIAttribute uiExtra = new UIAttribute(User.INFO_USER_EXTRA, "extra");
- UIAttribute uiSignature = new UIAttribute(User.INFO_USER_SIGNATURE, "signature");
- UIAttribute uiInterests = new UIAttribute(User.INFO_USER_INTERESTS, "interests");
- UIAttribute uiLocale = new UIAttribute(User.INFO_USER_LOCALE, "locale");
- UIAttribute uiIcq = new UIAttribute(User.INFO_USER_IM_ICQ, "icq");
- UIAttribute uiAim = new UIAttribute(User.INFO_USER_IM_AIM, "aim");
- UIAttribute uiMsmn = new UIAttribute(User.INFO_USER_IM_MSNM, "msnm");
- UIAttribute uiYim = new UIAttribute(User.INFO_USER_IM_YIM, "yim");
- UIAttribute uiXmmp = new UIAttribute(User.INFO_USER_IM_XMMP, "xmmp");
- UIAttribute uiHomepage = new UIAttribute(User.INFO_USER_HOMEPAGE, "homepage");
- UIAttribute uiTimeZone = new UIAttribute(User.INFO_USER_TIME_ZONE_OFFSET, "timezone");
- UIAttribute uiTheme = new UIAttribute(User.INFO_USER_THEME, "theme");
- UIAttribute uiSecurityQuestion = new UIAttribute(User.INFO_USER_SECURITY_QUESTION, "securityquestion");
- UIAttribute uiSecurityAnswer = new UIAttribute(User.INFO_USER_SECURITY_ANSWER, "securityanswer");
- UIAttribute uiLastLogin = new UIAttribute(User.INFO_USER_LAST_LOGIN_DATE, "lastlogin");
- UIAttribute uiRegistrationDate = new UIAttribute(User.INFO_USER_REGISTRATION_DATE, "registrationdate");
- UIAttribute uiEnabled = new UIAttribute(User.INFO_USER_ENABLED, "enabled");
-
- this.addToMap(uiEmail);
-
- this.addToMap(uiGivenName);
- this.addToMap(uiFamilyName);
- this.addToMap(uiSkype);
- this.addToMap(uiLocation);
- this.addToMap(uiOccupation);
- this.addToMap(uiExtra);
- this.addToMap(uiSignature);
- this.addToMap(uiInterests);
- this.addToMap(uiLocale);
- this.addToMap(uiIcq);
- this.addToMap(uiAim);
- this.addToMap(uiMsmn);
- this.addToMap(uiYim);
- this.addToMap(uiXmmp);
- this.addToMap(uiHomepage);
- this.addToMap(uiTimeZone);
- this.addToMap(uiTheme);
- this.addToMap(uiSecurityQuestion);
- this.addToMap(uiSecurityAnswer);
- this.addToMap(uiLastLogin);
- this.addToMap(uiRegistrationDate);
- this.addToMap(uiEnabled);
+ try
+ {
+ this.identityUIConfigurationService = (IdentityUIConfigurationService) new InitialContext().lookup("java:/portal/IdentityUIConfigurationService");
+ }
+ catch (NamingException e)
+ {
+ // FIXME
+ throw new RuntimeException(e);
+ }
+ this.createMap();
}
-
+
public Class getType(Object propertyName) throws IllegalArgumentException
{
- return UIAttribute.class;
+ return Object.class;
}
public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
{
- UIAttribute uiAttribute = (UIAttribute) map.get((String) propertyName);
- return uiAttribute != null ? new PropertyValue(uiAttribute) : null;
+ UIComponentConfiguration uiComponent = (UIComponentConfiguration) map.get((String) propertyName);
+ return uiComponent != null ? new PropertyValue(uiComponent) : null;
}
public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
{
- return false;
+ return true;
}
-
- private void addToMap(UIAttribute uiAttribute)
+
+ private void createMap()
{
- this.map.put(uiAttribute.getName(), uiAttribute);
+ 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);
+ }
}
}
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -22,79 +22,93 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<server>
+
+ <!-- CommandFactory -->
<mbean
- code="org.jboss.portal.core.identity.services.IdentityCommandFactoryService"
+ code="org.jboss.portal.core.identity.services.impl.IdentityCommandFactoryService"
name="portal:commandFactory=IdentityUI"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends
optional-attribute-name="ValidateEmailService"
- proxy-type="attribute">portal:service=ValidateEmailService,type=Workflow</depends>
+ proxy-type="attribute">portal:service=ValidateEmailService,type=IdentityUI
+ </depends>
</mbean>
-
+
<mbean
- code="org.jboss.portal.core.identity.services.IdentityMailServiceImpl"
+ 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 on MailModule -->
+ <depends optional-attribute-name="MailModule" proxy-type="attribute">portal:service=Module,type=Mail</depends>
<attribute name="JNDIName">java:portal/IdentityMailService</attribute>
</mbean>
- <mbean
- code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
- name="portal:commandFactory=Delegate,path=validateEmail"
+ <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/>
- <attribute name="Path">/validateEmail</attribute>
- <depends
- optional-attribute-name="DelegatingFactory"
- proxy-type="attribute">portal:commandFactory=Delegating</depends>
- <depends
- optional-attribute-name="DelegateFactory"
- proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
- </mbean>
+ <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.workflow.impl.IdentityManagementServiceImpl"
- name="portal:service=IdentityManagementService,type=IdentityUI"
+ code="org.jboss.portal.core.identity.services.impl.IdentityUserManagementServiceImpl"
+ name="portal:service=IdentityUserManagementService,type=IdentityUI"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <!-- depends on UserModule, RoleModule, UserProfileModule, MemberShipModule -->
- <attribute name="JNDIName">java:portal/IdentityManagementService</attribute>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+ <attribute name="JNDIName">java:portal/IdentityUserManagementService</attribute>
</mbean>
<mbean
code="org.jboss.portal.core.identity.services.workflow.impl.RegistrationServiceImpl"
- name="portal:service=RegistrationService,type=Workflow"
+ name="portal:service=RegistrationService,type=IdentityUI"
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 optional-attribute-name="IdentityUIConfigurationService" proxy-type="attribute">
+ portal:service=IdentityUIConfigurationService,type=IdentityUI
</depends>
- <depends optional-attribute-name="ValidateEmailService" proxy-type="attribute">
- portal:service=ValidateEmailService,type=Workflow
- </depends>
<attribute name="JNDIName">java:portal/RegistrationService</attribute>
</mbean>
<mbean
code="org.jboss.portal.core.identity.services.workflow.impl.ValidateEmailServiceImpl"
- name="portal:service=ValidateEmailService,type=Workflow"
+ name="portal:service=ValidateEmailService,type=IdentityUI"
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 optional-attribute-name="IdentityUIConfigurationService" proxy-type="attribute">
+ portal:service=IdentityUIConfigurationService,type=IdentityUI
</depends>
<attribute name="JNDIName">java:portal/ValidateEmailService</attribute>
</mbean>
+ <mbean
+ code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
+ name="portal:commandFactory=Delegate,path=validateEmail"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="Path">/validateEmail</attribute>
+ <depends
+ optional-attribute-name="DelegatingFactory"
+ proxy-type="attribute">portal:commandFactory=Delegating</depends>
+ <depends
+ optional-attribute-name="DelegateFactory"
+ proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
+ </mbean>
+
<!--
<mbean
code="org.jboss.portal.core.identity.services.IdentityURLFactory"
Added: 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 (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<identity-ui-configuration>
+
+ <subscription-mode>jbp_identity_validation_approval_workflow</subscription-mode>
+ <overwrite-workflow>false</overwrite-workflow>
+ <email-domain>jboss.org</email-domain>
+ <email-from>no-reply(a)jboss.com</email-from>
+ <password-generation-characters>0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWyYzZ*#!+-/"</password-generation-characters>
+ <default-roles>
+ <role>User</role>
+ <role>Admin</role>
+ </default-roles>
+
+ <!-- user interface components -->
+ <ui-components>
+ <ui-component name="nickname">
+ <property-ref>user.name.nickName</property-ref>
+ <required>true</required>
+
+ </ui-component>
+ <ui-component name="givenname">
+ <property-ref>user.name.given</property-ref>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="familyname">
+ <property-ref>user.name.family</property-ref>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="location">
+ <property-ref>portal.user.location</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="occupation">
+ <property-ref>portal.user.occupation</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="extra">
+ <property-ref>portal.user.extra</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="signature">
+ <property-ref>portal.user.signature</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="interests">
+ <property-ref>portal.user.interests</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="icq">
+ <property-ref>portal.user.im.icq</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="aim">
+ <property-ref>portal.user.im.aim</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="msnm">
+ <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>
+ </ui-component>
+ <ui-component name="skype">
+ <property-ref>portal.user.im.skype</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="xmmp">
+ <property-ref>portal.user.im.xmmp</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="homepage">
+ <property-ref>portal.user.homepage</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="timezone">
+ <property-ref>portal.user.time-zone-offset</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="theme">
+ <property-ref>portal.user.theme</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="securityquestion">
+ <property-ref>portal.user.security.question</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="securityanswer">
+ <property-ref>portal.user.security.answer</property-ref>
+ <required>false</required>
+ </ui-component>
+
+ <!-- read only :) -->
+ <ui-component name="email">
+ <property-ref>user.business-info.online.email</property-ref>
+ <validators>
+ <validator>EmailValidator</validator>
+ </validators>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="locale">
+ <property-ref>portal.user.locale</property-ref>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="registrationdate">
+ <property-ref>portal.user.registration-date</property-ref>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="enabled">
+ <property-ref>portal.user.enabled</property-ref>
+ <required>true</required>
+ </ui-component>
+ <ui-component name="lastlogin">
+ <property-ref>portal.user.last-login-date</property-ref>
+ <required>false</required>
+ </ui-component>
+ </ui-components>
+</identity-ui-configuration>
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xsd 2007-08-30 17:58:41 UTC (rev 8110)
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ elementFormDefault="qualified">
+
+<xsd:element name="identity-ui-configuration">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+
+ <xsd:choice>
+ <!-- User portlet and user management portlet preferences -->
+ <xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
+ <xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
+ <xsd:element name="overwrite-workflow" type="xsd:boolean" default="false"/>
+ <xsd:element name="email-domain" minOccurs="1" maxOccurs="1" type="xsd:string" />
+ <xsd:element name="email-from" minOccurs="1" maxOccurs="1" type="xsd:string" />
+ <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"/>
+ </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:complexType>
+ </xsd:element>
+ <!-- end: user interface components -->
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
+<!-- restictions for subscription-modes -->
+
+<xsd:simpleType name="subscriptionMode">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="automatic" />
+ <xsd:enumeration value="jbp_identity_validation_workflow" />
+ <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:complexType name="defaultRoles">
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="validators">
+ <xsd:sequence>
+ <xsd:element name="validator" minOccurs="1" type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+</xsd:schema>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -30,7 +30,6 @@
<application>
<variable-resolver>org.jboss.portal.core.identity.ui.faces.PortletVariableResolver</variable-resolver>
<property-resolver>org.jboss.portal.core.identity.ui.faces.PortletDelegatingPropertyResolver</property-resolver>
-<!-- <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver> -->
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
@@ -43,15 +42,7 @@
<managed-bean-name>identityrolemgr</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityRoleBean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
- <!--
- defaultRole
- -->
<managed-property>
- <property-name>defaultRole</property-name>
- <value>User</value>
- </managed-property>
- <!-- -->
- <managed-property>
<property-name>roleModule</property-name>
<value>#{applicationScope.RoleModule}</value>
</managed-property>
@@ -100,6 +91,10 @@
<value>#{identityusermgr}</value>
</managed-property>
<managed-property>
+ <property-name>defaultRoles</property-name>
+ <value>#{applicationScope.IdentityUIConfigurationService.configuration.defaultRoles}</value>
+ </managed-property>
+ <managed-property>
<property-name>registrationService</property-name>
<value>#{applicationScope.RegistrationService}</value>
</managed-property>
@@ -156,14 +151,10 @@
<managed-bean-name>lostpasswordmgr</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.identity.ui.actions.LostPasswordAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
- <!--
- Characters used in the generated password
- -->
<managed-property>
- <property-name>passwordCharacters</property-name>
- <value>0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWyYzZ*#!+-/"</value>
+ <property-name>passwordCharacters</property-name>
+ <value>#{applicationScope.IdentityUIConfigurationService.configuration.passwordGenerationCharacters}</value>
</managed-property>
- <!-- -->
<managed-property>
<property-name>identityUserBean</property-name>
<value>#{identityusermgr}</value>
@@ -361,6 +352,10 @@
<from-outcome>revise</from-outcome>
<to-view-id>/WEB-INF/jsf/admin/register.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/WEB-INF/jsf/admin/roles.xhtml</from-view-id>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -73,6 +73,11 @@
<service-ref>:service=Module,type=Membership</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>
+ </service>
+ <service>
<service-name>IdentityMailService</service-name>
<service-class>org.jboss.portal.core.identity.services.IdentityMailService</service-class>
<service-ref>:service=IdentityMailService,type=Mail</service-ref>
@@ -80,11 +85,11 @@
<service>
<service-name>RegistrationService</service-name>
<service-class>org.jboss.portal.core.identity.services.workflow.RegistrationService</service-class>
- <service-ref>:service=RegistrationService,type=Workflow</service-ref>
+ <service-ref>:service=RegistrationService,type=IdentityUI</service-ref>
</service>
<service>
<service-name>ValidateEmailService</service-name>
<service-class>org.jboss.portal.core.identity.services.workflow.ValidateEmailService</service-class>
- <service-ref>:service=ValidateEmailService,type=Workflow</service-ref>
+ <service-ref>:service=ValidateEmailService,type=IdentityUI</service-ref>
</service>
</portlet-app>
\ No newline at end of file
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -10,11 +10,13 @@
<ui:define name="title"/>
<ui:define name="content">
+ <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>
<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"/>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -44,7 +44,9 @@
</h:dataTable>
</h:form>
- <p style="text-align: right"><h:commandLink value="Create new role" action="createRole"/></p>
+ <h:form>
+ <p style="text-align: right"><h:commandLink value="Create new role" action="createRole"/></p>
+ </h:form>
</ui:define>
</ui:composition>
</div>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/pendingUsers.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -10,6 +10,7 @@
<ui:define name="title">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">
@@ -54,7 +55,7 @@
</h:commandLink>
</h:column>
</h:dataTable>
-
+</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/registerConfirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerConfirm.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerConfirm.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -14,6 +14,7 @@
<ui:decorate template="/WEB-INF/jsf/common/confirm.xhtml">
<ui:param name="manager" value="#{userregistermgr}"/>
<ui:param name="show_roles" value="true"/>
+ <ui:param name="subscriptionMode" value="admin" />
</ui:decorate>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/searchUsers.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -13,19 +13,20 @@
</ui:define>
<ui:define name="content">
<h:form>
- <h:panelGrid columns="3">
+ <h:panelGrid columns="4">
<h:inputText id="searchString" value="#{useradministrationbean.searchString}" />
- <h:commandButton value="Search" action="#{useradministrationbean.searchUsers}" styleClass="portlet-form-button"/>
+ <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"/>
+ <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:message for="limit" />
</h:panelGrid>
</h:form>
<hr/>
-
+ <h:form>
<h:dataTable id="userlist" value="#{useradministrationbean.userList}" var="uiUser" rendered="#{useradministrationbean.userList.rowCount > 0}" rows="#{useradministrationbean.limit}" rowClasses="portlet-section-body,portlet-section-alternate" headerClass="portlet-section-header" width="100%">
<h:column>
<f:facet name="header">
@@ -74,10 +75,10 @@
</h:commandLink>
</h:column>
</h:dataTable>
-
-
+
<h:commandLink value=" < " action="#{useradministrationbean.prevPage}" rendered="#{useradministrationbean.page > 1}" styleClass="portlet-form-button"/>
<h:commandLink value=" > " action="#{useradministrationbean.nextPage}" rendered="#{useradministrationbean.userList.rowCount > useradministrationbean.limit}" styleClass="portlet-form-button"/>
+ </h:form>
<br/>
</ui:define>
</ui:composition>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -28,7 +28,7 @@
<h:messages />
<hr/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_EDIT}" action="revise" styleClass="portlet-form-button"/>
- <h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{manager.register}" styleClass="portlet-form-button"/>
+ <h:commandButton id="#{subscriptionMode}" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" actionListener="#{manager.register}" 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/register/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -12,6 +12,7 @@
<ui:define name="content">
<ui:decorate template="/WEB-INF/jsf/common/confirm.xhtml">
<ui:param name="manager" value="#{userregistermgr}"/>
+ <ui:param name="subscriptionMode" value="user" />
</ui:decorate>
</ui:define>
</ui:composition>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -12,7 +12,9 @@
#{bundle.IDENTITY_NOT_LOGGED_IN}
</ui:define>
<ui:define name="content">
+ <h:form>
<p><h:commandLink value="#{bundle.IDENTITY_CREATE_ACCOUNT}" action="register"/></p>
+ </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/register/registerTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -16,9 +16,12 @@
<li id="currentTab">
<h:outputText value="#{bundle.IDENTITY_REGISTER}"/>
</li>
+ <!-- check if we should enable lostPassword -->
+ <c:if test="#{portletPreferenceValue.lostPassword == true}">
<li>
<h:commandLink value="#{bundle.IDENTITY_LOST_PASSWORD}" action="lostPassword"/>
</li>
+ </c:if>
</ul>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/startTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/startTemplate.xhtml 2007-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/startTemplate.xhtml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -16,9 +16,12 @@
<li>
<h:commandLink value="#{bundle.IDENTITY_REGISTER}" action="register"/>
</li>
+ <!-- check if we should enable lostPassword -->
+ <c:if test="#{portletPreferenceValue.lostPassword == true}">
<li>
<h:commandLink value="#{bundle.IDENTITY_LOST_PASSWORD}" action="lostPassword"/>
</li>
+ </c:if>
</ul>
</h:form>
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-08-30 13:49:43 UTC (rev 8109)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-30 17:58:41 UTC (rev 8110)
@@ -37,15 +37,6 @@
<name>default-view</name>
<value>/WEB-INF/jsf/index.xhtml</value>
</init-param>
- <init-param>
- <description>Default role of registered users</description>
- <name>defaultRole</name>
- <value>User</value>
- </init-param>
- <init-param>
- <name>subscriptionMode</name>
- <value>test</value>
- </init-param>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
@@ -63,6 +54,14 @@
<preference>
<!-- Use captcha verification -->
<name>captcha</name>
+ <value>true</value>
+ </preference>
+ <preference>
+ <!--
+ Use lost password service
+ requires correct mail service configuration
+ -->
+ <name>lostPassword</name>
<value>false</value>
</preference>
</portlet-preferences>
@@ -77,15 +76,6 @@
<name>default-view</name>
<value>/WEB-INF/jsf/admin/index.xhtml</value>
</init-param>
- <init-param>
- <description>Default role of registered users</description>
- <name>defaultRole</name>
- <value>User</value>
- </init-param>
- <init-param>
- <name>subscriptionMode</name>
- <value>test</value>
- </init-param>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
16 years, 8 months
JBoss Portal SVN: r8109 - trunk/faces/src/main/org/jboss/portal/faces/component/portlet.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-30 09:49:43 -0400 (Thu, 30 Aug 2007)
New Revision: 8109
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
Log:
- Fixed build: seems like IDEA's create/apply patch doesn't work all that good... :(
Modified: trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-30 05:40:15 UTC (rev 8108)
+++ trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-30 13:49:43 UTC (rev 8109)
@@ -44,6 +44,10 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -423,7 +427,7 @@
String clientId = getClientId(faces);
String clientIdValue = (String)faces.getExternalContext().getRequestParameterMap().get(clientId);
- // We have been targetted
+ // We have been targeted
if ("jbp".equals(clientIdValue))
{
Map jsfParams = faces.getExternalContext().getRequestParameterValuesMap();
16 years, 8 months
JBoss Portal SVN: r8108 - in branches/UIServer: core and 6 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-08-30 01:40:15 -0400 (Thu, 30 Aug 2007)
New Revision: 8108
Added:
branches/UIServer/core/src/main/org/jboss/portal/core/processor/
branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java
branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java
branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java
Modified:
branches/UIServer/build/build.xml
branches/UIServer/core/build.xml
branches/UIServer/core/src/main/org/jboss/portal/core/theme/PageRendition.java
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/uiserver/build.xml
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
Log:
Prototype architecture for modeling the HTTP -> UIServer -> Core Portal interaction
Modified: branches/UIServer/build/build.xml
===================================================================
--- branches/UIServer/build/build.xml 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/build/build.xml 2007-08-30 05:40:15 UTC (rev 8108)
@@ -145,7 +145,7 @@
<group name="portal">
<include
- modules="common, test, api, web, jems, server, security, identity, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, uiserver, core, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
+ modules="common, test, api, web, jems, server, security, identity, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, core, uiserver, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
</group>
<group name="cms">
Modified: branches/UIServer/core/build.xml
===================================================================
--- branches/UIServer/core/build.xml 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/core/build.xml 2007-08-30 05:40:15 UTC (rev 8108)
@@ -133,7 +133,9 @@
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
+ <!--
<path refid="jboss.portal-uiserver.classpath"/>
+ -->
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -334,8 +336,7 @@
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
- <fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
- <fileset dir="${jboss.portal-uiserver.root}/lib" includes="portal-uiserver-lib.jar"/>
+ <fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${javassist.javassist.lib}" includes="javassist.jar"/>
@@ -382,6 +383,13 @@
<!-- Build the jboss-portal.sar -->
<target name="output" depends="artifacts">
+ <copy todir="${build.resources}/jboss-portal/lib">
+ <fileset dir="${jboss.portal-uiserver.root}/lib" includes="portal-uiserver-lib.jar"/>
+ </copy>
+ <copy todir="${build.resources}/jboss-portal.sar/lib">
+ <fileset dir="${jboss.portal-uiserver.root}/lib" includes="portal-uiserver-lib.jar"/>
+ </copy>
+
<!-- Build configurations -->
<copy todir="${build.resources}/jboss-portal.sar">
<fileset dir="${build.resources}/jboss-portal" excludes="**/*.xml"/>
@@ -731,11 +739,11 @@
<!--
Some convenience build targets to help deployment during development
-->
- <target name="deploy-explode" depends="output,explode">
+ <target name="deploy-explode" depends="output,explode">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy todir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar" overwrite="true">
+ <copy todir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar" overwrite="true">
<fileset dir="${build.lib}/jboss-portal-exploded.sar"/>
- </copy>
+ </copy>
</target>
<target name="explode-ha" depends="init">
<explode
Added: branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java 2007-08-30 05:40:15 UTC (rev 8108)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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.processor;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.server.RequestControllerDispatcher;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.RequestController;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class MainProcessor extends AbstractJBossService implements Processor
+{
+ /**
+ *
+ */
+ private RequestController temp = null;
+
+
+ /**
+ *
+ */
+ public void process(ProcessorRequest request) throws ServerException
+ {
+ try
+ {
+ //This should process the request sent in from the UIServer using whatever framework the core Portal implements
+ //Basically based on the information sent in by the ProcessorRequest this component should have all the information
+ //it needs to perform necessary action inside the Portal
+
+
+ //the Processor should use the values sent in the ProcessorRequest object to perform
+ //the appropriate action and then send its Response back to the UIServer which should process
+ //the Response and sent a Response back to the client
+
+
+ //For now, just for prototype sake just use the existing Controller to produce the outcome
+ System.out.println(request);
+ request.getServerInvocation().setHandler(new RequestControllerDispatcher(this.temp));
+ request.getServerInvocation().invokeNext();
+ }
+ catch(Exception e)
+ {
+ throw new ServerException(e);
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public RequestController getTemp()
+ {
+ return temp;
+ }
+
+ /**
+ *
+ * @param temp
+ */
+ public void setTemp(RequestController temp)
+ {
+ this.temp = temp;
+ }
+}
Added: branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java 2007-08-30 05:40:15 UTC (rev 8108)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.processor;
+
+import org.jboss.portal.server.ServerException;
+
+/**
+ * Processor is the service exposed by the Core Portal to the UIServer. UIServer calls the Processor to hand it
+ * processing of an incoming Portal Request using the protocol between the two components
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Processor
+{
+ public void process(ProcessorRequest request) throws ServerException;
+}
Added: branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java (rev 0)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java 2007-08-30 05:40:15 UTC (rev 8108)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.processor;
+
+import java.io.Serializable;
+
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.server.ServerInvocation;
+
+
+/**
+ * ProcessorRequest is used to communicate information from the UIServer to the core Portal for it to process the incoming Portal request.
+ *
+ * This object is part of the protocol between the UIServer and the core
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorRequest implements Serializable
+{
+ /**
+ * Target object where action needs to be performed
+ */
+ private PortalObject target = null;
+
+ /**
+ * The Portal that the target object belongs to
+ */
+ private Portal portal = null;
+
+ /**
+ * The Portal action to be performed. For now, action and render
+ */
+ private String actionType = null;
+
+
+ private ServerInvocation serverInvocation = null;
+
+ /**
+ *
+ *
+ */
+ public ProcessorRequest(String actionType, ServerInvocation serverInvocation, Portal portal, PortalObject target)
+ {
+ this.actionType = actionType;
+ this.serverInvocation = serverInvocation;
+ this.portal = portal;
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getActionType()
+ {
+ return actionType;
+ }
+
+ /**
+ *
+ * @param actionType
+ */
+ public void setActionType(String actionType)
+ {
+ this.actionType = actionType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Portal getPortal()
+ {
+ return portal;
+ }
+
+ /**
+ *
+ * @param portal
+ */
+ public void setPortal(Portal portal)
+ {
+ this.portal = portal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getTarget()
+ {
+ return target;
+ }
+
+ /**
+ *
+ * @param target
+ */
+ public void setTarget(PortalObject target)
+ {
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServerInvocation getServerInvocation()
+ {
+ return serverInvocation;
+ }
+
+ /**
+ *
+ * @param serverInvocation
+ */
+ public void setServerInvocation(ServerInvocation serverInvocation)
+ {
+ this.serverInvocation = serverInvocation;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[actionType="+this.actionType+", portal="+this.portal+", target="+this.target+"]");
+ return buffer.toString();
+ }
+}
Modified: branches/UIServer/core/src/main/org/jboss/portal/core/theme/PageRendition.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/theme/PageRendition.java 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/theme/PageRendition.java 2007-08-30 05:40:15 UTC (rev 8108)
@@ -43,7 +43,7 @@
import java.util.List;
import java.util.ArrayList;
-import org.jboss.portal.uiserver.service.UIServer;
+//import org.jboss.portal.uiserver.service.UIServer;
/**
* Should not be a controller response, but it comes from legacy design.
@@ -81,7 +81,6 @@
/** Performs the page rendition. */
public void render(MarkupInfo markupInfo, ServletContextDispatcher dispatcher) throws IOException, ServletException
{
- /*
// Compute correct content type response header
//String contentType = rendererContext.getContentType() + "; charset=" + rendererContext.getCharset();
String contentType = markupInfo.getContentType() + "; charset=" + markupInfo.getCharset();
@@ -107,8 +106,8 @@
{
e.printStackTrace();
}
- */
+ /*
//Prototyping with the new ui server delegated rendering
UIServer uiServer = new UIServer(); //This will actually be a jmx service...instead of instantiating the UiServer here
@@ -132,6 +131,7 @@
//Delegate Rendering to the UIServer
uiServer.render(new PrintWriter(dispatcher.getResponse().getOutputStream()), uiPageResult);
+ */
}
public PageResult getPageResult()
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-30 05:40:15 UTC (rev 8108)
@@ -1053,7 +1053,7 @@
<!-- The controller -->
<mbean
code="org.jboss.portal.core.controller.Controller"
- name="portal:service=Controller"
+ name="portal:service=Temp"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
@@ -1091,6 +1091,44 @@
optional-attribute-name="PageControlPolicy"
proxy-type="attribute">portal:service=ControlPolicy,type=Page</depends>
</mbean>
+ <mbean
+ code="org.jboss.portal.uiserver.service.UIServer"
+ name="portal:service=Controller"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalObjectContainer" proxy-type="attribute">portal:container=PortalObject</depends>
+ <depends optional-attribute-name="Processor" proxy-type="attribute">portal:service=Processor</depends>
+ <depends>portal:service=PageService</depends>
+ <depends>portal:commandFactory=DefaultPortal</depends>
+ <depends>portal:urlFactory=Delegating</depends>
+ <depends>portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends>portal:container=Instance</depends>
+ <depends>portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends>portal:service=CustomizationManager</depends>
+ <depends>portal:service=ContentProviderRegistry</depends>
+ <depends>portal:service=ResponseHandler,type=Selector</depends>
+ <depends>portal:service=ControlPolicy,type=Page</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.core.processor.MainProcessor"
+ name="portal:service=Processor"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Temp" proxy-type="attribute">portal:service=Temp</depends>
+ <depends>portal:container=PortalObject</depends>
+ <depends>portal:service=PageService</depends>
+ <depends>portal:commandFactory=DefaultPortal</depends>
+ <depends>portal:urlFactory=Delegating</depends>
+ <depends>portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends>portal:container=Instance</depends>
+ <depends>portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends>portal:service=CustomizationManager</depends>
+ <depends>portal:service=ContentProviderRegistry</depends>
+ <depends>portal:service=ResponseHandler,type=Selector</depends>
+ <depends>portal:service=ControlPolicy,type=Page</depends>
+ </mbean>
<!-- The controller factory -->
<mbean
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/uiserver/build.xml 2007-08-30 05:40:15 UTC (rev 8108)
@@ -102,6 +102,7 @@
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-web.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-08-30 00:19:03 UTC (rev 8107)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-08-30 05:40:15 UTC (rev 8108)
@@ -25,8 +25,14 @@
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
+import java.util.StringTokenizer;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.portal.uiserver.layout.Container;
import org.jboss.portal.uiserver.layout.Page;
import org.jboss.portal.uiserver.layout.Window;
@@ -39,6 +45,18 @@
import org.jboss.portal.uiserver.protocol.PageResult;
import org.jboss.portal.uiserver.protocol.WindowResult;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.ServerInvocation;
+
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalContainer;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.processor.Processor;
+import org.jboss.portal.core.processor.ProcessorRequest;
+
/**
* The UIServer is responsible for generating the output that is sent back to the client based on the Portal state of a particular Portal Request
*
@@ -49,18 +67,80 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class UIServer
+public class UIServer extends AbstractJBossService implements RequestController
{
/**
*
+ */
+ private PortalObjectContainer portalObjectContainer = null;
+
+ /**
+ *
+ */
+ private Processor processor = null;
+
+ /**
+ *
*
*/
public UIServer()
{
}
+
/**
+ * handle is the entry point for handling an incoming Portal request. The request is handed over
+ * from the Http Layer via the main Portal Servlet
+ *
+ */
+ public void handle(ServerInvocation invocation) throws ServerException
+ {
+ String portalRequestPath = invocation.getServerContext().getPortalRequestPath();
+ PortalContainer container = this.portalObjectContainer.getContext();
+
+ //Process the incoming request and produce a proper ProcessorRequest to be
+ //processed by the core Portal component
+ Portal portal = null;
+ PortalObject target = null;
+ String actionType = "render";
+ StringTokenizer st = new StringTokenizer(portalRequestPath, "/");
+ while(st.hasMoreTokens())
+ {
+ String token = st.nextToken();
+
+ if(portal == null)
+ {
+ portal = container.getPortal(token);
+ }
+ else
+ {
+ if(target == null)
+ {
+ target = portal.getChild(token);
+ }
+ else
+ {
+ target = target.getChild(token);
+ }
+ }
+ }
+
+ String actionParam = invocation.getServerContext().getClientRequest().getParameter("action");
+ if(actionParam != null && actionParam.trim().length()>0 && actionParam.equals("1"))
+ {
+ actionType = "action";
+ }
+
+ ProcessorRequest processorRequest = new ProcessorRequest(actionType, invocation, portal, target);
+ this.processor.process(processorRequest);
+ }
+
+ /**
+ * Based on the latest design discussion, this method is not needed.
*
+ * This will be an implementation detail of the UIServer processing the Response that is sent back to it
+ * from the Core Portal Processor
+ *
* @param clientConnection
* @param page
*/
@@ -106,9 +186,42 @@
//Sending the results back to the Client
clientConnection.write(buffer.toString());
clientConnection.flush();
+ }
+ //-----------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return this.portalObjectContainer;
}
+
+ /**
+ *
+ * @param portalObjectContainer
+ */
+ public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
-
+ /**
+ *
+ * @return
+ */
+ public Processor getProcessor()
+ {
+ return processor;
+ }
+
+ /**
+ *
+ * @param processor
+ */
+ public void setProcessor(Processor processor)
+ {
+ this.processor = processor;
+ }
//---------All these are just helper methods for the prototype-----------------------------------------------------------------------------------------------
//----It containts mostly hard coded logic for the prototype-------------------------------------------------------------------------------------------------
/**
@@ -290,5 +403,5 @@
layoutManager.addRegionConstraints(centerConstraints);
return new Object[]{page, layoutManager};
- }
+ }
}
16 years, 8 months
JBoss Portal SVN: r8107 - in trunk: core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-29 20:19:03 -0400 (Wed, 29 Aug 2007)
New Revision: 8107
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
Log:
- JBPORTAL-1656: Fixed NPE if the associated portlet doesn't exist when trying to delete a window.
- JBPORTAL-1657: Improvements to confirm deletion dialog: more explicit, doesn't select the object anymore when cancelling the operation.
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-30 00:12:25 UTC (rev 8106)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-30 00:19:03 UTC (rev 8107)
@@ -279,6 +279,31 @@
return Boolean.valueOf(object.getName().equals(portalObject.getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME)));
}
});
+ portalObjectDecorator.setProperty("typeName", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+
+ if (object != null)
+ {
+ switch (object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ return "context";
+ case PortalObject.TYPE_PORTAL:
+ return "portal";
+ case PortalObject.TYPE_PAGE:
+ return "page";
+ case PortalObject.TYPE_WINDOW:
+ return "window";
+ }
+ }
+
+ //to make it safe
+ return "none";
+ }
+ });
registerDecorator(PortalObject.class, portalObjectDecorator);
//
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-30 00:12:25 UTC (rev 8106)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-30 00:19:03 UTC (rev 8107)
@@ -29,6 +29,7 @@
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
@@ -195,7 +196,12 @@
{
if (selectedContentType != null)
{
- return ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ ContentProvider contentProvider = ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType);
+ // the content provider exists (i.e. the associated portlet is deployed see: JBPORTAL-1656)
+ if (contentProvider != null)
+ {
+ return contentProvider.getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ }
}
return null;
}
@@ -493,11 +499,17 @@
selectedPlugin = (String)pmap.get("plugin");
}
- public void selectParentObject()
+ public void selectParentObject(ActionEvent actionEvent)
{
+ PortalObject parent = getSelectedObjectParent();
+ selectObject(parent);
+ }
+
+ public PortalObject getSelectedObjectParent()
+ {
PortalObject current = getSelectedObject();
PortalObject parent = current.getParent();
- selectObject(parent);
+ return parent == null ? current : parent; // if parent is null, return the current object
}
public void selectRootObject(ActionEvent ae)
@@ -648,7 +660,7 @@
{
Window window = (Window)po;
window.getContent().setURI(uri);
- selectParentObject();
+ selectParentObject(event);
break;
}
}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-30 00:12:25 UTC (rev 8106)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-30 00:19:03 UTC (rev 8107)
@@ -6,26 +6,34 @@
xmlns:jbp="http://www.jboss.org/portal"
xmlns:c="http://java.sun.com/jstl/core"
class="admin-ui">
-
+
<ui:composition template="../objectTemplate.xhtml">
<ui:param name="portalObjectScreen" value="Delete"/>
<ui:define name="content">
-
-
- <p class="portlet-msg-alert">WARNING ! You are about to delete this element from the portal !</p>
- <p class="portlet-class">Are you sure ?</p>
-
- <h:form>
- <h:commandButton value="Yes" action="objects" actionListener="#{portalobjectmgr.destroyObject}" styleClass="portlet-form-button">
- <f:attribute name="objectId" value="#{portalobjectmgr.selectedObject.id}" />
- </h:commandButton>
- <h:commandButton value="No" action="objects" actionListener="objects" styleClass="portlet-form-button"/>
- </h:form>
-
- </ui:define>
+ <h3>Delete <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
+ <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <h:outputText value=" #{portalobjectmgr.selectedObject.name} "/>
+ <h:outputText value="#{portalobjectmgr.selectedObject.typeName}"/> from the
+ <h:outputText value=" #{portalobjectmgr.selectedObjectParent.name} "/>
+ <h:outputText value="#{portalobjectmgr.selectedObjectParent.typeName}"/>!</p>
+
+ <p class="portlet-class">Are you sure you want to delete this
+ <h:outputText value="#{portalobjectmgr.selectedObjectType}"/>?</p>
+
+ <h:form>
+ <h:commandButton value="Delete" action="objects" actionListener="#{portalobjectmgr.destroyObject}"
+ styleClass="portlet-form-button">
+ <f:attribute name="objectId" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandButton>
+ <h:commandButton value="Cancel" action="objects" actionListener="#{portalobjectmgr.selectParentObject}"
+ styleClass="portlet-form-button"/>
+ </h:form>
+
+ </ui:define>
+
</ui:composition>
-
-</div>
\ No newline at end of file
+
+</div>
Modified: trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-30 00:12:25 UTC (rev 8106)
+++ trunk/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-30 00:19:03 UTC (rev 8107)
@@ -22,55 +22,37 @@
******************************************************************************/
package org.jboss.portal.faces.component.portlet;
-import org.jboss.portal.portlet.impl.PortletRequestDecoder;
-import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.faces.util.ActionEventDispatcher;
-import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import javax.faces.component.UICommand;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.faces.el.ValueBinding;
import javax.faces.el.MethodBinding;
-import javax.faces.el.EvaluationException;
-import javax.faces.event.FacesEvent;
+import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import javax.faces.event.ActionListener;
-import javax.faces.event.ActionEvent;
import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.ArrayList;
/**
- * @todo:
- * - add validation of initial mode and window state against the supported values
- * - add validation of mode and window state on portlet events against the supported values
- * - add handling of non expected results from render and process action
- * - add handling when portlet does not exist (probably show the nested content of the tag as markup)
- *
- * @todo but less important:
- * - integrate user profile
- * - clean up the facelet portlet handler
- * - make a JSP tag
- *
- * @todo later:
- * - form rewriting so it can work in a JSF form
- *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
+ * @todo: - add validation of initial mode and window state against the supported values - add validation of mode and
+ * window state on portlet events against the supported values - add handling of non expected results from render and
+ * process action - add handling when portlet does not exist (probably show the nested content of the tag as markup)
+ * @todo but less important: - integrate user profile - clean up the facelet portlet handler - make a JSP tag
+ * @todo later: - form rewriting so it can work in a JSF form
*/
public class UIPortlet extends UICommand
{
@@ -145,7 +127,16 @@
ValueBinding vb = getValueBinding("portletId");
if (vb != null)
{
- return (String)vb.getValue(getFacesContext());
+ String id = (String)vb.getValue(getFacesContext());
+ if (id == null)
+ {
+ return null;
+ }
+ else
+ {
+ // getValue will return an empty string if the binding exists but is not bound
+ return "".equals(id) ? null : id;
+ }
}
//
@@ -437,7 +428,7 @@
{
Map jsfParams = faces.getExternalContext().getRequestParameterValuesMap();
Map portletParams = new HashMap();
- for (Iterator i = jsfParams.entrySet().iterator();i.hasNext();)
+ for (Iterator i = jsfParams.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String name = (String)entry.getKey();
@@ -528,74 +519,74 @@
"var isIE = /msie/i.test(navigator.userAgent);\n" +
- "function attachEvent(elm, eventName, eventHandler) {\n" +
- " if (isIE) {\n" +
- " elm.attachEvent(\"on\" + eventName, eventHandler);\n" +
- " } else {\n" +
- " elm.addEventListener(eventName, eventHandler, false);\n" +
- " }\n" +
- "}\n" +
+ "function attachEvent(elm, eventName, eventHandler) {\n" +
+ " if (isIE) {\n" +
+ " elm.attachEvent(\"on\" + eventName, eventHandler);\n" +
+ " } else {\n" +
+ " elm.addEventListener(eventName, eventHandler, false);\n" +
+ " }\n" +
+ "}\n" +
- "function getEventTarget(event) {\n" +
- " var targetElement = isIE ? event.srcElement : event.target;\n" +
- " while (targetElement.nodeType == 3 && targetElement.parentNode != null) {\n" +
- " targetElement = targetElement.parentNode;\n" +
- " }\n" +
- " return targetElement;\n" +
- "}\n" +
+ "function getEventTarget(event) {\n" +
+ " var targetElement = isIE ? event.srcElement : event.target;\n" +
+ " while (targetElement.nodeType == 3 && targetElement.parentNode != null) {\n" +
+ " targetElement = targetElement.parentNode;\n" +
+ " }\n" +
+ " return targetElement;\n" +
+ "}\n" +
- "\n" +
+ "\n" +
- "function PortletURL(url) {\n" +
- " this.params = new Object();\n" +
- " this.url = url;\n" +
- " this.setParameter = function(name, value) {;\n" +
- " this.params[name] = value;\n" +
- " return this;\n" +
- " }\n" +
- " this.renderURL = function() {;\n" +
- " var tmp = this.url;\n" +
- " for (var i in this.params) {\n" +
- " tmp = tmp + ('&' + i + '=' + this.params[i]);\n" +
- " };\n" +
- " return tmp;\n" +
- " }\n" +
+ "function PortletURL(url) {\n" +
+ " this.params = new Object();\n" +
+ " this.url = url;\n" +
+ " this.setParameter = function(name, value) {;\n" +
+ " this.params[name] = value;\n" +
+ " return this;\n" +
+ " }\n" +
+ " this.renderURL = function() {;\n" +
+ " var tmp = this.url;\n" +
+ " for (var i in this.params) {\n" +
+ " tmp = tmp + ('&' + i + '=' + this.params[i]);\n" +
+ " };\n" +
+ " return tmp;\n" +
+ " }\n" +
// Temporary hack for Sun RI which encodes contextual state on the page
- " var viewStateId = document.getElementById('javax.faces.ViewState')\n" +
- " if (viewStateId != null) {\n" +
- " this.params['javax.faces.ViewState'] = viewStateId.value\n" +
- " }\n" +
+ " var viewStateId = document.getElementById('javax.faces.ViewState')\n" +
+ " if (viewStateId != null) {\n" +
+ " this.params['javax.faces.ViewState'] = viewStateId.value\n" +
+ " }\n" +
- "}\n" +
+ "}\n" +
- "function fx(event) {\n" +
- " var target = getEventTarget(event);\n" +
- " if (target.nodeName == 'INPUT' && target.type == 'submit') {\n" +
- " var current = target.parentNode;\n" +
- " while (current.nodeName != 'FORM' && current.nodeName != 'BODY') {\n" +
- " current = current.parentNode;\n" +
- " }\n" +
- " if (current.nodeName == 'FORM') {\n" +
- " var action = current.action;\n" +
- " var portletURL = new PortletURL(action);\n" +
- " (function(url){" + onClick + "})(portletURL);\n" +
- " current.action = portletURL.renderURL();\n" +
- " } else {\n" +
- " // Really can't do nothing for now\n" +
- " }\n" +
- " }\n" +
- " else if (target.nodeName == 'A') {\n" +
- " var href = target.href;\n" +
- " var portletURL = new PortletURL(href);\n" +
- " (function(url){" + onClick + "})(portletURL);\n" +
- " target.href = portletURL.renderURL();\n" +
- " }\n" +
- " \n" +
- "}\n" +
+ "function fx(event) {\n" +
+ " var target = getEventTarget(event);\n" +
+ " if (target.nodeName == 'INPUT' && target.type == 'submit') {\n" +
+ " var current = target.parentNode;\n" +
+ " while (current.nodeName != 'FORM' && current.nodeName != 'BODY') {\n" +
+ " current = current.parentNode;\n" +
+ " }\n" +
+ " if (current.nodeName == 'FORM') {\n" +
+ " var action = current.action;\n" +
+ " var portletURL = new PortletURL(action);\n" +
+ " (function(url){" + onClick + "})(portletURL);\n" +
+ " current.action = portletURL.renderURL();\n" +
+ " } else {\n" +
+ " // Really can't do nothing for now\n" +
+ " }\n" +
+ " }\n" +
+ " else if (target.nodeName == 'A') {\n" +
+ " var href = target.href;\n" +
+ " var portletURL = new PortletURL(href);\n" +
+ " (function(url){" + onClick + "})(portletURL);\n" +
+ " target.href = portletURL.renderURL();\n" +
+ " }\n" +
+ " \n" +
+ "}\n" +
- "var elt = document.getElementById('bilto');\n" +
- "attachEvent(elt, 'click', fx);\n"
+ "var elt = document.getElementById('bilto');\n" +
+ "attachEvent(elt, 'click', fx);\n"
);
writer.endElement("script");
}
16 years, 8 months
JBoss Portal SVN: r8106 - in branches/JBoss_Portal_Branch_2_6: core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-29 20:12:25 -0400 (Wed, 29 Aug 2007)
New Revision: 8106
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
Log:
- JBPORTAL-1656: Fixed NPE if the associated portlet doesn't exist when trying to delete a window.
- JBPORTAL-1657: Improvements to confirm deletion dialog: more explicit, doesn't select the object anymore when cancelling the operation.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-29 20:52:19 UTC (rev 8105)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-30 00:12:25 UTC (rev 8106)
@@ -279,6 +279,31 @@
return Boolean.valueOf(object.getName().equals(portalObject.getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME)));
}
});
+ portalObjectDecorator.setProperty("typeName", new AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+
+ if (object != null)
+ {
+ switch (object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ return "context";
+ case PortalObject.TYPE_PORTAL:
+ return "portal";
+ case PortalObject.TYPE_PAGE:
+ return "page";
+ case PortalObject.TYPE_WINDOW:
+ return "window";
+ }
+ }
+
+ //to make it safe
+ return "none";
+ }
+ });
registerDecorator(PortalObject.class, portalObjectDecorator);
//
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-29 20:52:19 UTC (rev 8105)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-30 00:12:25 UTC (rev 8106)
@@ -29,6 +29,7 @@
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
@@ -195,7 +196,12 @@
{
if (selectedContentType != null)
{
- return ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ ContentProvider contentProvider = ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType);
+ // the content provider exists (i.e. the associated portlet is deployed see: JBPORTAL-1656)
+ if (contentProvider != null)
+ {
+ return contentProvider.getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ }
}
return null;
}
@@ -493,11 +499,17 @@
selectedPlugin = (String)pmap.get("plugin");
}
- public void selectParentObject()
+ public void selectParentObject(ActionEvent actionEvent)
{
+ PortalObject parent = getSelectedObjectParent();
+ selectObject(parent);
+ }
+
+ public PortalObject getSelectedObjectParent()
+ {
PortalObject current = getSelectedObject();
PortalObject parent = current.getParent();
- selectObject(parent);
+ return parent == null ? current : parent; // if parent is null, return the current object
}
public void selectRootObject(ActionEvent ae)
@@ -648,7 +660,7 @@
{
Window window = (Window)po;
window.getContent().setURI(uri);
- selectParentObject();
+ selectParentObject(event);
break;
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-29 20:52:19 UTC (rev 8105)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-30 00:12:25 UTC (rev 8106)
@@ -6,26 +6,34 @@
xmlns:jbp="http://www.jboss.org/portal"
xmlns:c="http://java.sun.com/jstl/core"
class="admin-ui">
-
+
<ui:composition template="../objectTemplate.xhtml">
<ui:param name="portalObjectScreen" value="Delete"/>
<ui:define name="content">
-
-
- <p class="portlet-msg-alert">WARNING ! You are about to delete this element from the portal !</p>
- <p class="portlet-class">Are you sure ?</p>
-
- <h:form>
- <h:commandButton value="Yes" action="objects" actionListener="#{portalobjectmgr.destroyObject}" styleClass="portlet-form-button">
- <f:attribute name="objectId" value="#{portalobjectmgr.selectedObject.id}" />
- </h:commandButton>
- <h:commandButton value="No" action="objects" actionListener="objects" styleClass="portlet-form-button"/>
- </h:form>
-
- </ui:define>
+ <h3>Delete <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
+ <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <h:outputText value=" #{portalobjectmgr.selectedObject.name} "/>
+ <h:outputText value="#{portalobjectmgr.selectedObject.typeName}"/> from the
+ <h:outputText value=" #{portalobjectmgr.selectedObjectParent.name} "/>
+ <h:outputText value="#{portalobjectmgr.selectedObjectParent.typeName}"/>!</p>
+
+ <p class="portlet-class">Are you sure you want to delete this
+ <h:outputText value="#{portalobjectmgr.selectedObjectType}"/>?</p>
+
+ <h:form>
+ <h:commandButton value="Delete" action="objects" actionListener="#{portalobjectmgr.destroyObject}"
+ styleClass="portlet-form-button">
+ <f:attribute name="objectId" value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandButton>
+ <h:commandButton value="Cancel" action="objects" actionListener="#{portalobjectmgr.selectParentObject}"
+ styleClass="portlet-form-button"/>
+ </h:form>
+
+ </ui:define>
+
</ui:composition>
-
+
</div>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-29 20:52:19 UTC (rev 8105)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/UIPortlet.java 2007-08-30 00:12:25 UTC (rev 8106)
@@ -22,55 +22,41 @@
******************************************************************************/
package org.jboss.portal.faces.component.portlet;
-import org.jboss.portal.portlet.impl.PortletRequestDecoder;
-import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.faces.util.ActionEventDispatcher;
-import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import javax.faces.component.UICommand;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.faces.el.ValueBinding;
import javax.faces.el.MethodBinding;
-import javax.faces.el.EvaluationException;
-import javax.faces.event.FacesEvent;
+import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import javax.faces.event.ActionListener;
-import javax.faces.event.ActionEvent;
import java.io.IOException;
-import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
-import java.util.ArrayList;
/**
- * @todo:
- * - add validation of initial mode and window state against the supported values
- * - add validation of mode and window state on portlet events against the supported values
- * - add handling of non expected results from render and process action
- * - add handling when portlet does not exist (probably show the nested content of the tag as markup)
- *
- * @todo but less important:
- * - integrate user profile
- * - clean up the facelet portlet handler
- * - make a JSP tag
- *
- * @todo later:
- * - form rewriting so it can work in a JSF form
- *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
+ * @todo: - add validation of initial mode and window state against the supported values - add validation of mode and
+ * window state on portlet events against the supported values - add handling of non expected results from render and
+ * process action - add handling when portlet does not exist (probably show the nested content of the tag as markup)
+ * @todo but less important: - integrate user profile - clean up the facelet portlet handler - make a JSP tag
+ * @todo later: - form rewriting so it can work in a JSF form
*/
public class UIPortlet extends UICommand
{
@@ -145,7 +131,16 @@
ValueBinding vb = getValueBinding("portletId");
if (vb != null)
{
- return (String)vb.getValue(getFacesContext());
+ String id = (String)vb.getValue(getFacesContext());
+ if (id == null)
+ {
+ return null;
+ }
+ else
+ {
+ // getValue will return an empty string if the binding exists but is not bound
+ return "".equals(id) ? null : id;
+ }
}
//
@@ -437,7 +432,7 @@
{
Map jsfParams = faces.getExternalContext().getRequestParameterValuesMap();
Map portletParams = new HashMap();
- for (Iterator i = jsfParams.entrySet().iterator();i.hasNext();)
+ for (Iterator i = jsfParams.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String name = (String)entry.getKey();
@@ -528,74 +523,74 @@
"var isIE = /msie/i.test(navigator.userAgent);\n" +
- "function attachEvent(elm, eventName, eventHandler) {\n" +
- " if (isIE) {\n" +
- " elm.attachEvent(\"on\" + eventName, eventHandler);\n" +
- " } else {\n" +
- " elm.addEventListener(eventName, eventHandler, false);\n" +
- " }\n" +
- "}\n" +
+ "function attachEvent(elm, eventName, eventHandler) {\n" +
+ " if (isIE) {\n" +
+ " elm.attachEvent(\"on\" + eventName, eventHandler);\n" +
+ " } else {\n" +
+ " elm.addEventListener(eventName, eventHandler, false);\n" +
+ " }\n" +
+ "}\n" +
- "function getEventTarget(event) {\n" +
- " var targetElement = isIE ? event.srcElement : event.target;\n" +
- " while (targetElement.nodeType == 3 && targetElement.parentNode != null) {\n" +
- " targetElement = targetElement.parentNode;\n" +
- " }\n" +
- " return targetElement;\n" +
- "}\n" +
+ "function getEventTarget(event) {\n" +
+ " var targetElement = isIE ? event.srcElement : event.target;\n" +
+ " while (targetElement.nodeType == 3 && targetElement.parentNode != null) {\n" +
+ " targetElement = targetElement.parentNode;\n" +
+ " }\n" +
+ " return targetElement;\n" +
+ "}\n" +
- "\n" +
+ "\n" +
- "function PortletURL(url) {\n" +
- " this.params = new Object();\n" +
- " this.url = url;\n" +
- " this.setParameter = function(name, value) {;\n" +
- " this.params[name] = value;\n" +
- " return this;\n" +
- " }\n" +
- " this.renderURL = function() {;\n" +
- " var tmp = this.url;\n" +
- " for (var i in this.params) {\n" +
- " tmp = tmp + ('&' + i + '=' + this.params[i]);\n" +
- " };\n" +
- " return tmp;\n" +
- " }\n" +
+ "function PortletURL(url) {\n" +
+ " this.params = new Object();\n" +
+ " this.url = url;\n" +
+ " this.setParameter = function(name, value) {;\n" +
+ " this.params[name] = value;\n" +
+ " return this;\n" +
+ " }\n" +
+ " this.renderURL = function() {;\n" +
+ " var tmp = this.url;\n" +
+ " for (var i in this.params) {\n" +
+ " tmp = tmp + ('&' + i + '=' + this.params[i]);\n" +
+ " };\n" +
+ " return tmp;\n" +
+ " }\n" +
// Temporary hack for Sun RI which encodes contextual state on the page
- " var viewStateId = document.getElementById('javax.faces.ViewState')\n" +
- " if (viewStateId != null) {\n" +
- " this.params['javax.faces.ViewState'] = viewStateId.value\n" +
- " }\n" +
+ " var viewStateId = document.getElementById('javax.faces.ViewState')\n" +
+ " if (viewStateId != null) {\n" +
+ " this.params['javax.faces.ViewState'] = viewStateId.value\n" +
+ " }\n" +
- "}\n" +
+ "}\n" +
- "function fx(event) {\n" +
- " var target = getEventTarget(event);\n" +
- " if (target.nodeName == 'INPUT' && target.type == 'submit') {\n" +
- " var current = target.parentNode;\n" +
- " while (current.nodeName != 'FORM' && current.nodeName != 'BODY') {\n" +
- " current = current.parentNode;\n" +
- " }\n" +
- " if (current.nodeName == 'FORM') {\n" +
- " var action = current.action;\n" +
- " var portletURL = new PortletURL(action);\n" +
- " (function(url){" + onClick + "})(portletURL);\n" +
- " current.action = portletURL.renderURL();\n" +
- " } else {\n" +
- " // Really can't do nothing for now\n" +
- " }\n" +
- " }\n" +
- " else if (target.nodeName == 'A') {\n" +
- " var href = target.href;\n" +
- " var portletURL = new PortletURL(href);\n" +
- " (function(url){" + onClick + "})(portletURL);\n" +
- " target.href = portletURL.renderURL();\n" +
- " }\n" +
- " \n" +
- "}\n" +
+ "function fx(event) {\n" +
+ " var target = getEventTarget(event);\n" +
+ " if (target.nodeName == 'INPUT' && target.type == 'submit') {\n" +
+ " var current = target.parentNode;\n" +
+ " while (current.nodeName != 'FORM' && current.nodeName != 'BODY') {\n" +
+ " current = current.parentNode;\n" +
+ " }\n" +
+ " if (current.nodeName == 'FORM') {\n" +
+ " var action = current.action;\n" +
+ " var portletURL = new PortletURL(action);\n" +
+ " (function(url){" + onClick + "})(portletURL);\n" +
+ " current.action = portletURL.renderURL();\n" +
+ " } else {\n" +
+ " // Really can't do nothing for now\n" +
+ " }\n" +
+ " }\n" +
+ " else if (target.nodeName == 'A') {\n" +
+ " var href = target.href;\n" +
+ " var portletURL = new PortletURL(href);\n" +
+ " (function(url){" + onClick + "})(portletURL);\n" +
+ " target.href = portletURL.renderURL();\n" +
+ " }\n" +
+ " \n" +
+ "}\n" +
- "var elt = document.getElementById('bilto');\n" +
- "attachEvent(elt, 'click', fx);\n"
+ "var elt = document.getElementById('bilto');\n" +
+ "attachEvent(elt, 'click', fx);\n"
);
writer.endElement("script");
}
16 years, 8 months
JBoss Portal SVN: r8105 - docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-29 16:52:19 -0400 (Wed, 29 Aug 2007)
New Revision: 8105
Added:
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces.png
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_sunri.png
Log:
Added package screenshots.
Added: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_myfaces.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_sunri.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_sunri.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 8 months
JBoss Portal SVN: r8104 - modules/web/trunk/web/src/main/org/jboss/portal/web.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-29 15:12:15 -0400 (Wed, 29 Aug 2007)
New Revision: 8104
Modified:
modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java
Log:
update web module to latest common
Modified: modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java 2007-08-29 18:01:43 UTC (rev 8103)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/RequestInfo.java 2007-08-29 19:12:15 UTC (rev 8104)
@@ -114,7 +114,7 @@
String queryString = req.getQueryString();
if (queryString != null)
{
- queryParameterMap = QueryStringParser.parseQueryString(queryString);
+ queryParameterMap = QueryStringParser.getInstance().parseQueryString(queryString);
}
//
16 years, 8 months
JBoss Portal SVN: r8103 - 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-08-29 14:01:43 -0400 (Wed, 29 Aug 2007)
New Revision: 8103
Modified:
trunk/core-admin/src/bin/portal-admin-war/style.css
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
Log:
- JBPORTAL-1652: Unified create forms.
Modified: trunk/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- trunk/core-admin/src/bin/portal-admin-war/style.css 2007-08-29 17:53:14 UTC (rev 8102)
+++ trunk/core-admin/src/bin/portal-admin-war/style.css 2007-08-29 18:01:43 UTC (rev 8103)
@@ -233,3 +233,8 @@
margin: 2px;
padding: 2px;
}
+
+.admin-ui .createObjectForm {
+ display: block;
+ padding: 1em 0 0 0;
+}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-29 17:53:14 UTC (rev 8102)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-29 18:01:43 UTC (rev 8103)
@@ -15,21 +15,14 @@
</h:commandLink>
</h:form>
- <!-- Sub page addition -->
- <div style="padding:1em 0 0 0">
- <table>
- <tr>
- <h:form id="portal_form">
- <td><span class="portlet-font">Create a portal:</span></td>
- <td><h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field"
- required="true"/></td>
- <td><h:commandButton action="#{portalAction.addPortal}" value="Add portal"
- styleClass="portlet-form-button"/></td>
- <td><h:message for="name" errorClass="portlet-msg-error"/></td>
- </h:form>
- </tr>
- </table>
- </div>
+ <!-- Portal addition -->
+ <h:form styleClass="createObjectForm">
+ <span class="portlet-font">Create a portal named: </span>
+ <h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{portalAction.addPortal}" value="Create portal" styleClass="portlet-form-button"/>
+ <h:message for="name" errorClass="portlet-msg-error"/>
+ </h:form>
<!-- Separation -->
<hr/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-29 17:53:14 UTC (rev 8102)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-29 18:01:43 UTC (rev 8103)
@@ -36,30 +36,14 @@
</h:form>
<!-- Sub page addition -->
- <div style="padding:1em 0 0 0">
- <table>
- <tr>
- <h:form>
- <td>
- <span class="portlet-font">Create a page:</span>
- </td>
- <td>
- <h:inputText id="pageName" value="#{addPageAction.pageName}"
- styleClass="portlet-form-input-field" required="true"/>
- </td>
- <td>
- <h:commandButton action="#{addPageAction.execute}" value="Add"
- styleClass="portlet-form-button"/>
- </td>
- <td>
- <h:message for="pageName" errorClass="portlet-msg-error"/>
- </td>
- </h:form>
- </tr>
- </table>
- </div>
+ <h:form styleClass="createObjectForm">
+ <span class="portlet-font">Create a page named: </span>
+ <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{addPageAction.execute}" value="Create page" styleClass="portlet-form-button"/>
+ <h:message for="pageName" errorClass="portlet-msg-error"/>
+ </h:form>
-
<!-- Separation -->
<hr/>
Modified: 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-08-29 17:53:14 UTC (rev 8102)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-08-29 18:01:43 UTC (rev 8103)
@@ -1,9 +1,9 @@
<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">
<br/>
<!-- Portlet details -->
@@ -17,10 +17,12 @@
<!-- Instance creation -->
<hr/>
- <h:form id="add_instance_form">
- <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:commandButton>
+ <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>
16 years, 8 months
JBoss Portal SVN: r8102 - 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-08-29 13:53:14 -0400 (Wed, 29 Aug 2007)
New Revision: 8102
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
Log:
- JBPORTAL-1652: Unified create forms.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-08-29 17:24:09 UTC (rev 8101)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-08-29 17:53:14 UTC (rev 8102)
@@ -233,3 +233,8 @@
margin: 2px;
padding: 2px;
}
+
+.admin-ui .createObjectForm {
+ display: block;
+ padding: 1em 0 0 0;
+}
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-29 17:24:09 UTC (rev 8101)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-29 17:53:14 UTC (rev 8102)
@@ -15,21 +15,14 @@
</h:commandLink>
</h:form>
- <!-- Sub page addition -->
- <div style="padding:1em 0 0 0">
- <table>
- <tr>
- <h:form id="portal_form">
- <td><span class="portlet-font">Create a portal:</span></td>
- <td><h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field"
- required="true"/></td>
- <td><h:commandButton action="#{portalAction.addPortal}" value="Add portal"
- styleClass="portlet-form-button"/></td>
- <td><h:message for="name" errorClass="portlet-msg-error"/></td>
- </h:form>
- </tr>
- </table>
- </div>
+ <!-- Portal addition -->
+ <h:form styleClass="createObjectForm">
+ <span class="portlet-font">Create a portal named: </span>
+ <h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{portalAction.addPortal}" value="Create portal" styleClass="portlet-form-button"/>
+ <h:message for="name" errorClass="portlet-msg-error"/>
+ </h:form>
<!-- Separation -->
<hr/>
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-29 17:24:09 UTC (rev 8101)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-29 17:53:14 UTC (rev 8102)
@@ -36,30 +36,14 @@
</h:form>
<!-- Sub page addition -->
- <div style="padding:1em 0 0 0">
- <table>
- <tr>
- <h:form>
- <td>
- <span class="portlet-font">Create a page:</span>
- </td>
- <td>
- <h:inputText id="pageName" value="#{addPageAction.pageName}"
- styleClass="portlet-form-input-field" required="true"/>
- </td>
- <td>
- <h:commandButton action="#{addPageAction.execute}" value="Add"
- styleClass="portlet-form-button"/>
- </td>
- <td>
- <h:message for="pageName" errorClass="portlet-msg-error"/>
- </td>
- </h:form>
- </tr>
- </table>
- </div>
+ <h:form styleClass="createObjectForm">
+ <span class="portlet-font">Create a page named: </span>
+ <h:inputText id="pageName" value="#{addPageAction.pageName}" styleClass="portlet-form-input-field"
+ required="true"/>
+ <h:commandButton action="#{addPageAction.execute}" value="Create page" styleClass="portlet-form-button"/>
+ <h:message for="pageName" errorClass="portlet-msg-error"/>
+ </h:form>
-
<!-- Separation -->
<hr/>
Modified: 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-08-29 17:24:09 UTC (rev 8101)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-08-29 17:53:14 UTC (rev 8102)
@@ -1,9 +1,9 @@
<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">
<br/>
<!-- Portlet details -->
@@ -17,10 +17,12 @@
<!-- Instance creation -->
<hr/>
- <h:form id="add_instance_form">
- <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:commandButton>
+ <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>
16 years, 8 months