Merged V3.2 to HEAD

16725: Merged V3.1 to V3.2
      16721: Merged DEV/BELARUS/V3.1 to V3.1 
         16483: Fix for ETHREEOH-2728 : WCM - Forms rendering issue using IE6
   16889: Merged V3.1 to V3.2
      16888: Merged V2.2 to V3.1 
         16694: Fix for ETHREEOH-1384/ACT 11135: Poor performance when using webscript based web forms 
         16787: Fixed Web-Client Eclipse project after recent chiba JAR file name change 
         16840: Resolution to issue in ETHREEOH-2633: Change to Common.js function implemented in CHK-5134 causes problems with missing icons in Navigator panel. Implemented configuration approach so that both modes can be supported. 
         16870: Fix for ETWOTWO-119 & ALFCOM-332: WCM config override issues where the OOTB web-client-config-wcm.xml file needed to be changed and the ability to define custom scripts to load to avoid the need to edit xforms.js or XFormsProcessor.java

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16913 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2009-10-14 11:37:27 +00:00
parent ba3f9629b5
commit b1e86e69f2
21 changed files with 1103 additions and 100 deletions

View File

@@ -26,8 +26,11 @@ package org.alfresco.web.config;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement;
@@ -842,7 +845,7 @@ public class WebClientConfigTest extends BaseTest
public void testActionsOverriding()
{
XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml");
XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml");
// get the "Actions" config
Config cfg = svc.getConfig("Actions Override");
@@ -921,4 +924,142 @@ public class WebClientConfigTest extends BaseTest
assertNotNull("Expecting a list of search attributes", attrs);
assertEquals("Expecting 2 search attributes", 2, attrs.size());
}
public void testWCM()
{
// setup the config service
XMLConfigService svc = initXMLConfigService("test-config.xml");
// get the global config object
Config global = svc.getGlobalConfig();
assertNotNull(global);
// get the wcm config
ConfigElement wcmConfig = global.getConfigElement("wcm");
assertNotNull(wcmConfig);
// get the workflows config
ConfigElement workflows = wcmConfig.getChild("workflows");
assertNotNull(workflows);
assertEquals("wcmwf:submit", workflows.getValue());
// get the admin workflows config
ConfigElement adminWorkflows = wcmConfig.getChild("admin-workflows");
assertNotNull(adminWorkflows);
assertEquals("wcmwf:changerequest", adminWorkflows.getValue());
// get the browse page size config
ConfigElement viewsConfig = wcmConfig.getChild("views");
assertNotNull(viewsConfig);
ConfigElement browsePageSizeConfig = viewsConfig.getChild("browse-page-size");
assertNotNull(browsePageSizeConfig);
assertEquals("25", browsePageSizeConfig.getValue());
// get the deployment polling frequency
ConfigElement deploymentConfig = wcmConfig.getChild("deployment");
assertNotNull(deploymentConfig);
ConfigElement pollingConfig = deploymentConfig.getChild("progress-polling-frequency");
assertNotNull(pollingConfig);
assertEquals("2", pollingConfig.getValue());
// get the link validation polling frequency
ConfigElement linksConfig = wcmConfig.getChild("links-management");
assertNotNull(linksConfig);
pollingConfig = linksConfig.getChild("progress-polling-frequency");
assertNotNull(pollingConfig);
assertEquals("2", pollingConfig.getValue());
// get the widget config
ConfigElement xformsConfig = wcmConfig.getChild("xforms");
assertNotNull(xformsConfig);
List<ConfigElement> widgetConfig = xformsConfig.getChildren("widget");
assertEquals(2, widgetConfig.size());
// make sure the xforms-scripts config is NOT present
ConfigElement scriptsConfig = wcmConfig.getChild("xforms-scripts");
assertNull(scriptsConfig);
// make sure the custom config element is NOT present
ConfigElement customConfig = wcmConfig.getChild("custom-config");
assertNull(customConfig);
}
public void testWCMOverride()
{
// setup the config service
XMLConfigService svc = initXMLConfigService("test-config.xml", "test-config-override.xml");
// get the global config object
Config global = svc.getGlobalConfig();
assertNotNull(global);
// get the wcm config
ConfigElement wcmConfig = global.getConfigElement("wcm");
assertNotNull(wcmConfig);
// get the workflows config
ConfigElement workflows = wcmConfig.getChild("workflows");
assertNotNull(workflows);
assertEquals("custom:submit", workflows.getValue().trim());
StringTokenizer t = new StringTokenizer(workflows.getValue().trim(), ", ");
while (t.hasMoreTokens())
{
System.out.println("workflow = '" + t.nextToken() + "'");
}
// get the admin workflows config
ConfigElement adminWorkflows = wcmConfig.getChild("admin-workflows");
assertNotNull(adminWorkflows);
assertEquals("custom:changerequest, custom:somejob", adminWorkflows.getValue());
t = new StringTokenizer(adminWorkflows.getValue().trim(), ", ");
while (t.hasMoreTokens())
{
System.out.println("admin workflow = '" + t.nextToken() + "'");
}
// get the browse page size config
ConfigElement viewsConfig = wcmConfig.getChild("views");
assertNotNull(viewsConfig);
ConfigElement browsePageSizeConfig = viewsConfig.getChild("browse-page-size");
assertNotNull(browsePageSizeConfig);
assertEquals("50", browsePageSizeConfig.getValue());
// get the deployment polling frequency
ConfigElement deploymentConfig = wcmConfig.getChild("deployment");
assertNotNull(deploymentConfig);
ConfigElement pollingConfig = deploymentConfig.getChild("progress-polling-frequency");
assertNotNull(pollingConfig);
assertEquals("10", pollingConfig.getValue());
// get the link validation polling frequency
ConfigElement linksConfig = wcmConfig.getChild("links-management");
assertNotNull(linksConfig);
pollingConfig = linksConfig.getChild("progress-polling-frequency");
assertNotNull(pollingConfig);
assertEquals("15", pollingConfig.getValue());
// get the widget config
ConfigElement xformsConfig = wcmConfig.getChild("xforms");
assertNotNull(xformsConfig);
List<ConfigElement> widgetConfig = xformsConfig.getChildren("widget");
assertEquals(3, widgetConfig.size());
// make sure the xforms-scripts config is present
ConfigElement scriptsConfig = wcmConfig.getChild("xforms-scripts");
assertNotNull(scriptsConfig);
assertEquals("/custom/custom-xforms.js, /custom/another-custom-xforms.js", scriptsConfig.getValue());
t = new StringTokenizer(scriptsConfig.getValue().trim(), ", ");
while (t.hasMoreTokens())
{
System.out.println("custom script = '" + t.nextToken() + "'");
}
// make sure the custom config element is present
ConfigElement customConfig = wcmConfig.getChild("custom-config");
assertNotNull(customConfig);
assertEquals("50", customConfig.getValue());
}
}