From: <fg...@us...> - 2007-08-14 12:37:14
|
Revision: 409 http://openutils.svn.sourceforge.net/openutils/?rev=409&view=rev Author: fgiust Date: 2007-08-14 05:37:04 -0700 (Tue, 14 Aug 2007) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlstripes-0.2 Added Paths: ----------- tags/openutils-mgnlstripes-0.2/ tags/openutils-mgnlstripes-0.2/pom.xml tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java tags/openutils-mgnlstripes-0.2/src/site/ tags/openutils-mgnlstripes-0.2/src/site/apt/ tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt tags/openutils-mgnlstripes-0.2/src/site/changes/changes.xml Removed Paths: ------------- tags/openutils-mgnlstripes-0.2/pom.xml tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java tags/openutils-mgnlstripes-0.2/src/site/ tags/openutils-mgnlstripes-0.2/src/site/apt/ tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt Copied: tags/openutils-mgnlstripes-0.2 (from rev 403, trunk/openutils-mgnlstripes) Deleted: tags/openutils-mgnlstripes-0.2/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-08-14 07:35:54 UTC (rev 403) +++ tags/openutils-mgnlstripes-0.2/pom.xml 2007-08-14 12:37:04 UTC (rev 409) @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>3</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlstripes</artifactId> - <name>openutils-mgnlstripes</name> - <version>0.2-SNAPSHOT</version> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>net.sourceforge.stripes</groupId> - <artifactId>stripes</artifactId> - <version>1.4.3</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.1-m3</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.1-m3</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - <version>2.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> -</project> Copied: tags/openutils-mgnlstripes-0.2/pom.xml (from rev 408, trunk/openutils-mgnlstripes/pom.xml) =================================================================== --- tags/openutils-mgnlstripes-0.2/pom.xml (rev 0) +++ tags/openutils-mgnlstripes-0.2/pom.xml 2007-08-14 12:37:04 UTC (rev 409) @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>4</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlstripes</artifactId> + <name>openutils-mgnlstripes</name> + <version>0.2</version> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>net.sourceforge.stripes</groupId> + <artifactId>stripes</artifactId> + <version>1.4.3</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.1-m3</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.1-m3</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-0.2</url> + </scm> +</project> Deleted: tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-08-14 07:35:54 UTC (rev 403) +++ tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-08-14 12:37:04 UTC (rev 409) @@ -1,24 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.module.ModuleLifecycle; -import info.magnolia.module.ModuleLifecycleContext; - - -/** - * Stripes module. - * @author fgiust - * @version $Id: $ - */ -public class StripesModule implements ModuleLifecycle -{ - - /** - * {@inheritDoc} - */ - @Override - public void start(ModuleLifecycleContext moduleLifecycleContext) - { - // anything to do? - } - -} \ No newline at end of file Copied: tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java (from rev 404, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java) =================================================================== --- tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java (rev 0) +++ tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-08-14 12:37:04 UTC (rev 409) @@ -0,0 +1,23 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.module.ModuleLifecycle; +import info.magnolia.module.ModuleLifecycleContext; + + +/** + * Stripes module. + * @author fgiust + * @version $Id: $ + */ +public class StripesModule implements ModuleLifecycle +{ + + /** + * {@inheritDoc} + */ + public void start(ModuleLifecycleContext moduleLifecycleContext) + { + // anything to do? + } + +} \ No newline at end of file Deleted: tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java 2007-08-14 07:35:54 UTC (rev 403) +++ tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java 2007-08-14 12:37:04 UTC (rev 409) @@ -1,174 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.context.MgnlContext; -import info.magnolia.context.WebContext; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Locale; -import java.util.Map; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; - -import net.sourceforge.stripes.controller.StripesRequestWrapper; -import net.sourceforge.stripes.exception.StripesServletException; - - -/** - * Magnolia request wrapper for Stripes actions. - * @author fgiust - * @version $Id: $ - */ -class StripesParagraphRequestWrapper extends StripesRequestWrapper -{ - - /** - * Hacked servlet path. - */ - private String servletPath; - - /** - * Parameter map. - */ - private Map<String, String[]> parameterMap; - - /** - * Instantiate a new request wrapper. - * @param request original HttpServletRequest - * @param servletPath modified servlet path (matches Stripes binding) - * @param paragraphsData map containing paragraph attributes - * @throws StripesServletException if any other error occurs constructing the wrapper - */ - @SuppressWarnings("unchecked") - public StripesParagraphRequestWrapper( - HttpServletRequest request, - String servletPath, - Map<String, String[]> paragraphsData) throws StripesServletException - { - super(request); - this.servletPath = servletPath; - - parameterMap = new Hashtable<String, String[]>(); - parameterMap.putAll(request.getParameterMap()); - parameterMap.putAll(paragraphsData); - } - - /** - * {@inheritDoc} - */ - @Override - public String getServletPath() - { - return servletPath; - } - - /** - * {@inheritDoc} - */ - @Override - protected void setLocale(Locale locale) - { - super.setLocale(locale); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public Enumeration<String> getParameterNames() - { - return ((Hashtable) parameterMap).keys(); - } - - /** - * {@inheritDoc} - */ - @Override - public String[] getParameterValues(String name) - { - return parameterMap.get(name); - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, String[]> getParameterMap() - { - - return parameterMap; - } - - /** - * {@inheritDoc} - */ - @Override - public String getParameter(String name) - { - String[] values = getParameterValues(name); - if (values != null && values.length > 0) - { - return values[0]; - } - else - { - return null; - } - } - - /** - * {@inheritDoc} - */ - @Override - public RequestDispatcher getRequestDispatcher(String path) - { - return new MagnoliaRequestDispatcher(path); - } - - /** - * A {@link RequestDispatcher} that uses {@link WebContext} for including a resource. - * @author fgiust - * @version $Id: $ - */ - private static class MagnoliaRequestDispatcher implements RequestDispatcher - { - - /** - * The url this RequestDispatcher is bound to. - */ - private String url; - - /** - * Created a new MagnoliaRequestDispatcher for the given url. - * @param url url passed to {@link HttpServletRequest#getRequestDispatcher()} - */ - public MagnoliaRequestDispatcher(String url) - { - this.url = url; - } - - /** - * {@inheritDoc} - */ - @Override - public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException - { - ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); - } - - /** - * {@inheritDoc} - */ - @Override - public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException - { - ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); - } - } -} \ No newline at end of file Copied: tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java (from rev 404, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java) =================================================================== --- tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java (rev 0) +++ tags/openutils-mgnlstripes-0.2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java 2007-08-14 12:37:04 UTC (rev 409) @@ -0,0 +1,172 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.context.MgnlContext; +import info.magnolia.context.WebContext; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.controller.StripesRequestWrapper; +import net.sourceforge.stripes.exception.StripesServletException; + + +/** + * Magnolia request wrapper for Stripes actions. + * @author fgiust + * @version $Id: $ + */ +class StripesParagraphRequestWrapper extends StripesRequestWrapper +{ + + /** + * Hacked servlet path. + */ + private String servletPath; + + /** + * Parameter map. + */ + private Map<String, String[]> parameterMap; + + /** + * Instantiate a new request wrapper. + * @param request original HttpServletRequest + * @param servletPath modified servlet path (matches Stripes binding) + * @param paragraphsData map containing paragraph attributes + * @throws StripesServletException if any other error occurs constructing the wrapper + */ + @SuppressWarnings("unchecked") + public StripesParagraphRequestWrapper( + HttpServletRequest request, + String servletPath, + Map<String, String[]> paragraphsData) throws StripesServletException + { + super(request); + this.servletPath = servletPath; + + parameterMap = new Hashtable<String, String[]>(); + parameterMap.putAll(request.getParameterMap()); + parameterMap.putAll(paragraphsData); + } + + /** + * {@inheritDoc} + */ + @Override + public String getServletPath() + { + return servletPath; + } + + /** + * {@inheritDoc} + */ + @Override + protected void setLocale(Locale locale) + { + super.setLocale(locale); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + public Enumeration<String> getParameterNames() + { + return ((Hashtable) parameterMap).keys(); + } + + /** + * {@inheritDoc} + */ + @Override + public String[] getParameterValues(String name) + { + return parameterMap.get(name); + } + + /** + * {@inheritDoc} + */ + @Override + public Map<String, String[]> getParameterMap() + { + + return parameterMap; + } + + /** + * {@inheritDoc} + */ + @Override + public String getParameter(String name) + { + String[] values = getParameterValues(name); + if (values != null && values.length > 0) + { + return values[0]; + } + else + { + return null; + } + } + + /** + * {@inheritDoc} + */ + @Override + public RequestDispatcher getRequestDispatcher(String path) + { + return new MagnoliaRequestDispatcher(path); + } + + /** + * A {@link RequestDispatcher} that uses {@link WebContext} for including a resource. + * @author fgiust + * @version $Id: $ + */ + private static class MagnoliaRequestDispatcher implements RequestDispatcher + { + + /** + * The url this RequestDispatcher is bound to. + */ + private String url; + + /** + * Created a new MagnoliaRequestDispatcher for the given url. + * @param url url passed to {@link HttpServletRequest#getRequestDispatcher()} + */ + public MagnoliaRequestDispatcher(String url) + { + this.url = url; + } + + /** + * {@inheritDoc} + */ + public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException + { + ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); + } + + /** + * {@inheritDoc} + */ + public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException + { + ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); + } + } +} \ No newline at end of file Copied: tags/openutils-mgnlstripes-0.2/src/site (from rev 405, trunk/openutils-mgnlstripes/src/site) Copied: tags/openutils-mgnlstripes-0.2/src/site/apt (from rev 403, trunk/openutils-mgnlstripes/src/site/apt) Deleted: tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlstripes/src/site/apt/index.apt 2007-08-14 07:35:54 UTC (rev 403) +++ tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt 2007-08-14 12:37:04 UTC (rev 409) @@ -1,149 +0,0 @@ - -------------------------- - openutils-mgnlstripes - -------------------------- - Fabrizio Giustina - -------------------------- - -About openutils-mgnlstripes - - 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 - Copied: tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt (from rev 407, trunk/openutils-mgnlstripes/src/site/apt/index.apt) =================================================================== --- tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt (rev 0) +++ tags/openutils-mgnlstripes-0.2/src/site/apt/index.apt 2007-08-14 12:37:04 UTC (rev 409) @@ -0,0 +1,152 @@ + -------------------------- + openutils-mgnlstripes + -------------------------- + Fabrizio Giustina + -------------------------- + +About openutils-mgnlstripes + + 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.2</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 + + * Use spring binding/validation for validation of fields in dialogs + + Copied: tags/openutils-mgnlstripes-0.2/src/site/changes/changes.xml (from rev 406, trunk/openutils-mgnlstripes/src/site/changes/changes.xml) =================================================================== --- tags/openutils-mgnlstripes-0.2/src/site/changes/changes.xml (rev 0) +++ tags/openutils-mgnlstripes-0.2/src/site/changes/changes.xml 2007-08-14 12:37:04 UTC (rev 409) @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <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> + </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> + </release> + </body> +</document> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |