- Fixed actions config overriding

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2859 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-05-11 22:05:03 +00:00
parent 931685b753
commit 38f88da91b
17 changed files with 302 additions and 166 deletions

View File

@@ -67,15 +67,15 @@ public class AdvancedSearchConfigElement extends ConfigElementAdapter
*/
public ConfigElement combine(ConfigElement configElement)
{
AdvancedSearchConfigElement existingElement = (AdvancedSearchConfigElement)configElement;
AdvancedSearchConfigElement newElement = new AdvancedSearchConfigElement();
AdvancedSearchConfigElement newElement = (AdvancedSearchConfigElement)configElement;
AdvancedSearchConfigElement combinedElement = new AdvancedSearchConfigElement();
// just copy the list of types and properties from this instance to the new one
if (this.contentTypes != null)
{
for (String type : this.contentTypes)
{
newElement.addContentType(type);
combinedElement.addContentType(type);
}
}
@@ -83,28 +83,28 @@ public class AdvancedSearchConfigElement extends ConfigElementAdapter
{
for (CustomProperty property : this.customProps)
{
newElement.addCustomProperty(property);
combinedElement.addCustomProperty(property);
}
}
// now add those types and custom properties from the element to be combined
if (existingElement.getContentTypes() != null)
if (newElement.getContentTypes() != null)
{
for (String type : existingElement.getContentTypes())
for (String type : newElement.getContentTypes())
{
newElement.addContentType(type);
combinedElement.addContentType(type);
}
}
if (existingElement.getCustomProperties() != null)
if (newElement.getCustomProperties() != null)
{
for (CustomProperty property : existingElement.getCustomProperties())
for (CustomProperty property : newElement.getCustomProperties())
{
newElement.addCustomProperty(property);
combinedElement.addCustomProperty(property);
}
}
return newElement;
return combinedElement;
}
/**