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

@@ -23,6 +23,11 @@
*/
package org.alfresco.web.bean.wcm;
import static org.alfresco.web.bean.wcm.DescriptionAttributeHelper.getDescriptionNotEmpty;
import static org.alfresco.web.bean.wcm.DescriptionAttributeHelper.getTableBegin;
import static org.alfresco.web.bean.wcm.DescriptionAttributeHelper.getTableEnd;
import static org.alfresco.web.bean.wcm.DescriptionAttributeHelper.getTableLine;
import java.io.File;
import java.io.Serializable;
import java.text.MessageFormat;
@@ -65,8 +70,6 @@ import org.alfresco.web.forms.RenderingEngine;
import org.alfresco.web.forms.RenderingEngineTemplate;
import org.alfresco.web.forms.RenderingEngineTemplateImpl;
import org.alfresco.web.forms.XMLUtil;
import org.alfresco.web.forms.xforms.FormBuilderException;
import org.alfresco.web.forms.xforms.SchemaUtil;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIListItem;
import org.alfresco.web.ui.wcm.WebResources;
@@ -74,11 +77,10 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xerces.xs.XSConstants;
import org.apache.xerces.xs.XSElementDeclaration;
import org.apache.xerces.xs.XSModel;
import org.apache.xerces.xs.XSNamedMap;
import org.chiba.xml.ns.NamespaceConstants;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* Bean implementation for the "Create XML Form" dialog
@@ -238,7 +240,7 @@ public class CreateFormWizard extends BaseWizardBean
protected String defaultWorkflowName = null;
protected boolean applyDefaultWorkflow = true;
protected List<RenderingEngineTemplateData> renderingEngineTemplates = null;
protected transient XSModel schema;
transient protected Document schema;
protected String schemaFileName;
protected transient ContentService contentService;
protected transient MimetypeService mimetypeService;
@@ -773,17 +775,7 @@ public class CreateFormWizard extends BaseWizardBean
{
try
{
final Document d = XMLUtil.parse(this.getSchemaFile());
try
{
this.schema = SchemaUtil.parseSchema(d, true);
}
catch (FormBuilderException fbe)
{
this.schema = SchemaUtil.parseSchema(d, false);
LOGGER.warn("non fatal errors encountered parsing schema " + this.getFileName(FILE_SCHEMA) +
"\n " + fbe.getMessage());
}
this.schema = XMLUtil.parse(this.getSchemaFile());
}
catch (Exception e)
{
@@ -999,11 +991,16 @@ public class CreateFormWizard extends BaseWizardBean
if (this.schemaRootElementNameChoices == null)
{
this.schemaRootElementNameChoices = new LinkedList<SelectItem>();
final XSNamedMap elementsMap = this.schema.getComponents(XSConstants.ELEMENT_DECLARATION);
for (int i = 0; i < elementsMap.getLength(); i++)
NodeList elements = this.schema.getElementsByTagNameNS(NamespaceConstants.XMLSCHEMA_NS, "element");
for (int i = 0; i < elements.getLength(); i++)
{
final XSElementDeclaration e = (XSElementDeclaration)elementsMap.item(i);
this.schemaRootElementNameChoices.add(new SelectItem(e.getName(), e.getName()));
Node current = elements.item(i);
if (current.getParentNode().equals(this.schema.getDocumentElement()))
{
this.schemaRootElementNameChoices.add(new SelectItem(current.getAttributes().getNamedItem("name").getNodeValue(),
current.getAttributes().getNamedItem("name").getNodeValue()));
}
}
}
result = this.schemaRootElementNameChoices;

View File

@@ -48,7 +48,6 @@ import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.RenderingEngineTemplate;
import org.alfresco.web.forms.xforms.SchemaUtil;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -122,7 +121,7 @@ public class EditFormWizard
ContentModel.PROP_NAME));
try
{
this.schema = SchemaUtil.parseSchema(form.getSchema(), false);
this.schema = form.getSchema();
}
catch (Throwable t)
{