Index: api/src/main/java/org/hippoecm/addon/workflow/IWorkflowInvoker.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- api/src/main/java/org/hippoecm/addon/workflow/IWorkflowInvoker.java	(revision )
+++ api/src/main/java/org/hippoecm/addon/workflow/IWorkflowInvoker.java	(revision )
@@ -0,0 +1,10 @@
+package org.hippoecm.addon.workflow;
+
+import org.apache.wicket.IClusterable;
+/**
+ * @version $Id$
+ */
+public interface IWorkflowInvoker extends IClusterable {
+
+    public void invokeWorkflow() throws Exception;
+}
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_fr.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_fr.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_fr.properties	(revision )
@@ -0,0 +1,5 @@
+name-label=Nom
+url-label=URL
+
+url-edit=\u00c9diter
+url-reset=R\u00e9initialiser
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.properties	(revision 36884)
@@ -1,5 +0,0 @@
-name-label=Name
-url-label=URL name
-
-url-edit=Edit
-url-reset=Reset
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_nl.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_nl.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_nl.properties	(revision )
@@ -0,0 +1,8 @@
+name-label=Naam
+url-label=URL naam
+document-type=Document type
+
+url-edit=Bewerk
+url-reset=Reset
+
+language=Taal
Index: api/src/main/java/org/hippoecm/addon/workflow/ActionDescription.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- api/src/main/java/org/hippoecm/addon/workflow/ActionDescription.java	(revision 36884)
+++ api/src/main/java/org/hippoecm/addon/workflow/ActionDescription.java	(revision )
@@ -23,8 +23,9 @@
 import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.IModel;
+import org.hippoecm.repository.api.WorkflowException;
 
-public abstract class ActionDescription extends Panel {
+public abstract class ActionDescription extends Panel implements IWorkflowInvoker {
 
     private static final long serialVersionUID = 1L;
 
@@ -80,4 +81,8 @@
 
     protected abstract void invoke();
 
+    @Override
+    public void invokeWorkflow() throws Exception {
+        throw new WorkflowException("unsupported operation");
+    }
 }
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_it.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_it.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_it.properties	(revision 36884)
@@ -1,7 +0,0 @@
-name-label=Nome
-url-label=URL
-
-url-edit=Modifica
-url-reset=Pulisci
-
-language=Lingua
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_nl.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_nl.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_nl.properties	(revision 36884)
@@ -1,5 +0,0 @@
-name-label=Naam
-url-label=URL naam
-
-url-edit=Bewerk
-url-reset=Reset
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_de.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_de.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_de.properties	(revision )
@@ -0,0 +1,5 @@
+name-label=Name
+url-label=URL-Name
+
+url-edit=Bearbeiten
+url-reset=Wiederherstellen
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_nl.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_nl.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_nl.properties	(revision )
@@ -0,0 +1,5 @@
+name-label=Naam
+url-label=URL naam
+
+url-edit=Bewerk
+url-reset=Reset
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_fr.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_fr.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_fr.properties	(revision 36884)
@@ -1,7 +0,0 @@
-name-label=Nom
-url-label=URL
-
-url-edit=\u00c9diter
-url-reset=R\u00e9initialiser
-
-language=Langue
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_it.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_it.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog_it.properties	(revision )
@@ -0,0 +1,5 @@
+name-label=Nome
+url-label=URL
+
+url-edit=Modifica URL
+url-reset=Annulla modifiche URL
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentArguments.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentArguments.java	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentArguments.java	(revision )
@@ -0,0 +1,60 @@
+/*
+ *  Copyright 2012 Hippo.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.plugins.standardworkflow;
+
+import org.apache.wicket.IClusterable;
+
+public class AddDocumentArguments implements IClusterable {
+    private String targetName;
+    private String uriName;
+    private String prototype;
+    private String language;
+
+    public AddDocumentArguments() {
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(final String targetName) {
+        this.targetName = targetName;
+    }
+
+    public String getUriName() {
+        return uriName;
+    }
+
+    public void setUriName(final String uriName) {
+        this.uriName = uriName;
+    }
+
+    public String getPrototype() {
+        return prototype;
+    }
+
+    public void setPrototype(final String prototype) {
+        this.prototype = prototype;
+    }
+
+    public String getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(final String language) {
+        this.language = language;
+    }
+}
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.html	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.html	(revision )
@@ -0,0 +1,55 @@
+<!--
+  * Copyright 2008 Hippo
+  *
+  * Licensed under the Apache License, Version 2.0 (the  "License");
+  * you may not use this file except in compliance with the License.
+  * You may obtain a copy of the License at
+  *
+  * http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org/">
+  <wicket:extend>
+    <table class="hippo-window-form">
+      <tr>
+        <td><wicket:message key="name-label">Name</wicket:message></td>
+        <td>
+          <input type="text" wicket:id="name" class="hippo-form-input"/>
+        </td>
+      </tr>
+      <tr>
+        <td width="75"><wicket:message key="url-label">Name</wicket:message></td>
+        <td>
+          <input wicket:id="uriinput" class="hippo-form-input"/>
+          <a wicket:id="uriAction" class="action">
+            <span wicket:id="uriActionLabel">[ UriActionLabel ]</span>
+          </a>
+        </td>
+      </tr>
+      <tr wicket:id="language">
+        <td><label><wicket:message key="language" /></label></td>
+        <td><select class="hippo-form-select" wicket:id="select"></select></td>
+      </tr>
+      <tr>
+        <td>
+          <span wicket:id="typelabel"/>
+        </td>
+        <td>
+          <select class="hippo-form-select" wicket:id="prototype"/>
+        </td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+        <td>
+          <span wicket:id="notypes"/>
+          <br/>
+        </td>
+      </tr>
+    </table>
+  </wicket:extend>
+</html>
Index: api/src/main/java/org/hippoecm/frontend/dialog/AbstractDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- api/src/main/java/org/hippoecm/frontend/dialog/AbstractDialog.java	(revision 36884)
+++ api/src/main/java/org/hippoecm/frontend/dialog/AbstractDialog.java	(revision )
@@ -22,6 +22,7 @@
 import java.util.Map;
 
 import org.apache.wicket.Component;
+import org.apache.wicket.IClusterable;
 import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.Page;
 import org.apache.wicket.RequestCycle;
@@ -229,7 +230,7 @@
     protected boolean cancelled = false;
 
     public AbstractDialog() {
-        this(null);
+        this((IModel<T>) null);
     }
 
     public AbstractDialog(IModel<T> model) {
Index: api/src/main/java/org/hippoecm/addon/workflow/StdWorkflow.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- api/src/main/java/org/hippoecm/addon/workflow/StdWorkflow.java	(revision 36884)
+++ api/src/main/java/org/hippoecm/addon/workflow/StdWorkflow.java	(revision )
@@ -161,28 +161,28 @@
     }
 
     protected void execute() throws Exception {
-        execute((WorkflowDescriptorModel<T>)enclosingPlugin.getDefaultModel());
+        execute((WorkflowDescriptorModel<T>) enclosingPlugin.getDefaultModel());
     }
 
     protected void execute(WorkflowDescriptorModel<T> model) throws Exception {
-        WorkflowDescriptor descriptor = (WorkflowDescriptor)model.getObject();
+        WorkflowDescriptor descriptor = (WorkflowDescriptor) model.getObject();
         if (descriptor == null) {
             throw new MappingException("action no longer valid");
         }
-        WorkflowManager manager = ((UserSession)org.apache.wicket.Session.get()).getWorkflowManager();
+        WorkflowManager manager = ((UserSession) org.apache.wicket.Session.get()).getWorkflowManager();
-        javax.jcr.Session session = ((UserSession)org.apache.wicket.Session.get()).getJcrSession();
+        javax.jcr.Session session = ((UserSession) org.apache.wicket.Session.get()).getJcrSession();
         session.refresh(true);
         session.save();
         session.refresh(true);
         Workflow workflow = manager.getWorkflow(descriptor);
-        String message = execute((T)workflow);
+        String message = execute((T) workflow);
         if (message != null) {
             throw new WorkflowException(message);
         }
 
         // workflow may have closed existing session
         // FIXME should be removed
-        UserSession us = (UserSession)org.apache.wicket.Session.get();
+        UserSession us = (UserSession) org.apache.wicket.Session.get();
         session = us.getJcrSession();
         session.refresh(false);
         us.getFacetRootsObserver().broadcastEvents();
@@ -191,4 +191,8 @@
     protected String execute(T workflow) throws Exception {
         throw new WorkflowException("unsupported operation");
     }
+
+    public void invokeWorkflow() throws Exception{
+        execute();
+    }
 }
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_de.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_de.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_de.properties	(revision 36884)
@@ -1,7 +0,0 @@
-name-label=Name
-url-label=URL name
-
-url-edit=Bearbeiten
-url-reset=Wiederherstellen
-
-language=Sprache
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.html
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.html	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.html	(revision )
@@ -0,0 +1,36 @@
+<!--
+  * Copyright 2008 Hippo
+  *
+  * Licensed under the Apache License, Version 2.0 (the  "License");
+  * you may not use this file except in compliance with the License.
+  * You may obtain a copy of the License at
+  *
+  * http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org/">
+  <wicket:extend>
+    <table class="hippo-window-form">
+      <tr>
+        <td><wicket:message key="name-label">Name</wicket:message></td>
+        <td>
+          <input type="text" wicket:id="name" class="hippo-form-input"/>
+        </td>
+      </tr>
+      <tr>
+        <td width="75"><wicket:message key="url-label">Name</wicket:message></td>
+        <td>
+          <input wicket:id="uriinput" class="hippo-form-input"/>
+          <a wicket:id="uriAction" class="action">
+            <span wicket:id="uriActionLabel">[ UriActionLabel ]</span>
+          </a>
+        </td>
+      </tr>
+    </table>
+  </wicket:extend>
+</html>
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_de.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_de.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_de.properties	(revision )
@@ -0,0 +1,8 @@
+name-label=Name
+url-label=URL name
+document-type=Dokumententyp
+
+url-edit=Bearbeiten
+url-reset=Wiederherstellen
+
+language=Sprache
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentArguments.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentArguments.java	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentArguments.java	(revision )
@@ -0,0 +1,53 @@
+/*
+ *  Copyright 2012 Hippo.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.plugins.standardworkflow;
+
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.wicket.IClusterable;
+
+public class RenameDocumentArguments implements IClusterable {
+    private String targetName;
+    private String uriName;
+    private NodeType nodeType;
+
+    public RenameDocumentArguments() {
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(final String targetName) {
+        this.targetName = targetName;
+    }
+
+    public String getUriName() {
+        return uriName;
+    }
+
+    public void setUriName(final String uriName) {
+        this.uriName = uriName;
+    }
+
+    public NodeType getNodeType() {
+        return nodeType;
+    }
+
+    public void setNodeType(final NodeType nodeType) {
+        this.nodeType = nodeType;
+    }
+}
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.html
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.html	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.html	(revision 36884)
@@ -1,55 +0,0 @@
-<!--
-  * Copyright 2008 Hippo
-  *
-  * Licensed under the Apache License, Version 2.0 (the  "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  * http://www.apache.org/licenses/LICENSE-2.0
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org/">
-  <wicket:extend>
-    <table class="hippo-window-form">
-      <tr>
-        <td><wicket:message key="name-label">Name</wicket:message></td>
-        <td>
-          <input type="text" wicket:id="name" class="hippo-form-input"/>
-        </td>
-      </tr>
-      <tr>
-        <td width="75"><wicket:message key="url-label">Name</wicket:message></td>
-        <td>
-          <input wicket:id="uriinput" class="hippo-form-input"/>
-          <a wicket:id="uriAction" class="action">
-            <span wicket:id="uriActionLabel">[ UriActionLabel ]</span>
-          </a>
-        </td>
-      </tr>
-      <tr wicket:id="language">
-        <td><label><wicket:message key="language" /></label></td>
-        <td><select class="hippo-form-select" wicket:id="select"></select></td>
-      </tr>
-      <tr>
-        <td>
-          <span wicket:id="typelabel"/>
-        </td>
-        <td>
-          <select class="hippo-form-select" wicket:id="prototype"/>
-        </td>
-      </tr>
-      <tr>
-        <td>&nbsp;</td>
-        <td>
-          <span wicket:id="notypes"/>
-          <br/>
-        </td>
-      </tr>
-    </table>
-  </wicket:extend>
-</html>
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_nl.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_nl.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog_nl.properties	(revision 36884)
@@ -1,7 +0,0 @@
-name-label=Naam
-url-label=URL naam
-
-url-edit=Bewerk
-url-reset=Reset
-
-language=Taal
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$AddDocumentDialog.properties	(revision 36884)
@@ -1,7 +0,0 @@
-name-label=Name
-url-label=URL name
-
-url-edit=Edit
-url-reset=Reset
-
-language=Language
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.properties	(revision )
@@ -0,0 +1,5 @@
+name-label=Name
+url-label=URL name
+
+url-edit=Edit
+url-reset=Reset
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_it.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_it.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_it.properties	(revision 36884)
@@ -1,5 +0,0 @@
-name-label=Nome
-url-label=URL
-
-url-edit=Modifica URL
-url-reset=Annulla modifiche URL
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.java	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/RenameDocumentDialog.java	(revision )
@@ -0,0 +1,121 @@
+/*
+ *  Copyright 2012 Hippo.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.plugins.standardworkflow;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.util.string.Strings;
+import org.apache.wicket.util.time.Duration;
+import org.apache.wicket.util.value.IValueMap;
+import org.hippoecm.addon.workflow.AbstractWorkflowDialog;
+import org.hippoecm.addon.workflow.IWorkflowInvoker;
+import org.hippoecm.frontend.plugins.standards.list.resolvers.CssClassAppender;
+import org.hippoecm.repository.api.StringCodec;
+
+public class RenameDocumentDialog extends AbstractWorkflowDialog<RenameDocumentArguments> {
+    private IModel title;
+    private TextField nameComponent;
+    private TextField uriComponent;
+    private boolean uriModified;
+
+    public RenameDocumentDialog(RenameDocumentArguments renameDocumentModel, IModel title, IWorkflowInvoker invoker, final StringCodec nodeNameCodec) {
+        super(new Model(renameDocumentModel), invoker);
+        this.title = title;
+
+        final PropertyModel<String> nameModel = new PropertyModel<String>(renameDocumentModel, "targetName");
+        final PropertyModel<String> uriModel = new PropertyModel<String>(renameDocumentModel, "uriName");
+
+        String s1 = nameModel.getObject();
+        String s2 = uriModel.getObject();
+        uriModified = !s1.equals(s2);
+
+        nameComponent = new TextField<String>("name", nameModel);
+        nameComponent.setRequired(true);
+        nameComponent.setLabel(new StringResourceModel("name-label", this, null));
+        nameComponent.add(new OnChangeAjaxBehavior() {
+            @Override
+            protected void onUpdate(AjaxRequestTarget target) {
+                if (!uriModified) {
+                    uriModel.setObject(nodeNameCodec.encode(nameModel.getObject()));
+                    target.addComponent(uriComponent);
+                }
+            }
+        }.setThrottleDelay(Duration.milliseconds(500)));
+
+        nameComponent.setOutputMarkupId(true);
+        setFocus(nameComponent);
+        add(nameComponent);
+
+        uriComponent = new TextField<String>("uriinput", uriModel) {
+            @Override
+            public boolean isEnabled() {
+                return uriModified;
+            }
+        };
+
+        uriComponent.setLabel(new StringResourceModel("url-label", this, null));
+        add(uriComponent);
+
+        uriComponent.add(new CssClassAppender(new AbstractReadOnlyModel<String>() {
+            @Override
+            public String getObject() {
+                return uriModified ? "grayedin" : "grayedout";
+            }
+        }));
+        uriComponent.setOutputMarkupId(true);
+        uriComponent.setRequired(true);
+
+        AjaxLink<Boolean> uriAction = new AjaxLink<Boolean>("uriAction") {
+            @Override
+            public void onClick(AjaxRequestTarget target) {
+                uriModified = !uriModified;
+                if (!uriModified) {
+                    uriModel.setObject(Strings.isEmpty(nameModel.getObject()) ? "" : nodeNameCodec.encode(
+                            nameModel.getObject()));
+                    uriComponent.modelChanged();
+                } else {
+                    target.focusComponent(uriComponent);
+                }
+                target.addComponent(RenameDocumentDialog.this);
+            }
+        };
+        uriAction.add(new Label("uriActionLabel", new AbstractReadOnlyModel<String>() {
+            @Override
+            public String getObject() {
+                return uriModified ? getString("url-reset") : getString("url-edit");
+            }
+        }));
+        add(uriAction);
+    }
+
+    @Override
+    public IModel getTitle() {
+        return title;
+    }
+
+    @Override
+    public IValueMap getProperties() {
+        return MEDIUM;
+    }
+}
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_fr.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_fr.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_fr.properties	(revision 36884)
@@ -1,5 +0,0 @@
-name-label=Nom
-url-label=URL
-
-url-edit=\u00c9diter
-url-reset=R\u00e9initialiser
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin.java	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin.java	(revision )
@@ -29,42 +29,26 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeDefinition;
 
-import org.apache.wicket.Component;
 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.Session;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.markup.html.PackageResource;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.markup.html.panel.EmptyPanel;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.markup.repeater.data.IDataProvider;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;
-import org.apache.wicket.model.AbstractReadOnlyModel;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.StringResourceModel;
-import org.apache.wicket.util.string.Strings;
-import org.apache.wicket.util.time.Duration;
 import org.apache.wicket.util.value.IValueMap;
 import org.hippoecm.addon.workflow.CompatibilityWorkflowPlugin;
+import org.hippoecm.addon.workflow.IWorkflowInvoker;
 import org.hippoecm.addon.workflow.StdWorkflow;
 import org.hippoecm.addon.workflow.WorkflowDescriptorModel;
-import org.hippoecm.frontend.dialog.DialogConstants;
 import org.hippoecm.frontend.dialog.IDialogService.Dialog;
 import org.hippoecm.frontend.i18n.model.NodeTranslator;
-import org.hippoecm.frontend.i18n.types.SortedTypeChoiceRenderer;
 import org.hippoecm.frontend.model.JcrItemModel;
 import org.hippoecm.frontend.model.JcrNodeModel;
 import org.hippoecm.frontend.plugin.IPluginContext;
 import org.hippoecm.frontend.plugin.config.IPluginConfig;
-import org.hippoecm.frontend.plugins.standards.list.resolvers.CssClassAppender;
-import org.hippoecm.frontend.plugins.standardworkflow.components.LanguageField;
 import org.hippoecm.frontend.service.IBrowseService;
 import org.hippoecm.frontend.service.IEditor;
 import org.hippoecm.frontend.service.IEditorManager;
@@ -91,6 +75,8 @@
 import org.slf4j.LoggerFactory;
 
 public class FolderWorkflowPlugin extends CompatibilityWorkflowPlugin<FolderWorkflow> {
+    @SuppressWarnings("unused")
+    private final static String SVN_ID = "$Id$";
 
     private static final long serialVersionUID = 1L;
 
@@ -103,10 +89,11 @@
 
         add(new Label("new"));
 
-        add(new WorkflowAction("rename", new StringResourceModel("rename-title", this, null)) {
-            public String targetName;
-            public String uriName;
 
+        add(new StdWorkflow("rename", new StringResourceModel("rename-title", this, null), context, this) {
+
+            RenameDocumentArguments renameDocumentModel = new RenameDocumentArguments();
+
             @Override
             protected ResourceReference getIcon() {
                 return new ResourceReference(getClass(), "rename-16.png");
@@ -114,13 +101,20 @@
 
             @Override
             protected Dialog createRequestDialog() {
+
                 try {
-                    uriName =  ((WorkflowDescriptorModel)getDefaultModel()).getNode().getName();
-                    targetName = ((HippoNode)((WorkflowDescriptorModel)getDefaultModel()).getNode()).getLocalizedName();
+                    HippoNode node = (HippoNode) ((WorkflowDescriptorModel) getDefaultModel()).getNode();
+                    renameDocumentModel.setUriName(node.getName());
+                    renameDocumentModel.setTargetName(node.getLocalizedName());
+                    renameDocumentModel.setNodeType(node.getPrimaryNodeType());
-                } catch(RepositoryException ex) {
+                } catch (RepositoryException ex) {
-                    uriName = targetName = "";
+                    log.error("Could not retrieve workflow document", ex);
+                    renameDocumentModel.setUriName("");
+                    renameDocumentModel.setTargetName("");
+                    renameDocumentModel.setNodeType(null);
                 }
-                return new RenameDocumentDialog(this, new StringResourceModel("rename-title", FolderWorkflowPlugin.this, null));
+
+                return newRenameDocumentDialog(renameDocumentModel, this);
             }
 
             @Override
@@ -129,15 +123,15 @@
                 // and there is some logic here to look up the parent.  The real solution is
                 // in the visual component to merge two workflows.
                 HippoNode node = (HippoNode) model.getNode();
-                String nodeName = getNodeNameCodec().encode(uriName);
-                String localName = getLocalizeCodec().encode(targetName);
+                String nodeName = getNodeNameCodec().encode(renameDocumentModel.getUriName());
+                String localName = getLocalizeCodec().encode(renameDocumentModel.getTargetName());
                 WorkflowManager manager = ((UserSession) Session.get()).getWorkflowManager();
                 DefaultWorkflow defaultWorkflow = (DefaultWorkflow) manager.getWorkflow("core", node);
                 FolderWorkflow folderWorkflow = (FolderWorkflow) manager.getWorkflow("embedded", node.getParent());
-                if (!((WorkflowDescriptorModel)getDefaultModel()).getNode().getName().equals(nodeName)) {
+                if (!((WorkflowDescriptorModel) getDefaultModel()).getNode().getName().equals(nodeName)) {
                     folderWorkflow.rename(node.getName() + (node.getIndex() > 1 ? "[" + node.getIndex() + "]" : ""), nodeName);
                 }
-                if(!node.getLocalizedName().equals(localName)) {
+                if (!node.getLocalizedName().equals(localName)) {
                     defaultWorkflow.localizeName(localName);
                 }
             }
@@ -150,7 +144,7 @@
             protected ResourceReference getIcon() {
                 return new ResourceReference(getClass(), "reorder-16.png");
             }
-            
+
             @Override
             protected Dialog createRequestDialog() {
                 return new ReorderDialog(this, config, (WorkflowDescriptorModel) FolderWorkflowPlugin.this.getDefaultModel(),
@@ -180,11 +174,11 @@
                     log.error("Unable to retrieve node from WorkflowDescriptorModel, folder delete cancelled", e);
                 }
 
-                if(folderNode != null) {
+                if (folderNode != null) {
                     final IModel folderName = new NodeTranslator(new JcrNodeModel(folderNode)).getNodeName();
                     try {
                         boolean deleteAllowed = true;
-                        for (NodeIterator iter = folderNode.getNodes(); iter.hasNext();) {
+                        for (NodeIterator iter = folderNode.getNodes(); iter.hasNext(); ) {
                             Node child = iter.nextNode();
                             NodeDefinition nd = child.getDefinition();
                             if (nd.getDeclaringNodeType().isMixin()) {
@@ -216,7 +210,7 @@
                 public DeleteDialog(IModel messageModel, boolean deleteAllowed) {
                     super(messageModel);
 
-                    if(deleteAllowed) {
+                    if (deleteAllowed) {
                         setFocusOnOk();
                     } else {
                         setOkEnabled(false);
@@ -231,7 +225,7 @@
 
                 @Override
                 public IValueMap getProperties() {
-                    return DialogConstants.SMALL;
+                    return SMALL;
                 }
             }
 
@@ -248,6 +242,45 @@
         });
     }
 
+    protected Dialog newRenameDocumentDialog(RenameDocumentArguments renameDocumentModel, IWorkflowInvoker invoker) {
+        return new RenameDocumentDialog(
+                renameDocumentModel,
+                new StringResourceModel("rename-title", this, null),
+                invoker,
+                getNodeNameCodec());
+    }
+
+    protected Dialog newAddDocumentDialog(AddDocumentArguments addDocumentModel, String category, Set<String> prototypes, boolean translated, IWorkflowInvoker invoker) {
+
+        AddDocumentDialog dialog = new AddDocumentDialog(
+                addDocumentModel,
+                new StringResourceModel(category, this, null),
+                category,
+                prototypes,
+                translated,
+                invoker,
+                getNodeNameCodec(),
+                getLocaleProvider());
+
+        WorkflowDescriptorModel descriptorModel = (WorkflowDescriptorModel) getDefaultModel();
+        try {
+            Node node = descriptorModel.getNode();
+            if (node != null) {
+                while (node.getDepth() > 0) {
+                    if (node.isNodeType(HippoTranslationNodeType.NT_TRANSLATED)) {
+                        dialog.getLanguageField().setVisible(false);
+                        break;
+                    }
+                    node = node.getParent();
+                }
+            }
+        } catch (RepositoryException e) {
+            log.error("Could not determine visibility of language field");
+        }
+
+        return dialog;
+    }
+
     @Override
     public void onModelChanged() {
         try {
@@ -258,77 +291,80 @@
                 WorkflowDescriptor descriptor = (WorkflowDescriptor) model.getObject();
                 WorkflowManager manager = ((UserSession) org.apache.wicket.Session.get()).getWorkflowManager();
                 Workflow workflow = manager.getWorkflow(descriptor);
-                if(workflow instanceof FolderWorkflow) {
+                if (workflow instanceof FolderWorkflow) {
                     FolderWorkflow folderWorkflow = (FolderWorkflow) workflow;
                     Map<String, Serializable> hints = folderWorkflow.hints();
-    
+
                     if (hints.containsKey("reorder") && hints.get("reorder") instanceof Boolean) {
                         reorderAction.setVisible(((Boolean) hints.get("reorder")).booleanValue());
                     }
-    
+
                     final Set<String> translated = new TreeSet<String>();
                     if (getPluginConfig().containsKey("workflow.translated")) {
                         for (String translatedPrototype : getPluginConfig().getStringArray("workflow.translated")) {
                             translated.add(translatedPrototype);
                         }
                     }
-    
+
                     final Map<String, Set<String>> prototypes = (Map<String, Set<String>>) hints.get("prototypes");
                     for (final String category : prototypes.keySet()) {
                         String categoryLabel = new StringResourceModel("add-category", this, null,
-                                new Object[] { new StringResourceModel(category, this, null) }).getString();
+                                new Object[]{new StringResourceModel(category, this, null)}).getString();
                         ResourceReference iconResource = new ResourceReference(getClass(), category + "-16.png");
                         iconResource.bind(getApplication());
                         if (iconResource.getResource() == null ||
-                            (iconResource.getResource() instanceof PackageResource && ((PackageResource)iconResource.getResource()).getResourceStream(false) == null)) {
+                                (iconResource.getResource() instanceof PackageResource && ((PackageResource) iconResource.getResource()).getResourceStream(false) == null)) {
                             iconResource = new ResourceReference(getClass(), "new-document-16.png");
                             iconResource.bind(getApplication());
                         }
-                        list.add(new WorkflowAction("id", categoryLabel, iconResource) {
-                            public String prototype;
-                            public String targetName;
-                            public String uriName;
-                            public String language;
+                        list.add(new StdWorkflow<FolderWorkflow>("id", categoryLabel, iconResource, getPluginContext(), this) {
-    
+
+                            AddDocumentArguments addDocumentModel = new AddDocumentArguments();
+
                             @Override
                             protected Dialog createRequestDialog() {
-                                return new AddDocumentDialog(this, new StringResourceModel(category, FolderWorkflowPlugin.this, null),
-                                        category, prototypes.get(category), translated.contains(category));
+                                return newAddDocumentDialog(
+                                    addDocumentModel,
+                                    category,
+                                    prototypes.get(category),
+                                    translated.contains(category),
+                                    this
+                                );
                             }
-    
+
                             @Override
                             protected String execute(FolderWorkflow workflow) throws Exception {
-                                if (prototype == null) {
+                                if (addDocumentModel.getPrototype() == null) {
                                     throw new IllegalArgumentException("You need to select a type");
                                 }
-                                if (targetName == null || "".equals(targetName)) {
+                                if (addDocumentModel.getTargetName() == null || "".equals(addDocumentModel.getTargetName())) {
                                     throw new IllegalArgumentException("You need to enter a name");
                                 }
-                                if (uriName == null || "".equals(uriName)) {
+                                if (addDocumentModel.getUriName() == null || "".equals(addDocumentModel.getUriName())) {
                                     throw new IllegalArgumentException("You need to enter a URL name");
                                 }
                                 if (workflow != null) {
-                                    if (!prototypes.get(category).contains(prototype)) {
-                                        log.error("unknown folder type " + prototype);
-                                        return "Unknown folder type " + prototype;
+                                    if (!prototypes.get(category).contains(addDocumentModel.getPrototype())) {
+                                        log.error("unknown folder type " + addDocumentModel.getPrototype());
+                                        return "Unknown folder type " + addDocumentModel.getPrototype();
                                     }
-                                    String nodeName = getNodeNameCodec().encode(uriName);
-                                    String localName = getLocalizeCodec().encode(targetName);
+                                    String nodeName = getNodeNameCodec().encode(addDocumentModel.getUriName());
+                                    String localName = getLocalizeCodec().encode(addDocumentModel.getTargetName());
                                     if ("".equals(nodeName)) {
                                         throw new IllegalArgumentException("You need to enter a name");
                                     }
-    
+
                                     TreeMap<String, String> arguments = new TreeMap<String, String>();
                                     arguments.put("name", nodeName);
-                                    if (language != null) {
-                                        arguments.put("hippotranslation:locale", language);
+                                    if (addDocumentModel.getLanguage() != null) {
+                                        arguments.put("hippotranslation:locale", addDocumentModel.getLanguage());
                                     }
 
-                                    String path = workflow.add(category, prototype, arguments);
+                                    String path = workflow.add(category, addDocumentModel.getPrototype(), arguments);
                                     ((UserSession) Session.get()).getJcrSession().refresh(true);
                                     JcrNodeModel nodeModel = new JcrNodeModel(new JcrItemModel(path));
                                     select(nodeModel);
-                                    if(!nodeName.equals(localName)) {
+                                    if (!nodeName.equals(localName)) {
                                         WorkflowManager workflowMgr = ((UserSession) org.apache.wicket.Session.get()).getWorkflowManager();
                                         DefaultWorkflow defaultWorkflow = (DefaultWorkflow) workflowMgr.getWorkflow("core", nodeModel.getNode());
                                         defaultWorkflow.localizeName(localName);
@@ -374,7 +410,7 @@
         try {
             if (nodeModel.getNode() != null
                     && (nodeModel.getNode().isNodeType(HippoNodeType.NT_DOCUMENT) || nodeModel.getNode().isNodeType(
-                            HippoNodeType.NT_HANDLE))) {
+                    HippoNodeType.NT_HANDLE))) {
                 if (browser != null) {
                     browser.browse(nodeModel);
                 }
@@ -443,265 +479,4 @@
                 ILocaleProvider.class);
     }
 
-    public class AddDocumentDialog extends WorkflowAction.WorkflowDialog {
-        private String category;
-        private Set<String> prototypes;
-        private IModel title;
-        private Label typelabel;
-        private TextField nameComponent;
-        private TextField uriComponent;
-        private boolean uriModified = false;
-        private LanguageField languageField;
-
-        public AddDocumentDialog(WorkflowAction action, IModel title, String category, Set<String> prototypes, boolean translated) {
-            action.super();
-            this.title = title;
-            this.category = category;
-            this.prototypes = prototypes;
-
-            final PropertyModel<String> nameModel = new PropertyModel<String>(action, "targetName");
-            final PropertyModel<String> uriModel = new PropertyModel<String>(action, "uriName");
-            final PropertyModel<String> prototypeModel = new PropertyModel<String>(action, "prototype");
-
-            nameComponent = new TextField<String>("name", new IModel<String>() {
-                private static final long serialVersionUID = 1L;
-
-                public String getObject() {
-                    return nameModel.getObject();
-                }
-
-                public void setObject(String object) {
-                    nameModel.setObject(object);
-                    if (!uriModified) {
-                        uriModel.setObject(getNodeNameCodec().encode(nameModel.getObject()));
-                    }
-                }
-
-                public void detach() {
-                    nameModel.detach();
-                }
-                
-            });
-            nameComponent.setRequired(true);
-            nameComponent.setLabel(new StringResourceModel("name-label", this, null));
-            AjaxEventBehavior behavior;
-            nameComponent.add(behavior = new OnChangeAjaxBehavior() {
-                @Override
-                protected void onUpdate(AjaxRequestTarget target) {
-                    if (!uriModified) {
-                        target.addComponent(uriComponent);
-                    }
-                }
-            });
-            behavior.setThrottleDelay(Duration.milliseconds(500));
-            nameComponent.setOutputMarkupId(true);
-            setFocus(nameComponent);
-            add(nameComponent);
-
-            add(typelabel = new Label("typelabel", new StringResourceModel("document-type", FolderWorkflowPlugin.this,
-                    null)));
-
-            if (prototypes.size() > 1) {
-                final List<String> prototypesList = new LinkedList<String>(prototypes);
-                final DropDownChoice folderChoice;
-                SortedTypeChoiceRenderer typeChoiceRenderer = new SortedTypeChoiceRenderer(this, prototypesList);
-                add(folderChoice = new DropDownChoice("prototype", prototypeModel, typeChoiceRenderer, typeChoiceRenderer) {
-                    protected boolean wantOnSelectionChangedNotifications() {
-                        return false;
-                    }
-                });
-                folderChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
-                    @Override
-                    protected void onUpdate(AjaxRequestTarget target) {
-                        target.addComponent(folderChoice);
-                    }
-                });
-                folderChoice.setNullValid(false);
-                folderChoice.setRequired(true);
-                folderChoice.setLabel(new StringResourceModel("document-type", FolderWorkflowPlugin.this, null));
-                // while not a prototype chosen, disable ok button
-                Component notypes;
-                add(notypes = new EmptyPanel("notypes"));
-                notypes.setVisible(false);
-            } else if (prototypes.size() == 1) {
-                Component component;
-                add(component = new EmptyPanel("prototype"));
-                component.setVisible(false);
-                prototypeModel.setObject(prototypes.iterator().next());
-                Component notypes;
-                add(notypes = new EmptyPanel("notypes"));
-                notypes.setVisible(false);
-                typelabel.setVisible(false);
-            } else {
-                // if the folderWorkflowPlugin.templates.get(category).size() = 0 you cannot add this
-                // category currently.
-                Component component;
-                add(component = new EmptyPanel("prototype"));
-                component.setVisible(false);
-                prototypeModel.setObject(null);
-                add(new Label("notypes", "There are no types available for : [" + category
-                        + "] First create document types please."));
-                nameComponent.setVisible(false);
-                typelabel.setVisible(false);
-            }
-
-            add(uriComponent = new TextField<String>("uriinput", uriModel) {
-                @Override
-                public boolean isEnabled() {
-                    return uriModified;
-                }
-            });
-            
-            uriComponent.add(new CssClassAppender(new AbstractReadOnlyModel<String>() {
-                @Override
-                public String getObject() {
-                    return uriModified ? "grayedin" : "grayedout";
-                }
-            }));
-            uriComponent.setRequired(true);
-            uriComponent.setLabel(new StringResourceModel("url-label", this, null));
-            uriComponent.setOutputMarkupId(true);
-            
-            AjaxLink<Boolean> uriAction = new AjaxLink<Boolean>("uriAction") {
-                @Override
-                public void onClick(AjaxRequestTarget target) {
-                    uriModified = !uriModified;
-                    if (!uriModified) {
-                        uriModel.setObject(Strings.isEmpty(nameModel.getObject()) ? "" : getNodeNameCodec().encode(nameModel.getObject()));
-                        uriComponent.modelChanged();
-                    } else {
-                        target.focusComponent(uriComponent);
-                    }
-                    target.addComponent(AddDocumentDialog.this);
-                }
-            };
-            uriAction.add(new Label("uriActionLabel", new AbstractReadOnlyModel<String>() {
-                @Override
-                public String getObject() {
-                    return uriModified ? getString("url-reset") : getString("url-edit");
-                }
-            }));
-            add(uriAction);
-
-            languageField = new LanguageField("language", new PropertyModel<String>(action, "language"), getLocaleProvider());
-            if (!translated) {
-                languageField.setVisible(false);
-            } else {
-                WorkflowDescriptorModel descriptorModel = (WorkflowDescriptorModel) FolderWorkflowPlugin.this.getDefaultModel();
-                try {
-                    Node node = descriptorModel.getNode();
-                    if (node != null) {
-                        while (node.getDepth() > 0) {
-                            if (node.isNodeType(HippoTranslationNodeType.NT_TRANSLATED)) {
-                                languageField.setVisible(false);
-                                break;
-                            }
-                            node = node.getParent();
-                        }
-                    }
-                } catch (RepositoryException e) {
-                    log.error("Could not determine visibility of language field");
-                }
-            }
-            add(languageField);
-        }
-
-        @Override
-        public IModel getTitle() {
-            return title;
-        }
-
-        @Override
-        public IValueMap getProperties() {
-            return DialogConstants.MEDIUM;
-        }
-
-    }
-
-    public class RenameDocumentDialog extends WorkflowAction.WorkflowDialog {
-        private IModel title;
-        private TextField nameComponent;
-        private TextField uriComponent;
-        private boolean uriModified;
-
-        public RenameDocumentDialog(WorkflowAction action, IModel title) {
-            action.super();
-            this.title = title;
-
-            final PropertyModel<String> nameModel = new PropertyModel<String>(action, "targetName");
-            final PropertyModel<String> uriModel = new PropertyModel<String>(action, "uriName");
-
-            String s1 = nameModel.getObject();
-            String s2 = uriModel.getObject();
-            uriModified = !s1.equals(s2);
-
-            nameComponent = new TextField<String>("name", nameModel);
-            nameComponent.setRequired(true);
-            nameComponent.setLabel(new StringResourceModel("name-label", FolderWorkflowPlugin.this, null));
-            nameComponent.add(new OnChangeAjaxBehavior() {
-                @Override
-                protected void onUpdate(AjaxRequestTarget target) {
-                    if (!uriModified) {
-                        uriModel.setObject(getNodeNameCodec().encode(nameModel.getObject()));
-                        target.addComponent(uriComponent);
-                    }
-                }
-            }.setThrottleDelay(Duration.milliseconds(500)));
-
-            nameComponent.setOutputMarkupId(true);
-            setFocus(nameComponent);
-            add(nameComponent);
-
-            uriComponent = new TextField<String>("uriinput", uriModel) {
-                @Override
-                public boolean isEnabled() {
-                    return uriModified;
-                }
-            };
-
-            uriComponent.setLabel(new StringResourceModel("url-label", FolderWorkflowPlugin.this, null));
-            add(uriComponent);
-
-            uriComponent.add(new CssClassAppender(new AbstractReadOnlyModel<String>() {
-                @Override
-                public String getObject() {
-                    return uriModified ? "grayedin" : "grayedout";
-                }
-            }));
-            uriComponent.setOutputMarkupId(true);
-            uriComponent.setRequired(true);
-
-            AjaxLink<Boolean> uriAction = new AjaxLink<Boolean>("uriAction") {
-                @Override
-                public void onClick(AjaxRequestTarget target) {
-                    uriModified = !uriModified;
-                    if (!uriModified) {
-                        uriModel.setObject(Strings.isEmpty(nameModel.getObject()) ? "" : getNodeNameCodec().encode(
-                                nameModel.getObject()));
-                        uriComponent.modelChanged();
-                    } else {
-                        target.focusComponent(uriComponent);
-                    }
-                    target.addComponent(RenameDocumentDialog.this);
-                }
-            };
-            uriAction.add(new Label("uriActionLabel", new AbstractReadOnlyModel<String>() {
-                @Override
-                public String getObject() {
-                    return uriModified ? getString("url-reset") : getString("url-edit");
-                }
-            }));
-            add(uriAction);
-        }
-
-        @Override
-        public IModel getTitle() {
-            return title;
-        }
-
-        @Override
-        public IValueMap getProperties() {
-            return DialogConstants.MEDIUM;
-        }
-    }
 }
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.html
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.html	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog.html	(revision 36884)
@@ -1,36 +0,0 @@
-<!--
-  * Copyright 2008 Hippo
-  *
-  * Licensed under the Apache License, Version 2.0 (the  "License");
-  * you may not use this file except in compliance with the License.
-  * You may obtain a copy of the License at
-  *
-  * http://www.apache.org/licenses/LICENSE-2.0
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org/">
-  <wicket:extend>
-    <table class="hippo-window-form">
-      <tr>
-        <td><wicket:message key="name-label">Name</wicket:message></td>
-        <td>
-          <input type="text" wicket:id="name" class="hippo-form-input"/>
-        </td>
-      </tr>
-      <tr>
-        <td width="75"><wicket:message key="url-label">Name</wicket:message></td>
-        <td>
-          <input wicket:id="uriinput" class="hippo-form-input"/>
-          <a wicket:id="uriAction" class="action">
-            <span wicket:id="uriActionLabel">[ UriActionLabel ]</span>
-          </a>
-        </td>
-      </tr>
-    </table>
-  </wicket:extend>
-</html>
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_de.properties
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_de.properties	(revision 36884)
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/FolderWorkflowPlugin$RenameDocumentDialog_de.properties	(revision 36884)
@@ -1,5 +0,0 @@
-name-label=Name
-url-label=URL-Name
-
-url-edit=Bearbeiten
-url-reset=Wiederherstellen
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_it.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_it.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_it.properties	(revision )
@@ -0,0 +1,8 @@
+name-label=Nome
+url-label=URL
+document-type=Tipo di documento
+
+url-edit=Modifica
+url-reset=Pulisci
+
+language=Lingua
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_fr.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_fr.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog_fr.properties	(revision )
@@ -0,0 +1,8 @@
+name-label=Nom
+url-label=URL
+document-type=Type de document
+
+url-edit=\u00c9diter
+url-reset=R\u00e9initialiser
+
+language=Langue
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.properties	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.properties	(revision )
@@ -0,0 +1,8 @@
+name-label=Name
+url-label=URL name
+document-type=Document type
+
+url-edit=Edit
+url-reset=Reset
+
+language=Language
Index: api/src/main/java/org/hippoecm/addon/workflow/AbstractWorkflowDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- api/src/main/java/org/hippoecm/addon/workflow/AbstractWorkflowDialog.java	(revision )
+++ api/src/main/java/org/hippoecm/addon/workflow/AbstractWorkflowDialog.java	(revision )
@@ -0,0 +1,29 @@
+package org.hippoecm.addon.workflow;
+
+import org.apache.wicket.model.IModel;
+import org.hippoecm.frontend.dialog.AbstractDialog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Id$
+ */
+public abstract class AbstractWorkflowDialog<T> extends AbstractDialog<T> {
+
+    private static Logger log = LoggerFactory.getLogger(AbstractWorkflowDialog.class);
+    private IWorkflowInvoker invoker;
+
+    public AbstractWorkflowDialog(IModel<T> model, IWorkflowInvoker invoker) {
+        super(model);
+        this.invoker = invoker;
+    }
+
+    @Override
+    protected void onOk() {
+        try {
+            invoker.invokeWorkflow();
+        } catch (Exception e) {
+            log.error("Could not execute workflow.", e);
+        }
+    }
+}
Index: builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.java	(revision )
+++ builtin/src/main/java/org/hippoecm/frontend/plugins/standardworkflow/AddDocumentDialog.java	(revision )
@@ -0,0 +1,212 @@
+/*
+ *  Copyright 2012 Hippo.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.plugins.standardworkflow;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.EmptyPanel;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.util.string.Strings;
+import org.apache.wicket.util.time.Duration;
+import org.apache.wicket.util.value.IValueMap;
+import org.hippoecm.addon.workflow.AbstractWorkflowDialog;
+import org.hippoecm.addon.workflow.IWorkflowInvoker;
+import org.hippoecm.frontend.i18n.types.SortedTypeChoiceRenderer;
+import org.hippoecm.frontend.plugins.standards.list.resolvers.CssClassAppender;
+import org.hippoecm.frontend.plugins.standardworkflow.components.LanguageField;
+import org.hippoecm.frontend.translation.ILocaleProvider;
+import org.hippoecm.repository.api.StringCodec;
+
+public class AddDocumentDialog extends AbstractWorkflowDialog<AddDocumentArguments> {
+    private IModel title;
+    private Label typelabel;
+    private TextField nameComponent;
+    private TextField uriComponent;
+    private boolean uriModified = false;
+    private LanguageField languageField;
+
+    public AddDocumentDialog(AddDocumentArguments addDocumentModel, IModel title, String category, Set<String> prototypes, boolean translated, final IWorkflowInvoker invoker, final StringCodec nodeNameCodec, ILocaleProvider localeProvider) {
+        super(new Model(addDocumentModel), invoker);
+        this.title = title;
+
+        final PropertyModel<String> nameModel = new PropertyModel<String>(addDocumentModel, "targetName");
+        final PropertyModel<String> uriModel = new PropertyModel<String>(addDocumentModel, "uriName");
+        final PropertyModel<String> prototypeModel = new PropertyModel<String>(addDocumentModel, "prototype");
+
+        nameComponent = new TextField<String>("name", new IModel<String>() {
+            private static final long serialVersionUID = 1L;
+
+            public String getObject() {
+                return nameModel.getObject();
+            }
+
+            public void setObject(String object) {
+                nameModel.setObject(object);
+                if (!uriModified) {
+                    uriModel.setObject(nodeNameCodec.encode(nameModel.getObject()));
+                }
+            }
+
+            public void detach() {
+                nameModel.detach();
+            }
+
+        });
+        nameComponent.setRequired(true);
+        nameComponent.setLabel(new StringResourceModel("name-label", this, null));
+        AjaxEventBehavior behavior;
+        nameComponent.add(behavior = new OnChangeAjaxBehavior() {
+            @Override
+            protected void onUpdate(AjaxRequestTarget target) {
+                if (!uriModified) {
+                    target.addComponent(uriComponent);
+                }
+            }
+        });
+        behavior.setThrottleDelay(Duration.milliseconds(500));
+        nameComponent.setOutputMarkupId(true);
+        setFocus(nameComponent);
+        add(nameComponent);
+
+        add(typelabel = new Label("typelabel", new StringResourceModel("document-type", this, null)));
+
+        if (prototypes.size() > 1) {
+            final List<String> prototypesList = new LinkedList<String>(prototypes);
+            final DropDownChoice folderChoice;
+            SortedTypeChoiceRenderer typeChoiceRenderer = new SortedTypeChoiceRenderer(this, prototypesList);
+            add(folderChoice = new DropDownChoice("prototype", prototypeModel, typeChoiceRenderer, typeChoiceRenderer) {
+                protected boolean wantOnSelectionChangedNotifications() {
+                    return false;
+                }
+            });
+            folderChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+                @Override
+                protected void onUpdate(AjaxRequestTarget target) {
+                    target.addComponent(folderChoice);
+                }
+            });
+            folderChoice.setNullValid(false);
+            folderChoice.setRequired(true);
+            folderChoice.setLabel(new StringResourceModel("document-type", this, null));
+            // while not a prototype chosen, disable ok button
+            Component notypes;
+            add(notypes = new EmptyPanel("notypes"));
+            notypes.setVisible(false);
+        } else if (prototypes.size() == 1) {
+            Component component;
+            add(component = new EmptyPanel("prototype"));
+            component.setVisible(false);
+            prototypeModel.setObject(prototypes.iterator().next());
+            Component notypes;
+            add(notypes = new EmptyPanel("notypes"));
+            notypes.setVisible(false);
+            typelabel.setVisible(false);
+        } else {
+            // if the folderWorkflowPlugin.templates.get(category).size() = 0 you cannot add this
+            // category currently.
+            Component component;
+            add(component = new EmptyPanel("prototype"));
+            component.setVisible(false);
+            prototypeModel.setObject(null);
+            add(new Label("notypes", "There are no types available for : [" + category
+                    + "] First create document types please."));
+            nameComponent.setVisible(false);
+            typelabel.setVisible(false);
+        }
+
+        add(uriComponent = new TextField<String>("uriinput", uriModel) {
+            @Override
+            public boolean isEnabled() {
+                return uriModified;
+            }
+        });
+
+        uriComponent.add(new CssClassAppender(new AbstractReadOnlyModel<String>() {
+            @Override
+            public String getObject() {
+                return uriModified ? "grayedin" : "grayedout";
+            }
+        }));
+        uriComponent.setRequired(true);
+        uriComponent.setLabel(new StringResourceModel("url-label", this, null));
+        uriComponent.setOutputMarkupId(true);
+
+        AjaxLink<Boolean> uriAction = new AjaxLink<Boolean>("uriAction") {
+            @Override
+            public void onClick(AjaxRequestTarget target) {
+                uriModified = !uriModified;
+                if (!uriModified) {
+                    uriModel.setObject(Strings.isEmpty(nameModel.getObject()) ? "" : nodeNameCodec.encode(nameModel.getObject()));
+                    uriComponent.modelChanged();
+                } else {
+                    target.focusComponent(uriComponent);
+                }
+                target.addComponent(AddDocumentDialog.this);
+            }
+        };
+        uriAction.add(new Label("uriActionLabel", new AbstractReadOnlyModel<String>() {
+            @Override
+            public String getObject() {
+                return uriModified ? getString("url-reset") : getString("url-edit");
+            }
+        }));
+        add(uriAction);
+
+        languageField = new LanguageField("language", new PropertyModel<String>(addDocumentModel, "language"), localeProvider);
+        if (!translated) {
+            languageField.setVisible(false);
+        }
+        add(languageField);
+    }
+
+    @Override
+    public IModel getTitle() {
+        return title;
+    }
+
+    @Override
+    public IValueMap getProperties() {
+        return MEDIUM;
+    }
+
+    public LanguageField getLanguageField() {
+        return languageField;
+    }
+
+    public TextField getUriComponent() {
+        return uriComponent;
+    }
+
+    public TextField getNameComponent() {
+        return nameComponent;
+    }
+
+}
