|
From: <luc...@us...> - 2013-09-16 23:33:35
|
Revision: 4316
http://openutils.svn.sourceforge.net/openutils/?rev=4316&view=rev
Author: lucaboati
Date: 2013-09-16 23:33:31 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
complete js refactoring, "move fields" functionality added + examples
Modified Paths:
--------------
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/el/ContextMenuElFunctions.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementInfo.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementTag.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/MenuScripts.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/META-INF/tld/mgnlcontextmenu.tld
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.contextMenus.samples-form-label.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-form.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-form.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.pages.contextmenu-template-freemarker.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.pages.contextmenu-template-jsp.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/website.sample-contextmenu.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-files/templates/samples-contextmenu/paragraph-form.jsp
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-files/templates/samples-contextmenu/paragraph-textmedia.jsp
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-files/templates/samples-contextmenu/template-contextmenu.jsp
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/contextmenu-samples.css
Added Paths:
-----------
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/servlet/
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/servlet/SetPropertyServlet.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortItemTag.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortListTag.java
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap/contextmenu-nooverwrite/
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap/contextmenu-nooverwrite/config.server.filters.servlets.SetPropertyServlet.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-move-fields.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-move-fields.xml
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-files/templates/samples-contextmenu/page-editmenu.jsp
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-files/templates/samples-contextmenu/paragraph-move-fields.jsp
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-description.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-header.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-help.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-info.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-label.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-media.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-move.gif
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-text.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/menu-validation.gif
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/power_off.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/images/power_on.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/img/ico16-form-help.png
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/jquery.contextMenu.css
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/js/contextmenu-addMenu.js
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/js/contextmenu-sortList.js
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/js/jquery.contextMenu.js
Removed Paths:
-------------
magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-resources/contextmenu/css/img/ico16-form-hint.png
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/el/ContextMenuElFunctions.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/el/ContextMenuElFunctions.java 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/el/ContextMenuElFunctions.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -21,16 +21,27 @@
import info.magnolia.cms.security.Permission;
import info.magnolia.context.MgnlContext;
+import info.magnolia.context.WebContext;
import info.magnolia.jcr.util.NodeUtil;
import info.magnolia.jcr.wrapper.HTMLEscapingNodeWrapper;
import info.magnolia.objectfactory.Components;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+
import javax.jcr.Node;
+import javax.servlet.http.HttpServletRequest;
import net.sourceforge.openutils.mgnlcontextmenu.configuration.PersistenceStrategy;
import net.sourceforge.openutils.mgnlcontextmenu.module.ContextMenuModule;
+import net.sourceforge.openutils.mgnlcontextmenu.tags.ElementInfo;
import net.sourceforge.openutils.mgnlcontextmenu.tags.MenuScripts;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +57,18 @@
*/
private static Logger log = LoggerFactory.getLogger(ContextMenuElFunctions.class);
+ private static final String EDIT_MESSAGE_INFOS_KEY = "mgnlEditMessageInfos";
+
/**
+ * A shortcut to get the current request.
+ * @return The request.
+ */
+ private static HttpServletRequest getRequest()
+ {
+ return ((WebContext) MgnlContext.getInstance()).getRequest();
+ }
+
+ /**
* Gets the entry value for the specified name, searching for it in the local and global entries corresponding to
* the given node. Local entries take precedence on the global ones.
* @param node
@@ -81,15 +103,128 @@
out.append("<!-- start contextmenu:links -->\n");
out.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""
+ ctx
- + "/.resources/contextmenu/css/contextmenu.css\" media=\"screen\" />\n");
+ + "/.resources/contextmenu/css/jquery.contextMenu.css\" media=\"screen\" />\n");
+// out.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""
+// + ctx
+// + "/.resources/contextmenu/css/contextmenu.css\" media=\"screen\" />\n");
+// out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/contextmenu-jquery.js\"></script>\n");
out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/mgnladmin-custom.js\"></script>\n");
- out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/contextmenu-jquery.js\"></script>\n");
+ out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/jquery.contextMenu.js\"></script>\n");
+ out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/contextmenu-addMenu.js\"></script>\n");
+// if(mgnlSortLists != null){
+ out.append("<script src=\"" + ctx + "/.resources/contextmenu/js/contextmenu-sortList.js\"></script>\n");
+// }
out.append("<!-- end contextmenu:links -->\n");
-
-
}
return out.toString();
}
+ @SuppressWarnings({"rawtypes" })
+ private static Stack getSortListStack()
+ {
+ HttpServletRequest request = getRequest();
+ Stack stack = (Stack) request.getAttribute("SORT_LIST_STACK");
+ if (stack == null)
+ {
+ stack = new Stack();
+ request.setAttribute("SORT_LIST_STACK", stack);
+ }
+ return stack;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes" })
+ public static void beginSortList()
+ {
+ getSortListStack().push(new ArrayList());
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes" })
+ public static void addSortListItem(String html)
+ {
+ ((List) getSortListStack().peek()).add(html);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes" })
+ public static List endSortList(String order)
+ {
+ String[] tokens = StringUtils.splitPreserveAllTokens(order, ',');
+
+ List input = (List) getSortListStack().pop();
+ List output = new ArrayList(input.size());
+
+ int i = 0;
+ Iterator iter = input.iterator();
+ while (iter.hasNext())
+ {
+ String html = (String) iter.next();
+ int index = i < tokens.length ? NumberUtils.toInt(tokens[i], -1) : -1;
+ output.add(index >= 0 && index < input.size() ? input.get(index) : html);
+ i++;
+ }
+ return output;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes" })
+ public static ElementInfo addEditMessageInfo(String key, String path, String elementId)
+ {
+ HttpServletRequest request = getRequest();
+ List list = (List) request.getAttribute(EDIT_MESSAGE_INFOS_KEY);
+ if (list == null)
+ {
+ list = new ArrayList();
+ request.setAttribute(EDIT_MESSAGE_INFOS_KEY, list);
+ }
+ ElementInfo item = new ElementInfo(key, path, elementId);
+ list.add(item);
+
+ return item;
+ }
+
+ @SuppressWarnings({"rawtypes" })
+ public static List editMessageInfos()
+ {
+ List list = (List) getRequest().getAttribute(EDIT_MESSAGE_INFOS_KEY);
+ return list != null ? list : Collections.EMPTY_LIST;
+ }
+
+ public static String editMessageInfosJs()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (Object item : editMessageInfos())
+ {
+ if (sb.length() > 0)
+ {
+ sb.append(',');
+ }
+ ElementInfo info = (ElementInfo) item;
+ sb.append("'").append(info.getElementId()).append("'");
+ sb.append(":{");
+ if (!StringUtils.isEmpty(info.getParentTrigger()))
+ {
+ sb.append("'parentTrigger':'").append(info.getParentTrigger()).append("',");
+ }
+ if (!StringUtils.isEmpty(info.getEntryName()))
+ {
+ sb.append("'entryName':'").append(info.getEntryName()).append("',");
+ }
+ if (!StringUtils.isEmpty(info.getContextMenu()))
+ {
+ sb.append("'contextMenu':'").append(info.getContextMenu()).append("',");
+ }
+ if (!StringUtils.isEmpty(info.getEnterMode()))
+ {
+ sb.append("'enterMode':'").append(info.getEnterMode()).append("',");
+ }
+ if (!StringUtils.isEmpty(info.getShowCallback()))
+ {
+ sb.append("'showCallback':").append(info.getShowCallback()).append(',');
+ }
+ sb.append("'key':'").append(info.getKey()).append("',");
+ sb.append("'path':'").append(info.getPath()).append("'");
+ sb.append('}');
+ }
+ return "{" + sb + "}";
+ }
+
}
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/servlet/SetPropertyServlet.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/servlet/SetPropertyServlet.java (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/servlet/SetPropertyServlet.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,52 @@
+package net.sourceforge.openutils.mgnlcontextmenu.servlet;
+
+import info.magnolia.cms.security.Permission;
+import info.magnolia.context.MgnlContext;
+import info.magnolia.jcr.util.NodeUtil;
+import info.magnolia.repository.RepositoryConstants;
+
+import java.io.IOException;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class SetPropertyServlet extends HttpServlet
+{
+
+ private Logger log = LoggerFactory.getLogger(SetPropertyServlet.class);
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ doPost(req, resp);
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ String path = req.getParameter("path");
+ String name = req.getParameter("name");
+ String value = req.getParameter("value");
+ try
+ {
+ Node node = MgnlContext.getJCRSession(RepositoryConstants.WEBSITE).getNode(path);
+ if (NodeUtil.isGranted(node, Permission.SET))
+ {
+ node.setProperty(name, value);
+ MgnlContext.getJCRSession(RepositoryConstants.WEBSITE).save();
+ }
+ }
+ catch (RepositoryException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ }
+}
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementInfo.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementInfo.java 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementInfo.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -25,28 +25,29 @@
* @author dschivo
* @version $Id$
*/
+
public class ElementInfo
{
/**
- * Paragraph's handle
+ * Message key
*/
- private final String path;
+ private final String key;
/**
- * HTML identifier of the element containing the content
+ * Entry name
*/
- private final String elementId;
+ private String entryName;
/**
- * Entry name
+ * Paragraph's handle
*/
- private String entryName;
+ private final String path;
/**
- * Context menu name
+ * HTML identifier of the element containing the message
*/
- private String contextMenu;
+ private final String elementId;
/**
* Wrapper HTML tag to which attach context menu
@@ -54,6 +55,11 @@
private String parentTrigger;
/**
+ * Context menu type
+ */
+ private String contextMenu;
+
+ /**
* Enter mode for FCK editor
*/
private String enterMode;
@@ -63,115 +69,73 @@
*/
private String showCallback;
- public ElementInfo(String path, String elementId)
+ public ElementInfo(String key, String path, String elementId)
{
+ this.key = key;
this.path = path;
this.elementId = elementId;
}
- /**
- * Returns the path.
- * @return the path
- */
+ public String getKey()
+ {
+ return key;
+ }
+
public String getPath()
{
return path;
}
- /**
- * Returns the elementId.
- * @return the elementId
- */
public String getElementId()
{
return elementId;
}
- /**
- * Returns the entryName.
- * @return the entryName
- */
- public String getEntryName()
+ public String getParentTrigger()
{
- return entryName;
+ return parentTrigger;
}
- /**
- * Sets the entryName.
- * @param entryName the entryName to set
- */
- public void setEntryName(String entryName)
+ public void setParentTrigger(String parentTrigger)
{
- this.entryName = entryName;
+ this.parentTrigger = parentTrigger;
}
- /**
- * Returns the contextMenu.
- * @return the contextMenu
- */
public String getContextMenu()
{
return contextMenu;
}
- /**
- * Sets the contextMenu.
- * @param contextMenu the contextMenu to set
- */
public void setContextMenu(String contextMenu)
{
this.contextMenu = contextMenu;
}
- /**
- * Returns the parentTrigger.
- * @return the parentTrigger
- */
- public String getParentTrigger()
+ public String getEnterMode()
{
- return parentTrigger;
+ return enterMode;
}
- /**
- * Sets the parentTrigger.
- * @param parentTrigger the parentTrigger to set
- */
- public void setParentTrigger(String parentTrigger)
+ public void setEnterMode(String enterMode)
{
- this.parentTrigger = parentTrigger;
+ this.enterMode = enterMode;
}
- /**
- * Returns the enterMode.
- * @return the enterMode
- */
- public String getEnterMode()
+ public String getEntryName()
{
- return enterMode;
+ return entryName;
}
- /**
- * Sets the enterMode.
- * @param enterMode the enterMode to set
- */
- public void setEnterMode(String enterMode)
+ public void setEntryName(String entryName)
{
- this.enterMode = enterMode;
+ this.entryName = entryName;
}
- /**
- * Returns the showCallback.
- * @return the showCallback
- */
public String getShowCallback()
{
return showCallback;
}
- /**
- * Sets the showCallback.
- * @param showCallback the showCallback to set
- */
public void setShowCallback(String showCallback)
{
this.showCallback = showCallback;
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementTag.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementTag.java 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/ElementTag.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -19,17 +19,13 @@
package net.sourceforge.openutils.mgnlcontextmenu.tags;
-import info.magnolia.cms.core.Content;
import info.magnolia.cms.security.Permission;
import info.magnolia.context.MgnlContext;
import info.magnolia.jcr.util.NodeUtil;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
import javax.jcr.Node;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
@@ -170,34 +166,23 @@
throw new JspException(e);
}
- ElementInfo info = addElementInfo(NodeUtil.getPathIfPossible(node), elementId);
+ ElementInfo einfo = ContextMenuElFunctions.addEditMessageInfo(
+ name,
+ NodeUtil.getPathIfPossible(node),
+ elementId);
if (!StringUtils.isEmpty(name))
{
- info.setEntryName(name);
+ einfo.setEntryName(name);
}
if (!StringUtils.isEmpty(menu))
{
- info.setContextMenu(menu);
+ einfo.setContextMenu(menu);
}
+
}
return EVAL_PAGE;
}
- @SuppressWarnings("unchecked")
- protected ElementInfo addElementInfo(String path, String elementId)
- {
- HttpServletRequest request = MgnlContext.getWebContext().getRequest();
- List infos = (List) request.getAttribute(ELEMENT_INFOS_KEY);
- if (infos == null)
- {
- infos = new ArrayList();
- request.setAttribute(ELEMENT_INFOS_KEY, infos);
- }
- ElementInfo info = new ElementInfo(path, elementId);
- infos.add(info);
- return info;
- }
-
private boolean canEdit()
{
return NodeUtil.isGranted(MgnlContext.getAggregationState().getMainContent().getJCRNode(), Permission.SET);
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/MenuScripts.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/MenuScripts.java 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/MenuScripts.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -23,16 +23,12 @@
import info.magnolia.context.MgnlContext;
import info.magnolia.jcr.util.NodeUtil;
-import java.io.IOException;
import java.util.List;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.tagext.TagSupport;
-
import net.sourceforge.openutils.mgnlcontextmenu.configuration.ContextMenu;
import net.sourceforge.openutils.mgnlcontextmenu.configuration.ContextMenuItem;
import net.sourceforge.openutils.mgnlcontextmenu.configuration.ContextMenuManager;
+import net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions;
import org.apache.commons.lang.StringUtils;
@@ -50,15 +46,22 @@
{
StringBuilder out = new StringBuilder();
+ // out.append("<script type=\"text/javascript\">\n");
+ // out.append("var mgnlContextMenuInfo = {\n");
+ // out.append(" contextPath: '" + MgnlContext.getContextPath() + "',\n");
+ // out.append(" menus: " + menusJs() + ",\n");
+ // out.append(" elements: " + elementsJs() + "\n");
+ // out.append("};\n");
+ // out.append("</script>\n");
+
out.append("<!-- start contextmenu:scripts -->\n");
out.append("<script type=\"text/javascript\">\n");
- out.append("var mgnlContextMenuInfo = {\n");
- out.append(" contextPath: '" + MgnlContext.getContextPath() + "',\n");
- out.append(" menus: " + menusJs() + ",\n");
- out.append(" elements: " + elementsJs() + "\n");
- out.append("};\n");
+ out.append("jQuery(document).ready(function() {\n");
+ out.append(" jQuery.mgnlAddContextMenu(" + ContextMenuElFunctions.editMessageInfosJs() + ");\n");
+ out.append("});\n");
out.append("</script>\n");
out.append("<!-- end contextmenu:scripts -->\n");
+
return out.toString();
}
return StringUtils.EMPTY;
@@ -118,10 +121,7 @@
ElementInfo info = (ElementInfo) item;
sb.append("'").append(info.getElementId()).append("'");
sb.append(":{");
- if (!StringUtils.isEmpty(info.getEntryName()))
- {
- sb.append("'entryName':'").append(info.getEntryName()).append("',");
- }
+
if (!StringUtils.isEmpty(info.getContextMenu()))
{
sb.append("'contextMenu':'").append(info.getContextMenu()).append("',");
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortItemTag.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortItemTag.java (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortItemTag.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,38 @@
+/**
+ *
+ * ContextMenu Module for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcontextmenu.html)
+ * Copyright(C) 2010-2013, Openmind S.r.l. http://www.openmindonline.it
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.sourceforge.openutils.mgnlcontextmenu.tags;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+
+import net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions;
+
+
+public class SortItemTag extends BodyTagSupport
+{
+
+ @Override
+ public int doEndTag() throws JspException
+ {
+ ContextMenuElFunctions.addSortListItem(getBodyContent().getString());
+ return EVAL_BODY_BUFFERED;
+ }
+
+}
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortListTag.java
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortListTag.java (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/java/net/sourceforge/openutils/mgnlcontextmenu/tags/SortListTag.java 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,130 @@
+/**
+ *
+ * ContextMenu Module for Magnolia CMS (http://www.openmindlab.com/lab/products/mgnlcontextmenu.html)
+ * Copyright(C) 2010-2013, Openmind S.r.l. http://www.openmindonline.it
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.sourceforge.openutils.mgnlcontextmenu.tags;
+
+import info.magnolia.cms.security.Permission;
+import info.magnolia.cms.util.NodeDataUtil;
+import info.magnolia.context.MgnlContext;
+import info.magnolia.jcr.util.NodeUtil;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.exception.NestableRuntimeException;
+
+
+public class SortListTag extends TagSupport
+{
+
+ private String containerId;
+
+ private String orderProperty;
+
+ public void setContainerId(String containerId)
+ {
+ this.containerId = containerId;
+ }
+
+ public void setOrderProperty(String orderProperty)
+ {
+ this.orderProperty = orderProperty;
+ }
+
+ @Override
+ public int doStartTag() throws JspException
+ {
+ ContextMenuElFunctions.beginSortList();
+ return EVAL_BODY_INCLUDE;
+ }
+
+ @Override
+ public int doEndTag() throws JspException
+ {
+ if (StringUtils.isEmpty(orderProperty))
+ {
+ orderProperty = containerId;
+ }
+ String order = StringUtils.defaultString(NodeDataUtil.getString(MgnlContext
+ .getAggregationState()
+ .getCurrentContent(), orderProperty));
+
+ JspWriter out = pageContext.getOut();
+ try
+ {
+ for (Object item : ContextMenuElFunctions.endSortList(order))
+ {
+ out.print(item);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new NestableRuntimeException(e);
+ }
+ boolean canEdit;
+ try
+ {
+ canEdit = NodeUtil.isGranted(
+ MgnlContext.getAggregationState().getMainContent().getJCRNode(),
+ Permission.SET);
+
+ }
+ catch (Throwable e)
+ {
+ canEdit = false;
+ }
+ if (canEdit)
+ {
+ Map<String, String> item = new HashMap<String, String>();
+ item.put("containerId", containerId);
+ item.put("url", MgnlContext.getContextPath() + "/mgnl-set-property");
+ item.put("path", MgnlContext.getAggregationState().getCurrentContent().getHandle());
+ item.put("name", orderProperty);
+ item.put("order", '[' + order + ']');
+ List items = (List) pageContext.getRequest().getAttribute("mgnlSortLists");
+ if (items == null)
+ {
+ items = new ArrayList();
+ pageContext.getRequest().setAttribute("mgnlSortLists", items);
+ }
+ items.add(item);
+ }
+ containerId = null;
+ orderProperty = null;
+ return EVAL_PAGE;
+ }
+
+ @Override
+ public void release()
+ {
+ super.release();
+ containerId = null;
+ orderProperty = null;
+ }
+}
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/META-INF/tld/mgnlcontextmenu.tld
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/META-INF/tld/mgnlcontextmenu.tld 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/META-INF/tld/mgnlcontextmenu.tld 2013-09-16 23:33:31 UTC (rev 4316)
@@ -64,6 +64,32 @@
<type>boolean</type>
</attribute>
</tag>
+ <tag>
+ <description></description>
+ <display-name>sortList</display-name>
+ <name>sortList</name>
+ <tag-class>net.sourceforge.openutils.mgnlcontextmenu.tags.SortListTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <description></description>
+ <name>containerId</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>orderProperty</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <description></description>
+ <display-name>sortItem</display-name>
+ <name>sortItem</name>
+ <tag-class>net.sourceforge.openutils.mgnlcontextmenu.tags.SortItemTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
<function>
<description>
<![CDATA[Gets the entry value for the specified key, searching for it in the local and global contents
@@ -89,4 +115,35 @@
<function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
<function-signature>java.lang.String scripts()</function-signature>
</function>
+ <function>
+ <name>beginSortList</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>void beginSortList()</function-signature>
+ </function>
+ <function>
+ <name>addSortListItem</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>void addSortListItem(java.lang.String)</function-signature>
+ </function>
+ <function>
+ <name>endSortList</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>java.util.List endSortList(java.lang.String)</function-signature>
+ </function>
+ <function>
+ <name>addEditMessageInfo</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>net.sourceforge.openutils.mgnlcontextmenu.el.ElementInfo
+ addEditMessageInfo(java.lang.String, java.lang.String, java.lang.String)</function-signature>
+ </function>
+ <function>
+ <name>editMessageInfos</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>java.util.List editMessageInfos()</function-signature>
+ </function>
+ <function>
+ <name>editMessageInfosJs</name>
+ <function-class>net.sourceforge.openutils.mgnlcontextmenu.el.ContextMenuElFunctions</function-class>
+ <function-signature>java.lang.String editMessageInfosJs()</function-signature>
+ </function>
</taglib>
\ No newline at end of file
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap/contextmenu-nooverwrite/config.server.filters.servlets.SetPropertyServlet.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap/contextmenu-nooverwrite/config.server.filters.servlets.SetPropertyServlet.xml (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap/contextmenu-nooverwrite/config.server.filters.servlets.SetPropertyServlet.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sv:node sv:name="SetPropertyServlet" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>87516f73-b4d9-40e4-93fc-9012f4381c4b</sv:value>
+ </sv:property>
+ <sv:property sv:name="class" sv:type="String">
+ <sv:value>info.magnolia.cms.filters.ServletDispatchingFilter</sv:value>
+ </sv:property>
+ <sv:property sv:name="enabled" sv:type="Boolean">
+ <sv:value>true</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="servletClass" sv:type="String">
+ <sv:value>net.sourceforge.openutils.mgnlcontextmenu.servlet.SetPropertyServlet</sv:value>
+ </sv:property>
+ <sv:property sv:name="servletName" sv:type="String">
+ <sv:value>SetPropertyServlet</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2008-11-06T12:35:47.671+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2009-12-16T17:14:54.990+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:title" sv:type="String">
+ <sv:value/>
+ </sv:property>
+ </sv:node>
+ <sv:node sv:name="mappings">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>9428a424-1007-403e-b299-a6d1b66d306c</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2008-11-06T12:35:47.671+01:00</sv:value>
+ </sv:property>
+ </sv:node>
+ <sv:node sv:name="-mgnl-set-property">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>058dc477-a183-4817-8e93-0fbb8332377c</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="pattern" sv:type="String">
+ <sv:value>/mgnl-set-property</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2008-11-06T12:35:47.671+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2009-12-16T17:13:46.193+01:00</sv:value>
+ </sv:property>
+ </sv:node>
+ </sv:node>
+ </sv:node>
+ <sv:node sv:name="parameters">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>11433323-def8-4bab-a5b9-28c18b2fc9d9</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2013-09-16T22:51:36.579+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T22:56:08.123+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+ </sv:node>
+</sv:node>
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.contextMenus.samples-form-label.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.contextMenus.samples-form-label.xml 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.contextMenus.samples-form-label.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -117,7 +117,7 @@
</sv:property>
</sv:node>
</sv:node>
- <sv:node sv:name="hint">
+ <sv:node sv:name="help">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
</sv:property>
@@ -134,13 +134,13 @@
<sv:value>true</sv:value>
</sv:property>
<sv:property sv:name="icon" sv:type="String">
- <sv:value>/docroot/samples-contextmenu/ico16-form-hint.png</sv:value>
+ <sv:value>/docroot/samples-contextmenu/ico16-form-help.png</sv:value>
</sv:property>
<sv:property sv:name="jcr:createdBy" sv:type="String">
<sv:value>admin</sv:value>
</sv:property>
<sv:property sv:name="text" sv:type="String">
- <sv:value>Edit hint</sv:value>
+ <sv:value>Edit help</sv:value>
</sv:property>
<sv:node sv:name="MetaData">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-form.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-form.xml 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-form.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -155,7 +155,7 @@
<sv:value>String</sv:value>
</sv:property>
<sv:property sv:name="value" sv:type="String">
- <sv:value>Field labels and hints are editable via context menu: just right click on the label of a form field.</sv:value>
+ <sv:value>Field labels and helps are editable via context menu: just right click on the label of a form field.</sv:value>
</sv:property>
<sv:node sv:name="MetaData">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-move-fields.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-move-fields.xml (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.dialogs.samples-contextmenu-move-fields.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sv:node sv:name="samples-contextmenu-move-fields" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>0dbd4630-67ef-45ed-9f90-a1c4868b7cfd</sv:value>
+ </sv:property>
+ <sv:property sv:name="i18nBasename" sv:type="String">
+ <sv:value>net.sourceforge.openutils.mgnltestwebapp.lang.messages</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:Data" sv:type="String">
+ <sv:value>MetaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activatorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="String">
+ <sv:value>2004-11-02T15:34:43.213+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastaction" sv:type="Date">
+ <sv:value>2008-04-28T23:43:10.557+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:48:42.477+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:title" sv:type="String">
+ <sv:value/>
+ </sv:property>
+ </sv:node>
+ <sv:node sv:name="tabForm">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>6d09ffbd-d685-4824-b3dc-83606843a038</sv:value>
+ </sv:property>
+ <sv:property sv:name="controlType" sv:type="String">
+ <sv:value>tab</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="label" sv:type="String">
+ <sv:value>Form</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:Data" sv:type="String">
+ <sv:value>MetaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activatorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="String">
+ <sv:value>2004-11-02T15:34:29.217+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastaction" sv:type="Date">
+ <sv:value>2008-06-19T14:49:08.436+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:48:34.242+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+ <sv:node sv:name="dummy">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>e385ff62-22d7-4645-ab1c-2e56496767a2</sv:value>
+ </sv:property>
+ <sv:property sv:name="controlType" sv:type="String">
+ <sv:value>hidden</sv:value>
+ </sv:property>
+ <sv:property sv:name="defaultValue" sv:type="String">
+ <sv:value>.</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="type" sv:type="String">
+ <sv:value>String</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:Data" sv:type="String">
+ <sv:value>MetaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activatorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="String">
+ <sv:value>2004-11-02T15:34:29.357+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastaction" sv:type="Date">
+ <sv:value>2008-07-07T14:56:33.437+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:48:34.242+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+ </sv:node>
+ <sv:node sv:name="description">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>b4551617-bc5f-4f74-bfe5-0f088b00a3ac</sv:value>
+ </sv:property>
+ <sv:property sv:name="controlType" sv:type="String">
+ <sv:value>static</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="type" sv:type="String">
+ <sv:value>String</sv:value>
+ </sv:property>
+ <sv:property sv:name="value" sv:type="String">
+ <sv:value>Field position via context menu: just right click on the label of a form field.</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:Data" sv:type="String">
+ <sv:value>MetaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activatorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="String">
+ <sv:value>2004-11-02T15:34:29.357+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastaction" sv:type="Date">
+ <sv:value>2008-07-07T14:56:33.437+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:49:11.424+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+ </sv:node>
+ </sv:node>
+</sv:node>
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-form.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-form.xml 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-form.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -10,7 +10,7 @@
<sv:value>9c276214-2a48-4113-aa4f-653ac07854cb</sv:value>
</sv:property>
<sv:property sv:name="description" sv:type="String">
- <sv:value>Sample paragraph showing a form where field labels and hints can be edited via context menu on labels.</sv:value>
+ <sv:value>Sample paragraph showing a form where field labels and helps can be edited via context menu on labels.</sv:value>
</sv:property>
<sv:property sv:name="dialog" sv:type="String">
<sv:value>contextmenu:samples-contextmenu-form</sv:value>
Added: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-move-fields.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-move-fields.xml (rev 0)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.components.samples-contextmenu-move-fields.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sv:node sv:name="samples-contextmenu-move-fields" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>3e2e98d0-9f7b-4a40-87d5-9ce58bfbffef</sv:value>
+ </sv:property>
+ <sv:property sv:name="description" sv:type="String">
+ <sv:value>Sample paragraph showing fields moved via context menu.</sv:value>
+ </sv:property>
+ <sv:property sv:name="dialog" sv:type="String">
+ <sv:value>contextmenu:samples-contextmenu-move-fields</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="renderType" sv:type="String">
+ <sv:value>jsp</sv:value>
+ </sv:property>
+ <sv:property sv:name="templateScript" sv:type="String">
+ <sv:value>/templates/samples-contextmenu/paragraph-move-fields.jsp</sv:value>
+ </sv:property>
+ <sv:property sv:name="title" sv:type="String">
+ <sv:value>Move fields sample (jsp)</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2008-09-25T12:45:26.721+02:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:44:14.391+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+</sv:node>
Modified: magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.pages.contextmenu-template-freemarker.xml
===================================================================
--- magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.pages.contextmenu-template-freemarker.xml 2013-09-16 10:55:46 UTC (rev 4315)
+++ magnoliamodules/trunk/openutils-mgnlcontextmenu/src/main/resources/mgnl-bootstrap-samples/contextmenu/config.modules.contextmenu.templates.pages.contextmenu-template-freemarker.xml 2013-09-16 23:33:31 UTC (rev 4316)
@@ -257,6 +257,43 @@
</sv:property>
</sv:node>
</sv:node>
+ <sv:node sv:name="samples-contextmenu-move-fields">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:contentNode</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true">
+ <sv:value>mix:lockable</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:uuid" sv:type="String">
+ <sv:value>b27daf20-3a65-4822-a317-8dc6f9a92c76</sv:value>
+ </sv:property>
+ <sv:property sv:name="id" sv:type="String">
+ <sv:value>contextmenu:components/samples-contextmenu-move-fields</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:node sv:name="MetaData">
+ <sv:property sv:name="jcr:primaryType" sv:type="Name">
+ <sv:value>mgnl:metaData</sv:value>
+ </sv:property>
+ <sv:property sv:name="jcr:createdBy" sv:type="String">
+ <sv:value>admin</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:activated" sv:type="Boolean">
+ <sv:value>false</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:authorid" sv:type="String">
+ <sv:value>superuser</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:creationdate" sv:type="Date">
+ <sv:value>2012-03-21T07:32:14.200+01:00</sv:value>
+ </sv:property>
+ <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
+ <sv:value>2013-09-16T23:46:11.009+02:00</sv:value>
+ </sv:property>
+ </sv:node>
+ </sv:node>
<sv:node sv:name="samples-contextmenu-message-freemarker">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
Modified: magnoliamodules/trunk/openutils-...
[truncated message content] |