From: <die...@us...> - 2012-03-20 18:08:13
|
Revision: 3857 http://openutils.svn.sourceforge.net/openutils/?rev=3857&view=rev Author: diego_schivo Date: 2012-03-20 18:08:02 +0000 (Tue, 20 Mar 2012) Log Message: ----------- openutils-mgnlcontrols components Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/GridColumnTypeManager.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/META-INF/magnolia/controls.xml Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/GridColumnTypeManager.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/GridColumnTypeManager.java 2012-03-20 18:07:25 UTC (rev 3856) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/GridColumnTypeManager.java 2012-03-20 18:08:02 UTC (rev 3857) @@ -30,6 +30,8 @@ import java.util.Iterator; import java.util.Map; +import javax.inject.Singleton; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,6 +41,7 @@ * @author dschivo * @version $Id$ */ +@Singleton public class GridColumnTypeManager extends ObservedManager { Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/META-INF/magnolia/controls.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/META-INF/magnolia/controls.xml 2012-03-20 18:07:25 UTC (rev 3856) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/META-INF/magnolia/controls.xml 2012-03-20 18:08:02 UTC (rev 3857) @@ -7,6 +7,13 @@ <class>net.sourceforge.openutils.mgnlcontrols.lifecycle.ControlsModule</class> <versionHandler>net.sourceforge.openutils.mgnlcontrols.setup.ControlsModuleVersionHandler</versionHandler> <version>${project.version}</version> + <components> + <id>main</id> + <component> + <type>net.sourceforge.openutils.mgnlcontrols.configuration.GridColumnTypeManager</type> + <implementation>net.sourceforge.openutils.mgnlcontrols.configuration.GridColumnTypeManager</implementation> + </component> + </components> <dependencies> <dependency> <name>adminInterface</name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <df...@us...> - 2012-05-25 15:48:57
|
Revision: 4050 http://openutils.svn.sourceforge.net/openutils/?rev=4050&view=rev Author: dfghi Date: 2012-05-25 15:48:50 +0000 (Fri, 25 May 2012) Log Message: ----------- CONTROLS-47 Extended combobox to prevent value display in some cases. Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2012-05-25 15:47:01 UTC (rev 4049) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/configuration/ComboGridColumnType.java 2012-05-25 15:48:50 UTC (rev 4050) @@ -43,9 +43,20 @@ @Override public String getHeadSnippet() { - return "<script type=\"text/javascript\" src=\"" - + MgnlContext.getContextPath() - + "/.resources/controls/js/PipeComboBox.js\"></script>"; + StringBuilder result = new StringBuilder(super.getHeadSnippet()); + result.append("<script type=\"text/javascript\" src=\""); + result.append(MgnlContext.getContextPath()); + result.append("/.resources/controls/js/PipeComboBox.js\"></script>"); + // Combobox must be patched because of a bug. For reference, see: + // http://www.sencha.com/forum/showthread.php?17465-1.1.1-Local-ComboBox-data-store-filter-not-cleared-on-call-to-setValue%28%29 + result.append("var PatchedComboBox = Ext.extend(Ext.form.ComboBox, {"); + result.append(" setValue: function(v) {"); + result.append(" this.store.clearFilter();"); + result.append(" PatchedComboBox.superclass.setValue.call(this, v);"); + result.append(" }"); + result.append("});\n"); + result.append("</script>"); + return result.toString(); } /** @@ -89,7 +100,7 @@ column.put( "editor", "(function() { window.gridComboColumnTypeTmp = new " - + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "fm.ComboBox") + + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "PatchedComboBox") + "({" + StringUtils.join(options, ",") + "}); return new Ed(gridComboColumnTypeTmp); })()"); @@ -103,7 +114,7 @@ else { column.put("editor", "new Ed(new " - + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "fm.ComboBox") + + ("true".equals(String.valueOf(colMap.get("pipe"))) ? "PipeComboBox" : "PatchedComboBox") + "({" + StringUtils.join(options, ",") + "}))"); Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js 2012-05-25 15:47:01 UTC (rev 4049) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-resources/controls/js/PipeComboBox.js 2012-05-25 15:48:50 UTC (rev 4050) @@ -4,7 +4,14 @@ var v = PipeComboBox.superclass.getValue.call(this); return this.lastSelectionText + '|' + v; }, - + + // Combobox must be patched because of a bug. For reference, see: + // http://www.sencha.com/forum/showthread.php?17465-1.1.1-Local-ComboBox-data-store-filter-not-cleared-on-call-to-setValue%28%29 + setValue: function(v) { + this.store.clearFilter(); + PipeComboBox.superclass.setValue.call(this, v); + }, + findRecord : function(prop, value) { return PipeComboBox.superclass.findRecord.call(this, prop, value.replace(/^.*\|(.*)$/, '$1')); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 13:38:09
|
Revision: 4254 http://openutils.svn.sourceforge.net/openutils/?rev=4254&view=rev Author: diego_schivo Date: 2013-06-14 13:38:05 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 config.modules.controls.controls.dependentSelectList.xml Added Paths: ----------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListSaveHandler.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectList.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,194 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.dialog; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.gui.dialog.DialogControl; +import info.magnolia.cms.util.NodeDataUtil; +import info.magnolia.objectfactory.Classes; +import info.magnolia.objectfactory.MgnlInstantiationException; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; + +import org.apache.commons.lang.StringUtils; + + +/** + * @author diego + */ +public class DialogDependentSelectList extends ConfigurableFreemarkerDialog +{ + + private SelectOptionsProvider selectOptionsProvider; + + private List<String> treePathValues; + + private List<Map<String, String>> selectOptionsList; + + private Boolean leaf; + + /** + * Returns the selectOptionsProvider. + * @return the selectOptionsProvider + */ + public SelectOptionsProvider getSelectOptionsProvider() + { + if (selectOptionsProvider == null) + { + String className = getConfigValue("selectOptionsProvider"); + if (StringUtils.isNotEmpty(className)) + { + try + { + selectOptionsProvider = Classes.newInstance(className); + } + catch (MgnlInstantiationException e) + { + log.error("can't create select options provider", e); + } + catch (ClassNotFoundException e) + { + log.error("can't create select options provider", e); + } + } + } + return selectOptionsProvider; + } + + /** + * Returns the treePathValues. + * @return the treePathValues + */ + public List<String> getTreePathValues() + { + if (treePathValues == null) + { + treePathValues = new ArrayList<String>(); + if (StringUtils.isEmpty(getRequest().getParameter("dependentSelectListCK"))) + { + if (getStorageNode() != null) + { + String treePathValue; + while (!StringUtils.isEmpty(treePathValue = NodeDataUtil.getString(getStorageNode(), getName() + + "Select" + + treePathValues.size()))) + { + treePathValues.add(treePathValue); + } + } + } + else + { + String treePathValue; + while (!StringUtils.isEmpty(treePathValue = getRequest().getParameter( + getName() + "Select" + treePathValues.size()))) + { + treePathValues.add(treePathValue); + } + } + } + return treePathValues; + } + + /** + * Returns the selectOptionsList. + * @return the selectOptionsList + */ + public List<Map<String, String>> getSelectOptionsList() + { + if (selectOptionsList == null) + { + selectOptionsList = new ArrayList<Map<String, String>>(); + leaf = Boolean.FALSE; + int length = getTreePathValues().size(); + for (int i = 0; i <= length; i++) + { + Map<String, String> options = getSelectOptionsProvider().getSelectOptions( + getTreePathValues().subList(0, i).toArray(new String[i]), + this); + if (options.isEmpty()) + { + leaf = Boolean.TRUE; + break; + } + selectOptionsList.add(options); + } + } + return selectOptionsList; + } + + /** + * Returns the leaf. + * @return the leaf + */ + public Boolean getLeaf() + { + if (leaf == null) + { + getSelectOptionsList(); + } + return leaf; + } + + /** + * {@inheritDoc} + */ + @Override + protected String getPath() + { + return "dialogs/dependentSelectList.ftl"; + } + + /** + * {@inheritDoc} + */ + @Override + public void init(HttpServletRequest request, HttpServletResponse response, Content websiteNode, Content configNode) + throws RepositoryException + { + super.init(request, response, websiteNode, configNode); + } + + /** + * {@inheritDoc} + */ + @Override + protected void addToParameters(Map<String, Object> parameters) + { + super.addToParameters(parameters); + parameters.put("treePathValues", getTreePathValues()); + parameters.put("selectOptionsList", getSelectOptionsList()); + parameters.put("leaf", getLeaf()); + } + + public interface SelectOptionsProvider + { + + public Map<String, String> getSelectOptions(String[] treePathValues, DialogControl dialogControl); + } +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,132 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.dialog; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.gui.dialog.DialogControl; + +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; + + +/** + * @author diego + */ +public class DialogDependentSelectListAndRadioGroup extends ConfigurableFreemarkerDialog +{ + + private DialogDependentSelectList dependentSelectList; + + private DialogRadioGroup radioGroup; + + /** + * + */ + public DialogDependentSelectListAndRadioGroup() + { + } + + /** + * Returns the dependentSelectList. + * @return the dependentSelectList + */ + public DialogDependentSelectList getDependentSelectList() + { + if (dependentSelectList == null) + { + dependentSelectList = new DialogDependentSelectList(); + } + return dependentSelectList; + } + + /** + * Returns the radioGroup. + * @return the radioGroup + */ + public DialogRadioGroup getRadioGroup() + { + if (radioGroup == null) + { + radioGroup = new DialogRadioGroup() + { + + /** + * {@inheritDoc} + */ + @Override + protected DialogControl getThisDialogControl() + { + return DialogDependentSelectListAndRadioGroup.this; + } + + }; + } + return radioGroup; + } + + /** + * {@inheritDoc} + */ + @Override + public void setName(String s) + { + super.setName(s); + getDependentSelectList().setName(s); + getRadioGroup().setName(s); + } + + /** + * {@inheritDoc} + */ + @Override + protected String getPath() + { + return "dialogs/dependentSelectListAndRadioGroup.ftl"; + } + + /** + * {@inheritDoc} + */ + @Override + public void init(HttpServletRequest request, HttpServletResponse response, Content websiteNode, Content configNode) + throws RepositoryException + { + super.init(request, response, websiteNode, configNode); + getDependentSelectList().init(request, response, websiteNode, configNode); + getRadioGroup().init(request, response, websiteNode, configNode); + } + + /** + * {@inheritDoc} + */ + @Override + protected void addToParameters(Map<String, Object> parameters) + { + super.addToParameters(parameters); + getDependentSelectList().addToParameters(parameters); + getRadioGroup().addToParameters(parameters); + } + +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListSaveHandler.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListSaveHandler.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListSaveHandler.java 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,59 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.dialog; + +import info.magnolia.cms.beans.runtime.MultipartForm; +import info.magnolia.cms.core.Content; +import info.magnolia.cms.security.AccessDeniedException; +import info.magnolia.cms.util.NodeDataUtil; +import info.magnolia.module.admininterface.FieldSaveHandler; + +import javax.jcr.RepositoryException; + +import org.apache.commons.lang.StringUtils; + + +/** + * @author diego + */ +public class DialogDependentSelectListSaveHandler implements FieldSaveHandler +{ + + /** + * {@inheritDoc} + */ + public void save(Content parentNode, Content configNode, String name, MultipartForm form, int type, int valueType, + int isRichEditValue, int encoding) throws RepositoryException, AccessDeniedException + { + String selectName, selectValue; + int i = 0; + while (!StringUtils.isEmpty(selectValue = form.getParameter(selectName = name + "Select" + i++))) + { + NodeDataUtil.getOrCreateAndSet(parentNode, selectName, selectValue); + } + while (parentNode.hasNodeData(selectName)) + { + parentNode.deleteNodeData(selectName); + selectName = name + "Select" + i++; + } + NodeDataUtil.getOrCreateAndSet(parentNode, name, form.getParameter(name)); + } + +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListSaveHandler.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,128 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.dialog; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.gui.dialog.DialogControl; +import info.magnolia.objectfactory.Classes; +import info.magnolia.objectfactory.MgnlInstantiationException; + +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; + +import org.apache.commons.lang.StringUtils; + + +/** + * @author diego + */ +public class DialogRadioGroup extends ConfigurableFreemarkerDialog +{ + + private RadioOptionsProvider radioOptionsProvider; + + private Map<String, String> radioOptions; + + /** + * Returns the radioOptionsProvider. + * @return the radioOptionsProvider + */ + public RadioOptionsProvider getRadioOptionsProvider() + { + if (radioOptionsProvider == null) + { + String className = getConfigValue("radioOptionsProvider"); + if (StringUtils.isNotEmpty(className)) + { + try + { + radioOptionsProvider = Classes.newInstance(className); + } + catch (MgnlInstantiationException e) + { + log.error("can't create radio options provider", e); + } + catch (ClassNotFoundException e) + { + log.error("can't create radio options provider", e); + } + } + } + return radioOptionsProvider; + } + + /** + * Returns the radioOptions. + * @return the radioOptions + */ + public Map<String, String> getRadioOptions() + { + if (radioOptions == null) + { + radioOptions = getRadioOptionsProvider().getRadioOptions(getThisDialogControl()); + } + return radioOptions; + } + + /** + * {@inheritDoc} + */ + @Override + protected String getPath() + { + return "dialogs/radioGroup.ftl"; + } + + protected DialogControl getThisDialogControl() + { + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public void init(HttpServletRequest request, HttpServletResponse response, Content websiteNode, Content configNode) + throws RepositoryException + { + super.init(request, response, websiteNode, configNode); + } + + /** + * {@inheritDoc} + */ + @Override + protected void addToParameters(Map<String, Object> parameters) + { + super.addToParameters(parameters); + parameters.put("radioOptions", getRadioOptions()); + } + + public interface RadioOptionsProvider + { + + public Map<String, String> getRadioOptions(DialogControl dialogControl); + } +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,35 @@ +[#list selectOptionsList as options] +[#assign paramSelect]${name}Select${options_index}[/#assign] +<select style="width:100%;" class="mgnlDialogControlSelect" id="${paramSelect}" name="${paramSelect}"> + <option value="">- select -</option> + [#list options?keys as key] + <option value="${key?html!}"[#if key = request.getParameter(paramSelect)!] selected="selected"[/#if]>${options[key]!}</option> + [/#list] +</select> +[/#list] +[#assign refresh = request.getParameter("dependentSelectListCK")?has_content] +[#if !refresh] +<input type="hidden" name="${name}" value="${value?html}" /> +<script type="text/javascript"> +(function($){ + function init(){ + var dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); + var selects = dialogBoxInput.find('select[name!="${name}"]'); + selects.change(function(){ + var $this = $(this); + var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste").add(selects); + $.get($("#mgnlFormMain").attr("action"), data.serialize() + "&dependentSelectListCK=" + new Date().getTime(), function(data){ + $(data).find('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput").replaceAll(dialogBoxInput); + init(); + }); + }); + } + + $(function(){ + init(); + }); +})(jQuery); +</script> +[#else] +<input type="hidden" name="${name}" value="[#if leaf]${request.getParameter(paramSelect)?html!}[/#if]" /> +[/#if] Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,41 @@ +[#list selectOptionsList as options] +[#assign paramSelect]${name}Select${options_index}[/#assign] +<select style="width:100%;" class="mgnlDialogControlSelect" id="${paramSelect}" name="${paramSelect}"> + <option value="">- select -</option> + [#list options?keys as key] + <option value="${key?html!}"[#if key = treePathValues[options_index]!] selected="selected"[/#if]>${options[key]!}</option> + [/#list] +</select> +[/#list] +[#assign refresh = request.getParameter("dependentSelectListCK")?has_content] +[#assign found = false] +[#list radioOptions?keys as key] + [#assign checked = (!refresh && key = value!) || (refresh && key = request.getParameter(name)!)] + [#assign found = found || checked] +<input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if checked] checked="checked"[/#if] />${radioOptions[key]!}<br /> +[/#list] +[#if !refresh] + [#if !found] +<input type="hidden" name="${name}" value="${value?html}" /> + [/#if] +<script type="text/javascript"> +(function($){ + function init(){ + var dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); + var selects = dialogBoxInput.find('select[name!="${name}"]'); + selects.change(function(){ + var $this = $(this); + var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste").add(selects); + $.get($("#mgnlFormMain").attr("action"), data.serialize() + "&dependentSelectListCK=" + new Date().getTime(), function(data){ + $(data).find('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput").replaceAll(dialogBoxInput); + init(); + }); + }); + } + + $(function(){ + init(); + }); +})(jQuery); +</script> +[/#if] Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,3 @@ +[#list radioOptions?keys as key] +<input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if key = value!] checked="checked"[/#if] />${radioOptions[key]!}<br /> +[/#list] Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectList.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectList.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectList.xml 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="dependentSelectList" 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>46b21a36-f8c2-4193-b23e-17f06de93932</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectList</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T15:32:49.701+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectList.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="dialogDependentSelectListAndRadioGroup" 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>9c9b6148-f018-49f9-b674-102b1f4318eb</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListAndRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T15:33:36.393+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml 2013-06-14 13:38:05 UTC (rev 4254) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="dialogRadioGroup" 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>6c13516f-7746-4c0f-8bee-a2a463816e4e</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T15:33:15.234+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 14:05:31
|
Revision: 4257 http://openutils.svn.sourceforge.net/openutils/?rev=4257&view=rev Author: diego_schivo Date: 2013-06-14 14:05:21 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 website.sample-controls.xml Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java 2013-06-14 14:00:34 UTC (rev 4256) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectList.java 2013-06-14 14:05:21 UTC (rev 4257) @@ -33,8 +33,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; - import org.apache.commons.lang.StringUtils; @@ -172,6 +170,12 @@ throws RepositoryException { super.init(request, response, websiteNode, configNode); + if (StringUtils.isEmpty(getConfigValue("saveHandler"))) + { + setConfig( + "saveHandler", + "net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListSaveHandler"); + } } /** Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl 2013-06-14 14:00:34 UTC (rev 4256) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl 2013-06-14 14:05:21 UTC (rev 4257) @@ -3,7 +3,7 @@ <select style="width:100%;" class="mgnlDialogControlSelect" id="${paramSelect}" name="${paramSelect}"> <option value="">- select -</option> [#list options?keys as key] - <option value="${key?html!}"[#if key = request.getParameter(paramSelect)!] selected="selected"[/#if]>${options[key]!}</option> + <option value="${key?html!}"[#if key = treePathValues[options_index]!] selected="selected"[/#if]>${options[key]!}</option> [/#list] </select> [/#list] Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-06-14 14:00:34 UTC (rev 4256) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-06-14 14:05:21 UTC (rev 4257) @@ -29,7 +29,7 @@ <sv:value>2010-05-11T18:45:03.281+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T15:14:54.258+02:00</sv:value> + <sv:value>2013-06-14T16:02:47.597+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:template" sv:type="String"> <sv:value>controls:pages/sampleControls</sv:value> @@ -62,7 +62,7 @@ <sv:value>2010-05-11T18:55:40.453+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T14:55:50.194+02:00</sv:value> + <sv:value>2013-06-14T16:02:47.597+02:00</sv:value> </sv:property> </sv:node> <sv:node sv:name="0"> @@ -221,5 +221,54 @@ </sv:node> </sv:node> </sv:node> + <sv:node sv:name="00"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:component</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>2f0eb337-36c7-4dc6-bdd8-4a904834d038</sv:value> + </sv:property> + <sv:property sv:name="foo" sv:type="String"> + <sv:value>46b21a36-f8c2-4193-b23e-17f06de93932</sv:value> + </sv:property> + <sv:property sv:name="fooSelect0" sv:type="String"> + <sv:value>2f363acf-792e-4e2f-9fdb-6a52853b44f0</sv:value> + </sv:property> + <sv:property sv:name="fooSelect1" sv:type="String"> + <sv:value>ea1cf7df-1bcf-4b47-b7bc-f4403daa50e6</sv:value> + </sv:property> + <sv:property sv:name="fooSelect2" sv:type="String"> + <sv:value>9d29a284-9502-43a8-beba-c57fac3b462f</sv:value> + </sv:property> + <sv:property sv:name="fooSelect3" sv:type="String"> + <sv:value>46b21a36-f8c2-4193-b23e-17f06de93932</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>superuser</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>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="Date"> + <sv:value>2013-06-14T16:00:43.989+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T16:02:47.596+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>controls:components/samples-dependentSelectList</sv:value> + </sv:property> + </sv:node> + </sv:node> </sv:node> </sv:node> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 14:47:19
|
Revision: 4259 http://openutils.svn.sourceforge.net/openutils/?rev=4259&view=rev Author: diego_schivo Date: 2013-06-14 14:47:15 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 SampleRadioOptionsProvider.java Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml Added Paths: ----------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectListAndRadioGroup.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.radioGroup.xml Removed Paths: ------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogDependentSelectListAndRadioGroup.java 2013-06-14 14:47:15 UTC (rev 4259) @@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; +import org.apache.commons.lang.StringUtils; /** @@ -116,6 +116,12 @@ super.init(request, response, websiteNode, configNode); getDependentSelectList().init(request, response, websiteNode, configNode); getRadioGroup().init(request, response, websiteNode, configNode); + if (StringUtils.isEmpty(getConfigValue("saveHandler"))) + { + setConfig( + "saveHandler", + "net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListSaveHandler"); + } } /** Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 14:47:15 UTC (rev 4259) @@ -0,0 +1,61 @@ +package net.sourceforge.openutils.mgnlcontrols.samples; + +import info.magnolia.cms.gui.dialog.DialogControl; +import info.magnolia.context.MgnlContext; +import info.magnolia.jcr.util.NodeUtil; + +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.jcr.LoginException; +import javax.jcr.Node; +import javax.jcr.RepositoryException; + +import net.sourceforge.openutils.mgnlcontrols.dialog.DialogRadioGroup; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author diego + * @version $Id: $ + */ +public class SampleRadioOptionsProvider implements DialogRadioGroup.RadioOptionsProvider +{ + + /** + * Logger. + */ + private static final Logger log = LoggerFactory.getLogger(SampleRadioOptionsProvider.class); + + /** + * {@inheritDoc} + */ + public Map<String, String> getRadioOptions(DialogControl dialogControl) + { + Map<String, String> options = new LinkedHashMap<String, String>(); + try + { + Node parent = MgnlContext.getJCRSession("website").getRootNode(); + for (Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:page").iterator(); iter.hasNext();) + { + Node node = iter.next(); + options.put(node.getIdentifier(), node.getName()); + } + } + catch (LoginException e) + { + // TODO Auto-generated catch block + log.error(e.getMessage(), e); + } + catch (RepositoryException e) + { + // TODO Auto-generated catch block + log.error(e.getMessage(), e); + } + return options; + } + +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-14 14:47:15 UTC (rev 4259) @@ -0,0 +1,62 @@ +package net.sourceforge.openutils.mgnlcontrols.samples; + +import info.magnolia.cms.gui.dialog.DialogControl; +import info.magnolia.jcr.util.NodeUtil; + +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; + +import net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListAndRadioGroup; +import net.sourceforge.openutils.mgnlcontrols.dialog.DialogRadioGroup; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author diego + * @version $Id: $ + */ +public class SampleRadioOptionsProvider2 implements DialogRadioGroup.RadioOptionsProvider +{ + + /** + * Logger. + */ + private static final Logger log = LoggerFactory.getLogger(SampleRadioOptionsProvider2.class); + + /** + * {@inheritDoc} + */ + public Map<String, String> getRadioOptions(DialogControl dialogControl) + { + Map<String, String> options = new LinkedHashMap<String, String>(); + List<String> treePathValues = ((DialogDependentSelectListAndRadioGroup) dialogControl) + .getDependentSelectList() + .getTreePathValues(); + if (!treePathValues.isEmpty()) + { + try + { + Node parent = NodeUtil.getNodeByIdentifier("config", treePathValues.get(treePathValues.size() - 1)); + for (Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:contentNode").iterator(); iter.hasNext();) + { + Node node = iter.next(); + options.put(node.getIdentifier(), node.getName()); + } + } + catch (RepositoryException e) + { + // TODO Auto-generated catch block + log.error(e.getMessage(), e); + } + } + return options; + } + +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java 2013-06-14 14:47:15 UTC (rev 4259) @@ -41,7 +41,7 @@ Node parent = treePathValues.length > 0 ? NodeUtil.getNodeByIdentifier( "config", treePathValues[treePathValues.length - 1]) : MgnlContext.getJCRSession("config").getRootNode(); - for (Iterator<Node> iter = NodeUtil.getNodes(parent).iterator(); iter.hasNext();) + for (Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:content").iterator(); iter.hasNext();) { Node node = iter.next(); options.put(node.getIdentifier(), node.getName()); Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectListAndRadioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectListAndRadioGroup.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectListAndRadioGroup.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="dependentSelectListAndRadioGroup" 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>9c9b6148-f018-49f9-b674-102b1f4318eb</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListAndRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T16:31:38.578+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dependentSelectListAndRadioGroup.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Deleted: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogDependentSelectListAndRadioGroup.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sv:node sv:name="dialogDependentSelectListAndRadioGroup" 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>9c9b6148-f018-49f9-b674-102b1f4318eb</sv:value> - </sv:property> - <sv:property sv:name="class" sv:type="String"> - <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogDependentSelectListAndRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T15:33:36.393+02:00</sv:value> - </sv:property> - </sv:node> -</sv:node> Deleted: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.dialogRadioGroup.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sv:node sv:name="dialogRadioGroup" 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>6c13516f-7746-4c0f-8bee-a2a463816e4e</sv:value> - </sv:property> - <sv:property sv:name="class" sv:type="String"> - <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T15:33:15.234+02:00</sv:value> - </sv:property> - </sv:node> -</sv:node> Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.radioGroup.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.radioGroup.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.radioGroup.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="radioGroup" 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>6c13516f-7746-4c0f-8bee-a2a463816e4e</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogRadioGroup</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T16:31:31.801+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.radioGroup.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -129,5 +129,94 @@ </sv:property> </sv:node> </sv:node> + <sv:node sv:name="bar"> + <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>e70af52a-4bab-4192-94a4-4e54116ac97c</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>radioGroup</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>Bar</sv:value> + </sv:property> + <sv:property sv:name="radioOptionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleRadioOptionsProvider</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>superuser</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-06-14T15:54:03.927+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T16:35:32.392+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + <sv:node sv:name="baz"> + <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>59976845-c52e-487b-9a6d-c3c0a75692f4</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>dependentSelectListAndRadioGroup</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="label" sv:type="String"> + <sv:value>Baz</sv:value> + </sv:property> + <sv:property sv:name="radioOptionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleRadioOptionsProvider2</sv:value> + </sv:property> + <sv:property sv:name="selectOptionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleSelectOptionsProvider</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>superuser</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-06-14T15:54:03.927+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-06-14T16:43:16.185+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> </sv:node> </sv:node> Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-06-14 14:10:18 UTC (rev 4258) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-06-14 14:47:15 UTC (rev 4259) @@ -29,7 +29,7 @@ <sv:value>2010-05-11T18:45:03.281+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T16:02:47.597+02:00</sv:value> + <sv:value>2013-06-14T16:45:39.733+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:template" sv:type="String"> <sv:value>controls:pages/sampleControls</sv:value> @@ -62,7 +62,7 @@ <sv:value>2010-05-11T18:55:40.453+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T16:02:47.597+02:00</sv:value> + <sv:value>2013-06-14T16:45:39.732+02:00</sv:value> </sv:property> </sv:node> <sv:node sv:name="0"> @@ -231,6 +231,21 @@ <sv:property sv:name="jcr:uuid" sv:type="String"> <sv:value>2f0eb337-36c7-4dc6-bdd8-4a904834d038</sv:value> </sv:property> + <sv:property sv:name="bar" sv:type="String"> + <sv:value>1e1df947-3a2b-437c-8e38-d0a03d4c41c0</sv:value> + </sv:property> + <sv:property sv:name="baz" sv:type="String"> + <sv:value>9c9b6148-f018-49f9-b674-102b1f4318eb</sv:value> + </sv:property> + <sv:property sv:name="bazSelect0" sv:type="String"> + <sv:value>2f363acf-792e-4e2f-9fdb-6a52853b44f0</sv:value> + </sv:property> + <sv:property sv:name="bazSelect1" sv:type="String"> + <sv:value>ea1cf7df-1bcf-4b47-b7bc-f4403daa50e6</sv:value> + </sv:property> + <sv:property sv:name="bazSelect2" sv:type="String"> + <sv:value>9d29a284-9502-43a8-beba-c57fac3b462f</sv:value> + </sv:property> <sv:property sv:name="foo" sv:type="String"> <sv:value>46b21a36-f8c2-4193-b23e-17f06de93932</sv:value> </sv:property> @@ -243,9 +258,6 @@ <sv:property sv:name="fooSelect2" sv:type="String"> <sv:value>9d29a284-9502-43a8-beba-c57fac3b462f</sv:value> </sv:property> - <sv:property sv:name="fooSelect3" sv:type="String"> - <sv:value>46b21a36-f8c2-4193-b23e-17f06de93932</sv:value> - </sv:property> <sv:property sv:name="jcr:createdBy" sv:type="String"> <sv:value>superuser</sv:value> </sv:property> @@ -263,7 +275,7 @@ <sv:value>2013-06-14T16:00:43.989+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T16:02:47.596+02:00</sv:value> + <sv:value>2013-06-14T16:45:39.732+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:template" sv:type="String"> <sv:value>controls:components/samples-dependentSelectList</sv:value> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 15:14:09
|
Revision: 4260 http://openutils.svn.sourceforge.net/openutils/?rev=4260&view=rev Author: diego_schivo Date: 2013-06-14 15:14:06 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 RadioOptions Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java 2013-06-14 14:47:15 UTC (rev 4259) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogRadioGroup.java 2013-06-14 15:14:06 UTC (rev 4260) @@ -30,9 +30,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import net.sourceforge.openutils.mgnlcontrols.dialog.ConfigurableFreemarkerDialog; - import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; /** @@ -43,7 +42,7 @@ private RadioOptionsProvider radioOptionsProvider; - private Map<String, String> radioOptions; + private RadioOptions radioOptions; /** * Returns the radioOptionsProvider. @@ -77,11 +76,14 @@ * Returns the radioOptions. * @return the radioOptions */ - public Map<String, String> getRadioOptions() + public RadioOptions getRadioOptions() { if (radioOptions == null) { - radioOptions = getRadioOptionsProvider().getRadioOptions(getThisDialogControl()); + radioOptions = getRadioOptionsProvider().getRadioOptions( + NumberUtils.toInt(getConfigValue("itemsPerPage")), + NumberUtils.toInt(getRequest().getParameter("radioGroupPage"), 1), + getThisDialogControl()); } return radioOptions; } @@ -123,6 +125,51 @@ public interface RadioOptionsProvider { - public Map<String, String> getRadioOptions(DialogControl dialogControl); + public RadioOptions getRadioOptions(int itemsPerPage, int pageNumberStartingFromOne, DialogControl dialogControl); } + + public static class RadioOptions + { + + Map<String, String> items; + + boolean more; + + /** + * Returns the items. + * @return the items + */ + public Map<String, String> getItems() + { + return items; + } + + /** + * Sets the items. + * @param items the items to set + */ + public void setItems(Map<String, String> items) + { + this.items = items; + } + + /** + * Returns the more. + * @return the more + */ + public boolean isMore() + { + return more; + } + + /** + * Sets the more. + * @param more the more to set + */ + public void setMore(boolean more) + { + this.more = more; + } + + } } Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 14:47:15 UTC (rev 4259) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 15:14:06 UTC (rev 4260) @@ -6,9 +6,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; -import java.util.Map; -import javax.jcr.LoginException; import javax.jcr.Node; import javax.jcr.RepositoryException; @@ -33,23 +31,31 @@ /** * {@inheritDoc} */ - public Map<String, String> getRadioOptions(DialogControl dialogControl) + public DialogRadioGroup.RadioOptions getRadioOptions(int itemsPerPage, int pageNumberStartingFromOne, + DialogControl dialogControl) { - Map<String, String> options = new LinkedHashMap<String, String>(); + DialogRadioGroup.RadioOptions options = new DialogRadioGroup.RadioOptions(); + options.setItems(new LinkedHashMap<String, String>()); + options.setMore(false); try { Node parent = MgnlContext.getJCRSession("website").getRootNode(); - for (Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:page").iterator(); iter.hasNext();) + Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:page").iterator(); + int start = itemsPerPage > 0 ? Math.max(pageNumberStartingFromOne - 1, 0) * itemsPerPage : 0; + int i = 0; + while (i < start && iter.hasNext()) { + iter.next(); + i++; + } + int end = itemsPerPage > 0 ? start + itemsPerPage : 0; + while ((end == 0 || i < end) && iter.hasNext()) + { Node node = iter.next(); - options.put(node.getIdentifier(), node.getName()); + options.getItems().put(node.getIdentifier(), node.getName()); } + options.setMore(iter.hasNext()); } - catch (LoginException e) - { - // TODO Auto-generated catch block - log.error(e.getMessage(), e); - } catch (RepositoryException e) { // TODO Auto-generated catch block Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-14 14:47:15 UTC (rev 4259) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-14 15:14:06 UTC (rev 4260) @@ -6,7 +6,6 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import javax.jcr.Node; import javax.jcr.RepositoryException; @@ -33,9 +32,12 @@ /** * {@inheritDoc} */ - public Map<String, String> getRadioOptions(DialogControl dialogControl) + public DialogRadioGroup.RadioOptions getRadioOptions(int itemsPerPage, int pageNumberStartingFromOne, + DialogControl dialogControl) { - Map<String, String> options = new LinkedHashMap<String, String>(); + DialogRadioGroup.RadioOptions options = new DialogRadioGroup.RadioOptions(); + options.setItems(new LinkedHashMap<String, String>()); + options.setMore(false); List<String> treePathValues = ((DialogDependentSelectListAndRadioGroup) dialogControl) .getDependentSelectList() .getTreePathValues(); @@ -44,11 +46,21 @@ try { Node parent = NodeUtil.getNodeByIdentifier("config", treePathValues.get(treePathValues.size() - 1)); - for (Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:contentNode").iterator(); iter.hasNext();) + Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:contentNode").iterator(); + int start = itemsPerPage > 0 ? Math.max(pageNumberStartingFromOne - 1, 0) * itemsPerPage : 0; + int i = 0; + while (i < start && iter.hasNext()) { + iter.next(); + i++; + } + int end = itemsPerPage > 0 ? start + itemsPerPage : 0; + while ((end == 0 || i < end) && iter.hasNext()) + { Node node = iter.next(); - options.put(node.getIdentifier(), node.getName()); + options.getItems().put(node.getIdentifier(), node.getName()); } + options.setMore(iter.hasNext()); } catch (RepositoryException e) { Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp 2013-06-14 14:47:15 UTC (rev 4259) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp 2013-06-14 15:14:06 UTC (rev 4260) @@ -3,5 +3,7 @@ xmlns:cmsfn="http://magnolia-cms.com/taglib/templating-components/cmsfn" xmlns:media="http://net.sourceforge.openutils/mgnlMedia" xmlns:mu="mgnlutils"> <jsp:directive.page contentType="text/html; charset=UTF-8" session="false" /> - ${cmsfn:contentByIdentifier(content.foo, "config")} + ${cmsfn:contentByIdentifier(content.foo, "config")}<br /> + ${cmsfn:contentByIdentifier(content.bar, "website")}<br /> + ${cmsfn:contentByIdentifier(content.baz, "config")}<br /> </jsp:root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 15:40:00
|
Revision: 4261 http://openutils.svn.sourceforge.net/openutils/?rev=4261&view=rev Author: diego_schivo Date: 2013-06-14 15:39:57 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 radioGroup.ftl Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 15:14:06 UTC (rev 4260) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 15:39:57 UTC (rev 4261) @@ -53,6 +53,7 @@ { Node node = iter.next(); options.getItems().put(node.getIdentifier(), node.getName()); + i++; } options.setMore(iter.hasNext()); } Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-14 15:14:06 UTC (rev 4260) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-14 15:39:57 UTC (rev 4261) @@ -59,6 +59,7 @@ { Node node = iter.next(); options.getItems().put(node.getIdentifier(), node.getName()); + i++; } options.setMore(iter.hasNext()); } Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl 2013-06-14 15:14:06 UTC (rev 4260) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/radioGroup.ftl 2013-06-14 15:39:57 UTC (rev 4261) @@ -1,3 +1,32 @@ -[#list radioOptions?keys as key] -<input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if key = value!] checked="checked"[/#if] />${radioOptions[key]!}<br /> +[#list radioOptions.items?keys as key] +<input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if key = value!] checked="checked"[/#if] />${radioOptions.items[key]!}<br /> [/#list] +[#if radioOptions.more] +<a href="#" id="${name}More">More</a> +[/#if] +[#assign refresh = request.getParameter("radioGroupCK")?has_content] +[#if !refresh] +<script type="text/javascript"> +(function($){ + var page = 1; + + function init(){ + var dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); + var link = $("a#${name}More"); + link.click(function(e){ + e.preventDefault(); + var $this = $(this); + var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste"); + $.get($("#mgnlFormMain").attr("action"), data.serialize() + "&radioGroupPage=" + (++page) + "&radioGroupCK=" + new Date().getTime(), function(data){ + $(data).find('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput").replaceAll(link); + init(); + }); + }); + } + + $(function(){ + init(); + }); +})(jQuery); +</script> +[/#if] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-06-14 16:09:08
|
Revision: 4263 http://openutils.svn.sourceforge.net/openutils/?rev=4263&view=rev Author: diego_schivo Date: 2013-06-14 16:09:03 +0000 (Fri, 14 Jun 2013) Log Message: ----------- CONTROLS-54 dependentSelectListAndRadioGroup.ftl Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 15:45:04 UTC (rev 4262) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-14 16:09:03 UTC (rev 4263) @@ -39,8 +39,8 @@ options.setMore(false); try { - Node parent = MgnlContext.getJCRSession("website").getRootNode(); - Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:page").iterator(); + Node parent = MgnlContext.getJCRSession("config").getNode("/modules/controls/gridColumnTypes"); + Iterator<Node> iter = NodeUtil.getNodes(parent, "mgnl:contentNode").iterator(); int start = itemsPerPage > 0 ? Math.max(pageNumberStartingFromOne - 1, 0) * itemsPerPage : 0; int i = 0; while (i < start && iter.hasNext()) Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl 2013-06-14 15:45:04 UTC (rev 4262) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectListAndRadioGroup.ftl 2013-06-14 16:09:03 UTC (rev 4263) @@ -1,3 +1,4 @@ +[#assign refresh = request.getParameter("dependentSelectListCK")?has_content] [#list selectOptionsList as options] [#assign paramSelect]${name}Select${options_index}[/#assign] <select style="width:100%;" class="mgnlDialogControlSelect" id="${paramSelect}" name="${paramSelect}"> @@ -7,35 +8,57 @@ [/#list] </select> [/#list] -[#assign refresh = request.getParameter("dependentSelectListCK")?has_content] +<div class="radioGroup"> [#assign found = false] [#list radioOptions.items?keys as key] [#assign checked = (!refresh && key = value!) || (refresh && key = request.getParameter(name)!)] [#assign found = found || checked] -<input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if checked] checked="checked"[/#if] />${radioOptions.items[key]!}<br /> + <input type="radio" id="${name}_${key?html!}" name="${name}" value="${key?html!}"[#if checked] checked="checked"[/#if] />${radioOptions.items[key]!}<br /> [/#list] [#if radioOptions.more] -<a href="#" id="${name}More">More</a> + <a href="#" id="${name}More">More</a> [/#if] [#if !refresh] [#if !found] -<input type="hidden" name="${name}" value="${value?html}" /> + <input type="hidden" name="${name}" value="${value?html}" /> [/#if] +[/#if] +</div> +[#if !refresh] <script type="text/javascript"> (function($){ + var dialogBoxInput; + var selects; + var page = 1; + function init(){ - var dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); - var selects = dialogBoxInput.find('select[name!="${name}"]'); + dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); + selects = dialogBoxInput.find('select[name!="${name}"]'); selects.change(function(){ var $this = $(this); var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste").add(selects); $.get($("#mgnlFormMain").attr("action"), data.serialize() + "&dependentSelectListCK=" + new Date().getTime(), function(data){ $(data).find('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput").replaceAll(dialogBoxInput); + page = 1; init(); }); }); + initRadio(); } + function initRadio(){ + var link = $("a#${name}More"); + link.click(function(e){ + e.preventDefault(); + var $this = $(this); + var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste").add(selects); + $.get($("#mgnlFormMain").attr("action"), data.serialize() + "&radioGroupPage=" + (++page) + "&dependentSelectListCK=" + new Date().getTime(), function(data){ + $(data).find('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput .radioGroup").replaceAll(link); + initRadio(); + }); + }); + } + $(function(){ init(); }); Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml 2013-06-14 15:45:04 UTC (rev 4262) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-dependentSelectList.xml 2013-06-14 16:09:03 UTC (rev 4263) @@ -143,7 +143,7 @@ <sv:value>radioGroup</sv:value> </sv:property> <sv:property sv:name="itemsPerPage" sv:type="String"> - <sv:value>5</sv:value> + <sv:value>4</sv:value> </sv:property> <sv:property sv:name="jcr:createdBy" sv:type="String"> <sv:value>admin</sv:value> @@ -171,7 +171,7 @@ <sv:value>2013-06-14T15:54:03.927+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T17:40:38.218+02:00</sv:value> + <sv:value>2013-06-14T17:48:28.855+02:00</sv:value> </sv:property> </sv:node> </sv:node> @@ -189,7 +189,7 @@ <sv:value>dependentSelectListAndRadioGroup</sv:value> </sv:property> <sv:property sv:name="itemsPerPage" sv:type="String"> - <sv:value>5</sv:value> + <sv:value>4</sv:value> </sv:property> <sv:property sv:name="jcr:createdBy" sv:type="String"> <sv:value>admin</sv:value> @@ -220,7 +220,7 @@ <sv:value>2013-06-14T15:54:03.927+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T17:40:48.550+02:00</sv:value> + <sv:value>2013-06-14T17:48:32.429+02:00</sv:value> </sv:property> </sv:node> </sv:node> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2013-07-05 14:17:01
|
Revision: 4276 http://openutils.svn.sourceforge.net/openutils/?rev=4276&view=rev Author: diego_schivo Date: 2013-07-05 14:16:58 +0000 (Fri, 05 Jul 2013) Log Message: ----------- CONTROLS-55 Button set control Modified Paths: -------------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.pages.sampleControls.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp Added Paths: ----------- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogButtonSet.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleButtonSetOptionsProvider.java magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkbox.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkboxSwitch.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-radio.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-buttonSet.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.components.samples-buttonSet.xml magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-buttonSet.jsp Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogButtonSet.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogButtonSet.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogButtonSet.java 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,257 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.dialog; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.Content; +import info.magnolia.cms.gui.control.Button; +import info.magnolia.cms.gui.control.ControlImpl; +import info.magnolia.cms.util.ContentUtil; +import info.magnolia.cms.util.NodeDataUtil; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.BooleanUtils; +import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; + + +public class DialogButtonSet extends info.magnolia.cms.gui.dialog.DialogButtonSet +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(DialogButtonSet.class); + + private OptionsProvider optionsProvider = new OptionsProvider.DefaultImpl();; + + private boolean initHack; + + @Override + public void init(HttpServletRequest request, HttpServletResponse response, Content websiteNode, Content configNode) + throws RepositoryException + { + // super.init(request, response, websiteNode, configNode); + // String optionsProviderClass = getConfigValue("optionsProvider"); + String optionsProviderClass = NodeDataUtil.getString(configNode, "optionsProvider"); + try + { + optionsProvider = (OptionsProvider) Class.forName(optionsProviderClass).newInstance(); + } + catch (Throwable e) + { + log.error(e.getMessage(), e); + } + initHack = true; + super.init(request, response, websiteNode, configNode); + initHack = false; + } + + @Override + public String getConfigValue(String key, String nullValue) + { + String val = super.getConfigValue(key, nullValue); + if (initHack && StringUtils.equals(key, "selectType") && StringUtils.equals(val, nullValue)) + { + val = StringUtils.removeStart(val, "controls-"); + } + return val; + } + + @Override + public void setOptions(Content configNode, boolean setDefaultSelected) + { + List options = new ArrayList(); + try + { + Iterator<Option> it = optionsProvider.getOptions(this, configNode); + while (it.hasNext()) + { + Option o = it.next(); + Button button = new Button(this.getName(), o.getValue()); + button.setLabel(o.getLabel()); + if (StringUtils.isNotEmpty(o.getIconSrc())) + { + button.setIconSrc(o.getIconSrc()); + } + if (setDefaultSelected && o.isSelected()) + { + button.setState(ControlImpl.BUTTONSTATE_PUSHED); + } + options.add(button); + } + } + catch (Exception e) + { + if (log.isDebugEnabled()) + { + log.debug("Exception caught: " + e.getMessage(), e); + } + } + this.setOptions(options); + } + + public static interface Option + { + + String getValue(); + + String getLabel(); + + String getIconSrc(); + + boolean isSelected(); + + public static class ContentAdapter implements Option + { + + private final Content node; + + private final String valueNodeData; + + private final String labelNodeData; + + public ContentAdapter(Content node, String valueNodeData, String labelNodeData) + { + this.node = node; + this.valueNodeData = valueNodeData; + this.labelNodeData = labelNodeData; + } + + public String getValue() + { + return NodeDataUtil.getString(node, valueNodeData); + } + + public String getLabel() + { + return NodeDataUtil.getString(node, labelNodeData); + } + + public String getIconSrc() + { + return node.getNodeData("iconSrc").getString(); + } + + public boolean isSelected() + { + return node.getNodeData("selected").getBoolean(); + } + } + + public static class MapAdapter implements Option + { + + private final Map map; + + private final String valueNodeData; + + private final String labelNodeData; + + public MapAdapter(Map map, String valueNodeData, String labelNodeData) + { + this.map = map; + this.valueNodeData = valueNodeData; + this.labelNodeData = labelNodeData; + } + + public String getValue() + { + return ObjectUtils.toString(map.get(valueNodeData)); + } + + public String getLabel() + { + return ObjectUtils.toString(map.get(labelNodeData)); + } + + public String getIconSrc() + { + return ObjectUtils.toString(map.get("iconSrc")); + } + + public boolean isSelected() + { + return BooleanUtils.toBoolean(ObjectUtils.toString(map.get("selected"))); + } + } + } + + public interface OptionsProvider + { + + Iterator<Option> getOptions(DialogButtonSet control, Content configNode) throws Exception; + + public static class DefaultImpl implements OptionsProvider + { + + public Iterator<Option> getOptions(final DialogButtonSet control, Content configNode) throws Exception + { + // info.magnolia.cms.gui.dialog.DialogButtonSet.getOptionNodes(Content) + Content optionsNode = null; + + if (configNode.hasContent("options")) + { + optionsNode = configNode.getContent("options"); + } + else + { + String repository = control.getConfigValue("repository", ContentRepository.WEBSITE); + String path = control.getConfigValue("path"); + if (StringUtils.isNotEmpty(path)) + { + optionsNode = ContentUtil.getContent(repository, path); + } + } + + if (optionsNode != null) + { + return Iterators.transform( + ContentUtil.getAllChildren(optionsNode).iterator(), + new Function<Content, Option>() + { + + public Option apply(Content input) + { + return new Option.ContentAdapter(input, control + .getConfigValue("valueNodeData", "value"), control.getConfigValue( + "labelNodeData", + "label")); + } + }); + } + return new ArrayList().iterator(); + } + } + } +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/dialog/DialogButtonSet.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleButtonSetOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleButtonSetOptionsProvider.java (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleButtonSetOptionsProvider.java 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,62 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.samples; + +import info.magnolia.cms.core.Content; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import net.sourceforge.openutils.mgnlcontrols.dialog.DialogButtonSet; +import net.sourceforge.openutils.mgnlcontrols.dialog.DialogButtonSet.Option; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; + + +/** + * @author diego + * @version $Id: $ + */ +public class SampleButtonSetOptionsProvider implements DialogButtonSet.OptionsProvider +{ + + /** + * {@inheritDoc} + */ + public Iterator<Option> getOptions(DialogButtonSet control, Content configNode) throws Exception + { + return Iterators.transform( + Iterators.forArray(new String[]{"foo", "bar", "baz", "qux" }), + new Function<String, Option>() + { + + public Option apply(String input) + { + Map<String, String> map = new HashMap<String, String>(); + map.put("value", input); + map.put("label", input); + return new DialogButtonSet.Option.MapAdapter(map, "value", "label"); + } + }); + } + +} Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleButtonSetOptionsProvider.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider.java 2013-07-05 14:16:58 UTC (rev 4276) @@ -1,3 +1,22 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.samples; import info.magnolia.cms.gui.dialog.DialogControl; Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleRadioOptionsProvider2.java 2013-07-05 14:16:58 UTC (rev 4276) @@ -1,3 +1,22 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.samples; import info.magnolia.cms.gui.dialog.DialogControl; Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/java/net/sourceforge/openutils/mgnlcontrols/samples/SampleSelectOptionsProvider.java 2013-07-05 14:16:58 UTC (rev 4276) @@ -1,3 +1,22 @@ +/** + * + * Controls module for Magnolia CMS (http://www.openmindlab.com/lab/products/controls.html) + * Copyright(C) 2008-2012, 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.mgnlcontrols.samples; import info.magnolia.cms.gui.dialog.DialogControl; Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/dialogs/dependentSelectList.ftl 2013-07-05 14:16:58 UTC (rev 4276) @@ -9,12 +9,16 @@ [/#list] [#assign refresh = request.getParameter("dependentSelectListCK")?has_content] [#if !refresh] -<input type="hidden" name="${name}" value="${value?html}" /> + [#if (configuration['showValue']!false)?string == 'true'] +<input type="text" id="${name}" name="${name}" value="${value?html!}" class="mgnlDialogControlEdit" style="width: 100%;" /> + [#else] +<input type="hidden" id="${name}" name="${name}" value="${value?html!}" /> + [/#if] <script type="text/javascript"> (function($){ function init(){ var dialogBoxInput = $('label[for="${name}"]').closest("tr").find("td.mgnlDialogBoxInput"); - var selects = dialogBoxInput.find('select[name!="${name}"]'); + var selects = dialogBoxInput.find("select"); selects.change(function(){ var $this = $(this); var data = $("#mgnlPath,#mgnlParagraph,#mgnlRepository,#mgnlLocale,#mgnlRichE,#mgnlRichEPaste").add(selects); @@ -31,5 +35,9 @@ })(jQuery); </script> [#else] + [#if (configuration['showValue']!false)?string == 'true'] +<input type="text" id="${name}" name="${name}" value="[#if leaf]${request.getParameter(paramSelect)?html!}[/#if]" class="mgnlDialogControlEdit" style="width: 100%;" /> + [#else] <input type="hidden" name="${name}" value="[#if leaf]${request.getParameter(paramSelect)?html!}[/#if]" /> + [/#if] [/#if] Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkbox.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkbox.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkbox.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="controls-checkbox" 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>5bd47675-b1a3-48b4-9867-76d910fa2fbb</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogButtonSet</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:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T10:20:11.784+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkbox.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkboxSwitch.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkboxSwitch.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkboxSwitch.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="controls-checkboxSwitch" 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>a3649f86-0bcd-4129-b569-f7f3c0c76b1b</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogButtonSet</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T15:42:01.709+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-checkboxSwitch.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-radio.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-radio.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-radio.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="controls-radio" 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>9dba557a-a017-484b-b6c7-9d981f473109</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.dialog.DialogButtonSet</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>2008-06-07T18:15:12.496+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T15:41:54.814+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap/controls/config.modules.controls.controls.controls-radio.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-buttonSet.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-buttonSet.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-buttonSet.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="samples-buttonSet" 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>8978824a-20fa-4a92-b6a6-626fa1c40484</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-07-05T15:43:15.853+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="tabGeneral"> + <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>7361bf6e-9116-4a79-b0e1-7db49c958eaf</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>Button set</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-07-05T15:43:32.975+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="foo"> + <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>0f3c1fb7-02e1-48b3-bcc2-12b66506ba73</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>controls-radio</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>Foo</sv:value> + </sv:property> + <sv:property sv:name="optionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleButtonSetOptionsProvider</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-06-14T15:54:03.927+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T15:52:20.890+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + <sv:node sv:name="bar"> + <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>a890c8a7-eb39-46f7-ab7e-b2d7645b95e9</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>controls-checkbox</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>Bar</sv:value> + </sv:property> + <sv:property sv:name="optionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleButtonSetOptionsProvider</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-06-14T15:54:03.927+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T15:56:11.917+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + <sv:node sv:name="baz"> + <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>92c116a9-4f12-4dee-bd70-d4389115c1ba</sv:value> + </sv:property> + <sv:property sv:name="controlType" sv:type="String"> + <sv:value>controls-checkboxSwitch</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>Baz</sv:value> + </sv:property> + <sv:property sv:name="optionsProvider" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlcontrols.samples.SampleButtonSetOptionsProvider</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-06-14T15:54:03.927+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T15:52:57.016+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.dialogs.samples-buttonSet.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.components.samples-buttonSet.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.components.samples-buttonSet.xml (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.components.samples-buttonSet.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="samples-buttonSet" 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>543774c6-be98-4972-8ca9-7586e3734270</sv:value> + </sv:property> + <sv:property sv:name="description" sv:type="String"> + <sv:value>Sample button set paragraph</sv:value> + </sv:property> + <sv:property sv:name="dialog" sv:type="String"> + <sv:value>controls:samples-buttonSet</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-controls/paragraph-buttonSet.jsp</sv:value> + </sv:property> + <sv:property sv:name="title" sv:type="String"> + <sv:value>Button set sample</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-07-05T15:58:37.273+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.components.samples-buttonSet.xml ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.pages.sampleControls.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.pages.sampleControls.xml 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/config.modules.controls.templates.pages.sampleControls.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -223,6 +223,43 @@ </sv:property> </sv:node> </sv:node> + <sv:node sv:name="samples-buttonSet"> + <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>886ff1df-702d-4e8c-ae28-5968f607d280</sv:value> + </sv:property> + <sv:property sv:name="id" sv:type="String"> + <sv:value>controls:components/samples-buttonSet</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-07-05T15:59:04.740+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> </sv:node> </sv:node> </sv:node> Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-bootstrap-samples/controls/website.sample-controls.xml 2013-07-05 14:16:58 UTC (rev 4276) @@ -29,7 +29,7 @@ <sv:value>2010-05-11T18:45:03.281+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T17:42:42.408+02:00</sv:value> + <sv:value>2013-07-05T16:09:10.430+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:template" sv:type="String"> <sv:value>controls:pages/sampleControls</sv:value> @@ -62,7 +62,7 @@ <sv:value>2010-05-11T18:55:40.453+02:00</sv:value> </sv:property> <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2013-06-14T17:42:42.408+02:00</sv:value> + <sv:value>2013-07-05T16:09:10.430+02:00</sv:value> </sv:property> </sv:node> <sv:node sv:name="0"> @@ -238,14 +238,14 @@ <sv:value/> </sv:property> <sv:property sv:name="jcr:createdBy" sv:type="String"> - <sv:value>superuser</sv:value> + <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>superuser</sv:value> + <sv:value>admin</sv:value> </sv:property> <sv:property sv:name="mgnl:authorid" sv:type="String"> <sv:value>superuser</sv:value> @@ -261,5 +261,42 @@ </sv:property> </sv:node> </sv:node> + <sv:node sv:name="01"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:component</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>97f05bda-d320-42be-b55a-b8f342e4f498</sv:value> + </sv:property> + <sv:property sv:name="baz" sv:type="String"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>superuser</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>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="Date"> + <sv:value>2013-07-05T16:09:10.429+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2013-07-05T16:09:10.430+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:template" sv:type="String"> + <sv:value>controls:components/samples-buttonSet</sv:value> + </sv:property> + </sv:node> + </sv:node> </sv:node> </sv:node> Added: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-buttonSet.jsp =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-buttonSet.jsp (rev 0) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-buttonSet.jsp 2013-07-05 14:16:58 UTC (rev 4276) @@ -0,0 +1,9 @@ +<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" + xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:cms="http://magnolia-cms.com/taglib/templating-components/cms" + xmlns:cmsfn="http://magnolia-cms.com/taglib/templating-components/cmsfn" xmlns:media="http://net.sourceforge.openutils/mgnlMedia" + xmlns:mu="mgnlutils"> + <jsp:directive.page contentType="text/html; charset=UTF-8" session="false" /> + ${!empty(content.foo) ? content.foo : '-'}<br /> + ${!empty(content.bar) ? content.bar : '-'}<br /> + ${!empty(content.baz) ? content.baz : '-'}<br /> +</jsp:root> \ No newline at end of file Property changes on: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-buttonSet.jsp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/xml \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp =================================================================== --- magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp 2013-06-28 15:32:39 UTC (rev 4275) +++ magnoliamodules/trunk/openutils-mgnlcontrols/src/main/resources/mgnl-files/templates/samples-controls/paragraph-dependentSelectList.jsp 2013-07-05 14:16:58 UTC (rev 4276) @@ -3,7 +3,7 @@ xmlns:cmsfn="http://magnolia-cms.com/taglib/templating-components/cmsfn" xmlns:media="http://net.sourceforge.openutils/mgnlMedia" xmlns:mu="mgnlutils"> <jsp:directive.page contentType="text/html; charset=UTF-8" session="false" /> - ${cmsfn:contentByIdentifier(content.foo, "config")}<br /> - ${cmsfn:contentByIdentifier(content.bar, "config")}<br /> - ${cmsfn:contentByIdentifier(content.baz, "config")}<br /> + ${!empty(content.foo) ? cmsfn:contentByIdentifier(content.foo, "config") : '-'}<br /> + ${!empty(content.bar) ? cmsfn:contentByIdentifier(content.bar, "config") : '-'}<br /> + ${!empty(content.baz) ? cmsfn:contentByIdentifier(content.baz, "config") : '-'}<br /> </jsp:root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |