Author: chris.laprun(a)jboss.com
Date: 2010-01-15 13:46:42 -0500 (Fri, 15 Jan 2010)
New Revision: 1319
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
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/UIWsrpRegistrationDetails.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
Log:
- Properly set the persistent key on RegistrationPropertyDescription.
- Added persistence of policy and validator class names and fixed persistence of
registration properties on RegistrationRequirementsMapping.
- Removed non-working management of registration properties from producer configuration
UI. :(
- Fixed mapping errors in nodetypes for producer configuration.
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2010-01-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2010-01-15
18:46:42 UTC (rev 1319)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.mapping;
+import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
import org.gatein.common.util.ParameterValidation;
@@ -40,6 +41,9 @@
{
public static final String NODE_NAME =
"wsrp:registrationpropertydescription";
+ @Id
+ public abstract String getPersistentKey();
+
@Property(name = "name")
public abstract String getName(); // todo: this should really be a QName
@@ -92,6 +96,8 @@
public RegistrationPropertyDescription toRegistrationPropertyDescription()
{
RegistrationPropertyDescription desc = new
RegistrationPropertyDescription(getName(), QName.valueOf(getType()));
+ desc.setPersistentKey(getPersistentKey());
+
String description = getDescription();
if (!ParameterValidation.isNullOrEmpty(description))
{
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2010-01-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2010-01-15
18:46:42 UTC (rev 1319)
@@ -23,10 +23,13 @@
package org.gatein.portal.wsrp.state.producer.configuration.mapping;
import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FindById;
+import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.registration.RegistrationPolicy;
+import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
@@ -52,18 +55,42 @@
public abstract void setRegistrationRequiredForFullDescription(boolean
fullServiceDescriptionRequiresRegistration);
+ @Property(name = "policyclassname")
+ public abstract String getPolicyClassName();
+
+ public abstract void setPolicyClassName(String policyClassName);
+
+ @Property(name = "validatorclassname")
+ public abstract String getValidatorClassName();
+
+ public abstract void setValidatorClassName(String validatorClassName);
+
@OneToMany
public abstract List<RegistrationPropertyDescriptionMapping>
getRegistrationPropertyDescriptions();
@Create
public abstract RegistrationPropertyDescriptionMapping
createRegistrationPropertyDescription(String propertyName);
+ @FindById
+ public abstract RegistrationPropertyDescriptionMapping
findRegistrationPropertyDescriptionById(String id);
+
public void initFrom(ProducerRegistrationRequirements registrationRequirements)
{
setRegistrationRequired(registrationRequirements.isRegistrationRequired());
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
+ RegistrationPolicy policy = registrationRequirements.getPolicy();
+ setPolicyClassName(policy.getClass().getName());
+ if (policy instanceof DefaultRegistrationPolicy)
+ {
+ DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)policy;
+ setValidatorClassName(drp.getValidator().getClass().getName());
+ }
+ // first clear persisted properties
List<RegistrationPropertyDescriptionMapping> rpdms =
getRegistrationPropertyDescriptions();
+ rpdms.clear();
+
+ // then add the new ones if any
for (RegistrationPropertyDescription desc :
registrationRequirements.getRegistrationProperties().values())
{
RegistrationPropertyDescriptionMapping rpdm =
createRegistrationPropertyDescription(desc.getNameAsString());
@@ -80,6 +107,7 @@
req.setRegistrationRequired(getRegistrationRequired());
req.setRegistrationRequiredForFullDescription(getRegistrationRequiredForFullDescription());
+ req.reloadPolicyFrom(getPolicyClassName(), getValidatorClassName());
for (RegistrationPropertyDescriptionMapping rpdm :
getRegistrationPropertyDescriptions())
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-15
18:46:42 UTC (rev 1319)
@@ -26,9 +26,6 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -292,7 +289,7 @@
}
catch (Exception e)
{
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.activate.fail" , new
String[]{e.getCause().toString()}, ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.activate.fail", new
String[]{e.getCause().toString()}, ApplicationMessage.ERROR));
e.printStackTrace();
}
}
@@ -324,7 +321,8 @@
// refresh had issues, we should deactivate this consumer
registry.deactivateConsumerWith(consumer.getProducerId());
- uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail", null,
ApplicationMessage.ERROR));
+ uiApp.addMessage(new
ApplicationMessage("UIWsrp.consumer.grid.action.refresh.fail",
+ new Object[]{result.getStatus()}, ApplicationMessage.ERROR));
}
else
{
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-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-15
18:46:42 UTC (rev 1319)
@@ -80,7 +80,7 @@
// registration details
// form set to gather registration information
- registrationDetails = addChild(UIWsrpRegistrationDetails.class, null, null);
+ registrationDetails = addChild(UIWsrpRegistrationDetails.class, null,
REGISTRATION_DETAILS);
init(false);
}
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-15
18:46:42 UTC (rev 1319)
@@ -81,11 +81,12 @@
private UIGrid registrationProperties;
private static final String NAME = "name";
static String[] FIELDS = {NAME, "description", "label",
"hint"};
- static String[] PROPERTIES_ACTIONS = {"EditProperty",
"DeleteProperty"};
+// static String[] PROPERTIES_ACTIONS = {"EditProperty",
"DeleteProperty"};
+ static String[] PROPERTIES_ACTIONS = {};
static final String POLICY_CLASS = "policyClassName";
static final String VALIDATOR_CLASS = "validatorClassName";
- static final String REGISTRATION_PROPERTIES =
"RegistrationPropertySelector";
- static final String REGISTRATION_PROPERTIES_ITERATOR =
"ProducerPropPageIterator";
+ static final String REGISTRATION_PROPERTIES = "registrationproperties";
+ static final String REGISTRATION_PROPERTIES_ITERATOR =
"registrationpropertiesiterator";
public UIWsrpRegistrationDetails() throws Exception
{
@@ -256,8 +257,6 @@
public void updateRegistrationDetailsFromForm(ProducerRegistrationRequirements
registrationRequirements)
{
registrationRequirements.reloadPolicyFrom(policy.getValue(),
validator.getValue());
-
- // todo: deal with registration properties
}
static public class EditPropertyActionListener extends
EventListener<UIWsrpRegistrationDetails>
Modified:
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-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-15
18:46:42 UTC (rev 1319)
@@ -1,29 +1,18 @@
<%
- import org.exoplatform.wsrp.webui.component.UIWsrpProducerEditor;
- import org.exoplatform.wsrp.webui.component.UIWsrpRegistrationDetails;
+ import org.exoplatform.wsrp.webui.component.UIWsrpProducerEditor;
+ import org.exoplatform.wsrp.webui.component.UIWsrpRegistrationDetails;
%>
<div class="<%=uicomponent.getId()%>"
id="<%=uicomponent.getId()%>">
<% uicomponent.renderChildren(); %>
- <div class="FloatRight">
+ <div class="FloatRight">
<div class="UIAction">
<table class="ActionContainer">
<tr>
<td>
- <div
onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).event("AddProperty")%>"
class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getChild(UIWsrpProducerEditor.class).getChild(UIWsrpRegistrationDetails.class).getId()
+ ".action.AddProperty")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- <td>
<div
onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).event("Save")%>"
class="ActionButton LightBlueStyle">
<div class="ButtonLeft">
<div class="ButtonRight">
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2010-01-15
16:27:37 UTC (rev 1318)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2010-01-15
18:46:42 UTC (rev 1319)
@@ -63,10 +63,14 @@
onParentVersion="COPY" protected="false"
multiple="false">
<valueConstraints/>
</propertyDefinition>
- <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
+ <propertyDefinition name="policyclassname"
requiredType="String" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
<valueConstraints/>
</propertyDefinition>
+ <propertyDefinition name="validatorclassname"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
<childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationpropertydescription"
autoCreated="false"
@@ -89,7 +93,7 @@
onParentVersion="COPY" protected="false"
multiple="false">
<valueConstraints/>
</propertyDefinition>
- <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
+ <propertyDefinition name="status" requiredType="String"
autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
<valueConstraints/>
</propertyDefinition>