Author: chris.laprun(a)jboss.com
Date: 2010-01-06 22:04:13 -0500 (Wed, 06 Jan 2010)
New Revision: 1189
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
Log:
- More work on Producer configuration. UIWsrpProducerOverview will probably get removed at
some point.
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-06
23:36:01 UTC (rev 1188)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-07
03:04:13 UTC (rev 1189)
@@ -22,63 +22,185 @@
*/
package org.exoplatform.wsrp.webui.component;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
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.UIGrid;
+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.UIFormCheckBoxInput;
+import org.exoplatform.webui.form.UIFormInputBase;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.registration.RegistrationPolicy;
+import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
/** @author Wesley Hales */
-@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
- @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)})
+@ComponentConfigs({
+ @ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class,
template = "system:/groovy/webui/core/UIGrid.gtmpl"),
+ @ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpProducerEditor.AddPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpProducerEditor.EditPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpProducerEditor.DeletePropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)
+ }
+ )})
public class UIWsrpProducerEditor extends UIForm
{
+ private static String[] FIELDS = {"name", "description",
"label", "hint"};
+ private static String[] SELECT_ACTIONS = {"AddProperty",
"EditProperty", "DeleteProperty"};
- protected static final String REG_REQUIRED_FOR_DESCRIPTION =
"registrationrequiredforfulldescription";
- protected static final String STRICT_MODE = "strictmode";
- protected static final String REQUIRES_REGISTRATION =
"requiresregistration";
- protected static final String POLICY_CLASS = "policyClassName";
- protected static final String VALIDATOR_CLASS = "validatorClassName";
+ private static final String REG_REQUIRED_FOR_DESCRIPTION =
"registrationrequiredforfulldescription";
+ private static final String STRICT_MODE = "strictmode";
+ private static final String REQUIRES_REGISTRATION = "requiresregistration";
+ private static final String POLICY_CLASS = "policyClassName";
+ private static final String VALIDATOR_CLASS = "validatorClassName";
+ private ProducerConfigurationService configService;
+
public UIWsrpProducerEditor() throws Exception
{
addUIFormInput(new UIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION,
REG_REQUIRED_FOR_DESCRIPTION, null));
addUIFormInput(new UIFormCheckBoxInput(STRICT_MODE, STRICT_MODE, null));
addUIFormInput(new UIFormCheckBoxInput(REQUIRES_REGISTRATION,
REQUIRES_REGISTRATION, null));
- /*addUIFormInput(new UIFormStringInput(POLICY_CLASS, POLICY_CLASS,
null).addValidator(MandatoryValidator.class));
- addUIFormInput(new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS,
null).addValidator(MandatoryValidator.class));*/
+
+ //add the popup for property edit and adding new properties
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+ UIWsrpProducerPropertyEditor propertyForm =
createUIComponent(UIWsrpProducerPropertyEditor.class, null, "Producer Property
Editor");
+ popup.setUIComponent(propertyForm);
+ popup.setRendered(false);
}
- public void setProducerConfig(ProducerConfiguration producerConfiguration) throws
Exception
+ public void initWith(ProducerConfigurationService configurationService) throws
Exception
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(configurationService,
"ProducerConfigurationService");
+ configService = configurationService;
+ ProducerConfiguration configuration = configService.getConfiguration();
- ProducerRegistrationRequirements registrationRequirements =
producerConfiguration.getRegistrationRequirements();
+ ProducerRegistrationRequirements registrationRequirements =
configuration.getRegistrationRequirements();
getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).setValue(registrationRequirements.isRegistrationRequiredForFullDescription());
-
getUIFormCheckBoxInput(STRICT_MODE).setValue(producerConfiguration.isUsingStrictMode());
-
getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(registrationRequirements.isRegistrationRequired());
+ getUIFormCheckBoxInput(STRICT_MODE).setValue(configuration.isUsingStrictMode());
- /*RegistrationPolicy policy = registrationRequirements.getPolicy();
- String policyClassName = policy.getClass().getName();
- getUIStringInput(POLICY_CLASS).setValue(policyClassName);
+ boolean registrationRequired = registrationRequirements.isRegistrationRequired();
+ getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(registrationRequired);
- if
(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ // if registration is required then we display more information
+ if (registrationRequired)
{
- DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
-
getUIStringInput(VALIDATOR_CLASS).setValue(defaultPolicy.getValidator().getClass().getName());
- }*/
+ // registration policy
+ UIFormInputBase<String> policyInput = new UIFormStringInput(POLICY_CLASS,
POLICY_CLASS, null).addValidator(MandatoryValidator.class);
+ addUIFormInput(policyInput);
+ RegistrationPolicy policy = registrationRequirements.getPolicy();
+ String policyClassName = policy.getClass().getName();
+ policyInput.setValue(policyClassName);
+
+ // if policy is the default one, display information about the validator
+ if
(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ {
+ UIFormInputBase<String> validatorInput = new
UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS,
null).addValidator(MandatoryValidator.class);
+ addUIFormInput(validatorInput);
+ DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
+
getUIStringInput(VALIDATOR_CLASS).setValue(defaultPolicy.getValidator().getClass().getName());
+ }
+
+ // registration properties
+ Map<QName, RegistrationPropertyDescription> regProps =
configuration.getRegistrationRequirements().getRegistrationProperties();
+
+ UIGrid uiGrid = addChild(UIGrid.class, "RegistrationPropertySelector",
null);
+ //configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
+ uiGrid.configure("name", FIELDS, SELECT_ACTIONS);
+
+ //add the propery grid
+ uiGrid.getUIPageIterator().setId("ProducerPropPageIterator");
+ addChild(uiGrid.getUIPageIterator());
+ uiGrid.getUIPageIterator().setRendered(false);
+ LazyPageList propertyList = createPageList(getPropertyList(regProps));
+ uiGrid.getUIPageIterator().setPageList(propertyList);
+
+ }
}
+ private List<RegistrationPropertyDescription> getPropertyList(Map<QName,
RegistrationPropertyDescription> descriptions) throws Exception
+ {
+ Comparator<RegistrationPropertyDescription> descComparator = new
Comparator<RegistrationPropertyDescription>()
+ {
+ public int compare(RegistrationPropertyDescription o1,
RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+ List<RegistrationPropertyDescription> result = new
ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ Collections.sort(result, descComparator);
+ return result;
+ }
+
+ private LazyPageList<RegistrationPropertyDescription> createPageList(final
List<RegistrationPropertyDescription> pageList)
+ {
+ return new LazyPageList<RegistrationPropertyDescription>(new
ListAccess<RegistrationPropertyDescription>()
+ {
+
+ public int getSize() throws Exception
+ {
+ return pageList.size();
+ }
+
+ public RegistrationPropertyDescription[] load(int index, int length) throws
Exception, IllegalArgumentException
+ {
+ RegistrationPropertyDescription[] pcs = new
RegistrationPropertyDescription[pageList.size()];
+
+ if (index < 0)
+ {
+ throw new IllegalArgumentException("Illegal index: index must be a
positive number");
+ }
+
+ if (length < 0)
+ {
+ throw new IllegalArgumentException("Illegal length: length must be a
positive number");
+ }
+
+ if (index + length > pageList.size())
+ {
+ throw new IllegalArgumentException(
+ "Illegal index or length: sum of the index and the length cannot
be greater than the list size");
+ }
+
+ for (int i = 0; i < length; i++)
+ {
+ pcs[i] = pageList.get(i + index);
+ }
+
+ return pcs;
+ }
+
+ }, 10);
+ }
+
+
static public class SaveActionListener extends
EventListener<UIWsrpProducerEditor>
{
public void execute(Event<UIWsrpProducerEditor> event) throws Exception
@@ -98,8 +220,8 @@
//ProducerInfo producerInfo =
consumerRegistry.getProducerInfoByKey("").getRegistrationInfo().
UIApplication uiApp = context.getUIApplication();
- ProducerConfigurationService pconfService = getProducerConfigurationService();
- ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+ ProducerConfiguration producerConfiguration = configService.getConfiguration();
+
try
{
ProducerRegistrationRequirements registrationRequirements =
producerConfiguration.getRegistrationRequirements();
@@ -107,9 +229,9 @@
producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(getUIFormCheckBoxInput(STRICT_MODE).getValue().toString()));
registrationRequirements.setRegistrationRequired(Boolean.parseBoolean(getUIFormCheckBoxInput(REQUIRES_REGISTRATION).getValue().toString()));
-//
registrationRequirements.reloadPolicyFrom(getUIStringInput(POLICY_CLASS).getValue(),
getUIStringInput(VALIDATOR_CLASS).getValue());
+
registrationRequirements.reloadPolicyFrom(getUIStringInput(POLICY_CLASS).getValue(),
getUIStringInput(VALIDATOR_CLASS).getValue());
- pconfService.saveConfiguration();
+ configService.saveConfiguration();
uiApp.addMessage(new ApplicationMessage("Producer Successfully
Changed", null));
}
catch (Exception e)
@@ -121,9 +243,68 @@
return true;
}
- public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ static public class EditPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
{
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+
editor.setRegistrationPropertyDescription(producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+
+ }
}
+
+ static public class DeletePropertyActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event)
+ {
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+
producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ producerOverview.getProducerConfigurationService().saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ uiApp.addMessage(new ApplicationMessage("Failed to delete Producer
Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ }
+
+ }
+ }
+
+ static public class AddPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview wsrpProducerOverview = event.getSource();
+ UIPopupWindow popup = wsrpProducerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+
+ //reset the form
+ editor.setRegistrationPropertyDescription(null);
+ popup.setRendered(true);
+ popup.setShow(true);
+ popup.setShowCloseButton(true);
+ //popup.setShowMask(true);
+
+ }
+ }
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-06
23:36:01 UTC (rev 1188)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-07
03:04:13 UTC (rev 1189)
@@ -22,205 +22,29 @@
*/
package org.exoplatform.wsrp.webui.component;
-import org.exoplatform.commons.utils.LazyPageList;
-import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.web.application.ApplicationMessage;
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.UIContainer;
-import org.exoplatform.webui.core.UIGrid;
-import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
-import org.gatein.wsrp.registration.RegistrationPropertyDescription;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
/** @author Wesley Hales */
-@ComponentConfigs({
- @ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class,
template = "system:/groovy/webui/core/UIGrid.gtmpl"),
- @ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
- template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl",
- events = {
-// @EventConfig(listeners =
UIWsrpProducerOverview.AddPropertyActionListener.class),
- @EventConfig(listeners =
UIWsrpProducerOverview.EditPropertyActionListener.class),
- @EventConfig(listeners =
UIWsrpProducerOverview.DeletePropertyActionListener.class)
- }
- )})
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl"
+)
public class UIWsrpProducerOverview extends UIContainer
{
+ private UIWsrpProducerEditor producerForm;
- public static String[] FIELDS = {"name", "description",
"label", "hint"};
-
- public static String[] SELECT_ACTIONS = {"AddProperty",
"EditProperty", "DeleteProperty"};
-
public UIWsrpProducerOverview() throws Exception
{
- ProducerConfigurationService service = getProducerConfigurationService();
- ProducerConfiguration producerConfiguration = service.getConfiguration();
- UIWsrpProducerEditor producerForm = createUIComponent(UIWsrpProducerEditor.class,
null, "Producer Editor");
- producerForm.setProducerConfig(producerConfiguration);
+ producerForm = createUIComponent(UIWsrpProducerEditor.class, null, "Producer
Editor");
+ producerForm.initWith(getProducerConfigurationService());
addChild(producerForm);
-
- /*UIGrid uiGrid = addChild(UIGrid.class, "RegistrationPropertySelector",
null);
- //configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
- uiGrid.configure("name", FIELDS, SELECT_ACTIONS);
-
- //add the propery grid
- uiGrid.getUIPageIterator().setId("ProducerPropPageIterator");
- addChild(uiGrid.getUIPageIterator());
- uiGrid.getUIPageIterator().setRendered(false);
- LazyPageList propertyList = createPageList(getPropertyList());
- uiGrid.getUIPageIterator().setPageList(propertyList);
-
- //add the popup for property edit and adding new properties
- UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
- popup.setWindowSize(400, 300);
- UIWsrpProducerPropertyEditor propertyForm =
createUIComponent(UIWsrpProducerPropertyEditor.class, null, "Producer Property
Editor");
- popup.setUIComponent(propertyForm);
- popup.setRendered(false);*/
}
- public List<RegistrationPropertyDescription> getPropertyList() throws Exception
- {
- ProducerConfiguration producerConfiguration =
getProducerConfigurationService().getConfiguration();
- Map descriptions =
producerConfiguration.getRegistrationRequirements().getRegistrationProperties();
- Comparator<RegistrationPropertyDescription> descComparator = new
Comparator<RegistrationPropertyDescription>()
- {
- public int compare(RegistrationPropertyDescription o1,
RegistrationPropertyDescription o2)
- {
- return o1.getName().toString().compareTo(o2.getName().toString());
- }
- };
-
- List<RegistrationPropertyDescription> result = new
ArrayList<RegistrationPropertyDescription>(descriptions.values());
- Collections.sort(result, descComparator);
- return result;
- }
-
- public List<String> getSupportedPropertyTypes()
- {
- return Collections.singletonList(("xsd:string"));
- }
-
- public LazyPageList<RegistrationPropertyDescription> createPageList(final
List<RegistrationPropertyDescription> pageList)
- {
- return new LazyPageList<RegistrationPropertyDescription>(new
ListAccess<RegistrationPropertyDescription>()
- {
-
- public int getSize() throws Exception
- {
- return pageList.size();
- }
-
- public RegistrationPropertyDescription[] load(int index, int length) throws
Exception, IllegalArgumentException
- {
- RegistrationPropertyDescription[] pcs = new
RegistrationPropertyDescription[pageList.size()];
-
- if (index < 0)
- {
- throw new IllegalArgumentException("Illegal index: index must be a
positive number");
- }
-
- if (length < 0)
- {
- throw new IllegalArgumentException("Illegal length: length must be a
positive number");
- }
-
- if (index + length > pageList.size())
- {
- throw new IllegalArgumentException(
- "Illegal index or length: sum of the index and the length cannot
be greater than the list size");
- }
-
- for (int i = 0; i < length; i++)
- {
- pcs[i] = pageList.get(i + index);
- }
-
- return pcs;
- }
-
- }, 10);
- }
-
- static public class EditPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
- {
- public void execute(Event<UIWsrpProducerOverview> event) throws Exception
- {
- UIWsrpProducerOverview producerOverview = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
-
editor.setRegistrationPropertyDescription(producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- popup.setUIComponent(editor);
- popup.setRendered(true);
- popup.setShow(true);
-
- }
- }
-
- static public class DeletePropertyActionListener extends
EventListener<UIWsrpProducerOverview>
- {
- public void execute(Event<UIWsrpProducerOverview> event)
- {
- UIWsrpProducerOverview producerOverview = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
-
producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
- producerOverview.getProducerConfigurationService().saveConfiguration();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- uiApp.addMessage(new ApplicationMessage("Failed to delete Producer
Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
- }
-
- }
- }
-
- static public class AddPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
- {
- public void execute(Event<UIWsrpProducerOverview> event) throws Exception
- {
- UIWsrpProducerOverview wsrpProducerOverview = event.getSource();
- UIPopupWindow popup = wsrpProducerOverview.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
-
- //reset the form
- editor.setRegistrationPropertyDescription(null);
- popup.setRendered(true);
- popup.setShow(true);
- popup.setShowCloseButton(true);
- //popup.setShowMask(true);
-
- }
- }
-
public ProducerConfigurationService getProducerConfigurationService() throws
Exception
{
ExoContainer manager = ExoContainerContext.getCurrentContainer();
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-06
23:36:01 UTC (rev 1188)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-07
03:04:13 UTC (rev 1189)
@@ -1,43 +1,61 @@
-<%
- import org.exoplatform.webui.form.UIFormStringInput;
-%>
+<div class="WSRPProducerConfiguration">
+ <%
+ uiform.begin()
+ for (field in uiform.getChildren())
+ {
+ if (field.isRendered())
+ {
+ %>
+ <div class="row">
+ <%
+ label = uicomponent.getLabel(field.getName());
+ if (!label.equals(uicomponent.getId()))
+ {
+ %>
+ <label>
+ <%
+ if (label != null && label.length() > 0)
+ {
+ %>
+ <%=label%>
+ <%
+ }
+ %>
+ </label>
+ <% uiform.renderField(field) %>
+ </div>
+ <%
+ }
+ }
+ }
+ %>
-<div class="UILoginForm" id="ChildTest">
- <% uiform.begin() %>
- <%
- UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
- %>
- <div class="SignIn">Access to full service description requires
consumers to be registered. <% uiform.renderChild(0); %></div>
- <div class="SignIn">Use strict WSRP compliance. <%
uiform.renderChild(1); %></div>
- <div class="SignIn">Requires registration. Modifying this information
will trigger invalidation of consumer registrations. <% uiform.renderChild(2);
%></div>
+ <div class="FloatRight">
- <div class="FloatRight">
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
-
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
-
- </td>
- <td>
- <div onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </td>
+ <td>
+ <div
onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </div>
+ </div>
+ </div>
</div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
+ </td>
+ </tr>
+ </table>
+ </div>
-
- <div class="ClearRight"><span></span></div>
- <% uiform.end() %>
-</div>
+
+ <div class="ClearRight"><span></span></div>
+ <% uiform.end() %>
+ </div>
</div>
\ No newline at end of file