Author: nfilotto
Date: 2010-06-16 04:01:20 -0400 (Wed, 16 Jun 2010)
New Revision: 2620
Added:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChange.java
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChangePlugin.java
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/SafePortalContainerDefinition.java
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values2.xml
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/AbstractTestContainer.java
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-defs.xml
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml
Log:
EXOJCR-782: Implementation based on component-plugins
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -121,6 +121,11 @@
Collections.unmodifiableMap(new HashMap<String,
PortalContainerDefinition>());
/**
+ * The list of all the changes to apply to the registered {@link
PortalContainerDefinition}
+ */
+ private List<PortalContainerDefinitionChangePlugin> changes = new
ArrayList<PortalContainerDefinitionChangePlugin>();
+
+ /**
* The configuration manager
*/
private final ConfigurationManager cm;
@@ -569,6 +574,26 @@
}
/**
+ * Allow to define a set of changes to apply to the registered {@link
PortalContainerDefinition}
+ * @param plugin the plugin that defines the changes to apply
+ */
+ public void registerChangePlugin(PortalContainerDefinitionChangePlugin plugin)
+ {
+ final List<PortalContainerDefinitionChange> lchanges = plugin.getChanges();
+ if (lchanges != null && !lchanges.isEmpty())
+ {
+ synchronized (this)
+ {
+ if (initialized)
+ {
+ throw new IllegalStateException("The PortalContainerConfig has
already been initialized");
+ }
+ changes.add(plugin);
+ }
+ }
+ }
+
+ /**
* Construct the scopes of all the web applications from the given {@link
PortalContainerDefinition}
* @param definition the definition of a {@link PortalContainer} that contains the
dependencies with
* the web application
@@ -976,6 +1001,8 @@
hasChanged = true;
}
}
+ // Apply the changes corresponding to the given definition
+ applyChanges(definition);
registerDependencies(definition, mScopes);
if (hasChanged)
{
@@ -983,18 +1010,81 @@
}
initializeSettings(definition, true);
}
- if (!mDefinitions.containsKey(defaultDefinition.getName()) &&
defaultDefinition.getDependencies() != null
- && !defaultDefinition.getDependencies().isEmpty())
+ if (!mDefinitions.containsKey(defaultDefinition.getName()))
{
- // The default portal container has not been defined and some default
- // dependencies have been defined
- registerDependencies(defaultDefinition, mScopes);
+ // Apply the changes corresponding to the default definition
+ applyChanges(defaultDefinition);
+ initializeSettings(defaultDefinition, false);
+ if (defaultDefinition.getDependencies() != null &&
!defaultDefinition.getDependencies().isEmpty())
+ {
+ // The default portal container has not been defined and some default
+ // dependencies have been defined
+ registerDependencies(defaultDefinition, mScopes);
+ }
}
this.portalContainerNames = Collections.unmodifiableList(lPortalContainerNames);
this.scopes = Collections.unmodifiableMap(mScopes);
+ // clear the changes
+ changes.clear();
}
/**
+ * Apply the changes corresponding to the give {@link PortalContainerDefinition}
+ * @param definition
+ */
+ private void applyChanges(PortalContainerDefinition definition)
+ {
+ for (PortalContainerDefinitionChangePlugin plugin : changes)
+ {
+ if (matches(definition, plugin))
+ {
+ // The definition matches with the scope of the changes
+ for (PortalContainerDefinitionChange change : plugin.getChanges())
+ {
+ try
+ {
+ // Secure access to definition's info
+ change.apply(new SafePortalContainerDefinition(definition,
defaultDefinition));
+ }
+ catch (Exception e)
+ {
+ log.warn("Cannot apply the change " + change, e);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Indicates whether the given definition matches with the scope of the {@link
PortalContainerDefinitionChangePlugin}
+ * @param definition the {@link PortalContainerDefinition} to test.
+ * @param plugin the {@link PortalContainerDefinitionChangePlugin} from which we
extract the scopes
+ * of the embedded actions
+ * @return <code>true</code> if it matches, <code>false</code>
otherwise
+ */
+ private boolean matches(PortalContainerDefinition definition,
PortalContainerDefinitionChangePlugin plugin)
+ {
+ if (plugin.isAll())
+ {
+ // The changes have to be applied to all the portal containers
+ return true;
+ }
+ if ((plugin.getNames() == null || plugin.isDefault()) &&
defaultDefinition.getName().equals(definition.getName()))
+ {
+ // The changes have to be applied to the default portal container and the given
definition is
+ // the definition of the default portal container
+ return true;
+ }
+ if (plugin.getNames() != null &&
plugin.getNames().contains(definition.getName()))
+ {
+ // The changes have to be applied to a specific list of portal containers and
the given
+ // definition is the a definition of one of them
+ return true;
+ }
+ return false;
+ }
+
+ /**
* {@inheritDoc}
*/
public void start()
Added:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChange.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChange.java
(rev 0)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChange.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.container.definition;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This interface describes the change that cans be applied on a given {@link
PortalContainerDefinition}
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 11 juin 2010
+ */
+public interface PortalContainerDefinitionChange
+{
+
+ /**
+ * Apply the corresponding change of the given {@link PortalContainerDefinition}
+ * @param pcd the {@link PortalContainerDefinition} on which the change has to be
applied
+ */
+ void apply(PortalContainerDefinition pcd);
+
+ /**
+ * This class is an {@link PortalContainerDefinitionChange} that will add the nested
dependencies
+ * at the end of the dependency list of the {@link PortalContainerDefinition}. If the
nested
+ * dependency list is empty, this change will be ignored.
+ */
+ public static class AddDependencies implements PortalContainerDefinitionChange
+ {
+ /**
+ * The list of name of the dependencies to add
+ */
+ public List<String> dependencies;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void apply(PortalContainerDefinition pcd)
+ {
+ if (dependencies == null || dependencies.isEmpty())
+ {
+ return;
+ }
+ pcd.getDependencies().addAll(dependencies);
+ }
+ }
+
+ /**
+ * This class is an {@link PortalContainerDefinitionChange} that will add the nested
dependencies
+ * before a target dependency to the dependency list of the {@link
PortalContainerDefinition}.
+ * If the target dependency is empty or cannot be found, the nested dependencies will
be added at
+ * the head of the dependency list. If the nested dependency list is empty, this
change will be ignored.
+ */
+ public static class AddDependenciesBefore implements PortalContainerDefinitionChange
+ {
+ /**
+ * The list of name of the dependencies to add
+ */
+ public List<String> dependencies;
+
+ /**
+ * The name of the target dependency
+ */
+ public String target;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void apply(PortalContainerDefinition pcd)
+ {
+ if (dependencies == null || dependencies.isEmpty())
+ {
+ return;
+ }
+ if (target != null && target.length() > 0)
+ {
+ List<String> lDependencies = pcd.getDependencies();
+ for (int i = lDependencies.size() - 1; i >= 0; i--)
+ {
+ String dep = lDependencies.get(i);
+ if (target.equals(dep))
+ {
+ // The target could be found
+ lDependencies.addAll(i, dependencies);
+ return;
+ }
+ }
+ }
+ // The target is empty or cannot be found
+ pcd.getDependencies().addAll(0, dependencies);
+ }
+ }
+
+ /**
+ * This class is an {@link PortalContainerDefinitionChange} that will add the nested
dependencies
+ * after a target dependency to the dependency list of the {@link
PortalContainerDefinition}.
+ * If the target dependency is empty or cannot be found, the nested dependencies will
be added at
+ * the end of the dependency list. If the nested dependency list is empty, this change
will be ignored.
+ */
+ public static class AddDependenciesAfter implements PortalContainerDefinitionChange
+ {
+ /**
+ * The list of name of the dependencies to add
+ */
+ public List<String> dependencies;
+
+ /**
+ * The name of the target dependency
+ */
+ public String target;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void apply(PortalContainerDefinition pcd)
+ {
+ if (dependencies == null || dependencies.isEmpty())
+ {
+ return;
+ }
+ if (target != null && target.length() > 0)
+ {
+ List<String> lDependencies = pcd.getDependencies();
+ for (int i = 0, length = lDependencies.size(); i < length; i++)
+ {
+ String dep = lDependencies.get(i);
+ if (target.equals(dep))
+ {
+ // The target could be found
+ lDependencies.addAll(i + 1, dependencies);
+ return;
+ }
+ }
+ }
+ // The target is empty or cannot be found
+ pcd.getDependencies().addAll(dependencies);
+ }
+ }
+
+ /**
+ * This class is an {@link PortalContainerDefinitionChange} that will add new internal
settings
+ * to the {@link PortalContainerDefinition}. If the nested settings are empty, this
change will
+ * be ignored.
+ */
+ public static class AddSettings implements PortalContainerDefinitionChange
+ {
+ /**
+ * The settings to add to the internal settings
+ */
+ public Map<String, Object> settings;
+
+ public void apply(PortalContainerDefinition pcd)
+ {
+ if (settings == null || settings.isEmpty())
+ {
+ return;
+ }
+ pcd.getSettings().putAll(settings);
+ }
+ }
+}
Added:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChangePlugin.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChangePlugin.java
(rev 0)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerDefinitionChangePlugin.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.container.definition;
+
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class allows you to dynamically apply a list of changes to one or several portal
containers.
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 11 juin 2010
+ */
+public class PortalContainerDefinitionChangePlugin extends BaseComponentPlugin
+{
+
+ /**
+ * Indicates whether the changes have to be applied to all the portal containers or
not.
+ */
+ private boolean all;
+
+ /**
+ * Indicates whether the changes have to be applied to the default portal container or
not.
+ */
+ private boolean bDefault;
+
+ /**
+ * A set of specific portal container names on which we want to apply the changes.
+ */
+ private Set<String> names;
+
+ /**
+ * The list of changes to apply
+ */
+ private List<PortalContainerDefinitionChange> changes;
+
+ @SuppressWarnings("unchecked")
+ public PortalContainerDefinitionChangePlugin(InitParams params)
+ {
+ ValueParam vp = params.getValueParam("apply.all");
+ if (vp != null && vp.getValue().length() > 0)
+ {
+ this.all = Boolean.valueOf(vp.getValue());
+ }
+ vp = params.getValueParam("apply.default");
+ if (vp != null && vp.getValue().length() > 0)
+ {
+ this.bDefault = Boolean.valueOf(vp.getValue());
+ }
+ ValuesParam vsp = params.getValuesParam("apply.specific");
+ if (vsp != null && !vsp.getValues().isEmpty())
+ {
+ this.names = new HashSet<String>(vsp.getValues());
+ }
+ this.changes = params.getObjectParamValues(PortalContainerDefinitionChange.class);
+ }
+
+ public boolean isAll()
+ {
+ return all;
+ }
+
+ public boolean isDefault()
+ {
+ return bDefault;
+ }
+
+ public Set<String> getNames()
+ {
+ return names;
+ }
+
+ public List<PortalContainerDefinitionChange> getChanges()
+ {
+ return changes;
+ }
+}
Added:
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/SafePortalContainerDefinition.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/SafePortalContainerDefinition.java
(rev 0)
+++
kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition/SafePortalContainerDefinition.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -0,0 +1,147 @@
+/*
+ * 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.container.definition;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This class is a decorator used to protect the nested {@link
PortalContainerDefinition}. It mainly
+ * forbid access to setter. If a setter is called an {@link
UnsupportedOperationException} will be thrown.
+ * This class is mainly used to prevent any unsupported {@link
PortalContainerDefinitionChange}.
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 8 sept. 2009
+ */
+public class SafePortalContainerDefinition extends PortalContainerDefinition
+{
+
+ /**
+ * The {@link PortalContainerDefinition} to protected
+ */
+ private final PortalContainerDefinition definition;
+
+ /**
+ * The default {@link PortalContainerDefinition}
+ */
+ private final PortalContainerDefinition defaultDefinition;
+
+ /**
+ * Default constructor
+ */
+ public SafePortalContainerDefinition(PortalContainerDefinition definition,
+ PortalContainerDefinition defaultDefinition)
+ {
+ this.definition = definition;
+ this.defaultDefinition = defaultDefinition;
+ }
+
+ public String getName()
+ {
+ return definition.getName();
+ }
+
+ public void setName(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List<String> getDependencies()
+ {
+ // We ensure that the dependency list is not null to simplify the code in
+ // all instances of PortalContainerDefinitionChange
+ List<String> dependencies = definition.getDependencies();
+ if (dependencies == null || dependencies.isEmpty())
+ {
+ // Try to get the default dependencies
+ dependencies = defaultDefinition.getDependencies();
+ if (dependencies == null || dependencies.isEmpty())
+ {
+ dependencies = new ArrayList<String>();
+ }
+ else
+ {
+ dependencies = new ArrayList<String>(dependencies);
+ }
+ definition.setDependencies(dependencies);
+ }
+ return dependencies;
+ }
+
+ public void setDependencies(List<String> dependencies)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getRealmName()
+ {
+ return definition.getRealmName();
+ }
+
+ public void setRealmName(String realmName)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getRestContextName()
+ {
+ return definition.getRestContextName();
+ }
+
+ public void setRestContextName(String restContextName)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Map<String, Object> getSettings()
+ {
+ // We ensure that the settings are not null to simplify the code in
+ // all instances of PortalContainerDefinitionChange
+ Map<String, Object> settings = definition.getSettings();
+ if (settings == null)
+ {
+ settings = new HashMap<String, Object>();
+ }
+ else
+ {
+ settings = new HashMap<String, Object>(settings);
+ }
+ definition.setSettings(settings);
+ return settings;
+ }
+
+ public void setSettings(Map<String, Object> settings)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getExternalSettingsPath()
+ {
+ return definition.getExternalSettingsPath();
+ }
+
+ public void setExternalSettingsPath(String externalSettingsPath)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -20,7 +20,11 @@
import org.exoplatform.container.jmx.AbstractTestContainer;
import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* Created by The eXo Platform SAS
@@ -95,7 +99,7 @@
assertEquals("myRest-pcdef", config.getDefaultRestContext());
assertEquals("my-exo-domain-pcdef", config.getDefaultRealmName());
assertTrue(config.hasDefinition());
-
+
rootContainer =
createRootContainer("portal-container-config-with-no-default-values-but-with-portal-defs.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
@@ -103,19 +107,74 @@
assertEquals("myRest", config.getDefaultRestContext());
assertEquals("my-exo-domain", config.getDefaultRealmName());
assertTrue(config.hasDefinition());
-
+
rootContainer =
createRootContainer("portal-container-config-with-no-default-values-but-with-portal-defs2.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
assertEquals("myPortal-pcdef", config.getDefaultPortalContainer());
assertEquals("myRest-pcdef", config.getDefaultRestContext());
assertEquals("my-exo-domain-pcdef", config.getDefaultRealmName());
- assertTrue(config.hasDefinition());
+ assertTrue(config.hasDefinition());
}
+ public void testChanges()
+ {
+ Set<String> s;
+ try
+ {
+
createRootContainer("portal-container-config-with-no-default-values-but-with-portal-defs.xml");
+ s = TestPortalContainerDefinitionChange.NAMES.get("change1");
+ assertNotNull(s);
+ assertEquals(2, s.size());
+ assertTrue(s.contains("portal"));
+ assertTrue(s.contains("myPortal-pcdef"));
+
+ s = TestPortalContainerDefinitionChange.NAMES.get("change2");
+ assertNotNull(s);
+ assertEquals(1, s.size());
+ assertTrue(s.contains("portal"));
+
+ s = TestPortalContainerDefinitionChange.NAMES.get("change3");
+ assertNotNull(s);
+ assertEquals(1, s.size());
+ assertTrue(s.contains("myPortal-pcdef"));
+
+ s = TestPortalContainerDefinitionChange.NAMES.get("change4");
+ assertNotNull(s);
+ assertEquals(2, s.size());
+ assertTrue(s.contains("portal"));
+ assertTrue(s.contains("myPortal-pcdef"));
+
+ s = TestPortalContainerDefinitionChange.NAMES.get("change5");
+ assertNotNull(s);
+ assertEquals(1, s.size());
+ assertTrue(s.contains("portal"));
+
+ s = TestPortalContainerDefinitionChange.NAMES.get("change6");
+ assertNull(s);
+ }
+ finally
+ {
+ TestPortalContainerDefinitionChange.NAMES.clear();
+ }
+
+ try
+ {
+
createRootContainer("portal-container-config-with-no-default-values-but-with-portal-defs.xml",
"change6");
+ s = TestPortalContainerDefinitionChange.NAMES.get("change6");
+ assertNotNull(s);
+ assertEquals(1, s.size());
+ assertTrue(s.contains("portal"));
+ }
+ finally
+ {
+ TestPortalContainerDefinitionChange.NAMES.clear();
+ }
+ }
+
public void testDependencies()
{
-
+
// Empty
RootContainer rootContainer =
createRootContainer("portal-container-config-with-no-default-values.xml");
PortalContainerConfig config =
@@ -144,19 +203,65 @@
assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getRealmName("myPortal-pcdef"));
assertFalse(config.isPortalContainerName("foo"));
assertFalse(config.isPortalContainerName("myPortal"));
- assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("myPortal-pcdef"));
assertTrue(config.isPortalContainerName(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME));
// Needed for backward compatibility
assertTrue(config.isScopeValid("foo", "foo"));
assertTrue(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
assertFalse(config.hasDefinition());
-
+
+ // Empty with AddDependencies, AddDependenciesBefore and AddDependenciesAfter
+ String[] profiles =
+ {"AddDependencies", "AddDependenciesBefore-No-Target",
"AddDependenciesBefore-With-Fake-Target",
+ "AddDependenciesAfter-No-Target",
"AddDependenciesAfter-With-Fake-Target"};
+
+ List<String> deps;
+ for (String profile : profiles)
+ {
+ rootContainer =
createRootContainer("portal-container-config-with-no-default-values2.xml",
profile);
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ deps =
config.getDependencies(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME);
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("foo"));
+ deps = config.getDependencies("foo");
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("foo"));
+ deps = config.getDependencies("myPortal");
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("foo"));
+ deps = config.getDependencies("myPortal-pcdef");
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("foo"));
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
names.get(0));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
config.getPortalContainerName("foo"));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
config.getPortalContainerName("myPortal"));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME, config
+ .getPortalContainerName("myPortal-pcdef"));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getRestContextName("foo"));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getRestContextName("myPortal"));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getRestContextName("myPortal-pcdef"));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getRealmName("foo"));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getRealmName("myPortal"));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+
assertTrue(config.isPortalContainerName(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME));
+ // Needed for backward compatibility
+ assertFalse(config.isScopeValid("foo", "foo"));
+ assertFalse(config.isScopeValid("myPortal", "foo"));
+ assertFalse(config.isScopeValid("myPortal-pcdef", "foo"));
+
assertTrue(config.isScopeValid(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
"foo"));
+ assertFalse(config.hasDefinition());
+ }
// Without dependencies
- rootContainer =
-
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
- config =
-
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def.xml");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
assertNull(config.getDependencies("foo"));
assertNull(config.getDependencies("myPortal"));
assertNull(config.getDependencies("myPortal-pcdef"));
@@ -249,9 +354,10 @@
assertTrue(config.hasDefinition());
// Without dependencies and with default portal container definition
- rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml");
+ rootContainer =
+
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
- List<String> deps = config.getDependencies("foo");
+ deps = config.getDependencies("foo");
assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
deps = config.getDependencies("myPortal");
assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
@@ -289,6 +395,68 @@
assertTrue(config.isScopeValid("myPortal-pcdef", "fooX"));
assertTrue(config.hasDefinition());
+ profiles =
+ new String[]{"AddDependencies",
"AddDependenciesBefore-No-Target",
"AddDependenciesBefore-With-Fake-Target",
+ "AddDependenciesBefore-With-Target",
"AddDependenciesAfter-No-Target",
+ "AddDependenciesAfter-With-Fake-Target",
"AddDependenciesAfter-With-Target"};
+
+ for (String profile : profiles)
+ {
+ rootContainer =
+ createRootContainer(
+
"portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml",
+ "with-profiles", profile);
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ deps = config.getDependencies("foo");
+ assertTrue(deps != null && deps.size() == 2 &&
deps.contains("fooX") && deps.contains("foo"));
+ int index = deps.indexOf("foo");
+ if (profile.equals("AddDependenciesBefore-No-Target")
+ || profile.equals("AddDependenciesBefore-With-Fake-Target")
+ || profile.equals("AddDependenciesBefore-With-Target"))
+ {
+ assertEquals(0, index);
+ }
+ else
+ {
+ assertEquals(1, index);
+ }
+ deps = config.getDependencies("myPortal");
+ assertTrue(deps != null && deps.size() == 2 &&
deps.contains("fooX") && deps.contains("foo"));
+ deps = config.getDependencies("myPortal-pcdef");
+ assertTrue(deps != null && deps.size() == 2 &&
deps.contains("fooX") && deps.contains("foo"));
+ names = config.getPortalContainerNames("fooX");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertEquals("myPortal-dpcdef", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-dpcdef", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal-dpcdef",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest-dpcdef",
config.getRestContextName("foo"));
+ assertEquals("myRest-dpcdef",
config.getRestContextName("myPortal"));
+ assertEquals("myRest-pcdef",
config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain-dpcdef",
config.getRealmName("foo"));
+ assertEquals("my-exo-domain-dpcdef",
config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertFalse(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "fooX"));
+ assertFalse(config.isScopeValid("myPortal", "fooX"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "fooX"));
+ assertTrue(config.hasDefinition());
+ }
+
// With dependencies
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
@@ -321,9 +489,66 @@
assertFalse(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
assertTrue(config.hasDefinition());
-
+
+ for (String profile : profiles)
+ {
+ rootContainer =
+
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml",
+ "with-profiles", profile);
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ deps = config.getDependencies("foo");
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
+ deps = config.getDependencies("myPortal");
+ assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
+ deps = config.getDependencies("myPortal-pcdef");
+ assertTrue(deps != null && deps.size() == 4);
+ int index = deps.indexOf("fooX");
+ if (profile.equals("AddDependenciesBefore-No-Target") ||
profile.equals("AddDependenciesBefore-With-Fake-Target"))
+ {
+ assertEquals(0, index);
+ }
+ else if (profile.equals("AddDependenciesBefore-With-Target"))
+ {
+ assertEquals(1, index);
+ }
+ else if (profile.equals("AddDependenciesAfter-With-Target"))
+ {
+ assertEquals(2, index);
+ }
+ else
+ {
+ assertEquals(3, index);
+ }
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest",
config.getRestContextName("myPortal"));
+ assertEquals("myRest-pcdef",
config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain-pcdef",
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ assertFalse(config.isScopeValid("foo", "foo"));
+ assertFalse(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertTrue(config.hasDefinition());
+ }
+
// With dependencies and with default portal container definition
- rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def2.xml");
+ rootContainer =
+
createRootContainer("portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def2.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
deps = config.getDependencies("foo");
assertTrue(deps != null && deps.size() == 1 &&
deps.contains("fooX"));
@@ -360,7 +585,7 @@
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
- assertTrue(config.hasDefinition());
+ assertTrue(config.hasDefinition());
}
public void testSettings()
@@ -391,6 +616,33 @@
assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getSetting("myPortal-pcdef",
PortalContainerConfig.REALM_SETTING_NAME));
+ rootContainer =
createRootContainer("portal-container-config-with-no-default-values.xml",
"with-profiles");
+ config =
+
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getSetting("foo", "foo"));
+ assertNull(config.getSetting("myPortal", "foo"));
+ assertNull(config.getSetting("myPortal-pcdef", "foo"));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
config.getSetting("foo",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
config.getSetting("myPortal",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_PORTAL_CONTAINER_NAME,
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getSetting("foo",
+ PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getSetting("myPortal",
+ PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REST_CONTEXT_NAME,
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getSetting("foo",
+ PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getSetting("myPortal",
+ PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals(PortalContainerConfig.DEFAULT_REALM_NAME,
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("value1", config.getSetting("foo",
"string"));
+ assertEquals("value1", config.getSetting("foo",
"stringX"));
+
// Without settings and without portal definition
rootContainer =
createRootContainer("portal-container-config-with-default-values.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
@@ -593,8 +845,9 @@
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
assertEquals("../gatein/data", config.getSetting("portal",
"gatein.data.dir"));
assertEquals("../gatein/data/db", config.getSetting("portal",
"gatein.db.data.dir"));
- assertEquals("jdbc:hsqldb:file:../gatein/data/db/data/jdbcjcr_portal",
config.getSetting("portal", "gatein.jcr.datasource.url"));
-
+ assertEquals("jdbc:hsqldb:file:../gatein/data/db/data/jdbcjcr_portal",
config.getSetting("portal",
+ "gatein.jcr.datasource.url"));
+
// With external settings, with several portal container definitions and with
// default portal container definition
rootContainer =
@@ -721,7 +974,8 @@
assertEquals("2001", config.getSetting("myPortal",
"long"));
assertEquals("2001", config.getSetting("myPortal",
"double"));
assertEquals("false", config.getSetting("myPortal",
"boolean"));
- assertEquals("myPortal-myRest-my-exo-domain-value01-new value01",
config.getSetting("myPortal", "complex-value2"));
+ assertEquals("myPortal-myRest-my-exo-domain-value01-new value01",
config.getSetting("myPortal",
+ "complex-value2"));
assertEquals("new value01", config.getSetting("myPortal0",
"string"));
assertEquals("2001", config.getSetting("myPortal0",
"int"));
assertEquals("2001", config.getSetting("myPortal0",
"long"));
@@ -751,10 +1005,12 @@
PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
assertEquals("myRest", config.getSetting("foo",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
assertEquals("myRest", config.getSetting("myPortal",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
- assertEquals("myRest-pcdef",
config.getSetting("myPortal-pcdef",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef",
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
assertEquals("my-exo-domain", config.getSetting("foo",
PortalContainerConfig.REALM_SETTING_NAME));
assertEquals("my-exo-domain", config.getSetting("myPortal",
PortalContainerConfig.REALM_SETTING_NAME));
- assertEquals("my-exo-domain-pcdef",
config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef",
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REALM_SETTING_NAME));
}
finally
@@ -799,7 +1055,8 @@
System.setProperty("TestPortalContainerConfig-string", "system
value");
System.setProperty("TestPortalContainerConfig-int", "50");
// With both settings internal and external and default portal container
definition
- rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-both-settings-with-default-portal-def.xml");
+ rootContainer =
+
createRootContainer("portal-container-config-with-default-values-and-with-both-settings-with-default-portal-def.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
assertEquals("value0", config.getSetting("foo",
"foo"));
assertEquals("value0", config.getSetting("myPortal",
"foo"));
@@ -864,10 +1121,12 @@
PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
assertEquals("myRest", config.getSetting("foo",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
assertEquals("myRest", config.getSetting("myPortal",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
- assertEquals("myRest-pcdef",
config.getSetting("myPortal-pcdef",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest-pcdef",
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
assertEquals("my-exo-domain", config.getSetting("foo",
PortalContainerConfig.REALM_SETTING_NAME));
assertEquals("my-exo-domain", config.getSetting("myPortal",
PortalContainerConfig.REALM_SETTING_NAME));
- assertEquals("my-exo-domain-pcdef",
config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain-pcdef",
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.REALM_SETTING_NAME));
}
finally
{
@@ -894,4 +1153,24 @@
assertEquals("my-exo-domain", config.getSetting("myPortal",
PortalContainerConfig.REALM_SETTING_NAME));
assertEquals("my-exo-domain",
config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
}
+
+ public static class TestPortalContainerDefinitionChange implements
PortalContainerDefinitionChange
+ {
+
+ public String name;
+
+ public static Map<String, Set<String>> NAMES = new HashMap<String,
Set<String>>();
+
+ public void apply(PortalContainerDefinition pcd)
+ {
+ Set<String> names = NAMES.get(name);
+ if (names == null)
+ {
+ names = new HashSet<String>();
+ NAMES.put(name, names);
+ }
+ names.add(pcd.getName());
+ }
+
+ }
}
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/AbstractTestContainer.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/AbstractTestContainer.java 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/AbstractTestContainer.java 2010-06-16
08:01:20 UTC (rev 2620)
@@ -37,4 +37,11 @@
assertNotNull(url);
return new ContainerBuilder().withRoot(url).build();
}
+
+ public RootContainer createRootContainer(String relativeConfigurationFile, String...
profiles)
+ {
+ URL url = getClass().getResource(relativeConfigurationFile);
+ assertNotNull(url);
+ return new ContainerBuilder().withRoot(url).profiledBy(profiles).build();
+ }
}
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def-with-default-portal-def.xml 2010-06-16
08:01:20 UTC (rev 2620)
@@ -92,5 +92,131 @@
</object-param>
</init-params>
</component-plugin>
+ <component-plugin profiles="with-profiles">
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.default</name>
+ <value>true</value>
+ </value-param>
+ <values-param>
+ <name>apply.specific</name>
+ <value>fake</value>
+ <value>myPortal-dpcdef</value>
+ </values-param>
+ <object-param profiles="AddDependencies">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-With-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fooX</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-With-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fooX</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
</external-component-plugins>
</configuration>
\ No newline at end of file
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-portal-def2.xml 2010-06-16
08:01:20 UTC (rev 2620)
@@ -74,5 +74,126 @@
</object-param>
</init-params>
</component-plugin>
+ <component-plugin profiles="with-profiles">
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.all</name>
+ <value>true</value>
+ </value-param>
+ <object-param profiles="AddDependencies">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-With-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>foo2</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-With-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>fooX</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>foo2</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
</external-component-plugins>
</configuration>
\ No newline at end of file
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-defs.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-defs.xml 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values-but-with-portal-defs.xml 2010-06-16
08:01:20 UTC (rev 2620)
@@ -58,6 +58,142 @@
</object>
</object-param>
</init-params>
- </component-plugin>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.all</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>change1</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change1</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.default</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>change2</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change2</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <values-param>
+ <name>apply.specific</name>
+ <value>fake</value>
+ <value>myPortal-pcdef</value>
+ </values-param>
+ <object-param>
+ <name>change3</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change3</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.default</name>
+ <value>true</value>
+ </value-param>
+ <values-param>
+ <name>apply.specific</name>
+ <value>fake</value>
+ <value>myPortal-pcdef</value>
+ </values-param>
+ <object-param>
+ <name>change4</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change4</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <object-param>
+ <name>change5</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change5</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <object-param profiles="change6">
+ <name>change6</name>
+ <object
type="org.exoplatform.container.definition.TestPortalContainerConfig$TestPortalContainerDefinitionChange">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>change6</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
</external-component-plugins>
</configuration>
\ No newline at end of file
Modified:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml 2010-06-16
07:53:43 UTC (rev 2619)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values.xml 2010-06-16
08:01:20 UTC (rev 2620)
@@ -1,30 +1,59 @@
<?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_1.xsd
http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
- <component>
- <type>org.exoplatform.container.definition.PortalContainerConfig</type>
- </component>
-
+ 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_1.xsd
http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin profiles="with-profiles">
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.all</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddSettings">
+ <!-- The settings to add to the internal settings -->
+ <field name="settings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key>
+ <string>string</string>
+ </key>
+ <value>
+ <string>value1</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>stringX</string>
+ </key>
+ <value>
+ <string>value1</string>
+ </value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Added:
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values2.xml
===================================================================
---
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values2.xml
(rev 0)
+++
kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-no-default-values2.xml 2010-06-16
08:01:20 UTC (rev 2620)
@@ -0,0 +1,106 @@
+<?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_1.xsd
http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Change PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the changes on the PortalContainerDefinitions -->
+ <set-method>registerChangePlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
+ <init-params>
+ <value-param>
+ <name>apply.default</name>
+ <value>true</value>
+ </value-param>
+ <object-param profiles="AddDependencies">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesBefore-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesBefore">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-No-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ <object-param profiles="AddDependenciesAfter-With-Fake-Target">
+ <name>change</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependenciesAfter">
+ <!-- The list of name of the dependencies to add -->
+ <field name="dependencies">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>foo</string>
+ </value>
+ </collection>
+ </field>
+ <!-- The name of the target dependency -->
+ <field name="target">
+ <string>fake</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file