diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index c5c6b46190..0d64b1120a 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1488,3 +1488,11 @@ validation_regex={0} is invalid. validation_regex_not_match={0} is invalid. validation_numeric_range={0} must be between {1} and {2}. validation_invalid_character=is an invalid character. +validation_provide_values_for_required_fields=Please provide values for all required fields + +# XForms ui +idle=Idle +loading=Loading + +# File Picker +go_up=Go up diff --git a/source/java/org/alfresco/web/forms/xforms/Schema2XForms.java b/source/java/org/alfresco/web/forms/xforms/Schema2XForms.java index 45df10c6fe..1db4446bb5 100644 --- a/source/java/org/alfresco/web/forms/xforms/Schema2XForms.java +++ b/source/java/org/alfresco/web/forms/xforms/Schema2XForms.java @@ -555,7 +555,9 @@ public class Schema2XForms final ResourceBundle resourceBundle) { if (annotation == null) + { return null; + } // write annotation to empty doc final Document doc = XMLUtil.newDocument(); annotation.writeAnnotation(doc, XSAnnotation.W3C_DOM_DOCUMENT); @@ -664,7 +666,9 @@ public class Schema2XForms //remove "@" in nodeset String name = nodeset.substring(1); if (name.equals(attributeName)) + { bindId = bind.getAttributeNS(null, "id"); + } } } @@ -715,7 +719,6 @@ public class Schema2XForms ? null : currentAttributeUse.getConstraintValue()); defaultInstanceElement.setAttributeNS(this.targetNamespace, - // XXXarielb - i probably need the prefix here i.e. "alf:" + attributeName attributeName, defaultValue); } @@ -1013,13 +1016,17 @@ public class Schema2XForms } else { + final SchemaUtil.Occurance o = SchemaUtil.getOccurance(elementDecl); //create the bind in case it is a repeat LOGGER.debug("Adding empty bind for control " + controlType + " type " + typeName + - " nodeset " + pathToRoot); + " nodeset " + pathToRoot + + " occurs " + o); // create the element and add it to the model. - final Element bindElement = this.createBind(xformsDocument, pathToRoot); + final Element bindElement = + this.createBind(xformsDocument, + pathToRoot + (o.isRepeated() ? "[position() != last()]" : "")); final String bindId = bindElement.getAttributeNS(null, "id"); modelSection.appendChild(bindElement); @@ -1027,7 +1034,7 @@ public class Schema2XForms schema, controlType, null, - SchemaUtil.getOccurance(elementDecl)); + o); } return this.addComplexType(xformsDocument, modelSection, @@ -1443,7 +1450,7 @@ public class Schema2XForms if (LOGGER.isDebugEnabled()) { LOGGER.debug("AddRepeatIfNecessary for multiple element for type " + - controlType.getName() + ", maxOccurs=" + o.maximum); + controlType.getName() + ", maxOccurs = " + o.maximum); } final Element repeatSection = @@ -1688,8 +1695,10 @@ public class Schema2XForms else { formControl = this.createControlForAtomicType(xformsDocument, + (XSSimpleTypeDefinition)controlType, + owner, caption, - (XSSimpleTypeDefinition)controlType); + resourceBundle); } formControl.setAttributeNS(NamespaceConstants.XFORMS_NS, @@ -1850,19 +1859,22 @@ public class Schema2XForms final ResourceBundle resourceBundle) { // add a group node and recurse - final Element groupElement = + final Element result = xformsDocument.createElementNS(NamespaceConstants.XFORMS_NS, NamespaceConstants.XFORMS_PREFIX + ":group"); - this.setXFormsId(groupElement); - groupElement.setAttributeNS(NamespaceConstants.XFORMS_NS, - NamespaceConstants.XFORMS_PREFIX + ":appearance", - "full"); - - //groupElement = (Element) formSection.appendChild(groupElement); - formSection.appendChild(groupElement); - groupElement.appendChild(this.createLabel(xformsDocument, - this.createCaption(owner, resourceBundle))); - return groupElement; + this.setXFormsId(result); + final String appearance = this.extractPropertyFromAnnotation(NamespaceService.ALFRESCO_URI, + "appearance", + this.getAnnotation(owner), + resourceBundle); + result.setAttributeNS(NamespaceConstants.XFORMS_NS, + NamespaceConstants.XFORMS_PREFIX + ":appearance", + appearance == null || appearance.length() == 0 ? "full" : appearance); + + formSection.appendChild(result); + result.appendChild(this.createLabel(xformsDocument, + this.createCaption(owner, resourceBundle))); + return result; } public String createCaption(final String text, @@ -2003,10 +2015,9 @@ public class Schema2XForms final Element control = xformsDocument.createElementNS(NamespaceConstants.XFORMS_NS, NamespaceConstants.XFORMS_PREFIX + ":textarea"); this.setXFormsId(control); -// control.setAttributeNS(Schema2XForms.CHIBA_NS, -// Schema2XForms.CHIBA_PREFIX + "height", -// "3"); - + control.setAttributeNS(NamespaceConstants.XFORMS_NS, + NamespaceConstants.XFORMS_PREFIX + ":appearance", + "compact"); control.appendChild(this.createLabel(xformsDocument, caption)); return control; } @@ -2025,25 +2036,33 @@ public class Schema2XForms * @param controlType The XML Schema type for which the form control is to be created. * @return The element for the form control. */ - public Element createControlForAtomicType(Document xformsDocument, - String caption, - XSSimpleTypeDefinition controlType) + public Element createControlForAtomicType(final Document xformsDocument, + final XSSimpleTypeDefinition controlType, + final XSObject owner, + final String caption, + final ResourceBundle resourceBundle) { - LOGGER.debug("creating a control for atomic type {name: " + controlType.getName() + - ", numeric: " + controlType.getNumeric() + - ", bounded: " + controlType.getBounded() + - ", finite: " + controlType.getFinite() + - ", ordered: " + controlType.getOrdered() + - ", final: " + controlType.getFinal() + - ", minInc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MININCLUSIVE) + - ", maxInc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MAXINCLUSIVE) + - ", minExc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MINEXCLUSIVE) + - ", maxExc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MAXEXCLUSIVE) + - ", fractionDigits: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_FRACTIONDIGITS) + - ", builtInTypeName: " + SchemaUtil.getBuiltInTypeName(controlType) + - ", builtInType: " + SchemaUtil.getBuiltInType(controlType) + - "}"); - + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug("creating a control for atomic type {name: " + controlType.getName() + + ", numeric: " + controlType.getNumeric() + + ", bounded: " + controlType.getBounded() + + ", finite: " + controlType.getFinite() + + ", ordered: " + controlType.getOrdered() + + ", final: " + controlType.getFinal() + + ", minInc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MININCLUSIVE) + + ", maxInc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MAXINCLUSIVE) + + ", minExc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MINEXCLUSIVE) + + ", maxExc: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_MAXEXCLUSIVE) + + ", fractionDigits: " + controlType.getLexicalFacetValue(XSSimpleTypeDefinition.FACET_FRACTIONDIGITS) + + ", builtInTypeName: " + SchemaUtil.getBuiltInTypeName(controlType) + + ", builtInType: " + SchemaUtil.getBuiltInType(controlType) + + "}"); + } + String appearance = this.extractPropertyFromAnnotation(NamespaceService.ALFRESCO_URI, + "appearance", + this.getAnnotation(owner), + resourceBundle); Element result = null; if ("boolean".equals(controlType.getName())) { @@ -2056,6 +2075,15 @@ public class Schema2XForms result.appendChild(item); } } + else if ("string".equals(controlType.getName())) + { + result = xformsDocument.createElementNS(NamespaceConstants.XFORMS_NS, + NamespaceConstants.XFORMS_PREFIX + ":textarea"); + if (appearance == null || appearance.length() == 0) + { + appearance = "compact"; + } + } else if ("anyURI".equals(controlType.getName())) { result = xformsDocument.createElementNS(NamespaceConstants.XFORMS_NS, @@ -2100,10 +2128,21 @@ public class Schema2XForms { result = xformsDocument.createElementNS(NamespaceConstants.XFORMS_NS, NamespaceConstants.XFORMS_PREFIX + ":input"); + if ((appearance == null || appearance.length() == 0) && + SchemaUtil.getBuiltInType(controlType) == XSConstants.NORMALIZEDSTRING_DT) + { + appearance = "full"; + } } this.setXFormsId(result); result.appendChild(this.createLabel(xformsDocument, caption)); + if (appearance != null && appearance.length() != 0) + { + result.setAttributeNS(NamespaceConstants.XFORMS_NS, + NamespaceConstants.XFORMS_PREFIX + ":appearance", + appearance); + } return result; } diff --git a/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java b/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java index 4a790eeb81..b7c97d1c61 100644 --- a/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java +++ b/source/java/org/alfresco/web/forms/xforms/XFormsProcessor.java @@ -17,6 +17,7 @@ package org.alfresco.web.forms.xforms; import java.io.*; +import java.util.ResourceBundle; import javax.faces.context.FacesContext; import javax.servlet.http.HttpServletRequest; @@ -28,6 +29,7 @@ import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.alfresco.web.app.Application; import org.alfresco.web.app.servlet.FacesHelper; import org.chiba.xml.ns.NamespaceConstants; import org.chiba.xml.xforms.exception.XFormsException; @@ -46,7 +48,7 @@ public class XFormsProcessor { "alfresco", NamespaceService.ALFRESCO_URI, NamespaceService.ALFRESCO_PREFIX } }; - private final String[] JS_SCRIPTS = + private final static String[] JS_SCRIPTS = { "/scripts/tiny_mce/" + (LOGGER.isDebugEnabled() ? "tiny_mce_src.js" @@ -59,6 +61,18 @@ public class XFormsProcessor }; + private final static String[] BUNDLE_KEYS = + { + "validation_provide_values_for_required_fields", + "idle", + "loading", + "add_content", + "go_up", + "cancel", + "upload", + "path" + }; + public XFormsProcessor() { } @@ -139,6 +153,17 @@ public class XFormsProcessor append(ns[0].toUpperCase()). append("_PREFIX = '").append(ns[2]).append("';\n"); } + + final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); + js.append("alfresco_xforms_constants.resources = {\n"); + for (String k : BUNDLE_KEYS) + { + js.append(k). + append(": '"). + append(bundle.getString(k)). + append("'"). + append(k.equals(BUNDLE_KEYS[BUNDLE_KEYS.length - 1]) ? "\n}" : ",\n"); + } e.appendChild(result.createTextNode(js.toString())); div.appendChild(e); diff --git a/source/test-resources/xforms/demos/press-release/company-footer.xsd b/source/test-resources/xforms/demos/press-release/company-footer.xsd index fe863a6a15..9d4b4c2da1 100644 --- a/source/test-resources/xforms/demos/press-release/company-footer.xsd +++ b/source/test-resources/xforms/demos/press-release/company-footer.xsd @@ -25,8 +25,8 @@ Describes a press release and related assets. - - + + diff --git a/source/test-resources/xforms/demos/press-release/press-release.xsd b/source/test-resources/xforms/demos/press-release/press-release.xsd index 4598c39124..c5c0fa6452 100644 --- a/source/test-resources/xforms/demos/press-release/press-release.xsd +++ b/source/test-resources/xforms/demos/press-release/press-release.xsd @@ -26,7 +26,7 @@ Describes a press release and related assets. - + @@ -39,13 +39,13 @@ Describes a press release and related assets. - - - - + + + + - + diff --git a/source/test-resources/xforms/unit-tests/attributes-test/attributes-test.xsd b/source/test-resources/xforms/unit-tests/attributes-test/attributes-test.xsd index 457037f370..46266cefa7 100644 --- a/source/test-resources/xforms/unit-tests/attributes-test/attributes-test.xsd +++ b/source/test-resources/xforms/unit-tests/attributes-test/attributes-test.xsd @@ -2,7 +2,7 @@ - + @@ -16,31 +16,31 @@ - + @@ -11,7 +11,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/interesting-schema-test/element-ref-test.xsd b/source/test-resources/xforms/unit-tests/interesting-schema-test/element-ref-test.xsd index 7f3180c2ee..1c1930b45b 100644 --- a/source/test-resources/xforms/unit-tests/interesting-schema-test/element-ref-test.xsd +++ b/source/test-resources/xforms/unit-tests/interesting-schema-test/element-ref-test.xsd @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/interesting-schema-test/empty-extension-test.xsd b/source/test-resources/xforms/unit-tests/interesting-schema-test/empty-extension-test.xsd index ce09416989..40ebd8e0cf 100644 --- a/source/test-resources/xforms/unit-tests/interesting-schema-test/empty-extension-test.xsd +++ b/source/test-resources/xforms/unit-tests/interesting-schema-test/empty-extension-test.xsd @@ -6,7 +6,7 @@ targetNamespace="http://mine.org/mynsuri"> - + diff --git a/source/test-resources/xforms/unit-tests/interesting-schema-test/multi-namespace-test-other.xsd b/source/test-resources/xforms/unit-tests/interesting-schema-test/multi-namespace-test-other.xsd index 235cb2b282..a6d4321fd1 100644 --- a/source/test-resources/xforms/unit-tests/interesting-schema-test/multi-namespace-test-other.xsd +++ b/source/test-resources/xforms/unit-tests/interesting-schema-test/multi-namespace-test-other.xsd @@ -5,7 +5,7 @@ attributeFormDefault="qualified" targetNamespace="http://other.org/othernsuri"> - + diff --git a/source/test-resources/xforms/unit-tests/interesting-schema-test/xml-namespaces-test.xsd b/source/test-resources/xforms/unit-tests/interesting-schema-test/xml-namespaces-test.xsd index a6cc93b480..f5aef3f2d5 100644 --- a/source/test-resources/xforms/unit-tests/interesting-schema-test/xml-namespaces-test.xsd +++ b/source/test-resources/xforms/unit-tests/interesting-schema-test/xml-namespaces-test.xsd @@ -5,19 +5,19 @@ targetNamespace="http://www.alfresco.org/alf"> - - + + - - + + - - + + diff --git a/source/test-resources/xforms/unit-tests/output-method-callout-test/output-method-callout.xsd b/source/test-resources/xforms/unit-tests/output-method-callout-test/output-method-callout.xsd index ba8bb63689..4588d4ac1e 100644 --- a/source/test-resources/xforms/unit-tests/output-method-callout-test/output-method-callout.xsd +++ b/source/test-resources/xforms/unit-tests/output-method-callout-test/output-method-callout.xsd @@ -4,7 +4,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/repeat-multi/repeat-multi.xsd b/source/test-resources/xforms/unit-tests/repeat-multi/repeat-multi.xsd index c3dc549763..1ec792c0be 100644 --- a/source/test-resources/xforms/unit-tests/repeat-multi/repeat-multi.xsd +++ b/source/test-resources/xforms/unit-tests/repeat-multi/repeat-multi.xsd @@ -3,14 +3,14 @@ elementFormDefault="qualified"> - + - + diff --git a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-components.xsd b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-components.xsd index 4013e3acce..745c67135b 100644 --- a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-components.xsd +++ b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-components.xsd @@ -2,7 +2,7 @@ - + @@ -11,7 +11,7 @@ - + @@ -26,14 +26,14 @@ - + - + diff --git a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-constraints.xsd b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-constraints.xsd index 0fcfae6ec9..4408a42dfd 100644 --- a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-constraints.xsd +++ b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-constraints.xsd @@ -3,20 +3,20 @@ elementFormDefault="qualified"> - + - - - - - - - + + + + + + + diff --git a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-nested-simple.xsd b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-nested-simple.xsd index 137158a2ab..62cad2cc09 100644 --- a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-nested-simple.xsd +++ b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-nested-simple.xsd @@ -3,15 +3,15 @@ elementFormDefault="qualified"> - - + + - + diff --git a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-simple-test.xsd b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-simple-test.xsd index 99e96df297..de742f1742 100644 --- a/source/test-resources/xforms/unit-tests/repeat-tests/repeat-simple-test.xsd +++ b/source/test-resources/xforms/unit-tests/repeat-tests/repeat-simple-test.xsd @@ -4,10 +4,10 @@ - - - - + + + + diff --git a/source/test-resources/xforms/unit-tests/simple-test/components-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/components-test.xsd index 1b98e57097..3a7662d5b2 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/components-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/components-test.xsd @@ -3,7 +3,7 @@ xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified"> - + @@ -42,7 +42,7 @@ - + @@ -69,7 +69,7 @@ - + ${components-test.required_textfield.label} @@ -77,7 +77,7 @@ - + ${components-test.optional_textfield.label} @@ -85,8 +85,28 @@ - - + + + + + minimal + + + + + + + compact + + + + + + + full + + + @@ -158,7 +178,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/simple-test/inheritence-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/inheritence-test.xsd index 720574bbbd..3556a698f5 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/inheritence-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/inheritence-test.xsd @@ -5,18 +5,18 @@ - + - + - + - + diff --git a/source/test-resources/xforms/unit-tests/simple-test/list-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/list-test.xsd index f77efbb4ea..73a774a370 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/list-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/list-test.xsd @@ -3,7 +3,7 @@ xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified"> - + @@ -18,7 +18,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/simple-test/select1-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/select1-test.xsd index 8f9bd95b65..8fe446f302 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/select1-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/select1-test.xsd @@ -3,7 +3,7 @@ xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified"> - + diff --git a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd index bb2ca1c8dd..f105a6ddb1 100644 --- a/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd +++ b/source/test-resources/xforms/unit-tests/simple-test/simple-test.xsd @@ -4,7 +4,7 @@ - + diff --git a/source/test-resources/xforms/unit-tests/upload-tests/upload-simple-test.xsd b/source/test-resources/xforms/unit-tests/upload-tests/upload-simple-test.xsd index bb77c220fc..5814514633 100644 --- a/source/test-resources/xforms/unit-tests/upload-tests/upload-simple-test.xsd +++ b/source/test-resources/xforms/unit-tests/upload-tests/upload-simple-test.xsd @@ -4,7 +4,7 @@ - + diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index ff5ec303f4..61d06031fd 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -609,7 +609,7 @@ dojo.declare("alfresco.xforms.TextField", this.widget.setAttribute("type", "text"); this.widget.setAttribute("id", this.id + "-widget"); this.widget.setAttribute("value", initial_value); - if (this.xform.getBinding(this.xformsNode).getType() == "string") + if (this.getAppearance() == "full") { this.widget.style.width = "100%"; } @@ -745,8 +745,64 @@ dojo.declare("alfresco.xforms.NumericalRange", } }); -/** The textfield widget which handle xforms widget xf:textarea. */ -dojo.declare("alfresco.xforms.TextArea", +/** The text area widget handles xforms widget xf:textarea with appearance minimal */ +dojo.declare("alfresco.xforms.PlainTextEditor", + alfresco.xforms.Widget, + function(xform, xformsNode) + { + }, + { + ///////////////////////////////////////////////////////////////// + // overridden methods + ///////////////////////////////////////////////////////////////// + render: function(attach_point) + { + attach_point.appendChild(this.domNode); + dojo.html.prependClass(this.domNode, "xformsTextArea"); + var initialValue = this.getInitialValue() || ""; + this.widget = document.createElement("textarea"); + this.domNode.appendChild(this.widget); + this.widget.setAttribute("id", this.id + "-widget"); + this.widget.setAttribute("value", initialValue); + if (this.isReadonly()) + { + this.widget.setAttribute("readonly", this.isReadonly()); + } + this.widget.style.width = "100%"; + this.widget.style.height = "100%"; + dojo.event.connect(this.widget, "onchange", this, this._textarea_changeHandler); + }, + + setValue: function(value, forceCommit) + { + if (!this.widget) + { + this.setInitialValue(value, forceCommit); + } + else + { + alfresco.xform.PlainTextEditor.superclass.setValue.call(this, value, forceCommit); + this.widget.value = value; + } + }, + + getValue: function() + { + return this.widget.value; + }, + + ///////////////////////////////////////////////////////////////// + // DOM event handlers + ///////////////////////////////////////////////////////////////// + + _textarea_changeHandler: function(event) + { + this._commitValueChange(); + } + }); + +/** The textfield widget which handle xforms widget xf:textarea. with appearance full or compact */ +dojo.declare("alfresco.xforms.RichTextEditor", alfresco.xforms.Widget, function(xform, xformsNode) { @@ -823,7 +879,7 @@ dojo.declare("alfresco.xforms.TextArea", setReadonly: function(readonly) { - alfresco.xforms.TextArea.superclass.setReadonly.call(this, readonly); + alfresco.xforms.RichTextEditor.superclass.setReadonly.call(this, readonly); var mce = tinyMCE.getInstanceById(this.id); if (readonly && mce) { @@ -837,7 +893,7 @@ dojo.declare("alfresco.xforms.TextArea", _destroy: function() { - alfresco.xforms.TextArea.superclass._destroy.call(this); + alfresco.xforms.RichTextEditor.superclass._destroy.call(this); if (!this.isReadonly()) { dojo.debug("removing mce control " + this.id); @@ -3146,7 +3202,9 @@ dojo.declare("alfresco.xforms.XForm", case alfresco_xforms_constants.XFORMS_PREFIX + ":repeat": return new alfresco.xforms.Repeat(this, xformsNode); case alfresco_xforms_constants.XFORMS_PREFIX + ":textarea": - return new alfresco.xforms.TextArea(this, xformsNode); + return (new alfresco.xforms.Widget(this, xformsNode).getAppearance() == "minimal" + ? new alfresco.xforms.PlainTextEditor(this, xformsNode) + : new alfresco.xforms.RichTextEditor(this, xformsNode)); case alfresco_xforms_constants.XFORMS_PREFIX + ":upload": return new alfresco.xforms.FilePicker(this, xformsNode); case alfresco_xforms_constants.XFORMS_PREFIX + ":range": @@ -3579,7 +3637,7 @@ dojo.declare("alfresco.xforms.XForm", { this.submitWidget = null; var invalid = this.rootWidget.getWidgetsInvalidForSubmit(); - _show_error(document.createTextNode("Please provide values for all required fields.")); + _show_error(document.createTextNode(alfresco_xforms_constants.resources["validation_provide_values_for_required_fields"])); var error_list = document.createElement("ul"); for (var j = 0; j < invalid.length; j++) { @@ -3703,10 +3761,11 @@ AjaxHelper._updateLoaderDisplay = function() { var ajaxLoader = AjaxHelper._getLoaderElement(); ajaxLoader.innerHTML = (AjaxHelper._requests.length == 0 - ? "Idle" - : "Loading" + (AjaxHelper._requests.length > 1 - ? " (" + AjaxHelper._requests.length + ")" - : "...")); + ? alfresco_xforms_constants.resources["idle"] + : (alfresco_xforms_constants.resources["loading"] + + (AjaxHelper._requests.length > 1 + ? " (" + AjaxHelper._requests.length + ")" + : "..."))); dojo.debug(ajaxLoader.innerHTML); if (/* djConfig.isDebug && */ AjaxHelper._requests.length != 0) { @@ -4182,7 +4241,8 @@ _showPicker: function(data) addContentImage.align = "absmiddle"; addContentImage.setAttribute("src", alfresco_xforms_constants.WEBAPP_CONTEXT + "/images/icons/add.gif"); addContentLink.appendChild(addContentImage); - addContentLink.appendChild(d.createTextNode("Add Content")); + + addContentLink.appendChild(d.createTextNode(alfresco_xforms_constants.resources["add_content"])); var navigateToParentLink = d.createElement("a"); headerRightDiv.appendChild(navigateToParentLink); @@ -4211,7 +4271,7 @@ _showPicker: function(data) navigateToParentNodeImage.align = "absmiddle"; navigateToParentNodeImage.setAttribute("src", alfresco_xforms_constants.WEBAPP_CONTEXT + "/images/icons/up.gif"); navigateToParentLink.appendChild(navigateToParentNodeImage); - navigateToParentLink.appendChild(d.createTextNode("Go up")); + navigateToParentLink.appendChild(d.createTextNode(alfresco_xforms_constants.resources["go_up"])); headerRightDiv.style.position = "absolute"; headerRightDiv.style.height = headerDiv.style.height; @@ -4232,7 +4292,8 @@ _showPicker: function(data) var cancelButton = d.createElement("input"); cancelButton.type = "button"; cancelButton.filePickerWidget = this; - cancelButton.value = "Cancel"; + + cancelButton.value = alfresco_xforms_constants.resources["cancel"]; footerDiv.appendChild(cancelButton); cancelButton.style.margin = ((.5 * footerDiv.offsetHeight) - @@ -4396,7 +4457,7 @@ _showAddContent: function(currentPath) dojo.dom.removeChildren(w.addContentDiv); var fileName = event.target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1"); - w.addContentDiv.appendChild(d.createTextNode("Upload: " + fileName)); + w.addContentDiv.appendChild(d.createTextNode(alfresco_xforms_constants.resources["upload"] + ": " + fileName)); var img = d.createElement("img"); img.setAttribute("src", alfresco_xforms_constants.WEBAPP_CONTEXT + "/images/icons/process_animation.gif"); @@ -4506,7 +4567,8 @@ _openParentPathMenu: function(target, path) var pathTextDiv = d.createElement("div"); pathTextDiv.style.fontWeight = "bold"; pathTextDiv.style.paddingLeft = "5px"; - pathTextDiv.appendChild(d.createTextNode("Path")); + + pathTextDiv.appendChild(d.createTextNode(alfresco_xforms_constants.resources["path"])); this.parentPathMenu.appendChild(pathTextDiv); var currentPathNodes = []; for (var i = 0; i < parentNodes.length; i++)