gatein SVN: r1262 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-13 12:34:03 -0500 (Wed, 13 Jan 2010)
New Revision: 1262
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java
Removed:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java
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
Log:
- Renamed UIWSRPFormInputSet to UIWsrpRegistrationDetails and moved all the fields pertaining to registration details BUT
configuration is NOT working and results in the portlet failing to display. :(
Deleted: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java 2010-01-13 15:17:03 UTC (rev 1261)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java 2010-01-13 17:34:03 UTC (rev 1262)
@@ -1,84 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.exoplatform.wsrp.webui.component;
-
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormInputSet;
-
-import java.io.Writer;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class UIWSRPFormInputSet extends UIFormInputSet
-{
- public UIWSRPFormInputSet(String name)
- {
- super(name);
- }
-
- @Override
- public void processRender(WebuiRequestContext context) throws Exception
- {
- if (getComponentConfig() != null)
- {
- super.processRender(context);
- return;
- }
-
- Writer w = context.getWriter();
- w.write("<div class=\"UIFormInputSet\">");
-
- ResourceBundle res = context.getApplicationResourceBundle();
- UIForm uiForm = getAncestorOfType(UIForm.class);
- for (UIComponent inputEntry : getChildren())
- {
- if (inputEntry.isRendered())
- {
- w.write("<div class=\"row\">");
-
- String label;
- try
- {
- label = uiForm.getLabel(res, inputEntry.getId());
- }
- catch (MissingResourceException ex)
- {
- label = inputEntry.getName();
- System.err.println("\n " + uiForm.getId() + ".label." + inputEntry.getId() + " not found value");
- }
-
- w.write("<label>" + label + "</label>");
- renderUIComponent(inputEntry);
-
- w.write("</div>");
- }
- }
- w.write("</div>");
- }
-}
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-13 15:17:03 UTC (rev 1261)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-13 17:34:03 UTC (rev 1262)
@@ -24,7 +24,6 @@
import org.exoplatform.portal.webui.util.Util;
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.EventConfig;
import org.exoplatform.webui.core.UIApplication;
@@ -33,43 +32,34 @@
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.UIFormInputSet;
-import org.exoplatform.webui.form.UIFormStringInput;
-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;
-/** @author Wesley Hales */
-
+/**
+ * @author Wesley Hales
+ * @author Chris Laprun
+ */
@ComponentConfig(
lifecycle = UIFormLifecycle.class,
template = "app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl",
events = {
@EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)
- })
-
+ }
+)
public class UIWsrpProducerEditor extends UIForm
{
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 static final String REGISTRATION_DETAILS = "registrationdetails";
private ProducerConfigurationService configService;
-
- private UIFormInputSet registrationDetails;
- private UIFormInputBase<String> policy;
- private UIFormInputBase<String> validator;
+ private UIWsrpRegistrationDetails registrationDetails;
private UIFormCheckBoxInput regReqForDesc;
private UIFormCheckBoxInput strictMode;
private UIFormCheckBoxInput<Boolean> regRequired;
-
public UIWsrpProducerEditor() throws Exception
{
configService = Util.getUIPortalApplication().getApplicationComponent(ProducerConfigurationService.class);
@@ -89,22 +79,18 @@
// registration details
// form set to gather registration information
- registrationDetails = new UIWSRPFormInputSet(REGISTRATION_DETAILS);
+ registrationDetails = new UIWsrpRegistrationDetails(REGISTRATION_DETAILS, this);
addUIFormInput(registrationDetails);
- // policy
- policy = new UIFormStringInput(POLICY_CLASS, POLICY_CLASS, null);
- registrationDetails.addUIFormInput(policy);
+ init();
+ }
- // validator
- validator = new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null);
- registrationDetails.addUIFormInput(validator);
-
-
- //init();
+ ProducerConfigurationService getService()
+ {
+ return configService;
}
- public void processRender(WebuiRequestContext context) throws Exception
+ private void init() throws Exception
{
ProducerConfiguration configuration = configService.getConfiguration();
@@ -115,53 +101,19 @@
boolean registrationRequired = registrationRequirements.isRegistrationRequired();
regRequired.setValue(registrationRequired);
-
// if registration is required then we display more information
if (registrationRequired)
{
-
+ registrationDetails.init(registrationRequirements);
registrationDetails.setRendered(true);
- context.getUIApplication().findComponentById(UIWsrpProducerOverview.REGISTRATION_PROPERTIES).setRendered(true);
-
- RegistrationPolicy policy = registrationRequirements.getPolicy();
- String policyClassName = policy.getClass().getName();
- this.policy.setValue(policyClassName);
-
- // if policy is the default one, display information about the validator
- if (ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
- {
- DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
- validator.setValue(defaultPolicy.getValidator().getClass().getName());
- validator.setRendered(true);
- }
- else
- {
- validator.setRendered(false);
- }
-
- // registration properties
-
}
else
{
registrationDetails.setRendered(false);
- context.getUIApplication().findComponentById(UIWsrpProducerOverview.REGISTRATION_PROPERTIES).setRendered(false);
}
-
- super.processRender(context);
}
- ProducerConfigurationService getService()
- {
- return configService;
- }
- private void init() throws Exception
- {
-
- }
-
-
static public class SaveActionListener extends EventListener<UIWsrpProducerEditor>
{
public void execute(Event<UIWsrpProducerEditor> event) throws Exception
@@ -177,7 +129,7 @@
registrationRequirements.setRegistrationRequired(requiresReg);
if (requiresReg)
{
- registrationRequirements.reloadPolicyFrom(source.policy.getValue(), source.validator.getValue());
+ source.registrationDetails.updateRegistrationDetailsFromForm(registrationRequirements);
}
try
@@ -195,14 +147,13 @@
}
}
-
public static class RegistrationOnChangeActionListener extends EventListener<UIFormCheckBoxInput>
{
public void execute(Event<UIFormCheckBoxInput> event) throws Exception
{
UIFormCheckBoxInput source = event.getSource();
UIWsrpProducerEditor parent = source.getAncestorOfType(UIWsrpProducerEditor.class);
- //parent.init();
+ parent.init();
//update only the parent, avoid updating the full portlet
event.getRequestContext().addUIComponentToUpdateByAjax(parent);
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-13 15:17:03 UTC (rev 1261)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-13 17:34:03 UTC (rev 1262)
@@ -22,245 +22,25 @@
*/
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.portal.webui.util.Util;
-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.UIContainer;
-import org.exoplatform.webui.core.UIGrid;
-import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-import org.exoplatform.webui.core.renderers.ValueRenderer;
-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.LocalizedString;
-import org.gatein.wsrp.registration.RegistrationPropertyDescription;
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
-/** @author Wesley Hales */
-@ComponentConfigs({
- @ComponentConfig(id = UIWsrpProducerOverview.REGISTRATION_PROPERTIES, 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.EditActionListener.class),
- @EventConfig(listeners = UIWsrpProducerOverview.DeleteActionListener.class)
- }
- )})
-
+/**
+ * @author Wesley Hales
+ * @author Chris Laprun
+ */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl"
+)
public class UIWsrpProducerOverview extends UIContainer
{
- private static String[] FIELDS = {"key", "name", "description", "label", "hint"};
- private static String[] SELECT_ACTIONS = {"Add", "Edit", "Delete"};
-
- public static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
- private static final String REGISTRATION_PROPERTIES_ITERATOR = "ProducerPropPageIterator";
- private UIGrid registrationProperties;
- private ProducerConfigurationService configService;
private UIWsrpProducerEditor producerForm;
public UIWsrpProducerOverview() throws Exception
{
- //setSelectedTab(2);
- configService = Util.getUIPortalApplication().getApplicationComponent(ProducerConfigurationService.class);
- ProducerConfiguration configuration = configService.getConfiguration();
- //producerForm = createUIComponent();
- addChild(UIWsrpProducerEditor.class, null, null);
- // registration properties
- registrationProperties = addChild(UIGrid.class, REGISTRATION_PROPERTIES, REGISTRATION_PROPERTIES);
-
- // add renderer for LocalizedString
- ValueRenderer<LocalizedString> renderer = new ValueRenderer<LocalizedString>()
- {
- @Override
- public String render(LocalizedString value)
- {
- return value.getValue();
- }
- };
- registrationProperties.registerRendererFor(renderer, LocalizedString.class);
-
- //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
- registrationProperties.configure("key", FIELDS, SELECT_ACTIONS);
- registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
- //registrationDetails.addChild(registrationProperties.getUIPageIterator());
- registrationProperties.getUIPageIterator().setRendered(false);
-
- Map<QName, RegistrationPropertyDescription> regProps = configuration.getRegistrationRequirements().getRegistrationProperties();
- registrationProperties.getUIPageIterator().setPageList(createPageList(getPropertyList(regProps)));
-
- //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);
-
+ producerForm = createUIComponent(UIWsrpProducerEditor.class, null, "Producer Editor");
+ addChild(producerForm);
}
-
- 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>();
- for (Object o : descriptions.entrySet())
- {
- Map.Entry entry = (Map.Entry)o;
- RegistrationPropertyDescription rpd = (RegistrationPropertyDescription)entry.getValue();
- result.add(rpd);
-
- }
-
-
- //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 EditActionListener extends EventListener<UIWsrpProducerOverview>
- {
- public void execute(Event<UIWsrpProducerOverview> event) throws Exception
- {
- UIWsrpProducerOverview source = event.getSource();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
- editor.setRegistrationPropertyDescription(source.getService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- popup.setUIComponent(editor);
- popup.setRendered(true);
- popup.setShow(true);
-
- }
- }
-
- static public class DeleteActionListener extends EventListener<UIWsrpProducerOverview>
- {
- public void execute(Event<UIWsrpProducerOverview> event)
- {
- UIWsrpProducerOverview source = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
- ProducerConfigurationService service = source.getService();
- service.getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
- service.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 source = event.getSource();
- UIPopupWindow popup = source.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);
-
- }
- }
-
- ProducerConfigurationService getService()
- {
- return configService;
- }
-
- public void processRender(WebuiRequestContext context) throws Exception
- {
-// UITabPane uiTabPane = context.getUIApplication().findComponentById("UIWsrpConsoleTab");
-// uiTabPane.setSelectedTab(2);
- super.processRender(context);
- }
-
-
- public ProducerConfigurationService getProducerConfigurationService() throws Exception
- {
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- return (ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
- }
-
-
}
Copied: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java (from rev 1241, portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java)
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpRegistrationDetails.java 2010-01-13 17:34:03 UTC (rev 1262)
@@ -0,0 +1,319 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.wsrp.webui.component;
+
+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.UIComponent;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.renderers.ValueRenderer;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormInputBase;
+import org.exoplatform.webui.form.UIFormInputSet;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.gatein.registration.RegistrationPolicy;
+import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.xml.namespace.QName;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@ComponentConfigs({
+ @ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
+ @ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ events = {
+ @EventConfig(listeners = UIWsrpRegistrationDetails.AddPropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpRegistrationDetails.EditPropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpRegistrationDetails.DeletePropertyActionListener.class)
+ })
+})
+public class UIWsrpRegistrationDetails extends UIFormInputSet
+{
+ private UIFormInputBase<String> policy;
+ private UIFormInputBase<String> validator;
+ private UIGrid registrationProperties;
+ static String[] FIELDS = {"name", "description", "label", "hint"};
+ static String[] SELECT_ACTIONS = {"AddProperty", "EditProperty", "DeleteProperty"};
+ 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";
+
+ public UIWsrpRegistrationDetails(String name, UIWsrpProducerEditor parent) throws Exception
+ {
+ super(name);
+
+ // policy
+ policy = new UIFormStringInput(POLICY_CLASS, POLICY_CLASS, null);
+ addUIFormInput(policy);
+
+ // validator
+ validator = new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null);
+ addUIFormInput(validator);
+
+ // registration properties
+ registrationProperties = addChild(UIGrid.class, REGISTRATION_PROPERTIES, REGISTRATION_PROPERTIES);
+
+ // add renderer for LocalizedString
+ ValueRenderer<LocalizedString> renderer = new ValueRenderer<LocalizedString>()
+ {
+ @Override
+ public String render(LocalizedString value)
+ {
+ return value.getValue();
+ }
+ };
+ registrationProperties.registerRendererFor(renderer, LocalizedString.class);
+
+ //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
+ registrationProperties.configure("name", FIELDS, SELECT_ACTIONS);
+ registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
+ registrationProperties.getUIPageIterator().setRendered(false);
+ addChild(registrationProperties.getUIPageIterator());
+
+ init(parent.getService().getConfiguration().getRegistrationRequirements());
+
+ //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);
+ }
+
+ void init(ProducerRegistrationRequirements registrationRequirements) throws Exception
+ {
+ RegistrationPolicy policy = registrationRequirements.getPolicy();
+ String policyClassName = policy.getClass().getName();
+ this.policy.setValue(policyClassName);
+
+ // if policy is the default one, display information about the validator
+ if (ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ {
+ DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
+ validator.setValue(defaultPolicy.getValidator().getClass().getName());
+ validator.setRendered(true);
+ }
+ else
+ {
+ validator.setRendered(false);
+ }
+
+ // registration properties
+ Map<QName, RegistrationPropertyDescription> regProps = registrationRequirements.getRegistrationProperties();
+ registrationProperties.getUIPageIterator().setPageList(createPageList(getPropertyList(regProps)));
+ }
+
+ 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);
+ }
+
+ @Override
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+ if (getComponentConfig() != null)
+ {
+ super.processRender(context);
+ return;
+ }
+
+ Writer w = context.getWriter();
+ w.write("<div class=\"UIFormInputSet\">");
+
+ ResourceBundle res = context.getApplicationResourceBundle();
+ UIForm uiForm = getAncestorOfType(UIForm.class);
+ for (UIComponent inputEntry : getChildren())
+ {
+ if (inputEntry.isRendered())
+ {
+ w.write("<div class=\"row\">");
+
+ String label;
+ try
+ {
+ label = uiForm.getLabel(res, inputEntry.getId());
+ }
+ catch (MissingResourceException ex)
+ {
+ label = inputEntry.getName();
+ System.err.println("\n " + uiForm.getId() + ".label." + inputEntry.getId() + " not found value");
+ }
+
+ w.write("<label>" + label + "</label>");
+ renderUIComponent(inputEntry);
+
+ w.write("</div>");
+ }
+ }
+ w.write("</div>");
+ }
+
+ public void updateRegistrationDetailsFromForm(ProducerRegistrationRequirements registrationRequirements)
+ {
+ registrationRequirements.reloadPolicyFrom(policy.getValue(), validator.getValue());
+
+ // todo: deal with registration properties
+ }
+
+ static public class EditPropertyActionListener extends EventListener<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ {
+ UIWsrpProducerEditor source = event.getSource();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+ editor.setRegistrationPropertyDescription(source.getService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+
+ }
+ }
+
+ static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event)
+ {
+ UIWsrpProducerEditor source = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+ ProducerConfigurationService service = source.getService();
+ service.getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ service.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<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ {
+ UIWsrpProducerEditor source = event.getSource();
+ UIPopupWindow popup = source.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);
+
+ }
+ }
+}
14 years, 11 months
gatein SVN: r1261 - in portal/trunk: component/scripting/src/main/java/org/exoplatform/groovyscript/text and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 10:17:03 -0500 (Wed, 13 Jan 2010)
New Revision: 1261
Removed:
portal/trunk/component/scripting/src/test/java/org/exoplatform/commons/utils/
Modified:
portal/trunk/.classpath
portal/trunk/.project
portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatistic.java
portal/trunk/pom.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatistic.java
Log:
- Updated common and pc
- Removed classes that are already part of common
Modified: portal/trunk/.classpath
===================================================================
--- portal/trunk/.classpath 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/.classpath 2010-01-13 15:17:03 UTC (rev 1261)
@@ -38,12 +38,7 @@
<classpathentry kind="src" output="portlet/web/target/classes" path="portlet/web/src/main/java"/>
<classpathentry excluding="**" kind="src" output="server/tomcat/patch/target/classes" path="server/tomcat/patch/src/main/tomcat"/>
<classpathentry kind="src" output="server/tomcat/plugin/target/classes" path="server/tomcat/plugin/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="server/jboss/patch/target/classes" path="server/jboss/patch/src/main/jboss"/>
<classpathentry kind="src" output="server/jboss/plugin/target/classes" path="server/jboss/plugin/src/main/java"/>
- <classpathentry kind="src" output="sample/extension/config/target/classes" path="sample/extension/config/src/main/java"/>
- <classpathentry kind="src" output="sample/extension/jar/target/classes" path="sample/extension/jar/src/main/java"/>
- <classpathentry kind="src" output="sample/portal/config/target/classes" path="sample/portal/config/src/main/java"/>
- <classpathentry kind="src" output="sample/portal/jar/target/classes" path="sample/portal/jar/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: portal/trunk/.project
===================================================================
--- portal/trunk/.project 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/.project 2010-01-13 15:17:03 UTC (rev 1261)
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>portal</name>
+ <name>trunk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -19,5 +24,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
Modified: portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatistic.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatistic.java 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatistic.java 2010-01-13 15:17:03 UTC (rev 1261)
@@ -19,8 +19,8 @@
package org.exoplatform.groovyscript.text;
-import org.exoplatform.commons.utils.AtomicPositiveLong;
-import org.exoplatform.commons.utils.LongSampler;
+import org.gatein.common.concurrent.AtomicPositiveLong;
+import org.gatein.common.concurrent.LongSampler;
import org.exoplatform.resolver.ResourceResolver;
/**
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/pom.xml 2010-01-13 15:17:03 UTC (rev 1261)
@@ -44,9 +44,9 @@
<org.exoplatform.jcr.version>1.12.0-Beta05</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>SNAPSHOT-r790473</org.shindig.version>
- <org.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
+ <org.gatein.common.version>2.0.0-CR03</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
- <org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
+ <org.gatein.pc.version>2.1.0-CR02</org.gatein.pc.version>
<org.picketlink.idm>1.1.0.Beta1</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta04</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta13</org.gatein.mop.version>
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java 2010-01-13 15:17:03 UTC (rev 1261)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.application;
-import org.exoplatform.commons.utils.AtomicPositiveLong;
-import org.exoplatform.commons.utils.LongSampler;
+import org.gatein.common.concurrent.AtomicPositiveLong;
+import org.gatein.common.concurrent.LongSampler;
/**
* Created by The eXo Platform SAS Author : tam.nguyen
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatistic.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatistic.java 2010-01-13 15:07:53 UTC (rev 1260)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatistic.java 2010-01-13 15:17:03 UTC (rev 1261)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.application;
-import org.exoplatform.commons.utils.AtomicPositiveLong;
-import org.exoplatform.commons.utils.LongSampler;
+import org.gatein.common.concurrent.AtomicPositiveLong;
+import org.gatein.common.concurrent.LongSampler;
public class PortalStatistic
{
14 years, 11 months
gatein SVN: r1260 - portal/trunk/packaging.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 10:07:53 -0500 (Wed, 13 Jan 2010)
New Revision: 1260
Modified:
portal/trunk/packaging/profiles.xml
Log:
Rollback
Modified: portal/trunk/packaging/profiles.xml
===================================================================
--- portal/trunk/packaging/profiles.xml 2010-01-13 14:09:42 UTC (rev 1259)
+++ portal/trunk/packaging/profiles.xml 2010-01-13 15:07:53 UTC (rev 1260)
@@ -29,7 +29,7 @@
ex: On Windows 'c:/AS'
ex: On Linux '/home/user/AS'
-->
- <exo.projects.directory.dependencies>/home/theute/Portal/Development/workspace_GateIn/portal/packaging</exo.projects.directory.dependencies>
+ <exo.projects.directory.dependencies>REPLACE_WITH_YOUR_OWN_DIRECTORY</exo.projects.directory.dependencies>
<!--
If you want that the server is deployed always at the same place (not in packaging/pkg/target/<server> dir)
14 years, 11 months
gatein SVN: r1259 - in components/pc/trunk/distrib: jboss-5.1/server/default/deployers/jbossweb.deployer and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 09:09:42 -0500 (Wed, 13 Jan 2010)
New Revision: 1259
Modified:
components/pc/trunk/distrib/distrib.xml
components/pc/trunk/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml
Log:
Requires the correct version.
Wrong path to the lib containing the taglib
Modified: components/pc/trunk/distrib/distrib.xml
===================================================================
--- components/pc/trunk/distrib/distrib.xml 2010-01-13 14:00:19 UTC (rev 1258)
+++ components/pc/trunk/distrib/distrib.xml 2010-01-13 14:09:42 UTC (rev 1259)
@@ -2,9 +2,9 @@
<property name="source.dir" value="../"/>
<property name="src.docs.dir" value="${source.dir}/docs"/>
- <property name="pc.release.version" value="2.1.0-CR02-SNAPSHOT"/>
- <property name="demo.release.version" value="2.1.0-CR02-SNAPSHOT"/>
- <property name="maven.version" value="2.1.0-CR02-SNAPSHOT"/>
+ <property name="pc.release.version" value="2.1.0-CR03-SNAPSHOT"/>
+ <property name="demo.release.version" value="2.1.0-CR03-SNAPSHOT"/>
+ <property name="maven.version" value="2.1.0-CR03-SNAPSHOT"/>
<!-- -->
<property name="pc.release.name" value="gatein-portletcontainer-${pc.release.version}"/>
Modified: components/pc/trunk/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml
===================================================================
--- components/pc/trunk/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml 2010-01-13 14:00:19 UTC (rev 1258)
+++ components/pc/trunk/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml 2010-01-13 14:09:42 UTC (rev 1259)
@@ -283,7 +283,7 @@
<init-param>
<description>Portlet standard tlds</description>
<param-name>tagLibJar2</param-name>
- <param-value>../simple-portal/lib/pc-portlet-@maven.version@.jar</param-value>
+ <param-value>../../deploy/simple-portal.sar/lib/pc-portlet-2.1.0-CR02.jar</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
14 years, 11 months
gatein SVN: r1258 - in components/pc/tags/2.1.0-CR02/distrib: jboss-5.1/server/default/deployers/jbossweb.deployer and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 09:00:19 -0500 (Wed, 13 Jan 2010)
New Revision: 1258
Modified:
components/pc/tags/2.1.0-CR02/distrib/distrib.xml
components/pc/tags/2.1.0-CR02/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml
Log:
Requires the correct version.
Wrong path to the lib containing the taglib
Modified: components/pc/tags/2.1.0-CR02/distrib/distrib.xml
===================================================================
--- components/pc/tags/2.1.0-CR02/distrib/distrib.xml 2010-01-13 13:27:05 UTC (rev 1257)
+++ components/pc/tags/2.1.0-CR02/distrib/distrib.xml 2010-01-13 14:00:19 UTC (rev 1258)
@@ -2,9 +2,9 @@
<property name="source.dir" value="../"/>
<property name="src.docs.dir" value="${source.dir}/docs"/>
- <property name="pc.release.version" value="2.1.0-CR02-SNAPSHOT"/>
- <property name="demo.release.version" value="2.1.0-CR02-SNAPSHOT"/>
- <property name="maven.version" value="2.1.0-CR02-SNAPSHOT"/>
+ <property name="pc.release.version" value="2.1.0-CR02"/>
+ <property name="demo.release.version" value="2.1.0-CR02"/>
+ <property name="maven.version" value="2.1.0-CR02"/>
<!-- -->
<property name="pc.release.name" value="gatein-portletcontainer-${pc.release.version}"/>
Modified: components/pc/tags/2.1.0-CR02/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml
===================================================================
--- components/pc/tags/2.1.0-CR02/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml 2010-01-13 13:27:05 UTC (rev 1257)
+++ components/pc/tags/2.1.0-CR02/distrib/jboss-5.1/server/default/deployers/jbossweb.deployer/web.xml 2010-01-13 14:00:19 UTC (rev 1258)
@@ -283,7 +283,7 @@
<init-param>
<description>Portlet standard tlds</description>
<param-name>tagLibJar2</param-name>
- <param-value>../simple-portal/lib/pc-portlet-@maven.version@.jar</param-value>
+ <param-value>../../deploy/simple-portal.sar/lib/pc-portlet-2.1.0-CR02.jar</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
14 years, 11 months
gatein SVN: r1257 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 08:27:05 -0500 (Wed, 13 Jan 2010)
New Revision: 1257
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/api/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/bridge/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/controller/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/docs/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -9,7 +9,7 @@
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>GateIn - Portlet Container (User Guide ${translation})</name>
@@ -64,10 +64,4 @@
</releases>
</pluginRepository>
</pluginRepositories>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/tools/maven/doc-parent/tags...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/tools/maven/doc-parent/tags/2....</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/tools/maven/doc-parent/tags/2.1.0-...</url>
- </scm>
</project>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/federation/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/jsr168api/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/management/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/mc/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -6,7 +6,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
@@ -16,9 +16,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.1.0-CR02</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.1.0-CR02</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.1.0-CR02</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk/</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/portal/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/portlet/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/samples/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-01-13 13:26:38 UTC (rev 1256)
+++ components/pc/trunk/test/pom.xml 2010-01-13 13:27:05 UTC (rev 1257)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02</version>
+ <version>2.1.0-CR03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
14 years, 11 months
gatein SVN: r1256 - components/pc/tags.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 08:26:38 -0500 (Wed, 13 Jan 2010)
New Revision: 1256
Added:
components/pc/tags/2.1.0-CR02/
Log:
[maven-scm] copy for tag 2.1.0-CR02
Copied: components/pc/tags/2.1.0-CR02 (from rev 1255, components/pc/trunk)
14 years, 11 months
gatein SVN: r1255 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 08:26:14 -0500 (Wed, 13 Jan 2010)
New Revision: 1255
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare release 2.1.0-CR02
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/api/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/bridge/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/controller/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/docs/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -9,7 +9,7 @@
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
<packaging>jdocbook</packaging>
<name>GateIn - Portlet Container (User Guide ${translation})</name>
@@ -64,4 +64,10 @@
</releases>
</pluginRepository>
</pluginRepositories>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/tools/maven/doc-parent/tags...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/tools/maven/doc-parent/tags/2....</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/tools/maven/doc-parent/tags/2.1.0-...</url>
+ </scm>
</project>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/federation/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/jsr168api/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/management/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/mc/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -6,7 +6,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
<packaging>pom</packaging>
<parent>
@@ -16,9 +16,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk/</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk/</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.1.0-CR02</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.1.0-CR02</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.1.0-CR02</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/portal/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/portlet/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/samples/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
+++ components/pc/trunk/test/pom.xml 2010-01-13 13:26:14 UTC (rev 1255)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.1.0-CR02-SNAPSHOT</version>
+ <version>2.1.0-CR02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
14 years, 11 months
gatein SVN: r1254 - in components/pc/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-13 08:14:11 -0500 (Wed, 13 Jan 2010)
New Revision: 1254
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/src/build.xml
components/pc/trunk/test/src/test/build.xml
Log:
Updated WCI dependency
set failOnError to true to avoid bad releases
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-01-13 12:19:46 UTC (rev 1253)
+++ components/pc/trunk/api/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
@@ -34,6 +34,11 @@
<artifactId>jboss-unit-mc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${version.apache.log4j}</version>
+ </dependency>
</dependencies>
<build>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-01-13 12:19:46 UTC (rev 1253)
+++ components/pc/trunk/pom.xml 2010-01-13 13:14:11 UTC (rev 1254)
@@ -26,6 +26,7 @@
<version.gatein.wci>2.0.0-CR01</version.gatein.wci>
<version.apache.portals.bridges>1.0.4</version.apache.portals.bridges>
<version.apache.taglibs>1.1.2</version.apache.taglibs>
+ <version.apache.log4j>1.2.14</version.apache.log4j>
<!-- used in test module by maven-antrun-extended-plugin -->
<version.jboss.unit>1.2.3</version.jboss.unit>
Modified: components/pc/trunk/portal/src/build.xml
===================================================================
--- components/pc/trunk/portal/src/build.xml 2010-01-13 12:19:46 UTC (rev 1253)
+++ components/pc/trunk/portal/src/build.xml 2010-01-13 13:14:11 UTC (rev 1254)
@@ -822,7 +822,7 @@
<taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
- <jboss-unit jpda="false" jpdaPort="9000" jpdaSuspend="true" failOnError="false">
+ <jboss-unit jpda="false" jpdaPort="9000" jpdaSuspend="true" failOnError="true">
<tests config="${target}/test-classes/test/remote-jboss-unit.xml">
<property name="archivePath" value="${test.temp.lib}"/>
Modified: components/pc/trunk/test/src/test/build.xml
===================================================================
--- components/pc/trunk/test/src/test/build.xml 2010-01-13 12:19:46 UTC (rev 1253)
+++ components/pc/trunk/test/src/test/build.xml 2010-01-13 13:14:11 UTC (rev 1254)
@@ -946,7 +946,7 @@
<taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
- <jboss-unit jpda="false" jpdaPort="9000" jpdaSuspend="true" failOnError="false">
+ <jboss-unit jpda="false" jpdaPort="9000" jpdaSuspend="true" failOnError="true">
<tests config="${target}/test-classes/test/remote-jboss-unit.xml">
<property name="archivePath" value="${test.temp.lib}"/>
14 years, 11 months
gatein SVN: r1253 - in portal/trunk/webui/core/src: main/java/org/exoplatform/webui/application/replication and 5 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-13 07:19:46 -0500 (Wed, 13 Jan 2010)
New Revision: 1253
Added:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedField.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedType.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/FieldModel.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializableTypeModel.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeModel.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataOutput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/A.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/B.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C2.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/D.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/DataOutputImpl.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/MapBuilder.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/SetBuilder.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestTypeModel.java
Log:
work on the replication framework
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/Replicatable.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,28 @@
+/*
+ * 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.webui.application.replication;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface Replicatable
+{
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/ReplicatingStateManager.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,50 @@
+/*
+ * 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.webui.application.replication;
+
+import org.exoplatform.webui.application.StateManager;
+import org.exoplatform.webui.application.WebuiApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.core.UIApplication;
+
+/**
+ * The basis is either {@link org.exoplatform.webui.core.UIPortletApplication} or
+ * {@link org.exoplatform.portal.webui.workspace.UIPortalApplication}.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ReplicatingStateManager extends StateManager {
+
+ @Override
+ public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void storeUIRootComponent(WebuiRequestContext context) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void expire(String sessionId, WebuiApplication app) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedField.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedField.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedField.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,36 @@
+/*
+ * 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.webui.application.replication.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a field
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)Target(ElementType.FIELD)
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface ReplicatedField {
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedType.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedType.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/annotations/ReplicatedType.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,36 @@
+/*
+ * 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.webui.application.replication.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a field
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface ReplicatedType {
+}
\ No newline at end of file
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/ClassTypeModel.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,63 @@
+/*
+ * 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.webui.application.replication.model;
+
+import org.exoplatform.webui.application.replication.serial.ObjectWriter;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ClassTypeModel extends TypeModel {
+
+ /** . */
+ private final TypeModel superType;
+
+ /** . */
+ private final Map<String, FieldModel> fields;
+
+ /** . */
+ private final Map<String, FieldModel> immutableFields;
+
+ ClassTypeModel(Class<?> javaType, TypeModel superType, Map<String, FieldModel> fields) {
+ super(javaType);
+
+ //
+ this.superType = superType;
+ this.fields = fields;
+ this.immutableFields = Collections.unmodifiableMap(fields);
+ }
+
+ public TypeModel getSuperType() {
+ return superType;
+ }
+
+ public Collection<FieldModel> getFields() {
+ return immutableFields.values();
+ }
+
+ public Map<String, FieldModel> getFieldMap() {
+ return immutableFields;
+ }
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/FieldModel.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/FieldModel.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/FieldModel.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,56 @@
+/*
+ * 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.webui.application.replication.model;
+
+import java.lang.reflect.Field;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class FieldModel {
+
+ /** . */
+ private final Field field;
+
+ /** . */
+ private final TypeModel type;
+
+ public FieldModel(Field field, TypeModel type) {
+ this.field = field;
+ this.type = type;
+ }
+
+ public String getName() {
+ return field.getName();
+ }
+
+ public TypeModel getType() {
+ return type;
+ }
+
+ public Object getValue(Object o) {
+ try {
+ return field.get(o);
+ } catch (IllegalAccessException e) {
+ throw new AssertionError(e);
+ }
+ }
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializableTypeModel.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializableTypeModel.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/SerializableTypeModel.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,34 @@
+/*
+ * 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.webui.application.replication.model;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SerializableTypeModel extends TypeModel
+{
+ SerializableTypeModel(Class<? extends Serializable> serializable)
+ {
+ super(serializable);
+ }
+}
\ No newline at end of file
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeDomain.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,183 @@
+/*
+ * 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.webui.application.replication.model;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.*;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TypeDomain
+{
+
+ /** . */
+ private final Map<String, TypeModel> typeModelMap;
+
+ /** . */
+ private final Map<String, TypeModel> immutableTypeModelMap;
+
+ /** . */
+ private final Set<TypeModel> typeModelSet;
+
+ /** . */
+ private final Set<TypeModel> immutableTypeModelSet;
+
+ public TypeDomain()
+ {
+ HashMap<String, TypeModel> typeModelMap = new HashMap<String, TypeModel>();
+ Map<String, TypeModel> immutableTypeModelMap = Collections.unmodifiableMap(typeModelMap);
+ HashSet<TypeModel> typeModelSet = new HashSet<TypeModel>();
+ Set<TypeModel> immutableTypeModelSet = Collections.unmodifiableSet(typeModelSet);
+
+ //
+ this.typeModelMap = typeModelMap;
+ this.immutableTypeModelMap = immutableTypeModelMap;
+ this.typeModelSet = typeModelSet;
+ this.immutableTypeModelSet = immutableTypeModelSet;
+ }
+
+ public Map<String, TypeModel> getTypeModelMap()
+ {
+ return immutableTypeModelMap;
+ }
+
+ public Set<TypeModel> getTypeModels()
+ {
+ return immutableTypeModelSet;
+ }
+
+ public TypeModel getTypeModel(String typeName)
+ {
+ if (typeName == null)
+ {
+ throw new NullPointerException();
+ }
+ return typeModelMap.get(typeName);
+ }
+
+ public TypeModel getTypeModel(Class javaType)
+ {
+ if (javaType == null)
+ {
+ throw new NullPointerException();
+ }
+ return typeModelMap.get(javaType.getName());
+ }
+
+ public TypeModel add(Class<?> javaType)
+ {
+ if (javaType == null)
+ {
+ throw new NullPointerException();
+ }
+ Map<String, TypeModel> addedTypeModels = new HashMap<String, TypeModel>();
+ TypeModel model = build(javaType, addedTypeModels);
+ typeModelMap.putAll(addedTypeModels);
+ typeModelSet.addAll(addedTypeModels.values());
+ return model;
+ }
+
+ public int getSize()
+ {
+ return typeModelMap.size();
+ }
+
+ private TypeModel build(Class<?> javaType, Map<String, TypeModel> addedTypeModels)
+ {
+ ReplicatedType replicatedType = javaType.getAnnotation(ReplicatedType.class);
+ if (replicatedType != null)
+ {
+ return buildClassTypeModel(javaType, addedTypeModels);
+ }
+ else if (javaType.isPrimitive())
+ {
+ return buildSerializable(javaType, addedTypeModels);
+ }
+ else if (Serializable.class.isAssignableFrom(javaType))
+ {
+ return buildSerializable(javaType, addedTypeModels);
+ }
+ return null;
+ }
+
+ private ClassTypeModel buildClassTypeModel(Class<?> javaType, Map<String, TypeModel> addedTypeModels)
+ {
+ ClassTypeModel typeModel = (ClassTypeModel) get(javaType, addedTypeModels);
+ if (typeModel == null)
+ {
+ TypeModel superTypeModel = null;
+ for (Class<?> ancestor = javaType.getSuperclass();ancestor != null;ancestor = ancestor.getSuperclass())
+ {
+ superTypeModel = build(ancestor, addedTypeModels);
+ if (superTypeModel != null)
+ {
+ break;
+ }
+ }
+
+ //
+ TreeMap<String, FieldModel> fieldModels = new TreeMap<String, FieldModel>();
+
+ //
+ typeModel = new ClassTypeModel(javaType, superTypeModel, fieldModels);
+ addedTypeModels.put(javaType.getName(), typeModel);
+
+ //
+ for (Field field : javaType.getDeclaredFields())
+ {
+ field.setAccessible(true);
+ Class<?> fieldJavaType = field.getType();
+ TypeModel fieldTypeModel = build(fieldJavaType, addedTypeModels);
+ if (fieldTypeModel != null)
+ {
+ fieldModels.put(field.getName(), new FieldModel(field, fieldTypeModel));
+ }
+ }
+ }
+ return typeModel;
+ }
+
+ private SerializableTypeModel buildSerializable(Class<?> javaType, Map<String, TypeModel> addedTypeModels)
+ {
+ SerializableTypeModel typeModel = (SerializableTypeModel) get(javaType, addedTypeModels);
+ if (typeModel == null)
+ {
+ typeModel = new SerializableTypeModel((Class<Serializable>)javaType);
+ addedTypeModels.put(javaType.getName(), typeModel);
+ }
+ return typeModel;
+ }
+
+ private TypeModel get(Class<?> javaType, Map<String, TypeModel> addedTypeModels)
+ {
+ TypeModel typeModel = typeModelMap.get(javaType.getName());
+ if (typeModel == null)
+ {
+ typeModel = addedTypeModels.get(javaType.getName());
+ }
+ return typeModel;
+ }
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeModel.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeModel.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/model/TypeModel.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,52 @@
+/*
+ * 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.webui.application.replication.model;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class TypeModel
+{
+
+ /** . */
+ private final Class<?> javaType;
+
+ TypeModel(Class<?> javaType)
+ {
+ this.javaType = javaType;
+ }
+
+ public String getName()
+ {
+ return javaType.getName();
+ }
+
+ public Class<?> getJavaType()
+ {
+ return javaType;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "TypeModel[name=" + javaType.getName() + "]";
+ }
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataKind.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,34 @@
+/*
+ * 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.webui.application.replication.serial;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class DataKind
+{
+
+ public static final int OBJECT = 0;
+ public static final int NULL_VALUE = 1;
+ public static final int OBJECT_REF = 2;
+ public static final int SERIALIZABLE_OBJECT = 3;
+
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataOutput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataOutput.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/DataOutput.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,35 @@
+/*
+ * 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.webui.application.replication.serial;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface DataOutput
+{
+
+ void writeInt(int i);
+ void writeString(String s);
+ void writeSerializable(Serializable serializable);
+
+}
Added: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java (rev 0)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/replication/serial/ObjectWriter.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,127 @@
+/*
+ * 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.webui.application.replication.serial;
+
+import org.exoplatform.webui.application.replication.model.ClassTypeModel;
+import org.exoplatform.webui.application.replication.model.FieldModel;
+import org.exoplatform.webui.application.replication.model.TypeDomain;
+import org.exoplatform.webui.application.replication.model.TypeModel;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ObjectWriter
+{
+
+ /** . */
+ private final TypeDomain domain;
+
+ /** . */
+ private final IdentityHashMap<Object, Integer> objectToId;
+
+ /** . */
+ private final Map<Integer, Object> idToObject;
+
+ public ObjectWriter(TypeDomain domain)
+ {
+ this.domain = domain;
+ this.objectToId = new IdentityHashMap<Object, Integer>();
+ this.idToObject = new HashMap<Integer, Object>();
+ }
+
+ private int register(Object o)
+ {
+ int nextId = objectToId.size();
+ objectToId.put(o, nextId);
+ idToObject.put(nextId, o);
+ return nextId;
+ }
+
+ public void write(Object o, DataOutput output)
+ {
+ if (o == null)
+ {
+ output.writeInt(DataKind.NULL_VALUE);
+ }
+ else
+ {
+ Integer id = objectToId.get(o);
+ if (id != null)
+ {
+ output.writeInt(DataKind.OBJECT_REF);
+ output.writeInt(id);
+ }
+ else
+ {
+ TypeModel typeModel = domain.getTypeModel(o.getClass());
+ if (typeModel instanceof ClassTypeModel)
+ {
+ ClassTypeModel classTypeModel = (ClassTypeModel)typeModel;
+
+ //
+ output.writeInt(DataKind.OBJECT);
+ output.writeInt(register(o));
+ output.writeSerializable(o.getClass());
+
+ //
+ ClassTypeModel currentTypeModel = classTypeModel;
+ while (true)
+ {
+ for (FieldModel fieldModel : (currentTypeModel).getFields())
+ {
+ Object fieldValue = fieldModel.getValue(o);
+ write(fieldValue, output);
+ }
+ TypeModel currentSuperTypeModel = currentTypeModel.getSuperType();
+ if (currentSuperTypeModel == null)
+ {
+ break;
+ }
+ if (currentSuperTypeModel instanceof ClassTypeModel)
+ {
+ currentTypeModel = (ClassTypeModel)currentSuperTypeModel;
+ }
+ else
+ {
+ output.writeInt(DataKind.SERIALIZABLE_OBJECT);
+ output.writeSerializable((Serializable)o);
+ break;
+ }
+ }
+ }
+ else if (o instanceof Serializable)
+ {
+ output.writeInt(DataKind.SERIALIZABLE_OBJECT);
+ output.writeSerializable((Serializable)o);
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+ }
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/A.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/A.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/A.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,35 @@
+/*
+ * 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.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class A {
+
+ String a = "a";
+ int b = 2;
+ boolean c = true;
+
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/B.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/B.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/B.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,42 @@
+/*
+ * 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.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class B
+{
+
+ B ref;
+
+ public B(B ref)
+ {
+ this.ref = ref;
+ }
+
+ public B()
+ {
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C1.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C1.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,34 @@
+/*
+ * 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.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class C1
+{
+
+ String a = "a1";
+
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C2.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C2.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/C2.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,34 @@
+/*
+ * 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.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class C2 extends C1
+{
+
+ String a = "a2";
+
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/D.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/D.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/D.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,36 @@
+/*
+ * 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.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class D extends ArrayList
+{
+
+ String a = "a";
+
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/DataOutputImpl.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/DataOutputImpl.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/DataOutputImpl.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,81 @@
+/*
+ * 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.webui.replication;
+
+import junit.framework.Assert;
+import org.exoplatform.webui.application.replication.serial.DataOutput;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class DataOutputImpl implements DataOutput
+{
+
+ /** . */
+ private LinkedList<Object> stream = new LinkedList<Object>();
+
+ public void writeInt(int i)
+ {
+ stream.add(0);
+ stream.addLast(i);
+ }
+
+ public void writeString(String s)
+ {
+ stream.add(1);
+ stream.addLast(s);
+ }
+
+ public void writeSerializable(Serializable serializable)
+ {
+ stream.add(2);
+ stream.addLast(serializable);
+ }
+
+ public void assertEmpty()
+ {
+ Assert.assertEquals(0, stream.size());
+ }
+
+ public void assertInt(int i)
+ {
+ assertElement(0, i);
+ }
+
+ public void assertString(String s)
+ {
+ assertElement(1, s);
+ }
+
+ public void assertSerializable(Serializable s)
+ {
+ assertElement(2, s);
+ }
+
+ private void assertElement(int type, Object o)
+ {
+ Assert.assertEquals(type, stream.removeFirst());
+ Assert.assertEquals(o, stream.removeFirst());
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/MapBuilder.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/MapBuilder.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/MapBuilder.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,46 @@
+/*
+ * 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.webui.replication;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class MapBuilder<K, V> {
+
+ private final HashMap<K, V> map = new HashMap<K,V>();
+
+ public static <K, V> MapBuilder<K, V> create(K key, V value) {
+ return new MapBuilder<K,V>().with(key, value);
+ }
+
+ public MapBuilder<K, V> with(K key, V value) {
+ map.put(key, value);
+ return this;
+ }
+
+ public Map<K, V> build(K key, V value) {
+ map.put(key, value);
+ return map;
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/SetBuilder.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/SetBuilder.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/SetBuilder.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,46 @@
+/*
+ * 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.webui.replication;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SetBuilder<E> {
+
+ private final HashSet<E> map = new HashSet<E>();
+
+ public static <E> SetBuilder<E> create(E element) {
+ return new SetBuilder<E>().with(element);
+ }
+
+ public SetBuilder<E> with(E element) {
+ map.add(element);
+ return this;
+ }
+
+ public Set<E> build(E element) {
+ map.add(element);
+ return map;
+ }
+}
\ No newline at end of file
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,129 @@
+/*
+ * 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.webui.replication;
+
+import junit.framework.TestCase;
+import org.exoplatform.webui.application.replication.model.TypeDomain;
+import org.exoplatform.webui.application.replication.serial.DataKind;
+import org.exoplatform.webui.application.replication.serial.ObjectWriter;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestSerialization extends TestCase
+{
+
+ public void testBar()
+ {
+ TypeDomain domain = new TypeDomain();
+ domain.add(A.class);
+ A a = new A();
+ ObjectWriter writer = new ObjectWriter(domain);
+ DataOutputImpl output = new DataOutputImpl();
+ writer.write(a, output);
+ output.assertInt(DataKind.OBJECT);
+ output.assertInt(0);
+ output.assertSerializable(A.class);
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable("a");
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable(2);
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable(true);
+ output.assertEmpty();
+
+ //
+ writer.write(a, output);
+ output.assertInt(DataKind.OBJECT_REF);
+ output.assertInt(0);
+ output.assertEmpty();
+ }
+
+ public void testFoo()
+ {
+ TypeDomain domain = new TypeDomain();
+ domain.add(B.class);
+
+ B b = new B();
+ B b2 = new B(b);
+ b.ref = b2;
+
+ ObjectWriter writer = new ObjectWriter(domain);
+ DataOutputImpl output = new DataOutputImpl();
+ writer.write(b, output);
+
+ output.assertInt(DataKind.OBJECT);
+ output.assertInt(0);
+ output.assertSerializable(B.class);
+
+ output.assertInt(DataKind.OBJECT);
+ output.assertInt(1);
+ output.assertSerializable(B.class);
+
+ output.assertInt(DataKind.OBJECT_REF);
+ output.assertInt(0);
+ output.assertEmpty();
+ }
+
+ public void testJuu()
+ {
+ TypeDomain domain = new TypeDomain();
+ domain.add(C2.class);
+
+ C2 c = new C2();
+
+ ObjectWriter writer = new ObjectWriter(domain);
+ DataOutputImpl output = new DataOutputImpl();
+ writer.write(c, output);
+
+ output.assertInt(DataKind.OBJECT);
+ output.assertInt(0);
+ output.assertSerializable(C2.class);
+
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable("a2");
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable("a1");
+ output.assertEmpty();
+ }
+
+ public void testDaa()
+ {
+ TypeDomain domain = new TypeDomain();
+ domain.add(D.class);
+
+ D c = new D();
+
+ ObjectWriter writer = new ObjectWriter(domain);
+ DataOutputImpl output = new DataOutputImpl();
+ writer.write(c, output);
+
+ output.assertInt(DataKind.OBJECT);
+ output.assertInt(0);
+ output.assertSerializable(D.class);
+
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable("a");
+ output.assertInt(DataKind.SERIALIZABLE_OBJECT);
+ output.assertSerializable(c);
+ output.assertEmpty();
+ }
+}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestTypeModel.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestTypeModel.java (rev 0)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestTypeModel.java 2010-01-13 12:19:46 UTC (rev 1253)
@@ -0,0 +1,77 @@
+/*
+ * 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.webui.replication;
+
+import junit.framework.TestCase;
+import org.exoplatform.webui.application.replication.model.*;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestTypeModel extends TestCase
+{
+
+
+ public void testBar()
+ {
+ TypeDomain domain = new TypeDomain();
+ assertEquals(0, domain.getSize());
+ }
+
+ public void testFoo()
+ {
+ TypeDomain domain = new TypeDomain();
+ assertType(String.class, domain.add(String.class));
+ assertEquals(1, domain.getSize());
+ assertType(String.class, domain.getTypeModel(String.class));
+ }
+
+ public void testJuu()
+ {
+ TypeDomain domain = new TypeDomain();
+ ClassTypeModel aTM = (ClassTypeModel) domain.add(A.class);
+ assertEquals(4, domain.getSize());
+ assertEquals(A.class.getName(), aTM.getName());
+ assertEquals(SetBuilder.create(domain.getTypeModel(int.class)).with(aTM).with(domain.getTypeModel(boolean.class)).build(domain.getTypeModel(String.class)), domain.getTypeModels());
+ Map<String, FieldModel> fieldMap = aTM.getFieldMap();
+ assertEquals(3, fieldMap.size());
+ FieldModel aFM = fieldMap.get("a");
+ assertEquals("a", aFM.getName());
+ assertEquals(domain.getTypeModel(String.class), aFM.getType());
+ FieldModel bFM = fieldMap.get("b");
+ assertEquals("b", bFM.getName());
+ assertEquals(domain.getTypeModel(int.class), bFM.getType());
+ FieldModel cFM = fieldMap.get("c");
+ assertEquals("c", cFM.getName());
+ assertEquals(domain.getTypeModel(boolean.class), cFM.getType());
+ }
+
+ private void assertType(Class<? extends Serializable> javaType, TypeModel typeModel)
+ {
+ assertTrue(typeModel instanceof SerializableTypeModel);
+ SerializableTypeModel serializableTypeModel = (SerializableTypeModel)typeModel;
+ assertEquals(javaType, serializableTypeModel.getJavaType());
+ }
+
+}
14 years, 11 months