- fixing edit form wizard to properly show when no default workflow is configured

- fixing row highlight bug in repeats when they're moved around
- attempt to fix move up move down issues for tinymce - but mce is really not behaving at all
- fix for folder icon in manage task screen, but doesn't really solve the problem that inappropriate actions are available.
- some minor fixes for create form wizard summary page.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4772 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-01-09 23:34:49 +00:00
parent 54fe924c27
commit 33ad926233
8 changed files with 178 additions and 57 deletions

View File

@@ -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}''.

View File

@@ -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<String, Object>
}
};
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;

View File

@@ -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<RenderingEngineTemplateData> 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,14 +134,15 @@ public class EditFormWizard
WCMAppModel.PROP_XML_SCHEMA_ROOT_ELEMENT_NAME,
this.getSchemaRootElementName());
final WorkflowDefinition wd = this.getDefaultWorkflowDefinition();
if (wd != null)
{
final List<ChildAssociationRef> workflowRefs =
this.nodeService.getChildAssocs(formNodeRef,
WCMAppModel.ASSOC_FORM_WORKFLOW_DEFAULTS,
RegexQNamePattern.MATCH_ALL);
if (workflowRefs.size() == 0)
if (wd != null && workflowRefs.size() == 0)
{
LOGGER.debug("adding workflow definition " + wd.getName() +
" to form " + this.getFormName());
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(1, 1.0f);
props.put(WCMAppModel.PROP_WORKFLOW_NAME, wd.getName());
this.nodeService.createNode(formNodeRef,
@@ -143,12 +151,18 @@ public class EditFormWizard
WCMAppModel.TYPE_WORKFLOW_DEFAULTS,
props);
}
else
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)

View File

@@ -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);
}

View File

@@ -27,7 +27,7 @@
<xs:complexType name="multi-input">
<xs:sequence>
<xs:element name="string" type="xs:string"/>
<xs:element name="int" type="xs:anyType"/>
<xs:element name="any" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
<xs:element name="repeat-components">

View File

@@ -87,6 +87,8 @@
font-weight: bold;
margin: 2px 5%;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
}
.xformsFilePickerHeader

View File

@@ -63,11 +63,15 @@
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0">
<h:outputText rendered="#{empty WizardManager.bean.renderingEngineTemplates}"
value="#{msg.no_selected_items}"/>
<a:selectList id="rendering-engine-template-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
<c:forEach items="${WizardManager.bean.renderingEngineTemplates}" var="ret">
<a:listItem label="${msg.name}: ${ret.title}"
value="${ret.name}"
@@ -98,19 +102,17 @@
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0">
<h:outputText value="#{msg.apply_default_workflow}:"/>
<c:choose>
<c:when test="${WizardManager.bean.defaultWorkflowDefinition != null}">
<h:outputText value="#{msg.yes}"/>
</c:when>
<c:otherwise>
<h:outputText value="#{msg.no}"/>
</c:otherwise>
</c:choose>
<c:if test="${WizardManager.bean.defaultWorkflowDefinition != null}">
<h:outputText value="#{msg.name}:"/>
<h:outputText value="#{WizardManager.bean.defaultWorkflowDefinition.title}"/>
<h:outputText value="#{msg.description}:"/>
<h:outputText value="#{WizardManager.bean.defaultWorkflowDefinition.description}"/>
</c:if>
<h:outputText value="#{msg.no_selected_items}"
rendered="#{WizardManager.bean.defaultWorkflowDefinition == null}"/>
<a:selectList id="workflow-list"
rendered="#{WizardManager.bean.defaultWorkflowDefinition != null}"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
<a:listItem label="${msg.name}: ${WizardManager.bean.defaultWorkflowDefinition.title}"
value="${WizardManager.bean.defaultWorkflowDefinition.name}"
description="${msg.description}: ${WizardManager.bean.defaultWorkflowDefinition.description}"
image="/images/icons/workflow_large.gif"/>
</a:selectList>
</h:panelGrid>

View File

@@ -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)
{
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,9 +477,33 @@ dojo.declare("alfresco.xforms.TextArea",
_destroy: function()
{
this.inherited("_destroy", []);
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);
}
});
dojo.declare("alfresco.xforms.AbstractSelectWidget",
@@ -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()