gatein SVN: r1922 - portal/trunk/docs/user-guide/en/images.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-03-02 02:09:02 -0500 (Tue, 02 Mar 2010)
New Revision: 1922
Modified:
portal/trunk/docs/user-guide/en/images/AddNode4.png
portal/trunk/docs/user-guide/en/images/Admin1.png
portal/trunk/docs/user-guide/en/images/Breadcrumbs.png
portal/trunk/docs/user-guide/en/images/CloneNode2.png
portal/trunk/docs/user-guide/en/images/CopyNode3.png
portal/trunk/docs/user-guide/en/images/CutNode4.png
portal/trunk/docs/user-guide/en/images/DashboardPortlet.png
portal/trunk/docs/user-guide/en/images/DeleteNode2.png
portal/trunk/docs/user-guide/en/images/Demo1.png
portal/trunk/docs/user-guide/en/images/EditCategoryPermissions.png
portal/trunk/docs/user-guide/en/images/EditorPortlet.png
portal/trunk/docs/user-guide/en/images/GroupPortlet.png
portal/trunk/docs/user-guide/en/images/MoveUpDown.png
portal/trunk/docs/user-guide/en/images/NewSearch1.png
portal/trunk/docs/user-guide/en/images/NewSearch2.png
portal/trunk/docs/user-guide/en/images/PageNodeSetting.png
portal/trunk/docs/user-guide/en/images/PasteNode3.png
portal/trunk/docs/user-guide/en/images/SelectPage1.png
portal/trunk/docs/user-guide/en/images/SitePortlet.png
portal/trunk/docs/user-guide/en/images/StarPortlet.png
portal/trunk/docs/user-guide/en/images/Toolbar.png
Log:
Updated screenshots
Modified: portal/trunk/docs/user-guide/en/images/AddNode4.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/Admin1.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/Breadcrumbs.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/CloneNode2.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/CopyNode3.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/CutNode4.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/DashboardPortlet.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/DeleteNode2.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/Demo1.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/EditCategoryPermissions.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/EditorPortlet.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/GroupPortlet.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/MoveUpDown.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/NewSearch1.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/NewSearch2.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/PageNodeSetting.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/PasteNode3.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/SelectPage1.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/SitePortlet.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/StarPortlet.png
===================================================================
(Binary files differ)
Modified: portal/trunk/docs/user-guide/en/images/Toolbar.png
===================================================================
(Binary files differ)
14 years, 10 months
gatein SVN: r1921 - portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: dbaeli
Date: 2010-03-01 23:41:18 -0500 (Mon, 01 Mar 2010)
New Revision: 1921
Modified:
portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
Log:
GTNPORTAL-509 Selenium tests, fix Java5 api compatibility in generator, to avoid animal sniffer detection to fail the whole build
Modified: portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-03-01 23:26:41 UTC (rev 1920)
+++ portal/trunk/testsuite/selenium-snifftests/src/main/java/org/exoplatform/portal/selenium/SeleniumTestCaseGenerator.java 2010-03-02 04:41:18 UTC (rev 1921)
@@ -3,8 +3,6 @@
import java.io.File;
import java.io.IOException;
-import junit.framework.TestCase;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringEscapeUtils;
@@ -400,7 +398,7 @@
sb.append("selenium.waitForPageToLoad(timeout);\n");
} else if (param1.equals("echo")) {
sb.append("System.out.println(\"" + param2 + "\");\n");
- } else if (!param1.isEmpty()) {
+ } else if (param1.length() > 0) {
String message = param1 + " was not translated \"" + param2 + "\"";
System.err.println("[ERROR] " + message);
sb.append("// NOT GENERATED " + message);
14 years, 10 months
gatein SVN: r1920 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-03-01 18:26:41 -0500 (Mon, 01 Mar 2010)
New Revision: 1920
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
Log:
Set the transformer for the markupheaders to output html instead of xml. This will fix an issue that arose with the script element self closing (GTNPORTAL-764). Note that this will create html, and not xhtml, which will need to be fixed.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-03-01 23:13:03 UTC (rev 1919)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-03-01 23:26:41 UTC (rev 1920)
@@ -370,6 +370,7 @@
{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "html");
for (Element element : extraMarkupHeaders)
{
14 years, 10 months
gatein SVN: r1919 - in portal/trunk/component: portal/src/main/java/org/exoplatform/portal/pom/config and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-01 18:13:03 -0500 (Mon, 01 Mar 2010)
New Revision: 1919
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/GlobalKey.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml
Log:
- properly scope the data in the pom manager cache
- improved the new portal config listener
- log system properties with debug level in unit test
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -126,4 +126,10 @@
this.ownerType = ownerType;
}
+ @Override
+ public String toString()
+ {
+ return "PortalConfig[predefinedOwner=" + predefinedOwner + ",ownerType=" + ownerType + ",templateName=" + templateName +
+ "location=" + location + "]";
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -19,12 +19,10 @@
package org.exoplatform.portal.config;
-import org.apache.commons.lang.StringUtils;
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ObjectParameter;
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
@@ -34,23 +32,19 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.Page.PageSet;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.jibx.runtime.*;
-import org.jibx.runtime.impl.IXMLReaderFactory;
-import org.jibx.runtime.impl.RuntimeSupport;
import org.jibx.runtime.impl.UnmarshallingContext;
-import org.jibx.runtime.impl.XMLPullReaderFactory;
-import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
+import java.util.regex.Pattern;
/**
* Created by The eXo Platform SARL Author : Tuan Nguyen
@@ -60,16 +54,22 @@
public class NewPortalConfigListener extends BaseComponentPlugin
{
+ /** . */
private ConfigurationManager cmanager_;
+ /** . */
private DataStorage dataStorage_;
+ /** . */
private volatile List<NewPortalConfig> configs;
+ /** . */
private List<SiteConfigTemplates> templateConfigs;
+ /** . */
private String pageTemplatesLocation_;
+ /** . */
private String defaultPortal;
/**
@@ -78,9 +78,11 @@
*/
private boolean defaultPortalSpecified = false;
+ /** . */
private boolean isUseTryCatch;
- private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
+ /** . */
+ private Logger log = LoggerFactory.getLogger(getClass());
public NewPortalConfigListener(DataStorage dataStorage, ConfigurationManager cmanager, InitParams params)
throws Exception
@@ -316,16 +318,12 @@
public void createPortalConfig(NewPortalConfig config, String owner) throws Exception
{
- String type = config.getOwnerType();
-
- boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
- String path = getPathConfig(config, owner, type, isTemplate);
-
try
{
- String xml = getDefaultConfig(config.getTemplateLocation(), path);
+ String type = config.getOwnerType();
+ PortalConfig pconfig = getConfig(config, owner, type, PortalConfig.class);
- if (xml == null)
+ if (pconfig == null)
{
// Ensure that the PortalConfig has been defined
// The PortalConfig could be empty if the related PortalConfigListener
@@ -340,13 +338,7 @@
}
return;
}
- if (isTemplate)
- {
- xml = StringUtils.replace(xml, "@owner@", owner);
- }
- PortalConfig pconfig = fromXML(config.getOwnerType(), owner, xml, PortalConfig.class);
-
// We use that owner value because it may have been fixed for group names
owner = pconfig.getName();
@@ -361,124 +353,135 @@
dataStorage_.save(pconfig);
}
}
- catch (JiBXException e)
- {
- log.error(e.getMessage() + " file: " + path, e);
- throw e;
- }
catch (IOException e)
{
- log.error(e.getMessage() + " file: " + path);
+ log.error("Could not load portal configuration", e);
}
}
public void createPage(NewPortalConfig config, String owner) throws Exception
{
-
- boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
- String path = getPathConfig(config, owner, "pages", isTemplate);
-
- try
+ PageSet pageSet = getConfig(config, owner, "pages", PageSet.class);
+ if (pageSet == null)
{
- String xml = getDefaultConfig(config.getTemplateLocation(), path);
- if (xml == null)
- {
- return;
- }
-
- if (isTemplate)
- {
- xml = StringUtils.replace(xml, "@owner@", owner);
- }
-
- PageSet pageSet = fromXML(config.getOwnerType(), owner, xml, PageSet.class);
- ArrayList<Page> list = pageSet.getPages();
- for (Page page : list)
- {
- dataStorage_.create(page);
- }
+ return;
}
- catch (JiBXException e)
+ ArrayList<Page> list = pageSet.getPages();
+ for (Page page : list)
{
- log.error(e.getMessage() + " file: " + path, e);
- throw e;
+ dataStorage_.create(page);
}
}
public void createPageNavigation(NewPortalConfig config, String owner) throws Exception
{
- boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
- String path = getPathConfig(config, owner, "navigation", isTemplate);
-
- try
+ PageNavigation navigation = getConfig(config, owner, "navigation", PageNavigation.class);
+ if (navigation == null)
{
- String xml = getDefaultConfig(config.getTemplateLocation(), path);
- if (xml == null)
- {
- return;
- }
-
- if (isTemplate)
- {
- xml = StringUtils.replace(xml, "@owner@", owner);
- }
- PageNavigation navigation = fromXML(config.getOwnerType(), owner, xml, PageNavigation.class);
- PageNavigation currentNavigation = dataStorage_.getPageNavigation(navigation.getOwner());
- if (currentNavigation == null)
- {
- dataStorage_.create(navigation);
- }
- else
- {
- navigation.merge(currentNavigation);
- dataStorage_.save(navigation);
- }
+ return;
}
- catch (JiBXException e)
+ PageNavigation currentNavigation = dataStorage_.getPageNavigation(navigation.getOwner());
+ if (currentNavigation == null)
{
- log.error(e.getMessage() + " file: " + path, e);
- throw e;
+ dataStorage_.create(navigation);
}
+ else
+ {
+ navigation.merge(currentNavigation);
+ dataStorage_.save(navigation);
+ }
}
public void createPortletPreferences(NewPortalConfig config, String owner) throws Exception
{
- boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
- String path = getPathConfig(config, owner, "portlet-preferences", isTemplate);
+ PortletPreferencesSet portletSet = getConfig(config, owner, "portlet-preferences", PortletPreferencesSet.class);
+ if (portletSet == null)
+ {
+ return;
+ }
+ ArrayList<PortletPreferences> list = portletSet.getPortlets();
+ for (PortletPreferences portlet : list)
+ {
+ dataStorage_.save(portlet);
+ }
+ }
- try
+ private final Pattern OWNER_PATTERN = Pattern.compile("@owner@");
+
+ /**
+ * Best effort to load and unmarshall a configuration.
+ *
+ * @param config the config object
+ * @param owner the owner
+ * @param fileName the file name
+ * @param type the type to unmarshall to
+ * @return the xml of the config or null
+ * @throws Exception any exception
+ * @param <T> the generic type to unmarshall to
+ */
+ private <T> T getConfig(NewPortalConfig config, String owner, String fileName, Class<T> type) throws Exception
+ {
+ log.debug("About to load config=" + config + " owner=" + owner + " fileName=" + fileName);
+
+ //
+ String ownerType = config.getOwnerType();
+
+ // Get XML
+ String path = "/" + ownerType + "/" + owner + "/" + fileName + ".xml";
+ String xml = getDefaultConfig(config.getTemplateLocation(), path);
+
+ //
+ if (xml == null)
{
- String xml = getDefaultConfig(config.getTemplateLocation(), path);
- if (xml == null)
+ boolean isTemplate = (config.getTemplateName() != null && config.getTemplateName().trim().length() > 0);
+ if (isTemplate)
{
- return;
+ path = "/" + ownerType + "/template/" + config.getTemplateName() + "/" + fileName + ".xml";
+ xml = getDefaultConfig(config.getTemplateLocation(), path);
+ if (xml != null)
+ {
+ xml = OWNER_PATTERN.matcher(xml).replaceAll(owner);
+ }
}
+ }
- if (isTemplate)
+ //
+ if (xml != null)
+ {
+ boolean ok = false;
+ try
{
- xml = StringUtils.replace(xml, "@owner@", owner);
+ final T t = fromXML(config.getOwnerType(), owner, xml, type);
+ ok = true;
+ return t;
}
-
- PortletPreferencesSet portletSet = fromXML(config.getOwnerType(), owner, xml, PortletPreferencesSet.class);
- ArrayList<PortletPreferences> list = portletSet.getPortlets();
- for (PortletPreferences portlet : list)
+ catch (JiBXException e)
{
- dataStorage_.save(portlet);
+ log.error(e.getMessage() + " file: " + path, e);
+ throw e;
}
+ finally
+ {
+ if (!ok)
+ {
+ log.error("Could not load file: " + path);
+ }
+ }
}
- catch (JiBXException e)
- {
- log.error(e.getMessage() + " file: " + path, e);
- throw e;
- }
+
+ //
+ return null;
}
private String getDefaultConfig(String location, String path) throws Exception
{
String s = location + path;
+ log.debug("Attempt to load file " + s);
try
{
- return IOUtil.getStreamContentAsString(cmanager_.getInputStream(location + path));
+ String content = IOUtil.getStreamContentAsString(cmanager_.getInputStream(s));
+ log.debug("Loaded file from path " + s + " with content " + content);
+ return content;
}
catch (Exception ignore)
{
@@ -487,22 +490,6 @@
}
}
- private String getPathConfig(NewPortalConfig portalConfig, String owner, String fileName, boolean isTemplate)
- {
- String path = "";
- if (isTemplate)
- {
- String ownerType = portalConfig.getOwnerType();
- path = "/" + ownerType + "/template/" + portalConfig.getTemplateName() + "/" + fileName + ".xml";
- }
- else
- {
- String ownerType = portalConfig.getOwnerType();
- path = "/" + ownerType + "/" + owner + "/" + fileName + ".xml";
- }
- return path;
- }
-
public Page createPageFromTemplate(String ownerType, String owner, String temp) throws Exception
{
String path = pageTemplatesLocation_ + "/" + temp + "/page.xml";
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/GlobalKey.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/GlobalKey.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/GlobalKey.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -0,0 +1,97 @@
+/*
+ * 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.portal.pom.config;
+
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.ManageableRepository;
+
+import javax.jcr.RepositoryException;
+import java.io.Serializable;
+import java.lang.reflect.UndeclaredThrowableException;
+
+/**
+ * A global key wrapping a local key including the current repository id.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class GlobalKey implements Serializable
+{
+
+ public static GlobalKey wrap(RepositoryService repoService, Serializable localKey)
+ {
+ try
+ {
+ ManageableRepository repo = repoService.getCurrentRepository();
+ return new GlobalKey(repo.getConfiguration().getName(), localKey);
+ }
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredThrowableException(e);
+ }
+ }
+
+ /** . */
+ private final String repositoryId;
+
+ /** . */
+ private final Serializable localKey;
+
+ public GlobalKey(String repositoryId, Serializable localKey)
+ {
+ if (repositoryId == null)
+ {
+ throw new NullPointerException();
+ }
+ if (localKey == null)
+ {
+ throw new NullPointerException();
+ }
+ this.repositoryId = repositoryId;
+ this.localKey = localKey;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return repositoryId.hashCode() ^ localKey.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof GlobalKey)
+ {
+ GlobalKey that = (GlobalKey)obj;
+ return repositoryId.equals(that.repositoryId) && localKey.equals(that.localKey);
+ }
+ return false;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "GlobalKey[repositoryId=" + repositoryId + ",localKey=" + localKey + "]";
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -117,7 +117,7 @@
{
throw new IllegalStateException("Cannot read object in shared cache from a modified session");
}
- return mgr.cache.get(key);
+ return mgr.cacheGet(key);
}
public void putInCache(Serializable key, Object value)
@@ -126,7 +126,7 @@
{
throw new IllegalStateException("Cannot put object in shared cache from a modified session");
}
- mgr.cache.put(key, value);
+ mgr.cachePut(key, value);
}
public void scheduleForEviction(Serializable key)
@@ -362,7 +362,7 @@
{
for (Serializable key : staleKeys)
{
- mgr.cache.remove(key);
+ mgr.cacheRemove(key);
}
}
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.pom.config.cache.DataCache;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.jcr.RepositoryService;
import org.gatein.mop.core.api.MOPService;
import org.picocontainer.Startable;
@@ -42,7 +43,7 @@
private MOPService pomService;
/** . */
- final ExoCache<Serializable, Object> cache;
+ private final ExoCache<GlobalKey, Object> cache;
/** . */
final ChromatticManager manager;
@@ -53,15 +54,34 @@
/** . */
private final TaskExecutionDecorator executor;
- public POMSessionManager(ChromatticManager manager, CacheService cacheService)
+ /** . */
+ private final RepositoryService repositoryService;
+
+ public POMSessionManager(RepositoryService repositoryService, ChromatticManager manager, CacheService cacheService)
{
//
+ this.repositoryService = repositoryService;
this.manager = manager;
this.cache = cacheService.getCacheInstance(POMSessionManager.class.getSimpleName());
this.pomService = null;
this.executor = new DataCache(new ExecutorDispatcher());
}
+ public void cachePut(Serializable key, Object value)
+ {
+ cache.put(GlobalKey.wrap(repositoryService, key), value);
+ }
+
+ public Object cacheGet(Serializable key)
+ {
+ return cache.get(GlobalKey.wrap(repositoryService, key));
+ }
+
+ public void cacheRemove(Serializable key)
+ {
+ cache.remove(GlobalKey.wrap(repositoryService, key));
+ }
+
public void start()
{
try
Modified: portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml 2010-03-01 23:13:03 UTC (rev 1919)
@@ -34,8 +34,8 @@
<description>The default cache configuration</description>
<object type="org.exoplatform.services.cache.ExoCacheConfig">
<field name="name"><string>default</string></field>
- <field name="maxSize"><int>300</int></field>
- <field name="liveTime"><long>6000</long></field>
+ <field name="maxSize"><int>30000</int></field>
+ <field name="liveTime"><long>60000</long></field>
<field name="distributed"><boolean>false</boolean></field>
<field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
</object>
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-03-01 23:13:03 UTC (rev 1919)
@@ -74,14 +74,7 @@
if (entry.getKey() instanceof String)
{
String key = (String)entry.getKey();
- if (key.startsWith("gatein."))
- {
- log.info(key + "=" + entry.getValue());
- }
- else
- {
- log.debug(key + "=" + entry.getValue());
- }
+ log.debug(key + "=" + entry.getValue());
}
}
Modified: portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml 2010-03-01 22:18:46 UTC (rev 1918)
+++ portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml 2010-03-01 23:13:03 UTC (rev 1919)
@@ -28,17 +28,4 @@
<type>org.exoplatform.container.definition.PortalContainerConfig</type>
</component>
-<!--
- <component>
- <key>org.exoplatform.container.PropertyConfigurator</key>
- <type>org.exoplatform.container.PropertyConfigurator</type>
- <init-params>
- <value-param>
- <name>properties.url</name>
- <value>jar:/conf/test-configuration.properties</value>
- </value-param>
- </init-params>
- </component>
--->
-
</configuration>
14 years, 10 months
gatein SVN: r1918 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-03-01 17:18:46 -0500 (Mon, 01 Mar 2010)
New Revision: 1918
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
Pass cookies set in a portlet off to the portal (GTNPORTAL-763).
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-03-01 16:50:21 UTC (rev 1917)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-03-01 22:18:46 UTC (rev 1918)
@@ -53,6 +53,7 @@
import javax.portlet.MimeResponse;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
/**
* Created by The eXo Platform SAS May 8, 2006
@@ -231,6 +232,16 @@
}
}
}
+
+ //setup up portlet cookies
+ if (fragmentResponse.getProperties().getCookies() != null)
+ {
+ List<Cookie> cookies = fragmentResponse.getProperties().getCookies();
+ for (Cookie cookie : cookies)
+ {
+ prcontext.getResponse().addCookie(cookie);
+ }
+ }
//setup markup headers
if (fragmentResponse.getProperties().getMarkupHeaders() != null)
14 years, 10 months
gatein SVN: r1917 - in portal/trunk/component/wsrp/src/test: resources/conf and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-01 11:50:21 -0500 (Mon, 01 Mar 2010)
New Revision: 1917
Added:
portal/trunk/component/wsrp/src/test/resources/conf/gatein.portal.component.wsrp-configuration.xml
Removed:
portal/trunk/component/wsrp/src/test/resources/conf/exo.portal.component.wsrp-configuration.xml
Modified:
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
Log:
- Renamed configuration file to conform to new module name.
Modified: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-03-01 16:48:48 UTC (rev 1916)
+++ portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-03-01 16:50:21 UTC (rev 1917)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -23,7 +23,10 @@
package org.gatein.portal.wsrp.state.consumer;
-import org.exoplatform.component.test.*;
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.ConsumerException;
@@ -42,7 +45,7 @@
*/
@ConfiguredBy({
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.wsrp-configuration.xml")
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/gatein.portal.component.wsrp-configuration.xml")
})
public class ConsumerRegistryTestCase extends AbstractKernelTest
{
Deleted: portal/trunk/component/wsrp/src/test/resources/conf/exo.portal.component.wsrp-configuration.xml
===================================================================
--- portal/trunk/component/wsrp/src/test/resources/conf/exo.portal.component.wsrp-configuration.xml 2010-03-01 16:48:48 UTC (rev 1916)
+++ portal/trunk/component/wsrp/src/test/resources/conf/exo.portal.component.wsrp-configuration.xml 2010-03-01 16:50:21 UTC (rev 1917)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
- <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/consumers-configuration-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
- <external-component-plugins>
- <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
- <component-plugin>
- <name>chromattic</name>
- <set-method>addLifeCycle</set-method>
- <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
- <init-params>
- <value-param>
- <name>domain-name</name>
- <value>wsrp</value>
- </value-param>
- <value-param>
- <name>workspace-name</name>
- <value>portal-test</value>
- </value-param>
- <values-param>
- <name>entities</name>
- <value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Copied: portal/trunk/component/wsrp/src/test/resources/conf/gatein.portal.component.wsrp-configuration.xml (from rev 1915, portal/trunk/component/wsrp/src/test/resources/conf/exo.portal.component.wsrp-configuration.xml)
===================================================================
--- portal/trunk/component/wsrp/src/test/resources/conf/gatein.portal.component.wsrp-configuration.xml (rev 0)
+++ portal/trunk/component/wsrp/src/test/resources/conf/gatein.portal.component.wsrp-configuration.xml 2010-03-01 16:50:21 UTC (rev 1917)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
+ <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
+ </component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/consumers-configuration-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>wsrp</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-test</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
14 years, 10 months
gatein SVN: r1916 - in portal/trunk/component/wsrp: src/main/java/org/gatein/portal/wsrp/state/mapping and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-01 11:48:48 -0500 (Mon, 01 Mar 2010)
New Revision: 1916
Added:
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/mapping/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/mapping/MappedMapTestCase.java
Modified:
portal/trunk/component/wsrp/pom.xml
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
Log:
- Fixed MappedMap.initFrom method as it should remove any previous value apart from the blacklisted ones.
- Added and activated test case.
Modified: portal/trunk/component/wsrp/pom.xml
===================================================================
--- portal/trunk/component/wsrp/pom.xml 2010-03-01 12:41:06 UTC (rev 1915)
+++ portal/trunk/component/wsrp/pom.xml 2010-03-01 16:48:48 UTC (rev 1916)
@@ -117,7 +117,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <exclude>org/gatein/portal/wsrp/**</exclude>
+ <exclude>org/gatein/portal/wsrp/state/consumer/**</exclude>
</excludes>
</configuration>
</plugin>
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java 2010-03-01 12:41:06 UTC (rev 1915)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java 2010-03-01 16:48:48 UTC (rev 1916)
@@ -100,6 +100,17 @@
{
if (ParameterValidation.existsAndIsNotEmpty(externalMap))
{
+ // remove existing values (apart from blacklisted ones that we shouldn't touch)
+ Set<String> keys = new HashSet<String>(internalMap.keySet());
+ for (String key : keys)
+ {
+ if (!blacklistedPropertyKeys.contains(key))
+ {
+ internalMap.remove(key);
+ }
+ }
+
+ // put the new values in
for (Map.Entry<Key, Value> entry : externalMap.entrySet())
{
internalMap.put(keyConverter.toInternal(entry.getKey()), valueConverter.toInternal(entry.getValue()));
Added: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/mapping/MappedMapTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/mapping/MappedMapTestCase.java (rev 0)
+++ portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/mapping/MappedMapTestCase.java 2010-03-01 16:48:48 UTC (rev 1916)
@@ -0,0 +1,95 @@
+/*
+ * 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.gatein.portal.wsrp.state.mapping;
+
+import junit.framework.TestCase;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MappedMapTestCase extends TestCase
+{
+ private MappedMap<String, String> mapped;
+
+ public void testInitFrom()
+ {
+ Map<String, String> external = new HashMap<String, String>();
+ external.put("bar", "barvalue");
+
+ Map<String, Object> internal = new HashMap<String, Object>();
+ internal.put("foo", "foovalue");
+ internal.put("baz", "bazvalue");
+
+ mapped.initFrom(external, internal);
+
+ assertEquals("foovalue", internal.get("foo"));
+ assertEquals("barvalue", internal.get("bar"));
+ assertNull("baz isn't in the external map we initialize from so it shouldn't be present anymore after", internal.get("baz"));
+ }
+
+ public void testToExternalMap()
+ {
+ Map<String, Object> internal = new HashMap<String, Object>();
+ internal.put("foo", "foovalue");
+ internal.put("baz", "bazvalue");
+
+ Map<String, String> external = mapped.toExternalMap(internal);
+
+ assertNull(external.get("foo"));
+ assertEquals("bazvalue", external.get("baz"));
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ mapped = new MappedMap<String, String>(new MappedMap.Converter<String, String>()
+ {
+
+ public String fromInternal(String s)
+ {
+ return s;
+ }
+
+ public String toInternal(String s)
+ {
+ return s;
+ }
+ }, new MappedMap.Converter<Object, String>()
+ {
+ public String fromInternal(Object o)
+ {
+ return o.toString();
+ }
+
+ public Object toInternal(String s)
+ {
+ return s;
+ }
+ }, "foo");
+ }
+}
14 years, 10 months
gatein SVN: r1915 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-01 07:41:06 -0500 (Mon, 01 Mar 2010)
New Revision: 1915
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
Log:
- Add to parent then init, otherwise we get an exception.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2010-03-01 12:39:20 UTC (rev 1914)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2010-03-01 12:41:06 UTC (rev 1915)
@@ -1,31 +1,32 @@
/*
-* 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.
-*/
+ * 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.gatein.portal.wsrp.state.producer.registrations.mapping;
import org.chromattic.api.annotations.FindById;
import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
import org.chromattic.api.annotations.RelatedMappedBy;
import org.gatein.common.util.ParameterValidation;
@@ -79,8 +80,8 @@
String id = consumer.getPersistentKey();
ConsumerMapping cm = findConsumerById(id);
ParameterValidation.throwIllegalArgExceptionIfNull(cm, "ConsumerMapping (no such mapping with id: " + id + ")");
+ getConsumers().add(cm);
cm.initFrom(consumer);
- getConsumers().add(cm);
}
}
catch (RegistrationException e)
14 years, 10 months
gatein SVN: r1914 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-01 07:39:20 -0500 (Mon, 01 Mar 2010)
New Revision: 1914
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
Log:
- Minor code improvement.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java 2010-03-01 12:37:35 UTC (rev 1913)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java 2010-03-01 12:39:20 UTC (rev 1914)
@@ -50,11 +50,10 @@
public Map<QName, Object> toPropMap()
{
- Map<QName, Object> properties = Collections.emptyMap();
Map<String, String> propMap = getProperties();
if (!propMap.isEmpty())
{
- properties = new HashMap<QName, Object>(propMap.size());
+ Map<QName, Object> properties = new HashMap<QName, Object>(propMap.size());
for (Map.Entry<String, String> entry : propMap.entrySet())
{
String key = entry.getKey();
@@ -64,9 +63,13 @@
properties.put(QName.valueOf(key), entry.getValue());
}
}
+
+ return properties;
}
-
- return properties;
+ else
+ {
+ return Collections.emptyMap();
+ }
}
public void initFrom(Map<QName, Object> properties)
14 years, 10 months
gatein SVN: r1913 - in portal/trunk/component: wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-01 07:37:35 -0500 (Mon, 01 Mar 2010)
New Revision: 1913
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/Utils.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
Log:
- Minor.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/Utils.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/Utils.java 2010-03-01 12:31:01 UTC (rev 1912)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/Utils.java 2010-03-01 12:37:35 UTC (rev 1913)
@@ -1,16 +1,16 @@
/**
* 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
@@ -36,6 +36,14 @@
public final static String FIRST_CHARACTER_NAME_VALIDATOR_REGEX = "^[\\p{L}][\\p{L}._'\\- \\d]+$";
+
+ /**
+ * todo: move to common module
+ *
+ * @param separator
+ * @param strings
+ * @return
+ */
public static String join(String separator, String... strings)
{
if (strings == null)
@@ -65,6 +73,13 @@
return join(separator, array);
}
+ /**
+ * todo: move to common module
+ *
+ * @param separator
+ * @param s
+ * @return
+ */
public static String[] split(String separator, String s)
{
if (s == null)
@@ -130,13 +145,13 @@
/**
* Splits a string according to a string separator.
+ * <p/>
+ * The provided index defines the beginning of the splitted chunks in the returned array. The values from the
+ * beginning up to the value index - 1 will be null values.
*
- * The provided index defines the beginning of the splitted chunks in the returned array. The values
- * from the beginning up to the value index - 1 will be null values.
- *
* @param separator the string separator
- * @param index the index to which the chunks begin
- * @param s the string to split
+ * @param index the index to which the chunks begin
+ * @param s the string to split
* @return an array containing the splitted chunks plus extra leading pad
*/
public static String[] split(String separator, int index, String s)
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java 2010-03-01 12:31:01 UTC (rev 1912)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java 2010-03-01 12:37:35 UTC (rev 1913)
@@ -24,15 +24,12 @@
package org.gatein.portal.wsrp.state.mapping;
import org.exoplatform.commons.utils.Tools;
-import org.gatein.common.util.AbstractTypedMap;
import org.gatein.common.util.ParameterValidation;
-import javax.xml.namespace.QName;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -68,7 +65,7 @@
this.valueConverter = valueConverter;
int blacklistedNumber = blacklistedPropertyNames.length;
- if(blacklistedNumber > 0)
+ if (blacklistedNumber > 0)
{
blacklistedPropertyKeys = new HashSet<String>(jcrBlacklistedPropertyKeys);
blacklistedPropertyKeys.addAll(Arrays.asList(blacklistedPropertyNames));
@@ -113,6 +110,7 @@
public static interface Converter<Internal, External>
{
External fromInternal(Internal internal);
+
Internal toInternal(External external);
}
}
14 years, 10 months