JBoss Portal SVN: r8134 - in modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata: service and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-03 03:55:13 -0400 (Mon, 03 Sep 2007)
New Revision: 8134
Modified:
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/config/ModuleMetaData.java
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/service/ModuleServicesMetaData.java
Log:
JBPORTAL-1672: IdentityServiceControllerImpl.java : error message enhancement
Modified: modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/config/ModuleMetaData.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/config/ModuleMetaData.java 2007-09-03 07:36:51 UTC (rev 8133)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/config/ModuleMetaData.java 2007-09-03 07:55:13 UTC (rev 8134)
@@ -89,4 +89,10 @@
{
this.config = config;
}
+
+ public String toString()
+ {
+ return "ModuleMetaData[type=" + type + ", implementation= " + implementation +
+ ", serviceName=" + serviceName + ", className=" + className + "config=" + config + "]";
+ }
}
Modified: modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/service/ModuleServicesMetaData.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/service/ModuleServicesMetaData.java 2007-09-03 07:36:51 UTC (rev 8133)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/identity/metadata/service/ModuleServicesMetaData.java 2007-09-03 07:55:13 UTC (rev 8134)
@@ -22,6 +22,7 @@
package org.jboss.portal.identity.metadata.service;
+import org.jboss.logging.Logger;
import org.jboss.portal.identity.metadata.config.ModulesMetaData;
import org.jboss.portal.identity.metadata.config.ModuleMetaData;
import org.jboss.portal.identity.metadata.config.IdentityMetadataProcessor;
@@ -40,9 +41,12 @@
*/
public class ModuleServicesMetaData
{
+ /** . */
private List modulesList = new LinkedList();
+
+ /** . */
+ private Logger logger = Logger.getLogger(ModuleServicesMetaData.class);
-
public ModuleServicesMetaData(ModulesMetaData defaultModulesMetaData, ModulesMetaData modulesMetaData) throws Exception
{
//Map[implementation] --> Map[Type] --> ModuleMetaData
@@ -63,6 +67,8 @@
module.getServiceName() == null ||
module.getConfig() == null)
{
+
+ logger.error("Default module configuration isn't complete" + module);
throw new IdentityException("Default module configuration must be complete");
}
@@ -89,42 +95,37 @@
}
//process modules for instantiation
- for (Iterator iterator = modulesMetaData.getModules().iterator(); iterator.hasNext();)
- {
+ for (Iterator iterator = modulesMetaData.getModules().iterator(); iterator.hasNext();)
+ {
- ModuleMetaData module = (ModuleMetaData)iterator.next();
- //log.info("Processing module: " + module.getType() + "/" + module.getImplementation());// + "/" + module.getClassName());
+ ModuleMetaData module = (ModuleMetaData) iterator.next();
+ //log.info("Processing module: " + module.getType() + "/" + module.getImplementation());// + "/" + module.getClassName());
- IdentityMetadataProcessor.updateModuleWithDefaults(module, defaultImplementations);
+ IdentityMetadataProcessor.updateModuleWithDefaults(module, defaultImplementations);
- //generate initial options
- Map configOptions = module.getConfig().getOptions();
- Map optionMap = new HashMap();
- for (Iterator iterator1 = configOptions.keySet().iterator(); iterator1.hasNext();)
- {
- String optionName = (String)iterator1.next();
- ConfigOptionMetaData option = (ConfigOptionMetaData)configOptions.get(optionName);
- optionMap.put(optionName, option.getValue());
- }
+ //generate initial options
+ Map configOptions = module.getConfig().getOptions();
+ Map optionMap = new HashMap();
+ for (Iterator iterator1 = configOptions.keySet().iterator(); iterator1.hasNext();)
+ {
+ String optionName = (String) iterator1.next();
+ ConfigOptionMetaData option = (ConfigOptionMetaData) configOptions.get(optionName);
+ optionMap.put(optionName, option.getValue());
+ }
+ //instantiate the module
+ //IdentityModuleService moduleService = null;
+ if (module.getClassName() == null)
+ {
+ throw new IdentityException("No classname defined for module type: " + module.getType()
+ + ". Wrong configuration.");
+ }
+ modulesList.add(new ModuleServiceMetaData(module, optionMap));
+ }
- //instantiate the module
- //IdentityModuleService moduleService = null;
-
-
- if (module.getClassName() == null)
- {
- throw new IdentityException("Class name not found for module type: " + module.getType() + " wrong configuration");
- }
-
- modulesList.add(new ModuleServiceMetaData(module, optionMap));
-
-
- }
-
}
16 years, 8 months
JBoss Portal SVN: r8133 - in modules/identity/trunk: .settings and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-03 03:36:51 -0400 (Mon, 03 Sep 2007)
New Revision: 8133
Added:
modules/identity/trunk/.classpath
modules/identity/trunk/.project
modules/identity/trunk/.settings/
modules/identity/trunk/.settings/org.eclipse.jdt.core.prefs
Log:
Eclipse files
Added: modules/identity/trunk/.classpath
===================================================================
--- modules/identity/trunk/.classpath (rev 0)
+++ modules/identity/trunk/.classpath 2007-09-03 07:36:51 UTC (rev 8133)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="identity/src/main"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jbosssx.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-j2ee.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/hibernate/lib/hibernate3.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/test/lib/portal-test-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/sun-opends/lib/OpenDS.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: modules/identity/trunk/.project
===================================================================
--- modules/identity/trunk/.project (rev 0)
+++ modules/identity/trunk/.project 2007-09-03 07:36:51 UTC (rev 8133)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>identity-module</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: modules/identity/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- modules/identity/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ modules/identity/trunk/.settings/org.eclipse.jdt.core.prefs 2007-09-03 07:36:51 UTC (rev 8133)
@@ -0,0 +1,12 @@
+#Mon Sep 03 09:25:29 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
16 years, 8 months
JBoss Portal SVN: r8132 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-03 03:17:27 -0400 (Mon, 03 Sep 2007)
New Revision: 8132
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
Log:
JBPORTAL-1311: Renaming a page should be possible in the dashboard and management portlet
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-08-31 21:41:00 UTC (rev 8131)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-09-03 07:17:27 UTC (rev 8132)
@@ -28,8 +28,11 @@
import javax.faces.context.FacesContext;
import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.dashboard.DashboardBean;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PageContainer;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPath;
@@ -43,10 +46,12 @@
{
private String newName;
- /** . */
- private PortalObjectManagerBean portalObjectManager;
+ /** The page container that will create the child. */
+ public PageContainer pageContainer;
private DomainConfigurator domainConfigurator;
+
+ public Object bean;
public void setNewName(String newName)
{
@@ -55,6 +60,10 @@
public String getNewName()
{
+ if (newName == null)
+ {
+ newName = pageContainer.getName();
+ }
return newName;
}
@@ -68,39 +77,40 @@
{
this.domainConfigurator = domainConfigurator;
}
- public PortalObjectManagerBean getPortalObjectManager()
+
+ public PageContainer getPageContainer()
{
- return portalObjectManager;
+ return pageContainer;
}
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
+ public void setPageContainer(PageContainer pageContainer)
{
- this.portalObjectManager = portalObjectManager;
+ this.pageContainer = pageContainer;
}
public String execute()
{
- PortalObject portalObject = (PortalObject)portalObjectManager.getSelectedObject();
- PortalObject parent = portalObject.getParent();
+ PortalObject parent = pageContainer.getParent();
+ PortalObject newObject = null;
try
{
// TODO: Should be in a tx
// Clone portal object
- PortalObject newObject = portalObject.copy(parent, newName, true);
+ newObject = pageContainer.copy(parent, newName, true);
// Copy security settings
- Set set = domainConfigurator.getSecurityBindings(portalObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT));
+ Set set = domainConfigurator.getSecurityBindings(pageContainer.getId().toString(PortalObjectPath.CANONICAL_FORMAT));
domainConfigurator.setSecurityBindings(newObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT), set);
String defaultObject = (String)parent.getDeclaredProperties().get(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
- if (portalObject.getName().equals(defaultObject))
+ if (pageContainer.getName().equals(defaultObject))
{
parent.setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, newName);
}
// Destroy previous object
- parent.destroyChild(portalObject.getName());
+ parent.destroyChild(pageContainer.getName());
}
catch (IllegalArgumentException e)
{
@@ -116,8 +126,19 @@
{
e.printStackTrace();
}
- portalObjectManager.selectObject(parent);
- return "objects";
+
+ // TODO: This is not clean
+ if (bean instanceof PortalObjectManagerBean)
+ {
+ ((PortalObjectManagerBean)bean).selectObject(parent);
+ return "objects";
+ }
+ else if (bean instanceof DashboardBean)
+ {
+ ((DashboardBean)bean).selectedPageName = newObject.getName();
+ }
+
+ return null;
}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-08-31 21:41:00 UTC (rev 8131)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-09-03 07:17:27 UTC (rev 8132)
@@ -288,15 +288,37 @@
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
- <property-name>portalObjectManager</property-name>
- <value>#{sessionScope.portalobjectmgr}</value>
+ <property-name>pageContainer</property-name>
+ <value>#{portalobjectmgr.selectedObject}</value>
</managed-property>
<managed-property>
+ <property-name>bean</property-name>
+ <value>#{portalobjectmgr}</value>
+ </managed-property>
+ <managed-property>
<property-name>domainConfigurator</property-name>
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
</managed-property>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>renameDashboardPageAction</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>pageContainer</property-name>
+ <value>#{dashboard.selectedPage}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>bean</property-name>
+ <value>#{dashboard}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>domainConfigurator</property-name>
+ <value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
+ </managed-property>
+ </managed-bean>
+
<!-- Constants -->
<managed-bean>
<managed-bean-name>PortalObject</managed-bean-name>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-08-31 21:41:00 UTC (rev 8131)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-09-03 07:17:27 UTC (rev 8132)
@@ -12,7 +12,7 @@
<table width="100%">
<tr>
- <th colspan="2" class="portlet-section-header" align="center">Personal Dashboard Editor</th>
+ <th class="portlet-section-header" align="center">Personal Dashboard Editor</th>
</tr>
<tr>
<td class="portlet-section-body" align="center">
@@ -31,6 +31,18 @@
</h:form>
</td>
</tr>
+ <tr>
+ <td align="left" valign="top"><b>Rename this Page:</b><br/>New page name: 
+ <h:form id="renameForm" style="padding:0;margin:0">
+ <h:message for="newName"/>
+ <h:inputText id="newName" value="#{renameDashboardPageAction.newName}"
+ styleClass="portlet-form-input-field"/>
+ <h:commandButton value="Rename"
+ action="#{renameDashboardPageAction.execute}"
+ styleClass="portlet-form-button"/>
+ </h:form>
+ </td>
+ </tr>
</table>
</td>
<td align="left" valign="top">
@@ -38,28 +50,29 @@
You can control the page titles, column layouts, page themes,
and add,
order, or remove portlets.
- </td>
+ </td>
</tr>
</table>
</td>
</tr>
<tr>
- <th colspan="2" class="portlet-section-header" align="center">Currently editing page #{dashboard.selectedPage.name}</th>
+ <td class="portlet-section-header" align="center">Currently editing page #{dashboard.selectedPage.name}</td>
</tr>
<tr>
<td class="portlet-section-body" align="center">
<h:form id="page_selector_form" style="padding:0;margin:0">
Select: <h:selectOneMenu
- id="pageNameSelector"
- value="#{dashboard.selectedPageName}"
- styleClass="portlet-form-field"
- onchange="document.getElementById('page_selector_form').submit()">
- <f:selectItems value="#{dashboard.pageItems}"/>
+ id="pageNameSelector"
+ value="#{dashboard.selectedPageName}"
+ styleClass="portlet-form-field"
+ onchange="document.getElementById('page_selector_form').submit()">
+ <f:selectItems value="#{dashboard.pageItems}"/>
</h:selectOneMenu>
</h:form>
<br/>
</td>
</tr>
+
<tr>
<td>
<table width="100%">
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-08-31 21:41:00 UTC (rev 8131)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-09-03 07:17:27 UTC (rev 8132)
@@ -10,7 +10,6 @@
<h3>Rename #{portalobjectmgr.selectedObjectType}</h3>
<h:form id="renameForm">
<h:message for="newName"/>
-
<p>Rename the <span class="objectName">#{portalobjectmgr.selectedObject.name}</span>
#{portalobjectmgr.selectedObjectType} to:
<h:inputText id="newName" value="#{renameAction.newName}"/>
16 years, 8 months