From: <fg...@us...> - 2007-08-13 10:04:09
|
Revision: 397 http://openutils.svn.sourceforge.net/openutils/?rev=397&view=rev Author: fgiust Date: 2007-08-13 03:04:10 -0700 (Mon, 13 Aug 2007) Log Message: ----------- basic documentation Added Paths: ----------- trunk/openutils-mgnlstripes/src/site/ trunk/openutils-mgnlstripes/src/site/apt/ trunk/openutils-mgnlstripes/src/site/apt/index.apt Added: trunk/openutils-mgnlstripes/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlstripes/src/site/apt/index.apt (rev 0) +++ trunk/openutils-mgnlstripes/src/site/apt/index.apt 2007-08-13 10:04:10 UTC (rev 397) @@ -0,0 +1,149 @@ + -------------------------- + openutils-mgnlstripes + -------------------------- + Fabrizio Giustina + -------------------------- + +About + + openutils-mgnlstripes is a custom {{{http://www.magnolia.info}magnolia}} module which integrates the + {{{http://mc4j.org/confluence/display/stripes/Home}Stripes}} MVC framework. + + After installed into magnolia, this module will allow you to use any available Stripes action as a Magnolia paragraph, + Any magically-converted Stripes action will still be able to use any standard Stripes feature, plus it will enjoy the + automatic injection of any paragraph property. + + <<This module requires magnolia 3.1-m3, and will not work on any earlier version!>> + +Configuration + + First of all drop the openutils-mgnlstripes jar and the stripes jar into WEB-INF/lib, or (better) if you are using maven + just declare the following dependency: + ++----------------------------------------------+ + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlstripes</artifactId> + <version>0.1</version> + </dependency> ++----------------------------------------------+ + + Then configure stripes in your web.xml as usual (see {{{http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}}} for this. + + You only need to change the configuration for the stripes <<<ActionResolver.Class>>> in order to use + <<<it.openutils.magnoliastripes.MgnlActionResolver>>>. You can do that by adding/modifying the following init parameter + in WEB.xml: + + ++----------------------------------------------+ + <init-param> + <param-name>ActionResolver.Class</param-name> + <param-value>it.openutils.magnoliastripes.MgnlActionResolver</param-value> + </init-param> ++----------------------------------------------+ + +Usage + + When magnolia and stripes will startup now any auto-discovered stripes action will be configured in order to be used as + a magnolia paragraph. This means that paragraphs will be auto-generated, and they don't need to be configured into jcr. + + You should see a few <<<info>>> logs that enumerates the list of stripes paragraphs configured. By convention the name of + the paragraph is the same name of the Stripes action class minus action and lowercase. + + So <<<it.myapp.web.MyStripesAction >>> will be available as a paragraph named <<<mystripes>>>. + + Before being able to use any paragraph you will need to create a dialog for that. By convention the dialog should have + the same name of the paragraph so, following the previous example, you will need to configure a dialog called <<<mystripes>>>. + + Try to put a property called <<<title>>> in such dialog for a test. + + You are ready to use your paragraph into any magnolia template as usual: + ++----------------------------------------------+ + + <cms:contentNodeIterator contentNodeCollectionName="column"> + <cms:editBar adminOnly="true" /> + <cms:includeTemplate /> + </cms:contentNodeIterator> + <cms:newBar contentNodeCollectionName="column" paragraph="mystripes" adminOnly="true" /> + ++----------------------------------------------+ + + Try to add an instance of the <<<mystripes>>> paragraph. Set the title property to whatever you want, you + will be able to use it in your Stripes action bean. + + The following example show the code for the simple <<<MyStripesAction>>> that prints out the configured title to the log: + ++----------------------------------------------+ +package it.myapp.web; + +import net.sourceforge.stripes.action.ActionBean; +import net.sourceforge.stripes.action.ActionBeanContext; +import net.sourceforge.stripes.action.DefaultHandler; +import net.sourceforge.stripes.action.ForwardResolution; +import net.sourceforge.stripes.action.Resolution; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class MyStripesAction implements ActionBean +{ + + private Logger log = LoggerFactory.getLogger(MyStripesAction.class); + + private String title; + + @Override + public ActionBeanContext getContext() + { + // TODO + return null; + } + + @Override + public void setContext(ActionBeanContext context) + { + // TODO + } + + public void setTitle(String title) + { + this.title = title; + } + + @DefaultHandler + public Resolution show() + { + + log.info("My title is: {}!", title); + + return new ForwardResolution("/templates/paragraphs/anyjsp.jsp"); + } +} ++----------------------------------------------+ + + As you can see, you will be able to mix parameters that you can use in Stripes action with pure content. Note that you + will not need to configure and use any magnolia paragraph property into your action since you can still use also the + standard magnolia tags in the jsp that is rendered by stripes! + + +Todo/improvements + + Warning! This is a preliminary technology-preview release! + + What does this means? Well, that it should work fine, but the integration is not yet complete and there are still some + missing features... be careful for what is know to not to work. + + + This is a list of know todos: + + * Important! reload stripes paragraph when the configuration of other paragraphs in magnolia is changed! At this moment + stripes paragraphs disappear after any change in paragraphs configured into jcr. + + * Handle multipart forms in request wrapper (should be easy to do) + + * A better way of handling multivalued properties in paragraph + + * Handle binary properties in paragraph + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-05 23:08:41
|
Revision: 807 http://openutils.svn.sourceforge.net/openutils/?rev=807&view=rev Author: fgiust Date: 2008-05-05 16:08:04 -0700 (Mon, 05 May 2008) Log Message: ----------- ready for 3.5 Modified Paths: -------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java trunk/openutils-mgnlstripes/src/site/apt/index.apt trunk/openutils-mgnlstripes/src/site/changes/changes.xml Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld Removed Paths: ------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -22,6 +22,10 @@ /** + * <p> + * workaround needed to create a form tag with an "url" attribute different from the actionbean mapped uri. Could be + * solved more cleanly by http://mc4j.org/jira/browse/STS-349, which will be available in stripes 1.5 + * </p> * @author fgiust * @version $Id: $ */ Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind 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 it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author molaschi - * @version $Id: $ - */ -public class ExtendedLabelTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedLabelTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - if (isRequiredField(this.getActionBean(), fieldName)) - { - String cssClass = get("class"); - if (cssClass != null) - { - set("class", cssClass + " required"); - } - else - { - set("class","required"); - } - } - - // Write out the tag - writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind 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 it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author luca boati - * @version $Id$ - */ -public class ExtendedMessagesTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedMessagesTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - // if (isRequiredField(this.getActionBean(), fieldName)) - // { - // String cssClass = get("class"); - // if (cssClass != null) - // { - // set("class", cssClass + " required"); - // } - // else - // { - // set("class", "required"); - // } - // } - - // Write out the tag - // writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - // writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - // set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Added: trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld (rev 0) +++ trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld 2008-05-05 23:08:04 UTC (rev 807) @@ -0,0 +1,198 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + version="2.0"> + <description>mgnlstripes</description> + <display-name>mgnlstripes tags</display-name> + <tlib-version>1.0</tlib-version> + <short-name>mgnlstripes</short-name> + <uri>mgnlstripes</uri> + <tag> + <description> Stripes' HTML form tag. Provides a standard HTML form tag interface, but allows other stripes input + tags to re-populate their values. Also includes a hidden field in the form for the page name that the form is + being rendered on (to allow forwarding to the same page in the case of a validation error. </description> + <display-name>form</display-name> + <name>form</name> + <tag-class>it.openutils.magnoliastripes.tag.ExtendedFormTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> The URL to which this form will post. Expected to be a web-app relative path - the tag will prepend + the context path to any action that begins with a slash and does not already contain the context path. Should + match a URL to which an ActionBean has been bound. Required unless 'beanclass' is provided. </description> + <name>action</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The fully qualified name of an ActionBean class, or alternatively a Class instance for an ActionBean + class. An alternative to the 'action' attribute, the 'beanclass' attribute will generate an action appropriate + for the ActionBean identified. Note that if an "ActionBean" that does not yet exist is identified an exception + will be thrown! </description> + <name>beanclass</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.Object</type> + </attribute> + <attribute> + <description> The name of the form field that should receive focus when the page is loaded. Two special values are + recognized, 'first' and the empty string; these values cause the form to set focus on the first element in the + form. If any value is set, and the form has validation errors, the behaviour is altered and the first field with + validation errors is focused instead. </description> + <name>focus</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.String</type> + </attribute> + <attribute> + <description> A comma separated list of content types that it is acceptable to submit through this form. (HTML + Pass-through) </description> + <name>accept</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> A comma separated list of possible character sets for form data. Will be written to the page as + accept-charset. (HTML Pass-through) </description> + <name>acceptcharset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The mime type used to encode the content of this form. This value will be overridden if one or more + Stripes file input tags is used within the body of the form. </description> + <name>enctype</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The HTTP method used for sending data to the server. Options are GET and POST. Default is GET. (HTML + Pass-through) </description> + <name>method</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The unique name of the form. (HTML Pass-through)</description> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> Where the target URL is to be opened. One of _blank, _self, _parent and _top. (HTML Pass-through) + </description> + <name>target</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the form is reset. (HTML Pass-through)</description> + <name>onreset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run prior to the form being submitted to the server, (HTML Pass-through)</description> + <name>onsubmit</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- Start: Standard HTML attributes --> + <attribute> + <description>The CSS class to be applied to the element. (HTML Pass-through)</description> + <name>class</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Text direction. (HTML Pass-through)</description> + <name>dir</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>A unique identifier for the HTML tag on the pgae. (HTML Pass-through)</description> + <name>id</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The language code of the element. (HTML Pass-through)</description> + <name>lang</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on each mouse click. (HTML Pass-through)</description> + <name>onclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on a double-click of the mouse. (HTML Pass-through)</description> + <name>ondblclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is depressed. (HTML Pass-through)</description> + <name>onkeydown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is pressed and released. (HTML Pass-through)</description> + <name>onkeypress</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is released. (HTML Pass-through)</description> + <name>onkeyup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is depressed. (HTML Pass-through)</description> + <name>onmousedown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer is moved. (HTML Pass-through)</description> + <name>onmousemove</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves out of the element. (HTML Pass-through)</description> + <name>onmouseout</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves over the element. (HTML Pass-through)</description> + <name>onmouseover</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is released. (HTML Pass-through)</description> + <name>onmouseup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Inline CSS style fragment that applies to the element (HTML Pass-through)</description> + <name>style</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Tool-tip text for the element. (HTML Pass-through)</description> + <name>title</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- End: Standard HTML attributes --> + <dynamic-attributes>false</dynamic-attributes> + </tag> +</taglib> \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlstripes/src/site/apt/index.apt 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/site/apt/index.apt 2008-05-05 23:08:04 UTC (rev 807) @@ -13,7 +13,7 @@ Any magically-converted Stripes action will still be able to use any standard Stripes feature, plus it will enjoy the automatic injection of any paragraph property. - <<This module requires magnolia 3.1-m3, and will not work on any earlier version!>> + <<This module requires magnolia 3.5.x, and will not work on any earlier version!>> Configuration @@ -24,12 +24,16 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnlstripes</artifactId> - <version>0.2</version> + <version>3.5</version> </dependency> +----------------------------------------------+ Then configure stripes in your web.xml as usual (see {{{http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}} for this). + <<update: since version 3.5 you don't need to add the Stripes filter to web.xml manually, since this is automatically + configured by the module in config:server/filters. You can add any initialization parameter you may need to the main + magnolia filter in web.xml and it will be inherited by the stripes filter>> + You only need to change the configuration for the stripes <<<ActionResolver.Class>>> in order to use <<<it.openutils.magnoliastripes.MgnlActionResolver>>>. You can do that by adding/modifying the following init parameter in WEB.xml: @@ -130,23 +134,11 @@ Todo/improvements - Warning! This is a preliminary technology-preview release! - - What does this means? Well, that it should work fine, but the integration is not yet complete and there are still some - missing features... be careful for what is know to not to work. - - This is a list of know todos: * Important! reload stripes paragraph when the configuration of other paragraphs in magnolia is changed! At this moment stripes paragraphs disappear after any change in paragraphs configured into jcr. - * Handle multipart forms in request wrapper (should be easy to do) + * Use stripes binding/validation for validation of fields in dialogs - * A better way of handling multivalued properties in paragraph - * Handle binary properties in paragraph - - * Use spring binding/validation for validation of fields in dialogs - - Modified: trunk/openutils-mgnlstripes/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/site/changes/changes.xml 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/site/changes/changes.xml 2008-05-05 23:08:04 UTC (rev 807) @@ -9,18 +9,17 @@ </properties> <body> <release version="3.5" date="2008-04-24" description="3.5"> - <action type="add" dev="fgiust" due-to=""> </action> + <action type="update" dev="fgiust">update deps to magnolia 3.5.4</action> + <action type="update" dev="fgiust">the stripes filter is now added by the module automatically, and it should not + be added anymore in web.xml</action> + <action type="update" dev="fgiust">multipart forms are now handled properly</action> </release> <release version="0.2" date="2007-08-14" description=""> - <action type="update" dev="fgiust"> - Added support for indexed parameters by replacing "{}" with "[]" in parameter names (hack). With Stripes you can - use indexed parameters, but square brakets are not allowed in jcr node names and can't be used in paragraph - attributes. You can now use "list{1}" in attribute names for that. - </action> - <action type="fix" dev="fgiust"> - Excluded commons-logging dependency from stripes in pom.xml. Magnolia already imports jcl104-over-slf4j, which - is a replacement over the standard commons-logging jar. - </action> + <action type="update" dev="fgiust"> Added support for indexed parameters by replacing "{}" with "[]" in parameter + names (hack). With Stripes you can use indexed parameters, but square brakets are not allowed in jcr node names + and can't be used in paragraph attributes. You can now use "list{1}" in attribute names for that.</action> + <action type="fix" dev="fgiust"> Excluded commons-logging dependency from stripes in pom.xml. Magnolia already + imports jcl104-over-slf4j, which is a replacement over the standard commons-logging jar.</action> </release> <release version="0.1" date="2007-08-13" description="Initial release"> <action type="add" dev="fgiust" due-to="">Initial release with support for stripes paragraphs.</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |