Author: chris.laprun(a)jboss.com
Date: 2010-01-22 16:49:31 -0500 (Fri, 22 Jan 2010)
New Revision: 1422
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UISetPropertyValueForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationPropertyStatusValueRenderer.java
Removed:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerOverview.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
Modified:
portal/trunk/component/wsrp/src/main/java/conf/wsrp-producer-config.xml
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/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/UIWsrpProducerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.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
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRenderer.java
Log:
- UIRegistrationPropertiesGrid now records associated registration properties.
- Overriden getName in UIRegistrationPropertiesGrid to return id so that label can be
properly displayed in UIForm.gtmpl.
- Started adding support for setting registration properties value but can't figure
out a way to make it work with
the event system as events don't recall what element they originated from.
- Removed more UIWsrpProducerOverview as it wasn't needed.
- More localization.
- Added ValueRenderer.render(V, WebuiBindingContext) so that values can be resolved from a
resource bundle if needed.
- Added ValueRenderer for RegistrationProperty.Status.
- Added Cancel actions on popups.
Modified: portal/trunk/component/wsrp/src/main/java/conf/wsrp-producer-config.xml
===================================================================
--- portal/trunk/component/wsrp/src/main/java/conf/wsrp-producer-config.xml 2010-01-22
15:27:58 UTC (rev 1421)
+++ portal/trunk/component/wsrp/src/main/java/conf/wsrp-producer-config.xml 2010-01-22
21:49:31 UTC (rev 1422)
@@ -26,6 +26,13 @@
<registration-configuration
fullServiceDescriptionRequiresRegistration="true">
<registration-property-validator>org.gatein.registration.policies.DefaultRegistrationPropertyValidator
</registration-property-validator>
+ <registration-property-description>
+ <name>prop</name>
+ <type>xsd:string</type>
+ <description xml:lang="en">desc</description>
+ <hint xml:lang="en">hint</hint>
+ <label xml:lang="en">label</label>
+ </registration-property-description>
</registration-configuration>
</producer-configuration>
Modified:
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 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -26,24 +26,33 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.commons.utils.ListAccessImpl;
import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIPageIterator;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIFormGrid;
import org.gatein.common.util.ParameterValidation;
import org.gatein.wsrp.consumer.RegistrationProperty;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-@ComponentConfig(template = "system:/groovy/webui/core/UIGrid.gtmpl")
+@ComponentConfig(
+ template = "system:/groovy/webui/core/UIGrid.gtmpl",
+ events = {
+ @EventConfig(listeners =
UIRegistrationPropertiesGrid.EditPropertyActionListener.class)
+ })
public class UIRegistrationPropertiesGrid extends UIFormGrid
{
private static final String NAME = "name";
static String[] FIELDS = {NAME, "description", "status",
"value"};
static String[] PROPERTIES_ACTIONS = {"EditProperty",
"DeleteProperty"};
+ private Map<String, RegistrationProperty> props;
public UIRegistrationPropertiesGrid() throws Exception
{
@@ -55,8 +64,15 @@
pageIterator.setRendered(false);
}
- public void resetProps(List<RegistrationProperty> props)
+ @Override
+ public String getName()
{
+ return getId();
+ }
+
+ public void resetProps(Map<String, RegistrationProperty> props)
+ {
+
ListAccessImpl<RegistrationProperty> listAccess;
if (ParameterValidation.existsAndIsNotEmpty(props))
{
@@ -64,10 +80,29 @@
}
else
{
- props = Collections.emptyList();
+ props = Collections.emptyMap();
setRendered(false);
}
- listAccess = new
ListAccessImpl<RegistrationProperty>(RegistrationProperty.class, props);
+
+ this.props = props;
+
+ ArrayList<RegistrationProperty> propsList = new
ArrayList<RegistrationProperty>(props.values());
+ listAccess = new
ListAccessImpl<RegistrationProperty>(RegistrationProperty.class, propsList);
getUIPageIterator().setPageList(new
LazyPageList<RegistrationProperty>(listAccess, 10));
}
+
+ public RegistrationProperty getProperty(String name)
+ {
+ return props.get(name);
+ }
+
+ static public class EditPropertyActionListener extends
EventListener<UIRegistrationPropertiesGrid>
+ {
+ @Override
+ public void execute(Event<UIRegistrationPropertiesGrid> event) throws
Exception
+ {
+ String name = event.getRequestContext().getRequestParameter(OBJECTID);
+ UIRegistrationPropertiesGrid registrationPropertiesGrid = event.getSource();
+ }
+ }
}
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-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -28,9 +28,11 @@
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.producer.UIWsrpProducerEditor;
import org.exoplatform.wsrp.webui.component.renderers.LocalizedStringValueRenderer;
import
org.exoplatform.wsrp.webui.component.renderers.RegistrationDescriptionValueRenderer;
+import
org.exoplatform.wsrp.webui.component.renderers.RegistrationPropertyStatusValueRenderer;
+import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.registration.LocalizedString;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
@@ -45,13 +47,14 @@
// register value renderers
ValueRendererRegistry.registerDefaultRendererFor(new
RegistrationDescriptionValueRenderer(), RegistrationPropertyDescription.class);
ValueRendererRegistry.registerDefaultRendererFor(new
LocalizedStringValueRenderer(), LocalizedString.class);
+ ValueRendererRegistry.registerDefaultRendererFor(new
RegistrationPropertyStatusValueRenderer(), RegistrationProperty.Status.class);
}
public UIWsrpPortlet() throws Exception
{
UITabPane uiTabPane = addChild(UITabPane.class, null, null);
- uiTabPane.addChild(UIWsrpConsumerOverview.class, null, "Manage
Consumers");
- uiTabPane.addChild(UIWsrpProducerOverview.class, null, "Producer
Configuration");
+ uiTabPane.addChild(UIWsrpConsumerOverview.class, null, "Consumers");
+ uiTabPane.addChild(UIWsrpProducerEditor.class, null, "Producer");
if (uiTabPane.getSelectedTabId().equals(""))
{
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UISetPropertyValueForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UISetPropertyValueForm.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UISetPropertyValueForm.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -0,0 +1,77 @@
+/*
+ * 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.consumer;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIForm.gtmpl",
+ events = {
+ @EventConfig(listeners = UISetPropertyValueForm.SaveActionListener.class),
+ @EventConfig(listeners = UISetPropertyValueForm.CancelActionListener.class)
+ })
+public class UISetPropertyValueForm extends UIForm
+{
+ private UIFormStringInput value;
+ private static final String[] ACTIONS = new String[]{"Save",
"Cancel"};
+
+ public UISetPropertyValueForm()
+ {
+ value = new UIFormStringInput("value", null);
+ setActions(ACTIONS);
+ }
+
+ static public class CancelActionListener extends
EventListener<UISetPropertyValueForm>
+ {
+ @Override
+ public void execute(Event<UISetPropertyValueForm> event) throws Exception
+ {
+ // simply close the popup
+ UIPopupWindow popup = event.getSource().getParent();
+ popup.setRendered(false);
+ popup.setShow(false);
+ }
+ }
+
+ static public class SaveActionListener extends
EventListener<UISetPropertyValueForm>
+ {
+ @Override
+ public void execute(Event<UISetPropertyValueForm> event) throws Exception
+ {
+
+ }
+ }
+}
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-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -37,7 +37,6 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
-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;
@@ -46,33 +45,34 @@
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(
lifecycle = UIFormLifecycle.class,
template = "system:/groovy/webui/form/UIForm.gtmpl",
events = {
- @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class)
+ @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerEditor.CancelActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerEditor.EditPropertyActionListener.class)
})
public class UIWsrpConsumerEditor extends UIForm
{
- private UIFormInputBase<String> consumerName;
+ private UIFormStringInput consumerName;
private UIFormStringInput cache;
private UIFormStringInput timeoutWS;
private UIFormStringInput wsdl;
private UIRegistrationPropertiesGrid localRegistration;
private UIRegistrationPropertiesGrid expectedRegistration;
- private static final String[] ACTIONS = new String[]{"Save"};
+ private static final String[] ACTIONS = new String[]{"Save",
"Cancel"};
+ private UIPopupWindow setValuePopup;
+ private UISetPropertyValueForm setPropertyForm;
public UIWsrpConsumerEditor() throws Exception
{
- consumerName = new UIFormStringInput("name",
null).addValidator(MandatoryValidator.class);
+ consumerName = new UIFormStringInput("name", null);
+ consumerName.addValidator(MandatoryValidator.class);
addUIFormInput(consumerName);
cache = new UIFormStringInput("cache", null);
addUIFormInput(cache);
@@ -90,6 +90,13 @@
// actions
setActions(ACTIONS);
+
+ // set property value popup
+ setValuePopup = addChild(UIPopupWindow.class, null, null);
+ setValuePopup.setWindowSize(200, 0);
+ setPropertyForm = createUIComponent(UISetPropertyValueForm.class, null,
"SetProperty");
+ setValuePopup.setUIComponent(setPropertyForm);
+ setValuePopup.setRendered(false);
}
private String getConsumerName()
@@ -154,16 +161,12 @@
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);
+ localRegistration.resetProps(local.getRegistrationProperties());
RegistrationInfo expected = producerInfo.getExpectedRegistrationInfo();
if (local != expected && expected != null)
{
- regProps = expected.getRegistrationProperties().values();
- regPropsList = new ArrayList<RegistrationProperty>(regProps);
- expectedRegistration.resetProps(regPropsList);
+ expectedRegistration.resetProps(expected.getRegistrationProperties());
}
else
{
@@ -173,6 +176,51 @@
setNewConsumer(false);
}
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try
+ {
+ consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration(),
getWSDLURL());
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.success", null));
+ }
+ catch (ConsumerException ce)
+ {
+ //todo - add to resource bundle
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.exists", null,
ApplicationMessage.ERROR));
+ }
+ return true;
+ }
+
+ public boolean edit(WebuiRequestContext context) throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ ProducerInfo producerInfo =
consumerRegistry.getConsumer(getConsumerName()).getProducerInfo();
+
+ producerInfo.setId(getConsumerName());
+ producerInfo.setExpirationCacheSeconds(getCacheExpiration());
+ producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWSDLURL());
+ producerInfo.getEndpointConfigurationInfo().setWSOperationTimeOut(getTimeout());
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try
+ {
+ consumerRegistry.updateProducerInfo(producerInfo);
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.success", null));
+ }
+ catch (ConsumerException ce)
+ {
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.fail", null,
ApplicationMessage.ERROR));
+ }
+ return true;
+ }
+
static public class SaveActionListener extends
EventListener<UIWsrpConsumerEditor>
{
public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
@@ -211,49 +259,26 @@
}
}
- public boolean save(WebuiRequestContext context) throws Exception
+ static public class CancelActionListener extends
EventListener<UIWsrpConsumerEditor>
{
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
-
- UIApplication uiApp = context.getUIApplication();
-
- try
+ @Override
+ public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
{
- consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration(),
getWSDLURL());
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.success", null));
+ // simply close the popup
+ UIPopupWindow popup = event.getSource().getParent();
+ popup.setRendered(false);
+ popup.setShow(false);
}
- catch (ConsumerException ce)
- {
- //todo - add to resource bundle
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.add.exists", null,
ApplicationMessage.ERROR));
- }
- return true;
}
- public boolean edit(WebuiRequestContext context) throws Exception
+ static public class EditPropertyActionListener extends
EventListener<UIWsrpConsumerEditor>
{
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
- ProducerInfo producerInfo =
consumerRegistry.getConsumer(getConsumerName()).getProducerInfo();
+ @Override
+ public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
+ {
+ String name = event.getRequestContext().getRequestParameter(OBJECTID);
+ UIWsrpConsumerEditor editor = event.getSource();
- producerInfo.setId(getConsumerName());
- producerInfo.setExpirationCacheSeconds(getCacheExpiration());
- producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWSDLURL());
- producerInfo.getEndpointConfigurationInfo().setWSOperationTimeOut(getTimeout());
-
- UIApplication uiApp = context.getUIApplication();
-
- try
- {
- consumerRegistry.updateProducerInfo(producerInfo);
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.success", null));
}
- catch (ConsumerException ce)
- {
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.action.edit.fail", null,
ApplicationMessage.ERROR));
- }
- return true;
}
-
}
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-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerOverview.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -81,7 +81,6 @@
ConsumerRegistry registry =
(ConsumerRegistry)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(ConsumerRegistry.class);
controller = new ConsumerController(registry);
- //setSelectedTab(1);
consumerEditorPopup = addChild(UIPopupWindow.class, null, null);
consumerEditorPopup.setWindowSize(800, 0);
UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class,
null, "ConsumerEditor");
@@ -141,7 +140,6 @@
editor.setConsumer(consumer);
consumerEditorPopup.setRendered(true);
consumerEditorPopup.setShow(true);
- consumerEditorPopup.setShowCloseButton(true);
}
static public class EditActionListener extends
EventListener<UIWsrpConsumerOverview>
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerEditor.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerEditor.java 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerEditor.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -42,7 +42,7 @@
*/
@ComponentConfig(
lifecycle = UIFormLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl",
+ template = "system:/groovy/webui/form/UIForm.gtmpl",
events = {
@EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class),
@EventConfig(listeners =
UIWsrpProducerEditor.RegistrationOnChangeActionListener.class)
@@ -60,6 +60,7 @@
private UIFormCheckBoxInput regReqForDesc;
private UIFormCheckBoxInput strictMode;
private UIFormCheckBoxInput<Boolean> regRequired;
+ private static final String[] ACTIONS = new String[]{"Save"};
public UIWsrpProducerEditor() throws Exception
{
@@ -76,7 +77,7 @@
addUIFormInput(regRequired);
// because when we use setOnChange method, new eventListener will add to this form,
we must re-set the actions of this form.
// thif form has no action, so i'll put empty string array
- setActions(new String[]{});
+ setActions(ACTIONS);
// registration details
// form set to gather registration information
Deleted:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerOverview.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerOverview.java 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/producer/UIWsrpProducerOverview.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -1,46 +0,0 @@
-/*
- * 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.producer;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIContainer;
-import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-
-/**
- * @author Wesley Hales
- * @author Chris Laprun
- */
-@ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl"
-)
-public class UIWsrpProducerOverview extends UIContainer
-{
- private UIWsrpProducerEditor producerForm;
-
- public UIWsrpProducerOverview() throws Exception
- {
- producerForm = createUIComponent(UIWsrpProducerEditor.class, null, "Producer
Editor");
- addChild(producerForm);
- }
-}
Modified:
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 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/LocalizedStringValueRenderer.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -36,6 +36,7 @@
@Override
public String render(LocalizedString value)
{
+ // todo: maybe implement a localized version?
return value.getValue();
}
}
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationPropertyStatusValueRenderer.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationPropertyStatusValueRenderer.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/renderers/RegistrationPropertyStatusValueRenderer.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -0,0 +1,47 @@
+/*
+ * 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.lifecycle.WebuiBindingContext;
+import org.exoplatform.webui.core.renderers.ValueRenderer;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class RegistrationPropertyStatusValueRenderer extends
ValueRenderer<RegistrationProperty.Status>
+{
+ @Override
+ public String render(RegistrationProperty.Status value, WebuiBindingContext context)
throws Exception
+ {
+ return context.appRes(value.getLocalizationKey());
+ }
+
+ @Override
+ public String getCSSClassFor(RegistrationProperty.Status value)
+ {
+ return value.name();
+ }
+}
Modified:
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 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_en.properties 2010-01-22
21:49:31 UTC (rev 1422)
@@ -26,4 +26,18 @@
ConsumerEditor.label.wsdl=WSDL URL:
ConsumerEditor.label.local=Local registration properties:
ConsumerEditor.label.expected=Expected registration properties:
+registration_property_status_inexistent=Inexistent
+registration_property_status_missing=Missing
+registration_property_status_missing_value=Value missing
+registration_property_status_unchecked_value=Unchecked
+registration_property_status_invalid_value=Invalid
+registration_property_status_valid=Valid
+Producer.label.policyClassName=Policy class name:
+Producer.label.validatorClassName=Validator class name:
+Producer.label.registrationproperties=Registration properties:
+Producer.label.registrationrequiredforfulldescription=Registration required for full
service description.
+Producer.label.strictmode=Strict mode.
+Producer.label.requiresregistration=Requires registration?
+UITabPane.title.Producer=Producer configuration
+UITabPane.title.Consumers=Consumers configuration
Modified:
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 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/WSRPAdminPortlet_fr.properties 2010-01-22
21:49:31 UTC (rev 1422)
@@ -26,4 +26,18 @@
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
+ConsumerEditor.label.wsdl=URL du WSDL:
+registration_property_status_inexistent=Inexistante
+registration_property_status_invalid_value=Invalide
+registration_property_status_missing=Manquante
+registration_property_status_missing_value=Valeur manquante
+registration_property_status_unchecked_value=Non-v�rifi�e
+registration_property_status_valid=Valide
+Producer.label.policyClassName=Nom de la classe de politique de validation:
+Producer.label.registrationproperties=Propri�t�s d'enregistrement:
+Producer.label.registrationrequiredforfulldescription=Enregistrement n�cessaire pour la
description compl�te.
+Producer.label.requiresregistration=Requiert l'enregistrement?
+Producer.label.strictmode=Mode strict.
+Producer.label.validatorClassName=Nom de la classe du validateur:
+UITabPane.title.Consumers=Configuration des consommateurs
+UITabPane.title.Producer=Configuration du producteur
\ No newline at end of file
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-22
21:49:31 UTC (rev 1422)
@@ -1,30 +0,0 @@
-<%
- import org.exoplatform.wsrp.webui.component.producer.UIWsrpProducerEditor;
- import org.exoplatform.wsrp.webui.component.producer.UIWsrpRegistrationDetails;
-%>
-
-<div class="<%=uicomponent.getId()%>"
id="<%=uicomponent.getId()%>">
-
- <% uicomponent.renderChildren(); %>
-
- <div class="FloatRight">
-
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div
onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).event("Save")%>"
class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getChild(UIWsrpProducerEditor.class).getId()
+ ".action.Save")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
- </div>
-</div>
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl 2010-01-22
15:27:58 UTC (rev 1421)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl 2010-01-22
21:49:31 UTC (rev 1422)
@@ -61,7 +61,7 @@
{
def fieldValue = uicomponent.getFieldValue(bean, field);
def renderer = uicomponent.getRendererFor(fieldValue);
- println "<td><div class=\"" +
renderer.getCSSClassFor(fieldValue) + "\" title='$fieldValue'>"
+ renderer.render(fieldValue) + "</div></td>";
+ println "<td><div class=\"" +
renderer.getCSSClassFor(fieldValue) + "\" title='$fieldValue'>"
+ renderer.render(fieldValue, _ctx) + "</div></td>";
}
if (beanActions != null && beanActions.length > 0)
{
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRenderer.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRenderer.java 2010-01-22
15:27:58 UTC (rev 1421)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/renderers/ValueRenderer.java 2010-01-22
21:49:31 UTC (rev 1422)
@@ -23,6 +23,7 @@
package org.exoplatform.webui.core.renderers;
+import org.exoplatform.webui.core.lifecycle.WebuiBindingContext;
import org.gatein.common.util.ParameterValidation;
/**
@@ -56,6 +57,11 @@
return value.toString();
}
+ public String render(V value, WebuiBindingContext context) throws Exception
+ {
+ return render(value);
+ }
+
public String getCSSClassFor(V value)
{
return DEFAULT_CSS_CLASS;