diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 8fe20dbeda..a2844a842e 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -69,7 +69,7 @@ inherited=Inherited search=Search advanced_search=Advanced Search value_not_set=not set -description_not_set=no description set +description_not_set=No description set. clear=Clear Results results_contains=Results for ''{0}''. results_contains_filter=Results for ''{0}'' in ''{1}''. diff --git a/source/java/org/alfresco/web/bean/wcm/AVMNode.java b/source/java/org/alfresco/web/bean/wcm/AVMNode.java index 90aa3d2d6a..b62f153f2e 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMNode.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMNode.java @@ -28,9 +28,11 @@ import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.repository.Path; import org.alfresco.service.namespace.QName; import org.alfresco.web.app.Application; +import org.alfresco.web.bean.BrowseBean; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.NodePropertyResolver; import org.alfresco.web.config.ClientConfigElement; +import org.alfresco.web.ui.common.Utils; /** * Node class representing an AVM specific Node. @@ -91,6 +93,26 @@ public class AVMNode extends Node implements Map } }; + public final static NodePropertyResolver RESOLVER_FILE_TYPE_16 = + new NodePropertyResolver() + { + public Object get(final Node node) + { + if (! (node instanceof AVMNode)) + { + return null; + } + if (((AVMNode)node).isDirectory()) + { + return "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif"; + } + else + { + return Utils.getFileTypeImage(node.getName(), true); + } + } + }; + private AVMNodeDescriptor avmRef; private int version; diff --git a/source/java/org/alfresco/web/bean/wcm/EditFormWizard.java b/source/java/org/alfresco/web/bean/wcm/EditFormWizard.java index 0ecb0544e5..57238d66f9 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditFormWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/EditFormWizard.java @@ -41,6 +41,8 @@ import org.alfresco.web.forms.Form; import org.alfresco.web.forms.FormsService; import org.alfresco.web.forms.RenderingEngineTemplate; import org.alfresco.web.ui.common.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * Backing bean for the Edit Form wizard. @@ -50,6 +52,7 @@ import org.alfresco.web.ui.common.Utils; public class EditFormWizard extends CreateFormWizard { + private final static Log LOGGER = LogFactory.getLog(EditFormWizard.class); private List removedRenderingEngineTemplates; @@ -97,6 +100,10 @@ public class EditFormWizard { this.defaultWorkflowName = wf.getName(); } + else + { + this.applyDefaultWorkflow = false; + } this.setOutputPathPatternForFormInstanceData(form.getOutputPathPattern()); for (RenderingEngineTemplate ret : form.getRenderingEngineTemplates()) @@ -127,29 +134,36 @@ public class EditFormWizard WCMAppModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME, this.getSchemaRootElementName()); final WorkflowDefinition wd = this.getDefaultWorkflowDefinition(); - if (wd != null) + final List workflowRefs = + this.nodeService.getChildAssocs(formNodeRef, + WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, + RegexQNamePattern.MATCH_ALL); + + if (wd != null && workflowRefs.size() == 0) { - final List workflowRefs = - this.nodeService.getChildAssocs(formNodeRef, - WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, - RegexQNamePattern.MATCH_ALL); - if (workflowRefs.size() == 0) - { - final Map props = new HashMap(1, 1.0f); - props.put(WCMAppModel.PROP_WORKFLOW_NAME, wd.getName()); - this.nodeService.createNode(formNodeRef, - WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, - WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, - WCMAppModel.TYPE_WORKFLOW_DEFAULTS, - props); - } - else - { - this.nodeService.setProperty(workflowRefs.get(0).getChildRef(), - WCMAppModel.PROP_WORKFLOW_NAME, - wd.getName()); - } + LOGGER.debug("adding workflow definition " + wd.getName() + + " to form " + this.getFormName()); + final Map props = new HashMap(1, 1.0f); + props.put(WCMAppModel.PROP_WORKFLOW_NAME, wd.getName()); + this.nodeService.createNode(formNodeRef, + WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, + WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS, + WCMAppModel.TYPE_WORKFLOW_DEFAULTS, + props); } + else if (wd != null && workflowRefs.size() == 1) + { + LOGGER.debug("setting workflow definition " + wd.getName() + + " to form " + this.getFormName()); + this.nodeService.setProperty(workflowRefs.get(0).getChildRef(), + WCMAppModel.PROP_WORKFLOW_NAME, + wd.getName()); + } + else if (wd == null && workflowRefs.size() == 1) + { + LOGGER.debug("removing workflow definitions from form " + this.getFormName()); + this.nodeService.removeChild(formNodeRef, workflowRefs.get(0).getChildRef()); + } if (this.getSchemaFile() != null) { diff --git a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java index cb55bf06be..08218cb177 100644 --- a/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java +++ b/source/java/org/alfresco/web/bean/workflow/ManageTaskDialog.java @@ -28,6 +28,7 @@ import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; import org.alfresco.web.app.servlet.FacesHelper; +import org.alfresco.web.bean.BrowseBean; import org.alfresco.web.bean.dialog.BaseDialogBean; import org.alfresco.web.bean.repository.MapNode; import org.alfresco.web.bean.repository.Node; @@ -691,11 +692,15 @@ public class ManageTaskDialog extends BaseDialogBean protected void addAVMNode(final AVMNode node) { - LOGGER.debug("adding node " + node); node.getProperties().put("taskId", this.task.id); - this.browseBean.setupCommonBindingProperties(node); node.addPropertyResolver("path", AVMNode.RESOLVER_SANDBOX_RELATIVE_PATH); node.addPropertyResolver("previewUrl", AVMNode.RESOLVER_PREVIEW_URL); + node.addPropertyResolver("fileType16", AVMNode.RESOLVER_FILE_TYPE_16); + node.addPropertyResolver("size", this.browseBean.resolverSize); + if (!node.isDirectory()) + { + node.addPropertyResolver("url", this.browseBean.resolverUrl); + } this.resources.add(node); } 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 32e3c0b954..4013e3acce 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 @@ -27,7 +27,7 @@ - + diff --git a/source/web/css/xforms.css b/source/web/css/xforms.css index 95e4bdff03..d8c3cab8c8 100644 --- a/source/web/css/xforms.css +++ b/source/web/css/xforms.css @@ -87,6 +87,8 @@ font-weight: bold; margin: 2px 5%; text-align: center; + text-overflow: ellipsis; + overflow: hidden; } .xformsFilePickerHeader diff --git a/source/web/jsp/wcm/create-form-wizard/summary.jsp b/source/web/jsp/wcm/create-form-wizard/summary.jsp index ad93b97c03..371831ca17 100644 --- a/source/web/jsp/wcm/create-form-wizard/summary.jsp +++ b/source/web/jsp/wcm/create-form-wizard/summary.jsp @@ -63,11 +63,15 @@ + + + - - - - - - - - - - - - - - - + + + + diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index 03c7885c13..f529adc00b 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -235,6 +235,8 @@ dojo.declare("alfresco.xforms.Widget", { dojo.debug("destroying " + this.id); }, + _handlePrepareForMove: function() {}, + _handleMoveComplete: function() {}, getRepeatIndices: function() { function RepeatIndexData(repeat, index) @@ -424,28 +426,48 @@ dojo.declare("alfresco.xforms.TextArea", { initializer: function(xform, xformsNode) { -// this.inherited("initializer", [ xform, xformsNode ]); }, render: function(attach_point) { attach_point.appendChild(this.domNode); dojo.html.prependClass(this.domNode, "xformsTextArea"); - this.domNode.innerHTML = this.getInitialValue() || ""; - tinyMCE.addMCEControl(this.domNode, this.id); - - var editorDocument = tinyMCE.getInstanceById(this.id).getDoc(); - editorDocument.widget = this; - tinyMCE.addEvent(editorDocument, "blur", this._tinyMCE_blurHandler); - this.widget = this.domNode; + this.widget = document.createElement("div"); + this.domNode.appendChild(this.widget); + dojo.html.prependClass(this.widget, "xformsTextArea"); + this.widget.innerHTML = this.getInitialValue() || ""; + if (!this.isReadonly()) + { + this._createTinyMCE(); + } }, setValue: function(value) { - tinyMCE.selectedInstance = tinyMCE.getInstanceById(this.id); - tinyMCE.setContent(value); + if (this.isReadonly()) + { + this.widget.innerHTML = value; + } + else + { + tinyMCE.selectedInstance = tinyMCE.getInstanceById(this.id); + tinyMCE.setContent(value); + } }, getValue: function() { - return tinyMCE.getContent(this.id); + return this.isReadonly() ? this.widget.innerHTML : tinyMCE.getContent(this.id); + }, + setReadonly: function(readonly) + { + this.inherited("setReadonly", [ readonly ]); + var mce = tinyMCE.getInstanceById(this.id); + if (readonly && mce) + { + this._removeTinyMCE(); + } + else if (!readonly && !mce && this.widget) + { + this._createTinyMCE(); + } }, _tinyMCE_blurHandler: function(event) { @@ -455,8 +477,32 @@ dojo.declare("alfresco.xforms.TextArea", _destroy: function() { this.inherited("_destroy", []); - dojo.debug("removing mce control " + this.id); + if (!this.isReadonly()) + { + dojo.debug("removing mce control " + this.id); + tinyMCE.removeMCEControl(this.id); + } + }, + _handlePrepareForMove: function() + { + this._removeTinyMCE(); + }, + _handleMoveComplete: function() + { + this._createTinyMCE(); + }, + _removeTinyMCE: function() + { + var value = tinyMCE.getContent(this.id); tinyMCE.removeMCEControl(this.id); + }, + _createTinyMCE:function() + { + tinyMCE.addMCEControl(this.widget, this.id); + + var editorDocument = tinyMCE.getInstanceById(this.id).getDoc(); + editorDocument.widget = this; + tinyMCE.addEvent(editorDocument, "blur", this._tinyMCE_blurHandler); } }); @@ -465,7 +511,6 @@ dojo.declare("alfresco.xforms.AbstractSelectWidget", { initializer: function(xform, xformsNode) { -// this.inherited("initializer", [ xform, xformsNode ]); }, getValues: function() { @@ -900,6 +945,30 @@ dojo.declare("alfresco.xforms.Group", this.children[i]._destroy(); } }, + _handlePrepareForMove: function() + { + this.inherited("_handlePrepareForMove", [ ]); + for (var i = 0; i < this.children.length; i++) + { + this.children[i]._handlePrepareForMove(); + } + }, + _handleMoveComplete: function() + { + this.inherited("_handleMoveComplete", [ ]); + for (var i = 0; i < this.children.length; i++) + { + this.children[i]._handleMoveComplete(); + } + }, + setReadonly: function(readonly) + { + this.inherited("setReadonly", [ readonly ]); + for (var i = 0; i < this.children.length; i++) + { + this.children[i].setReadonly(readonly); + } + }, render: function(attach_point) { this.domNode.widget = this; @@ -1114,6 +1183,12 @@ dojo.declare("alfresco.xforms.Repeat", this.inherited("_updateDisplay", []); for (var i = 0; i < this.children.length; i++) { + if (dojo.html.hasClass(this.children[i].domContainer, + "xformsRow" + (i % 2 ? "Odd" : "Even"))) + { + dojo.html.removeClass(this.children[i].domContainer, + "xformsRow" + (i % 2 ? "Odd" : "Even")); + } dojo.html.addClass(this.children[i].domContainer, "xformsRow" + (i % 2 ? "Even" : "Odd")); } @@ -1218,12 +1293,14 @@ dojo.declare("alfresco.xforms.Repeat", ", " + toIndex + ")"); var fromChild = this.getChildAt(fromIndex); var toChild = this.getChildAt(toIndex); - + fromChild._handlePrepareForMove(); + toChild._handlePrepareForMove(); var swapNode = document.createElement("div"); this.domNode.childContainerNode.replaceChild(swapNode, fromChild.domContainer); this.domNode.childContainerNode.replaceChild(fromChild.domContainer, toChild.domContainer); this.domNode.childContainerNode.replaceChild(toChild.domContainer, swapNode); - + fromChild._handleMoveComplete(); + toChild._handleMoveComplete(); this.children[fromIndex] = toChild; this.children[toIndex] = fromChild; this._selectedIndex = toIndex; @@ -2610,8 +2687,7 @@ _showAddContentPanel: function(addContentLink, currentPath) }, _upload_completeHandler: function(fileName, webappRelativePath) { - this._showStatus("Successfully uploaded " + fileName + - " into " + webappRelativePath); + this._showStatus("Successfully uploaded " + fileName + "."); // " into " + webappRelativePath); this._navigateToNode(webappRelativePath); }, _closeParentPathMenu: function()