Author: chris.laprun(a)jboss.com
Date: 2010-01-21 22:05:14 -0500 (Thu, 21 Jan 2010)
New Revision: 1412
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationDescriptionValueRenderer.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_en.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_fr.properties
Modified:
portal/trunk/pom.xml
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerOverview.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpRegistrationDetails.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/ConfigurationManager.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/config/Component.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java
Log:
- Updated to Beta06 of WSRP.
- Started implementing registration of aspects of Consumer configuration.
- Added UIRegistrationPropertiesGrid to deal with registration properties.
- Started trying to use standard templates instead of custom ones.
- Added LocalizedString and RegistrationPropertyDescription renderers.
- Added default renderer for Strings.
- Started adding localization, though, for some reason, it's not currently working.
- Make ConfigurationManager use empty lists instead of creating one when there's no
associated configuration.
- Make Component use Lists instead of ArrayLists.
- Make UIComponent use a default lifecycle if there is no configuration for process*
methods and log that detail instead of just failing with an NPE.
- Removed getName overriden method in UIGrid since it was using a field that was never
set.
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-01-21 23:12:55 UTC (rev 1411)
+++ portal/trunk/pom.xml 2010-01-22 03:05:14 UTC (rev 1412)
@@ -19,7 +19,8 @@
-->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -47,7 +48,7 @@
<org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-CR02</org.gatein.pc.version>
<org.picketlink.idm>1.1.0.Beta2</org.picketlink.idm>
- <org.gatein.wsrp.version>1.0.0-Beta05</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>1.0.0-Beta06</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta14</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
@@ -558,11 +559,12 @@
<phase>compile</phase>
<configuration>
<tasks>
- <copy failonerror="false"
todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
+ <copy failonerror="false"
+
todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
<fileset
dir="${basedir}/src/main/webapp/WEB-INF/classes">
- <include name="**/*_en.properties" />
+ <include name="**/*_en.properties"/>
</fileset>
- <globmapper from="*_en.properties"
to="*.properties" />
+ <globmapper from="*_en.properties"
to="*.properties"/>
</copy>
</tasks>
</configuration>
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccessImpl;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UIPageIterator;
+import org.exoplatform.webui.form.UIFormGrid;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@ComponentConfig(template = "system:/groovy/webui/core/UIGrid.gtmpl")
+public class UIRegistrationPropertiesGrid extends UIFormGrid
+{
+ private static final String NAME = "name";
+ static String[] FIELDS = {NAME, "description", "status",
"value"};
+ static String[] PROPERTIES_ACTIONS = {"EditProperty",
"DeleteProperty"};
+
+ public UIRegistrationPropertiesGrid() throws Exception
+ {
+ super();
+
+ //configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
+ configure(NAME, FIELDS, PROPERTIES_ACTIONS);
+ UIPageIterator pageIterator = getUIPageIterator();
+ pageIterator.setRendered(false);
+ }
+
+ public void resetProps(List<RegistrationProperty> props)
+ {
+ ListAccessImpl<RegistrationProperty> listAccess;
+ if (ParameterValidation.existsAndIsNotEmpty(props))
+ {
+ setRendered(true);
+ }
+ else
+ {
+ props = Collections.emptyList();
+ setRendered(false);
+ }
+ listAccess = new
ListAccessImpl<RegistrationProperty>(RegistrationProperty.class, props);
+ getUIPageIterator().setPageList(new
LazyPageList<RegistrationProperty>(listAccess, 10));
+ }
+}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -26,8 +26,13 @@
import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.webui.core.UITabPane;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.renderers.ValueRendererRegistry;
import org.exoplatform.wsrp.webui.component.consumer.UIWsrpConsumerOverview;
import org.exoplatform.wsrp.webui.component.producer.UIWsrpProducerOverview;
+import org.exoplatform.wsrp.webui.component.renderers.LocalizedStringValueRenderer;
+import
org.exoplatform.wsrp.webui.component.renderers.RegistrationDescriptionValueRenderer;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
/** @author Wesley Hales */
@ComponentConfig(
@@ -35,6 +40,13 @@
)
public class UIWsrpPortlet extends UIPortletApplication
{
+ static
+ {
+ // register value renderers
+ ValueRendererRegistry.registerDefaultRendererFor(new
RegistrationDescriptionValueRenderer(), RegistrationPropertyDescription.class);
+ ValueRendererRegistry.registerDefaultRendererFor(new
LocalizedStringValueRenderer(), LocalizedString.class);
+ }
+
public UIWsrpPortlet() throws Exception
{
UITabPane uiTabPane = addChild(UITabPane.class, null, null);
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -40,38 +40,56 @@
import org.exoplatform.webui.form.UIFormInputBase;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.wsrp.webui.component.UIRegistrationPropertiesGrid;
import org.gatein.common.util.ParameterValidation;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.ConsumerException;
import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.services.ManageableServiceFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+
/** @author Wesley Hales */
-@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
- @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class)})
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIForm.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class)
+ })
public class UIWsrpConsumerEditor extends UIForm
{
- protected static final String CONSUMER_NAME = "Consumer name: ";
- protected static final String CACHE_EXPIRATION = "Seconds before cache
expiration: ";
- protected static final String TIMEOUT = "Milliseconds before timeout: ";
- protected static final String WSDL_URL = "WSDL URL: ";
private UIFormInputBase<String> consumerName;
private UIFormStringInput cache;
private UIFormStringInput timeoutWS;
private UIFormStringInput wsdl;
+ private UIRegistrationPropertiesGrid localRegistration;
+ private UIRegistrationPropertiesGrid expectedRegistration;
+ private static final String[] ACTIONS = new String[]{"Save"};
public UIWsrpConsumerEditor() throws Exception
{
-
- consumerName = new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME,
null).addValidator(MandatoryValidator.class);
+ consumerName = new UIFormStringInput("name",
null).addValidator(MandatoryValidator.class);
addUIFormInput(consumerName);
- cache = new UIFormStringInput(CACHE_EXPIRATION, CACHE_EXPIRATION, null);
+ cache = new UIFormStringInput("cache", null);
addUIFormInput(cache);
- timeoutWS = new UIFormStringInput(TIMEOUT, TIMEOUT, null);
+ timeoutWS = new UIFormStringInput("timeout", null);
addUIFormInput(timeoutWS);
- wsdl = new UIFormStringInput(WSDL_URL, WSDL_URL, null);
+ wsdl = new UIFormStringInput("wsdl", null);
addUIFormInput(wsdl);
+
+ // registration properties
+ localRegistration = addChild(UIRegistrationPropertiesGrid.class, null,
"local");
+ localRegistration.setRendered(false);
+
+ expectedRegistration = addChild(UIRegistrationPropertiesGrid.class, null,
"expected");
+ expectedRegistration.setRendered(false);
+
+ // actions
+ setActions(ACTIONS);
}
private String getConsumerName()
@@ -134,6 +152,24 @@
cache.setValue(producerInfo.getExpirationCacheSeconds().toString());
timeoutWS.setValue("" +
producerInfo.getEndpointConfigurationInfo().getWSOperationTimeOut());
wsdl.setValue(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
+
+ RegistrationInfo local = producerInfo.getRegistrationInfo();
+ Collection<RegistrationProperty> regProps =
local.getRegistrationProperties().values();
+ ArrayList<RegistrationProperty> regPropsList = new
ArrayList<RegistrationProperty>(regProps);
+ localRegistration.resetProps(regPropsList);
+
+ RegistrationInfo expected = producerInfo.getExpectedRegistrationInfo();
+ if (local != expected && expected != null)
+ {
+ regProps = expected.getRegistrationProperties().values();
+ regPropsList = new ArrayList<RegistrationProperty>(regProps);
+ expectedRegistration.resetProps(regPropsList);
+ }
+ else
+ {
+ expectedRegistration.setRendered(false);
+ }
+
setNewConsumer(false);
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerOverview.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerOverview.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerOverview.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -83,8 +83,8 @@
//setSelectedTab(1);
consumerEditorPopup = addChild(UIPopupWindow.class, null, null);
- consumerEditorPopup.setWindowSize(450, 0);
- UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class,
null, "Consumer Editor");
+ consumerEditorPopup.setWindowSize(800, 0);
+ UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class,
null, "ConsumerEditor");
consumerEditorPopup.setUIComponent(consumerForm);
consumerEditorPopup.setRendered(false);
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpRegistrationDetails.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpRegistrationDetails.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpRegistrationDetails.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -30,14 +30,12 @@
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIGrid;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
-import org.exoplatform.webui.core.renderers.ValueRenderer;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
@@ -48,7 +46,6 @@
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
-import org.gatein.wsrp.registration.LocalizedString;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
import javax.xml.namespace.QName;
@@ -65,16 +62,13 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-@ComponentConfigs({
- @ComponentConfig(id = UIWsrpRegistrationDetails.REGISTRATION_PROPERTIES, type =
UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
- @ComponentConfig(
- lifecycle = UIContainerLifecycle.class,
- events = {
- @EventConfig(listeners =
UIWsrpRegistrationDetails.AddPropertyActionListener.class),
- @EventConfig(listeners =
UIWsrpRegistrationDetails.EditPropertyActionListener.class),
- @EventConfig(listeners =
UIWsrpRegistrationDetails.DeletePropertyActionListener.class)
- })
-})
+@ComponentConfig(
+ lifecycle = UIContainerLifecycle.class,
+ events = {
+ @EventConfig(listeners =
UIWsrpRegistrationDetails.AddPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpRegistrationDetails.EditPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpRegistrationDetails.DeletePropertyActionListener.class)
+ })
public class UIWsrpRegistrationDetails extends UIFormInputSet
{
private UIFormInputBase<String> policy;
@@ -102,24 +96,12 @@
addUIFormInput(validator);
// registration properties
- registrationProperties = addChild(UIGrid.class, REGISTRATION_PROPERTIES,
REGISTRATION_PROPERTIES);
+ registrationProperties = addChild(UIGrid.class, null, REGISTRATION_PROPERTIES);
- // add renderer for LocalizedString
- ValueRenderer<LocalizedString> renderer = new
ValueRenderer<LocalizedString>()
- {
- @Override
- public String render(LocalizedString value)
- {
- return value.getValue();
- }
- };
- registrationProperties.registerRendererFor(renderer, LocalizedString.class);
-
//configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
registrationProperties.configure(NAME, FIELDS, PROPERTIES_ACTIONS);
registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
registrationProperties.getUIPageIterator().setRendered(false);
- addChild(registrationProperties.getUIPageIterator());
init(getService().getConfiguration().getRegistrationRequirements());
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.exoplatform.wsrp.webui.component.renderers;
+
+import org.exoplatform.webui.core.renderers.ValueRenderer;
+import org.gatein.wsrp.registration.LocalizedString;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("unused")
+public class LocalizedStringValueRenderer extends ValueRenderer<LocalizedString>
+{
+ @Override
+ public String render(LocalizedString value)
+ {
+ return value.getValue();
+ }
+}
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationDescriptionValueRenderer.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationDescriptionValueRenderer.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationDescriptionValueRenderer.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.exoplatform.wsrp.webui.component.renderers;
+
+import org.exoplatform.webui.core.renderers.ValueRenderer;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("unused")
+public class RegistrationDescriptionValueRenderer extends
ValueRenderer<RegistrationPropertyDescription>
+{
+ @Override
+ public String render(RegistrationPropertyDescription value)
+ {
+ LocalizedString description = value.getDescription();
+ if (description != null)
+ {
+ return description.getValue();
+ }
+ else
+ {
+ return ValueRenderer.EMPTY;
+ }
+ }
+}
Added:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_en.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_en.properties
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_en.properties 2010-01-22
03:05:14 UTC (rev 1412)
@@ -0,0 +1,29 @@
+#
+# JBoss, a division of Red Hat
+# Copyright 2010, 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.
+#
+ConsumerEditor.label.name = Consumer name:
+ConsumerEditor.label.cache = Seconds before cache expiration:
+ConsumerEditor.label.timeout = Milliseconds before timeout:
+ConsumerEditor.label.wsdl = WSDL URL:
+ConsumerEditor.label.local = Local registration properties:
+ConsumerEditor.label.expected = Expected registration properties:
+
Added:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_fr.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_fr.properties
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_fr.properties 2010-01-22
03:05:14 UTC (rev 1412)
@@ -0,0 +1,29 @@
+#
+# JBoss, a division of Red Hat
+# Copyright 2010, 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.
+#
+
+ConsumerEditor.label.cache=Secondes avant expiration du cache:
+ConsumerEditor.label.expected=Propri�t�s attendues d'enregistrement:
+ConsumerEditor.label.local=Propri�t�s locales d'enregistrement:
+ConsumerEditor.label.name=Nom du consommateur:
+ConsumerEditor.label.timeout=Millisecondes avant timeout:
+ConsumerEditor.label.wsdl=URL du WSDL:
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-01-21 23:12:55
UTC (rev 1411)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-01-22 03:05:14
UTC (rev 1412)
@@ -19,7 +19,9 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
<portlet>
<description xml:lang="EN">Organization
Portlet</description>
<portlet-name>OrganizationPortlet</portlet-name>
@@ -80,55 +82,60 @@
</portlet>
<portlet>
- <description xml:lang="EN">Register Portlet</description>
- <portlet-name>RegisterPortlet</portlet-name>
- <display-name xml:lang="EN">Register Portlet</display-name>
-
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <description xml:lang="EN">Register Portlet</description>
+ <portlet-name>RegisterPortlet</portlet-name>
+ <display-name xml:lang="EN">Register Portlet</display-name>
+
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
- <init-param>
- <name>webui.configuration</name>
-
<value>/WEB-INF/conf/portlet/exoadmin/RegisterPortlet/webui/configuration.xml</value>
- </init-param>
+ <init-param>
+ <name>webui.configuration</name>
+
<value>/WEB-INF/conf/portlet/exoadmin/RegisterPortlet/webui/configuration.xml</value>
+ </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>help</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
-
<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
- <portlet-info>
- <title>Register Portlet</title>
- <short-title>Register Portlet</short-title>
- <keywords>Administration</keywords>
- </portlet-info>
+
<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
+ <portlet-info>
+ <title>Register Portlet</title>
+ <short-title>Register Portlet</short-title>
+ <keywords>Administration</keywords>
+ </portlet-info>
</portlet>
- <portlet>
- <description xml:lang="EN">WSRP Admin Portlet</description>
- <portlet-name>WSRPAdminPortlet</portlet-name>
- <display-name xml:lang="EN">WSRP Admin Portlet</display-name>
-
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <portlet>
+ <description xml:lang="EN">WSRP Admin Portlet</description>
+ <portlet-name>WSRPAdminPortlet</portlet-name>
+ <display-name xml:lang="EN">WSRP Admin
Portlet</display-name>
+
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
- <init-param>
- <name>webui.configuration</name>
-
<value>/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml</value>
- </init-param>
+ <init-param>
+ <name>webui.configuration</name>
+
<value>/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml</value>
+ </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>help</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
-
<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
- <portlet-info>
- <title>Register Portlet</title>
- <short-title>Register Portlet</short-title>
- <keywords>Administration</keywords>
- </portlet-info>
+
<resource-bundle>locale.portlet.exoadmin.WSRPAdminPortlet</resource-bundle>
+ <portlet-info>
+ <title>WSRP Admin Portlet</title>
+ <short-title>WSRP Admin Portlet</short-title>
+ <keywords>Administration,WSRP</keywords>
+ </portlet-info>
+
+ <security-role-ref>
+ <role-name>admin</role-name>
+ <role-link>admin</role-link>
+ </security-role-ref>
</portlet>
<portlet>
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/ConfigurationManager.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/ConfigurationManager.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/ConfigurationManager.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* 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
@@ -46,15 +46,16 @@
/**
* May 10, 2006
- *
+ * <p/>
* Manages the ComponentConfig of a list of components.
+ *
* @see ComponentConfig
*/
public class ConfigurationManager
{
/**
* todo (julien) : this map should be synchronized somehow
- *
+ * <p/>
* The components of which we manage the configuration
*/
private Map<String, Component> configs_ = new HashMap<String,
Component>();
@@ -62,7 +63,6 @@
private org.exoplatform.webui.config.Application application_;
/**
- *
* @param inputStream A stream that links the configuration file
* @throws Exception
*/
@@ -87,7 +87,9 @@
{
String key = component.getType();
if (component.getId() != null)
+ {
key = key + ":" + component.getId();
+ }
configs_.put(key, component);
}
}
@@ -97,6 +99,7 @@
/**
* Adds components to the list
+ *
* @param configs An array of Component
*/
void setComponentConfigs(Component[] configs)
@@ -105,13 +108,16 @@
{
String key = component.getType();
if (component.getId() != null)
+ {
key = key + ":" + component.getId();
+ }
configs_.put(key, component);
}
}
/**
* Gets the components of a given class
+ *
* @param clazz The class of the components
* @return the list of components
*/
@@ -123,25 +129,32 @@
for (Component comp : values)
{
if (comp.getType().equals(type))
+ {
configs.add(comp);
+ }
}
return configs;
}
/**
* Gets a component of a given class and identified by id
+ *
* @param type The class of the component
- * @param id The id of the component
+ * @param id The id of the component
* @return The component
*/
public Component getComponentConfig(Class<?> type, String id)
{
String key = type.getName();
if (id != null)
+ {
key = key + ":" + id;
+ }
Component config = configs_.get(key);
if (config != null)
+ {
return config;
+ }
try
{
Component[] components = annotationToComponents(type);
@@ -161,7 +174,8 @@
/**
* Gets an array of Component from a ComponentConfig annotation
- * @param cl the classloader to create the annotation
+ *
+ * @param cl the classloader to create the annotation
* @param annClass the annotation class
* @return The array of Component
* @throws Exception
@@ -174,6 +188,7 @@
/**
* Gets an array of Component from a ComponentConfig annotation
+ *
* @param clazz The annotation class from which to get the ComponentConfig
* @return The array of Component
* @throws Exception
@@ -205,40 +220,72 @@
{
Component config = new Component();
if (annotation.id().length() > 0)
+ {
config.setId(annotation.id());
+ }
Class<?> type = annotation.type() == void.class ? clazz : annotation.type();
config.setType(type.getName());
if (annotation.template().length() > 0)
+ {
config.setTemplate(annotation.template());
+ }
if (annotation.lifecycle() != void.class)
+ {
config.setLifecycle(annotation.lifecycle().getName());
+ }
if (annotation.decorator().length() > 0)
+ {
config.setDecorator(annotation.decorator());
+ }
config.setInitParams(toInitParams(annotation.initParams()));
EventConfig[] eventAnnotations = annotation.events();
- ArrayList<Event> events = new ArrayList<Event>();
- for (EventConfig eventAnnotation : eventAnnotations)
+ List<Event> events;
+ if (eventAnnotations.length != 0)
{
- events.add(toEventConfig(eventAnnotation));
+ events = new ArrayList<Event>();
+ for (EventConfig eventAnnotation : eventAnnotations)
+ {
+ events.add(toEventConfig(eventAnnotation));
+ }
}
+ else
+ {
+ events = Collections.emptyList();
+ }
config.setEvents(events);
EventInterceptorConfig[] eventInterceptorAnnotations =
annotation.eventInterceptors();
- ArrayList<EventInterceptor> eventInterceptors = new
ArrayList<EventInterceptor>();
- for (EventInterceptorConfig eventAnnotation : eventInterceptorAnnotations)
+ List<EventInterceptor> eventInterceptors;
+ if (eventInterceptorAnnotations.length != 0)
{
- eventInterceptors.add(toEventInterceptorConfig(eventAnnotation));
+ eventInterceptors = new ArrayList<EventInterceptor>();
+ for (EventInterceptorConfig eventAnnotation : eventInterceptorAnnotations)
+ {
+ eventInterceptors.add(toEventInterceptorConfig(eventAnnotation));
+ }
}
+ else
+ {
+ eventInterceptors = Collections.emptyList();
+ }
config.setEventInterceptors(eventInterceptors);
ValidatorConfig[] validatorAnnotations = annotation.validators();
- ArrayList<Validator> validators = new ArrayList<Validator>();
- for (ValidatorConfig ele : validatorAnnotations)
+ List<Validator> validators;
+ if (validatorAnnotations.length != 0)
{
- validators.add(toValidator(ele));
+ validators = new ArrayList<Validator>();
+ for (ValidatorConfig ele : validatorAnnotations)
+ {
+ validators.add(toValidator(ele));
+ }
}
+ else
+ {
+ validators = Collections.emptyList();
+ }
config.setValidators(validators);
return config;
@@ -264,7 +311,9 @@
String name = annotation.listeners()[0].getSimpleName();
int idx = name.indexOf("ActionListener");
if (idx > -1)
+ {
name = name.substring(0, idx);
+ }
event.setName(name);
}
event.setListeners(listeners);
@@ -293,7 +342,9 @@
private InitParams toInitParams(ParamConfig[] annotations)
{
if (annotations == null || annotations.length < 1)
+ {
return null;
+ }
ArrayList<Param> listParam = new ArrayList<Param>();
for (ParamConfig ele : annotations)
{
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/config/Component.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/config/Component.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/config/Component.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* 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
@@ -28,12 +28,7 @@
import java.util.List;
import java.util.Map;
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * May 4, 2006
- */
+/** Created by The eXo Platform SARL Author : Tuan Nguyen tuan08(a)users.sourceforge.net
May 4, 2006 */
public class Component
{
@@ -49,11 +44,11 @@
private InitParams initParams;
- private ArrayList<Validator> validators;
+ private List<Validator> validators;
- private ArrayList<Event> events;
+ private List<Event> events;
- private ArrayList<EventInterceptor> eventInterceptors;
+ private List<EventInterceptor> eventInterceptors;
transient private Map<String, Event> eventMap;
@@ -119,32 +114,32 @@
this.initParams = initParams;
}
- public ArrayList<Validator> getValidators()
+ public List<Validator> getValidators()
{
return validators;
}
- public void setValidators(ArrayList<Validator> validators)
+ public void setValidators(List<Validator> validators)
{
this.validators = validators;
}
- public ArrayList<Event> getEvents()
+ public List<Event> getEvents()
{
return events;
}
- public void setEvents(ArrayList<Event> events)
+ public void setEvents(List<Event> events)
{
this.events = events;
}
- public ArrayList<EventInterceptor> getEventInterceptors()
+ public List<EventInterceptor> getEventInterceptors()
{
return eventInterceptors;
}
- public void setEventInterceptors(ArrayList<EventInterceptor> events)
+ public void setEventInterceptors(List<EventInterceptor> events)
{
eventInterceptors = events;
}
@@ -152,10 +147,14 @@
public Event getUIComponentEventConfig(String eventName) throws Exception
{
if (eventMap != null)
+ {
return eventMap.get(eventName);
+ }
eventMap = new HashMap<String, Event>();
if (events == null)
+ {
return null;
+ }
for (Event event : events)
{
createCachedEventListeners(event);
@@ -168,10 +167,14 @@
{
Event event = getUIComponentEventConfig(eventName);
if (event == null)
+ {
return null;
+ }
List<EventListener> cachedListeners = event.getCachedEventListeners();
if (cachedListeners != null)
+ {
return cachedListeners;
+ }
cachedListeners = new ArrayList<EventListener>();
for (String listener : event.getListeners())
{
@@ -192,7 +195,9 @@
for (String listener : event.getListeners())
{
if (listener.indexOf(".") < 0)
+ {
listener = type + "$" + listener;
+ }
EventListener eventListener = (EventListener)Util.createObject(listener,
event.getInitParams());
cachedListeners.add(eventListener);
}
@@ -202,7 +207,9 @@
public Lifecycle getUIComponentLifecycle() throws Exception
{
if (componentLifecycle != null)
+ {
return componentLifecycle;
+ }
if (lifecycle != null)
{
componentLifecycle = (Lifecycle)Util.createObject(lifecycle, null);
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -21,12 +21,15 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.resolver.ResourceResolver;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.Parameter;
import org.exoplatform.web.application.URLBuilder;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.replication.api.annotations.Serialized;
import org.exoplatform.webui.config.Component;
+import org.exoplatform.webui.core.lifecycle.Lifecycle;
import org.exoplatform.webui.core.renderers.ValueRenderer;
import org.exoplatform.webui.core.renderers.ValueRendererRegistry;
import org.exoplatform.webui.event.Event;
@@ -41,6 +44,7 @@
@Serialized
abstract public class UIComponent
{
+ private static final Log log = ExoLogger.getLogger("webui:UIComponent");
final static public String OBJECTID = "objectId";
@@ -59,6 +63,7 @@
protected transient Component config;
private transient ValueRendererRegistry rendererRegistry = new
ValueRendererRegistry();
+ private static final Lifecycle DEFAULT_LIFECYCLE = new Lifecycle();
public String getId()
{
@@ -120,7 +125,7 @@
public void processDecode(WebuiRequestContext context) throws Exception
{
MonitorEvent<UIComponent> mevent = createMonitorEvent(Event.Phase.DECODE,
context);
- config.getUIComponentLifecycle().processDecode(this, context);
+ getLifecycle().processDecode(this, context);
if (mevent != null)
{
mevent.setEndExecutionTime(System.currentTimeMillis());
@@ -131,7 +136,7 @@
public void processAction(WebuiRequestContext context) throws Exception
{
MonitorEvent<UIComponent> mevent = createMonitorEvent(Event.Phase.PROCESS,
context);
- config.getUIComponentLifecycle().processAction(this, context);
+ getLifecycle().processAction(this, context);
if (mevent != null)
{
mevent.setEndExecutionTime(System.currentTimeMillis());
@@ -142,7 +147,7 @@
public void processRender(WebuiRequestContext context) throws Exception
{
MonitorEvent<UIComponent> mevent = createMonitorEvent(Event.Phase.RENDER,
context);
- config.getUIComponentLifecycle().processRender(this, context);
+ getLifecycle().processRender(this, context);
if (mevent != null)
{
mevent.setEndExecutionTime(System.currentTimeMillis());
@@ -150,6 +155,16 @@
}
}
+ private Lifecycle getLifecycle() throws Exception
+ {
+ if (config == null)
+ {
+ log.debug("No config was found for " + getClass().getSimpleName() +
" with id '" + id + "'. Using a default one.");
+ return DEFAULT_LIFECYCLE;
+ }
+ return config.getUIComponentLifecycle();
+ }
+
//
// public void processDestroy(WebuiRequestContext context) throws Exception {
// MonitorEvent<UIComponent> mevent = createMonitorEvent(Event.Phase.DESTROY,
context);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIGrid.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -49,8 +49,6 @@
/** An array of String representing the actions on each bean */
protected String[] action_;
- protected String classname_;
-
protected String label_;
protected boolean useAjax = true;
@@ -96,11 +94,6 @@
return uiIterator_.getCurrentPageData();
}
- public String getName()
- {
- return classname_;
- }
-
public String getLabel()
{
return label_;
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRendererRegistry.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -43,6 +43,8 @@
static
{
+ registerDefaultRendererFor(ValueRenderer.DEFAULT_RENDERER, String.class);
+
FormattableValueRenderer<Number> numberRenderer = new
FormattableValueRenderer<Number>(null, "number");
registerDefaultRendererFor(numberRenderer, Number.class);
registerDefaultRendererFor(numberRenderer, Byte.class);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java 2010-01-21
23:12:55 UTC (rev 1411)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm.java 2010-01-22
03:05:14 UTC (rev 1412)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* 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
@@ -29,16 +29,11 @@
import org.exoplatform.webui.core.UIContainer;
import java.io.Writer;
-import java.util.ArrayList;
+import java.util.List;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minhdv81(a)yahoo.com
- * Jun 6, 2006
- */
+/** Created by The eXo Platform SARL Author : Dang Van Minh minhdv81(a)yahoo.com Jun 6,
2006 */
@Serialized
public class UIForm extends UIContainer
{
@@ -153,14 +148,18 @@
public void invokeGetBindingBean(Object bean) throws Exception
{
if (beanMapping == null)
+ {
beanMapping = ReflectionDataMapping.getInstance();
+ }
beanMapping.mapField(this, bean);
}
public void invokeSetBindingBean(Object bean) throws Exception
{
if (beanMapping == null)
+ {
beanMapping = ReflectionDataMapping.getInstance();
+ }
beanMapping.mapBean(bean, this);
}
@@ -173,9 +172,13 @@
Writer writer = context.getWriter();
writer.append("<form class=\"UIForm\"
id=\"").append(getId()).append("\"
action=\"").append(b).append('\"');
if (submitAction_ != null)
+ {
writer.append("
onsubmit=\"").append(submitAction_).append("\"");
+ }
if (multipart_)
+ {
writer.append(" enctype=\"multipart/form-data\"");
+ }
writer.append(" method=\"post\">");
writer.append("<div><input type=\"hidden\"
name=\"").append(ACTION).append("\"
value=\"\"/></div>");
}
@@ -210,8 +213,10 @@
public String[] getActions()
{
if (actions_ != null)
+ {
return actions_;
- ArrayList<Event> events = config.getEvents();
+ }
+ List<Event> events = config.getEvents();
actions_ = new String[events.size()];
for (int i = 0; i < actions_.length; i++)
{
@@ -223,8 +228,7 @@
public void renderField(String name) throws Exception
{
UIComponent uiInput = findComponentById(name);
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- uiInput.processRender(context);
+ renderField(uiInput);
}
public void renderField(UIComponent uiInput) throws Exception
@@ -279,7 +283,9 @@
UIComponent subComponent = findComponentById(componentId);
org.exoplatform.webui.config.Event event =
subComponent.getComponentConfig().getUIComponentEventConfig(name);
if (event == null)
+ {
return "??config??";
+ }
String confirm = event.getConfirm();
if (confirm != null && confirm.trim().length() > 0)
{
@@ -293,7 +299,9 @@
b.append(name).append("','");
b.append("&").append(SUBCOMPONENT_ID).append("=").append(componentId);
if (beanId != null)
+ {
b.append("&").append(OBJECTID).append("=").append(beanId);
+ }
b.append("')");
return b.toString();
}