Author: chris.laprun(a)jboss.com
Date: 2010-01-27 03:53:45 -0500 (Wed, 27 Jan 2010)
New Revision: 1452
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
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/consumer/UIWsrpConsumerEditor.java
Log:
- Deactivate localRegistration's actions so that there's no ambiguity as to which
grid issued the event.
- Display form to edit registration property value (not currently working).
- Inject ExoContainerContext in ExoKernelIntegration.
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2010-01-27
06:25:11 UTC (rev 1451)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2010-01-27
08:53:45 UTC (rev 1452)
@@ -75,8 +75,9 @@
private final String consumersConfigLocation;
private ConsumerRegistry consumerRegistry;
private static final String REMOTE_INVOKERS_INVOKER_ID = "remote";
+ private ExoContainer container;
- public ExoKernelIntegration(InitParams params, ConfigurationManager
configurationManager,
+ public ExoKernelIntegration(ExoContainerContext context, InitParams params,
ConfigurationManager configurationManager,
org.exoplatform.portal.pc.ExoKernelIntegration pc) throws
Exception
{
// IMPORTANT: even though PC ExoKernelIntegration is not used anywhere in the code,
it's still needed for pico
@@ -94,16 +95,17 @@
}
configurationIS = configurationManager.getInputStream(CLASSPATH +
producerConfigLocation);
+
+ container = context.getContainer();
}
public void start()
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- startProducer(container);
- startConsumers(container);
+ startProducer();
+ startConsumers();
}
- private void startProducer(ExoContainer container)
+ private void startProducer()
{
JCRProducerConfigurationService producerConfigurationService;
@@ -167,7 +169,7 @@
producer.start();
}
- private void startConsumers(ExoContainer container)
+ private void startConsumers()
{
// retrieve federating portlet invoker from container
FederatingPortletInvoker federatingPortletInvoker =
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-27
06:25:11 UTC (rev 1451)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIRegistrationPropertiesGrid.java 2010-01-27
08:53:45 UTC (rev 1452)
@@ -26,10 +26,7 @@
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;
@@ -43,15 +40,14 @@
* @version $Revision$
*/
@ComponentConfig(
- template = "system:/groovy/webui/core/UIGrid.gtmpl",
- events = {
- @EventConfig(listeners =
UIRegistrationPropertiesGrid.EditPropertyActionListener.class)
- })
+ 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"};
+ static String[] INACTIVE_ACTIONS = {};
private Map<String, RegistrationProperty> props;
public UIRegistrationPropertiesGrid() throws Exception
@@ -96,13 +92,15 @@
return props.get(name);
}
- static public class EditPropertyActionListener extends
EventListener<UIRegistrationPropertiesGrid>
+ public void setActive(boolean active)
{
- @Override
- public void execute(Event<UIRegistrationPropertiesGrid> event) throws
Exception
+ if (active)
{
- String name = event.getRequestContext().getRequestParameter(OBJECTID);
- UIRegistrationPropertiesGrid registrationPropertiesGrid = event.getSource();
+ configure(NAME, FIELDS, PROPERTIES_ACTIONS);
}
+ else
+ {
+ configure(NAME, FIELDS, INACTIVE_ACTIONS);
+ }
}
}
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-27
06:25:11 UTC (rev 1451)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/consumer/UIWsrpConsumerEditor.java 2010-01-27
08:53:45 UTC (rev 1452)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -45,6 +45,7 @@
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;
@@ -92,8 +93,8 @@
setActions(ACTIONS);
// set property value popup
- setValuePopup = addChild(UIPopupWindow.class, null, null);
- setValuePopup.setWindowSize(200, 0);
+ setValuePopup = addChild(UIPopupWindow.class, null, "SetPropertyPopup");
+ setValuePopup.setWindowSize(400, 0);
setPropertyForm = createUIComponent(UISetPropertyValueForm.class, null,
"SetProperty");
setValuePopup.setUIComponent(setPropertyForm);
setValuePopup.setRendered(false);
@@ -162,11 +163,13 @@
RegistrationInfo local = producerInfo.getRegistrationInfo();
localRegistration.resetProps(local.getRegistrationProperties());
+ localRegistration.setActive(false);
RegistrationInfo expected = producerInfo.getExpectedRegistrationInfo();
if (local != expected && expected != null)
{
expectedRegistration.resetProps(expected.getRegistrationProperties());
+ expectedRegistration.setActive(true);
}
else
{
@@ -279,6 +282,17 @@
String name = event.getRequestContext().getRequestParameter(OBJECTID);
UIWsrpConsumerEditor editor = event.getSource();
+ RegistrationProperty property = editor.expectedRegistration.getProperty(name);
+ editor.displayPropertyValueEditor(property);
}
}
+
+ private void displayPropertyValueEditor(RegistrationProperty prop) throws Exception
+ {
+ setPropertyForm.reset();
+ setPropertyForm.setProperty(prop);
+
+ setValuePopup.setRendered(true);
+ setValuePopup.setShow(true);
+ }
}