gatein SVN: r763 - in portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state: consumer/mapping and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-23 09:43:45 -0500 (Mon, 23 Nov 2009)
New Revision: 763
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
Log:
- Let mapping classes deal with conversion to and from model objects for better encapsulation.
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -24,7 +24,6 @@
package org.gatein.portal.wsrp.state.consumer;
import org.chromattic.api.ChromatticSession;
-import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
import org.gatein.portal.wsrp.state.JCRPersister;
@@ -36,15 +35,9 @@
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.ProducerInfo;
-import org.gatein.wsrp.consumer.RegistrationInfo;
-import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
-import org.gatein.wsrp.registration.LocalizedString;
-import org.gatein.wsrp.registration.RegistrationPropertyDescription;
-import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -174,95 +167,11 @@
pim = session.insert(ProducerInfoMapping.class, getPathFor(producerInfo));
}
- pim.setActive(producerInfo.isActive());
- pim.setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
- pim.setId(producerInfo.getId());
+ pim.initFrom(producerInfo);
- EndpointInfoMapping eim = pim.getEndpointInfo();
- eim.setWSDLURL(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
-
- RegistrationInfoMapping rim = pim.getRegistrationInfo();
- RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
- rim.setConsumerName(regInfo.getConsumerName());
- rim.setRegistrationHandle(regInfo.getRegistrationHandle());
- byte[] bytes = regInfo.getRegistrationState();
- if (bytes != null && bytes.length > 0)
- {
- ByteArrayInputStream is = new ByteArrayInputStream(bytes);
- rim.setRegistrationState(is);
- }
-
- // clear and recreate registration properties
- List<RegistrationPropertyMapping> rpms = rim.getRegistrationProperties();
- rpms.clear();
- for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
- {
- // create new RegistrationPropertyMapping for this RegistrationInfoMapping
- RegistrationPropertyMapping rpm = rim.create();
-
- // set properties
- rpm.setStatus(property.getStatus().name());
- rpm.setValue(property.getValue());
-
- // description
- RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
- RegistrationPropertyDescription desc = property.getDescription();
- rpdm.setDescription(desc.getDescription().getValue()); // todo: should really persist LocalizedString here...
- rpdm.setHint(desc.getHint().getValue()); // todo: should really persist LocalizedString here...
- rpdm.setLabel(desc.getLabel().getValue()); // todo: should really persist LocalizedString here...
-
- // convert QNames to Strings
- rpdm.setName(desc.getName().toString());
- rpdm.setType(desc.getType().toString());
-
- // add newly created RegistrationPropertyMapping to parent
- rpms.add(rpm);
- }
-
return pim;
}
- private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
- {
- // todo: should probably use a ProducerInfo implementation backed by mapping at some point
- ProducerInfo info = new ProducerInfo();
-
- // basic properties
- info.setKey(mapping.getKey());
- info.setId(mapping.getId());
- info.setActive(mapping.getActive());
- info.setExpirationCacheSeconds(mapping.getExpirationCacheSeconds());
-
- // endpoint
- info.getEndpointConfigurationInfo().setWsdlDefinitionURL(mapping.getEndpointInfo().getWSDLURL());
-
- // registration
- RegistrationInfo regInfo = info.getRegistrationInfo();
- RegistrationInfoMapping rim = mapping.getRegistrationInfo();
- regInfo.setConsumerName(rim.getConsumerName());
- regInfo.setRegistrationHandle(rim.getRegistrationHandle());
- regInfo.setRegistrationState(Safe.getBytes(rim.getRegistrationState()));
-
- // registration properties
- for (RegistrationPropertyMapping rpm : rim.getRegistrationProperties())
- {
- RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
- String name = rpdm.getName();
-
- RegistrationProperty prop = regInfo.setRegistrationPropertyValue(name, rpm.getValue());
-
- RegistrationPropertyDescription desc = new RegistrationPropertyDescription(name, QName.valueOf(rpdm.getType()));
- desc.setDefaultDescription(rpdm.getDescription());
- desc.setHint(new LocalizedString(rpdm.getHint()));
- desc.setLabel(new LocalizedString(rpdm.getLabel()));
- prop.setDescription(desc);
-
- prop.setStatus(RegistrationProperty.Status.valueOf(rpm.getStatus()));
- }
-
- return info;
- }
-
private static class MappingToProducerInfoIterator implements Iterator<ProducerInfo>
{
private Iterator<ProducerInfoMapping> mappings;
@@ -279,7 +188,7 @@
public ProducerInfo next()
{
- return toProducerInfo(mappings.next());
+ return mappings.next().toProducerInfo();
}
public void remove()
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -25,6 +25,7 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.Property;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -39,4 +40,16 @@
public abstract String getWSDLURL();
public abstract void setWSDLURL(String wsdlURL);
+
+ public void initFrom(EndpointConfigurationInfo info)
+ {
+ setWSDLURL(info.getWsdlDefinitionURL());
+ }
+
+ public EndpointConfigurationInfo toEndpointConfigurationInfo()
+ {
+ EndpointConfigurationInfo info = new EndpointConfigurationInfo();
+ info.setWsdlDefinitionURL(getWSDLURL());
+ return info;
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -28,6 +28,9 @@
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -68,4 +71,40 @@
public abstract boolean getAvailable();
public abstract void setAvailable(boolean available);*/
+
+ public void initFrom(ProducerInfo producerInfo)
+ {
+ setActive(producerInfo.isActive());
+ setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
+ setId(producerInfo.getId());
+
+ EndpointInfoMapping eim = getEndpointInfo();
+ eim.initFrom(producerInfo.getEndpointConfigurationInfo());
+
+ RegistrationInfoMapping rim = getRegistrationInfo();
+ RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
+ rim.initFrom(regInfo);
+ }
+
+ public ProducerInfo toProducerInfo()
+ {
+ // todo: should probably use a ProducerInfo implementation backed by mapping at some point
+ ProducerInfo info = new ProducerInfo();
+
+ // basic properties
+ info.setKey(getKey());
+ info.setId(getId());
+ info.setActive(getActive());
+ info.setExpirationCacheSeconds(getExpirationCacheSeconds());
+
+ // endpoint
+ EndpointConfigurationInfo endInfo = getEndpointInfo().toEndpointConfigurationInfo();
+ info.setEndpointConfigurationInfo(endInfo);
+
+ // registration
+ RegistrationInfo regInfo = getRegistrationInfo().toRegistrationInfo();
+ info.setRegistrationInfo(regInfo);
+
+ return info;
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -27,7 +27,13 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
+import org.exoplatform.commons.utils.Safe;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
@@ -60,4 +66,56 @@
@Create
public abstract RegistrationPropertyMapping create();
+
+ public void initFrom(RegistrationInfo regInfo)
+ {
+ setConsumerName(regInfo.getConsumerName());
+ setRegistrationHandle(regInfo.getRegistrationHandle());
+ byte[] bytes = regInfo.getRegistrationState();
+ if (bytes != null && bytes.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+ setRegistrationState(is);
+ }
+
+ // clear and recreate registration properties
+ List<RegistrationPropertyMapping> rpms = getRegistrationProperties();
+ rpms.clear();
+ for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
+ {
+ // create new RegistrationPropertyMapping for this RegistrationInfoMapping
+ RegistrationPropertyMapping rpm = create();
+
+ // initialize
+ rpm.initFrom(property);
+
+ // add newly created RegistrationPropertyMapping to parent
+ rpms.add(rpm);
+ }
+ }
+
+ public RegistrationInfo toRegistrationInfo()
+ {
+ RegistrationInfo regInfo = new RegistrationInfo();
+
+ regInfo.setConsumerName(getConsumerName());
+ regInfo.setRegistrationHandle(getRegistrationHandle());
+ regInfo.setRegistrationState(Safe.getBytes(getRegistrationState()));
+
+ // registration properties
+ for (RegistrationPropertyMapping rpm : getRegistrationProperties())
+ {
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ String name = rpdm.getName();
+
+ RegistrationProperty prop = regInfo.setRegistrationPropertyValue(name, rpm.getValue());
+
+ RegistrationPropertyDescription desc = rpdm.toRegistrationPropertyDescription();
+ prop.setDescription(desc);
+
+ prop.setStatus(RegistrationProperty.Status.valueOf(rpm.getStatus()));
+ }
+
+ return regInfo;
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -28,6 +28,8 @@
import org.chromattic.api.annotations.Property;
import org.chromattic.api.annotations.RelatedMappedBy;
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -53,4 +55,16 @@
public abstract String getStatus();
public abstract void setStatus(String status);
+
+ public void initFrom(RegistrationProperty property)
+ {
+ // set properties
+ setStatus(property.getStatus().name());
+ setValue(property.getValue());
+
+ // description
+ RegistrationPropertyDescriptionMapping rpdm = getDescription();
+ RegistrationPropertyDescription desc = property.getDescription();
+ rpdm.initFrom(desc);
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-23 14:32:21 UTC (rev 762)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-23 14:43:45 UTC (rev 763)
@@ -25,7 +25,11 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.Property;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import javax.xml.namespace.QName;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -35,39 +39,50 @@
{
public static final String NODE_NAME = "wsrp:registrationpropertydescription";
- // todo: this should really be a QName
-
@Property(name = "name")
- public abstract String getName();
+ public abstract String getName(); // todo: this should really be a QName
public abstract void setName(String name);
- // todo: this should really be a QName
@Property(name = "type")
- public abstract String getType();
+ public abstract String getType(); // todo: this should really be a QName
public abstract void setType(String type);
-
- // todo: this should really be a LocalizedString
-
@Property(name = "description")
- public abstract String getDescription();
+ public abstract String getDescription(); // todo: this should really be a LocalizedString
public abstract void setDescription(String description);
- // todo: this should really be a LocalizedString
-
@Property(name = "hint")
- public abstract String getHint();
+ public abstract String getHint(); // todo: this should really be a LocalizedString
public abstract void setHint(String hint);
- // todo: this should really be a LocalizedString
-
@Property(name = "label")
- public abstract String getLabel();
+ public abstract String getLabel(); // todo: this should really be a LocalizedString
public abstract void setLabel(String label);
+
+ public void initFrom(RegistrationPropertyDescription desc)
+ {
+ setDescription(desc.getDescription().getValue());
+ setHint(desc.getHint().getValue());
+ setLabel(desc.getLabel().getValue());
+
+ // convert QNames to Strings
+ setName(desc.getName().toString());
+ setType(desc.getType().toString());
+ }
+
+ public RegistrationPropertyDescription toRegistrationPropertyDescription()
+ {
+ RegistrationPropertyDescription desc = new RegistrationPropertyDescription(getName(), QName.valueOf(getType()));
+ desc.setDefaultDescription(getDescription());
+ desc.setHint(new LocalizedString(getHint()));
+ desc.setLabel(new LocalizedString(getLabel()));
+
+ return desc;
+ }
}
15 years, 1 month
gatein SVN: r762 - in components/wsrp/trunk/consumer/src: test/java/org/gatein/wsrp/consumer and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-23 09:32:21 -0500 (Mon, 23 Nov 2009)
New Revision: 762
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
Log:
- Added test cases and checks.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-23 14:01:38 UTC (rev 761)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-23 14:32:21 UTC (rev 762)
@@ -218,8 +218,9 @@
return persistentEndpointInfo;
}
- void setEndpointConfigurationInfo(EndpointConfigurationInfo endpointConfigurationInfo)
+ public void setEndpointConfigurationInfo(EndpointConfigurationInfo endpointConfigurationInfo)
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(endpointConfigurationInfo, "EndpointConfigurationInfo");
this.persistentEndpointInfo = endpointConfigurationInfo;
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2009-11-23 14:01:38 UTC (rev 761)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2009-11-23 14:32:21 UTC (rev 762)
@@ -104,6 +104,25 @@
}
}
+ public void testSetEndpointConfigurationInfo()
+ {
+ EndpointConfigurationInfo endInfo = new EndpointConfigurationInfo();
+ info.setEndpointConfigurationInfo(endInfo);
+ assertEquals(endInfo, info.getEndpointConfigurationInfo());
+ }
+
+ public void testSetNullEndpointConfigurationInfo()
+ {
+ try
+ {
+ info.setEndpointConfigurationInfo(null);
+ fail("Shouldn't be possible to set a null EndpointConfigurationInfo");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
public void testRefreshAndCache() throws Exception
{
ServiceDescriptionBehavior behavior = new ServiceDescriptionBehavior();
15 years, 1 month
gatein SVN: r761 - in components/wsrp/trunk/consumer/src: test/java/org/gatein/wsrp/consumer and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-23 09:01:38 -0500 (Mon, 23 Nov 2009)
New Revision: 761
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
Log:
- Added more tests and additional check.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-23 13:39:25 UTC (rev 760)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-23 14:01:38 UTC (rev 761)
@@ -232,6 +232,7 @@
public void setRegistrationInfo(RegistrationInfo registrationInfo)
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(registrationInfo, "RegistrationInfo");
this.persistentRegistrationInfo = registrationInfo;
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2009-11-23 13:39:25 UTC (rev 760)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2009-11-23 14:01:38 UTC (rev 761)
@@ -77,6 +77,33 @@
info.setRegistry(new MockConsumerRegistry());
}
+ public void testSetRegistrationInfo()
+ {
+ RegistrationInfo regInfo = new RegistrationInfo(info);
+ assertEquals(regInfo, info.getRegistrationInfo());
+ assertEquals(info, regInfo.getParent());
+
+ RegistrationInfo regInfo2 = new RegistrationInfo();
+ assertEquals(regInfo, info.getRegistrationInfo());
+ assertNull(regInfo2.getParent());
+
+ info.setRegistrationInfo(regInfo2);
+ assertEquals(regInfo2, info.getRegistrationInfo());
+ assertEquals(info, regInfo2.getParent());
+ }
+
+ public void testSetNullRegistrationInfo()
+ {
+ try
+ {
+ info.setRegistrationInfo(null);
+ fail("Shouldn't be possible to set a null RegistrationInfo");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
public void testRefreshAndCache() throws Exception
{
ServiceDescriptionBehavior behavior = new ServiceDescriptionBehavior();
15 years, 1 month
gatein SVN: r760 - components/sso/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2009-11-23 08:39:25 -0500 (Mon, 23 Nov 2009)
New Revision: 760
Modified:
components/sso/trunk/pom.xml
Log:
Fix name
Modified: components/sso/trunk/pom.xml
===================================================================
--- components/sso/trunk/pom.xml 2009-11-23 10:33:28 UTC (rev 759)
+++ components/sso/trunk/pom.xml 2009-11-23 13:39:25 UTC (rev 760)
@@ -24,7 +24,7 @@
<name>Gatein - Single Sign On Integration</name>
- <description>Gatein Single Sign On Integration</description>
+ <description>GateIn Single Sign On Integration</description>
<modules>
<module>agent</module>
15 years, 1 month
gatein SVN: r759 - in portal/trunk/portlet/exoadmin/src/main: webapp/WEB-INF/classes/locale/portlet/exoadmin and 1 other directory.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-11-23 05:33:28 -0500 (Mon, 23 Nov 2009)
New Revision: 759
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
Log:
GTNPORTAL-244: Add 'successfully registered' message and update relevant resource bundles
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-23 10:19:24 UTC (rev 758)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-23 10:33:28 UTC (rev 759)
@@ -90,6 +90,8 @@
if(registerInput.save(userHandler, context)){
//TODO: Send email and add Account Activating feature
+ UIApplication uiApp = context.getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UIRegisterForm.registerWithSuccess.message", null));
}
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-11-23 10:19:24 UTC (rev 758)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-11-23 10:33:28 UTC (rev 759)
@@ -17,4 +17,5 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
-UIRegisterForm.title=Register New Account
\ No newline at end of file
+UIRegisterForm.registerWithSuccess.message=You have successfully registered a new account!
+UIRegisterForm.title=Register New Account
15 years, 1 month
gatein SVN: r758 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-23 05:19:24 -0500 (Mon, 23 Nov 2009)
New Revision: 758
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
Log:
GTNPORTAL-284: Still show category selector form when select gadget in Gadget item
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-23 09:52:08 UTC (rev 757)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-23 10:19:24 UTC (rev 758)
@@ -65,8 +65,7 @@
public UIGadgetInfo() throws Exception
{
- UICategorySelector categorySelector = addChild(UICategorySelector.class, null, null);
- categorySelector.setRendered(false);
+ addChild(UICategorySelector.class, null, null);
}
public Gadget getGadget()
@@ -99,8 +98,7 @@
for (ApplicationCategory category : allCategories)
{
- String definitionName = gadget_.getTitle().replace(' ', '_');
- if (appRegService.getApplication(category.getName(), definitionName) != null)
+ if (appRegService.getApplication(category.getName(), gadget_.getName()) != null)
{
nameList.add(category.getDisplayName());
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-23 09:52:08 UTC (rev 757)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-23 10:19:24 UTC (rev 758)
@@ -128,6 +128,7 @@
uiGadgetInfo = addChild(UIGadgetInfo.class, null, null);
}
uiGadgetInfo.setGadget(selectedGadget_);
+ uiGadgetInfo.getChild(UICategorySelector.class).setRendered(false);
}
public void processRender(WebuiRequestContext context) throws Exception
15 years, 1 month
gatein SVN: r757 - portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-23 04:52:08 -0500 (Mon, 23 Nov 2009)
New Revision: 757
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
Log:
GTNPORTAL-277: Problem when add tab, which has same name with a deleted tab, on dashboard
Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-23 08:38:37 UTC (rev 756)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-23 09:52:08 UTC (rev 757)
@@ -132,7 +132,6 @@
{
PageNode currentParent = selectedPath.get(selectedPath.size() - 2);
siblings = currentParent.getChildren();
-
}
return siblings;
}
@@ -172,6 +171,12 @@
nodes.remove(nodeIndex);
+ String pageRef = tobeRemoved.getPageReference();
+ if (pageRef != null && pageRef.length() > 0)
+ {
+ configService.remove(configService.getPage(pageRef));
+ }
+
if (tobeRemoved.getUri().equals(selectedNode.getUri()))
{
selectedNode = nodes.get(Math.max(0, nodeIndex - 1));
@@ -377,6 +382,7 @@
if (selectedNode != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
+ prContext.setResponseComplete(true);
prContext.getResponse().sendRedirect(prContext.getPortalURI() + selectedNode.getUri());
}
}
@@ -400,6 +406,7 @@
if (uri != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
+ prContext.setResponseComplete(true);
prContext.getResponse().sendRedirect(prContext.getPortalURI() + uri);
}
}
15 years, 1 month
gatein SVN: r756 - in portal/trunk/portlet/exoadmin/src/main: webapp/WEB-INF and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-11-23 03:38:37 -0500 (Mon, 23 Nov 2009)
New Revision: 756
Added:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
GTNPORTAL-244: Add title to the register form, and add reset action
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-23 07:42:35 UTC (rev 755)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-23 08:38:37 UTC (rev 756)
@@ -75,6 +75,10 @@
setActions(ACTIONS);
}
+ private void resetInput(){
+ getChild(UIRegisterInputSet.class).reset();
+ }
+
static public class SubscribeActionListener extends EventListener<UIRegisterForm>{
@Override
public void execute(Event<UIRegisterForm> event) throws Exception {
@@ -129,7 +133,7 @@
{
// TODO Auto-generated method stub
UIRegisterForm registerForm = event.getSource();
- registerForm.reset();
+ registerForm.resetInput();
}
}
}
Added: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-11-23 08:38:37 UTC (rev 756)
@@ -0,0 +1,20 @@
+#
+# 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
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+UIRegisterForm.title=Register New Account
\ 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 2009-11-23 07:42:35 UTC (rev 755)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-11-23 08:38:37 UTC (rev 756)
@@ -97,7 +97,7 @@
</supports>
<supported-locale>en</supported-locale>
- <!--<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>-->
+ <resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
<portlet-info>
<title>Register Portlet</title>
<short-title>Register Portlet</short-title>
15 years, 1 month
gatein SVN: r755 - in portal/trunk/portlet/dashboard/src/main: webapp/groovy/gadget/webui/component and 1 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-23 02:42:35 -0500 (Mon, 23 Nov 2009)
New Revision: 755
Removed:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
portal/trunk/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css
Log:
GTNPORTAL-278 Disable edit mode of gadget wrapper portlet:
- Remove UIGadgetEditMode.java
- Change UIGadgetPortlet.java, UIGadgetPortlet.gtmpl, UIGadgetPortlet/DefaultStyleSheets
Deleted: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java 2009-11-23 07:04:58 UTC (rev 754)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java 2009-11-23 07:42:35 UTC (rev 755)
@@ -1,212 +0,0 @@
-/**
- * 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
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.gadget.webui.component;
-
-import org.exoplatform.application.registry.Application;
-import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.webui.application.UIGadget;
-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.application.portlet.PortletRequestContext;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.core.model.SelectItemOption;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormSelectBox;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
-import org.exoplatform.webui.form.validator.URLValidator;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-
-/**
- * Created by The eXo Platform SARL Author : dang.tung tungcnw(a)gmail.com June
- * 27, 2008
- */
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
- @EventConfig(listeners = UIGadgetEditMode.SaveActionListener.class),
- @EventConfig(listeners = UIGadgetEditMode.SelectTypeActionListener.class, phase = Phase.DECODE)})
-public class UIGadgetEditMode extends UIForm
-{
-
- public static final String FIELD_URL = "gadgetUrl";
-
- public static final String TYPE_SELECTOR = "typeSelector";
-
- public static final String GADGET_SELECTOR = "gadgetSelector";
-
- public static final String REMOTE_TYPE = "remote";
-
- public static final String LOCAL_TYPE = "local";
-
- public UIGadgetEditMode() throws Exception
- {
- PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- PortletPreferences pref = pcontext.getRequest().getPreferences();
-
- List<SelectItemOption<String>> options = new ArrayList<SelectItemOption<String>>();
- options.add(new SelectItemOption<String>(REMOTE_TYPE, REMOTE_TYPE));
- options.add(new SelectItemOption<String>(LOCAL_TYPE, LOCAL_TYPE));
-
- UIFormSelectBox typeSelector = new UIFormSelectBox(TYPE_SELECTOR, null, options);
- typeSelector.setOnChange("SelectType");
- addUIFormInput(typeSelector);
- addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url",
- "http://www.google.com/ig/modules/horoscope.xml")));
- UIFormSelectBox gadgetSelector =
- new UIFormSelectBox(GADGET_SELECTOR, null, new ArrayList<SelectItemOption<String>>());
- gadgetSelector.setRendered(false);
- gadgetSelector.addValidator(MandatoryValidator.class);
- addUIFormInput(gadgetSelector);
- setActions(new String[]{"Save"});
- }
-
- public static class SaveActionListener extends EventListener<UIGadgetEditMode>
- {
- public void execute(final Event<UIGadgetEditMode> event) throws Exception
- {
- UIGadgetEditMode uiGadgetEditMode = event.getSource();
- PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- String url = uiGadgetEditMode.getUIStringInput(FIELD_URL).getValue();
- UIGadgetPortlet uiPortlet = uiGadgetEditMode.getParent();
- UIFormSelectBox typeSelector = uiGadgetEditMode.getUIFormSelectBox(TYPE_SELECTOR);
- org.exoplatform.webui.core.UIApplication uiApplication = pcontext.getUIApplication();
- UIPortalApplication portalApp = Util.getUIPortalApplication();
-
- if (typeSelector.getValue().equals(REMOTE_TYPE))
- {
- String label = uiGadgetEditMode.getLabel(FIELD_URL);
- if (label.charAt(label.length() - 1) == ':')
- label = label.substring(0, label.length() - 1);
- Object[] args = {label};
-
- if (url == null || url.length() == 0)
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- uiApplication.addMessage(new ApplicationMessage("EmptyFieldValidator.msg.empty-input", args,
- ApplicationMessage.WARNING));
- return;
- }
- url = url.trim();
- if (!url.matches(URLValidator.URL_REGEX))
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- uiApplication.addMessage(new ApplicationMessage("URLValidator.msg.invalid-url", args,
- ApplicationMessage.WARNING));
- return;
- }
- try
- {
- PortletPreferences pref = pcontext.getRequest().getPreferences();
- new URL(url);
- pref.setValue("url", url);
- pref.store();
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(url);
- if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
- pcontext.setApplicationMode(PortletMode.VIEW);
- }
- catch (Exception e)
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- }
- }
- else
- {
- UIFormSelectBox gadgetSelector = uiGadgetEditMode.getUIFormSelectBox(GADGET_SELECTOR);
- String gadgetId = gadgetSelector.getValue();
-
- ApplicationRegistryService service = uiPortlet.getApplicationComponent(ApplicationRegistryService.class);
- Application application = service.getApplication(gadgetId);
- if (application == null)
- {
- return;
- }
- UIGadget uiGadget = event.getSource().createUIComponent(pcontext, UIGadget.class, null, null);
- uiGadget.setState(new TransientApplicationState<Gadget>(application.getApplicationName()));
- PortletPreferences pref = pcontext.getRequest().getPreferences();
- pref.setValue("url", uiGadget.getUrl());
- pref.store();
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiGadget.getUrl());
-
- if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
- pcontext.setApplicationMode(PortletMode.VIEW);
- pcontext.addUIComponentToUpdateByAjax(uiPortlet);
- }
- }
- }
-
- static public class SelectTypeActionListener extends EventListener<UIGadgetEditMode>
- {
- public void execute(final Event<UIGadgetEditMode> event) throws Exception
- {
- UIGadgetEditMode uiGadgetEdit = event.getSource();
- UIFormSelectBox typeSelector = uiGadgetEdit.getUIFormSelectBox(TYPE_SELECTOR);
- String selectedValue = typeSelector.getValue();
- UIFormStringInput urlInput = uiGadgetEdit.getUIStringInput(FIELD_URL);
- UIFormSelectBox gadgetSelector = uiGadgetEdit.getUIFormSelectBox(GADGET_SELECTOR);
- if (selectedValue.equals(REMOTE_TYPE))
- {
- urlInput.setRendered(true);
- gadgetSelector.setRendered(false);
- }
- else
- {
- urlInput.setRendered(false);
- gadgetSelector.setRendered(true);
- List<SelectItemOption<String>> gadgetItems = gadgetSelector.getOptions();
- gadgetItems.clear();
-
- ApplicationRegistryService service = uiGadgetEdit.getApplicationComponent(ApplicationRegistryService.class);
- UserACL acl = uiGadgetEdit.getApplicationComponent(UserACL.class);
- List<Application> appList = service.getAllApplications();
- for (Application app : appList)
- {
- if (app.getType().equals(ApplicationType.GADGET))
- {
- for (String per : app.getAccessPermissions())
- {
- if (acl.hasPermission(per))
- {
- gadgetItems.add(new SelectItemOption<String>(app.getDisplayName(), app.getId()));
- break;
- }
- }
- }
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(uiGadgetEdit);
- }
- }
-}
Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2009-11-23 07:04:58 UTC (rev 754)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2009-11-23 07:42:35 UTC (rev 755)
@@ -41,8 +41,7 @@
{
public UIGadgetPortlet() throws Exception
{
- addChild(UIGadgetViewMode.class, null, null);
- addChild(UIGadgetEditMode.class, null, null);
+ addChild(UIGadgetViewMode.class, null, null);
}
public String getUrl()
Modified: portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2009-11-23 07:04:58 UTC (rev 754)
+++ portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2009-11-23 07:42:35 UTC (rev 755)
@@ -1,6 +1,5 @@
<% import javax.portlet.PortletMode ;
- import org.exoplatform.gadget.webui.component.UIGadgetViewMode ;
- import org.exoplatform.gadget.webui.component.UIGadgetEditMode ;
+ import org.exoplatform.gadget.webui.component.UIGadgetViewMode;
def rcontext = _ctx.getRequestContext() ;
def popupMsgs = uicomponent.getUIPopupMessages();
%>
@@ -8,8 +7,6 @@
<%
if( rcontext.getApplicationMode() == PortletMode.VIEW ) {
uicomponent.renderChild(UIGadgetViewMode.class) ;
- } else {
- uicomponent.renderChild(UIGadgetEditMode.class);
}
if(popupMsgs != null) popupMsgs.processRender(rcontext); %>
Modified: portal/trunk/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css 2009-11-23 07:04:58 UTC (rev 754)
+++ portal/trunk/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css 2009-11-23 07:42:35 UTC (rev 755)
@@ -21,9 +21,7 @@
padding: 1px;
height: 100%;
}
-.UIGadgetPortlet .UIGadgetEditMode{
- padding: 50px 0;
-}
+
.UIGadgetPortlet .UIGadgetViewMode {
height: 100%;
}
15 years, 1 month
gatein SVN: r754 - portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-23 02:04:58 -0500 (Mon, 23 Nov 2009)
New Revision: 754
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java
Log:
GTNPORTAL-276: Problem when change URL of logo portlet is empty
Modified: portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java
===================================================================
--- portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java 2009-11-23 03:14:40 UTC (rev 753)
+++ portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java 2009-11-23 07:04:58 UTC (rev 754)
@@ -19,9 +19,6 @@
package org.exoplatform.portal.webui.component;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.ApplicationMessage;
@@ -35,9 +32,11 @@
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.URLValidator;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+
/** Created by The eXo Platform SAS Author : eXoPlatform October 2, 2009 */
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {@EventConfig(listeners = UILogoEditMode.SaveActionListener.class)})
public class UILogoEditMode extends UIForm
@@ -49,8 +48,7 @@
{
PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
PortletPreferences pref = pcontext.getRequest().getPreferences();
- addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url", ""))
- .addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url", "")));
}
static public class SaveActionListener extends EventListener<UILogoEditMode>
@@ -59,7 +57,7 @@
{
UILogoEditMode uiForm = event.getSource();
String url = uiForm.getUIStringInput(FIELD_URL).getValue();
- if (url != null && !url.trim().matches(URLValidator.URL_REGEX))
+ if ((url == null || url.trim().length() == 0) || (!url.trim().matches(URLValidator.URL_REGEX)))
{
UILogoPortlet uiPortlet = uiForm.getParent();
uiForm.getUIStringInput(FIELD_URL).setValue(uiPortlet.getURL());
15 years, 1 month