From: <fg...@us...> - 2008-04-27 18:42:02
|
Revision: 782 http://openutils.svn.sourceforge.net/openutils/?rev=782&view=rev Author: fgiust Date: 2008-04-27 11:42:02 -0700 (Sun, 27 Apr 2008) Log Message: ----------- minor updates Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2008-04-27 18:29:29 UTC (rev 781) +++ trunk/openutils-mgnlstripes/pom.xml 2008-04-27 18:42:02 UTC (rev 782) @@ -1,5 +1,6 @@ <?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"> +<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> @@ -50,12 +51,12 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>3.5-rc2</version> + <version>3.5.4</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>3.5.2</version> + <version>3.5.4</version> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -83,6 +84,15 @@ </exclusions> </dependency> </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>INVALID</version> + </dependency> + </dependencies> + </dependencyManagement> <repositories> <repository> <id>repository.magnolia.info</id> @@ -96,4 +106,4 @@ </snapshots> </repository> </repositories> -</project> +</project> \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java 2008-04-27 18:29:29 UTC (rev 781) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java 2008-04-27 18:42:02 UTC (rev 782) @@ -20,7 +20,7 @@ /** * @author fgiust - * @version $Id$ + * @version $Id: $ */ public class StripesMagnoliaFilter extends StripesFilter implements MgnlFilter { @@ -81,7 +81,7 @@ public void init(FilterConfig filterConfig) throws ServletException { super.init(filterConfig); - filterConfig.getServletContext().setAttribute(Configuration.class.getName(), getConfiguration()); + filterConfig.getServletContext().setAttribute(Configuration.class.getName(), getInstanceConfiguration()); } /** Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2008-04-27 18:29:29 UTC (rev 781) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2008-04-27 18:42:02 UTC (rev 782) @@ -87,7 +87,6 @@ * </p> * {@inheritDoc} */ - @SuppressWarnings("unchecked") public void render(Content content, Paragraph paragraph, Writer out) throws IOException { // @fgiust start custom magnolia setup @@ -104,7 +103,8 @@ request = new StripesParagraphRequestWrapper( ((WebContext) MgnlContext.getInstance()).getRequest(), templatePath, - nodeDataMap); + nodeDataMap, + out); ((StripesParagraphRequestWrapper) request).setLocale(MgnlContext.getLocale()); } @@ -117,7 +117,7 @@ request.setAttribute(StripesConstants.REQ_ATTR_INCLUDE_PATH, templatePath); PageContext pageContext = webContext.getPageContext(); - ServletContext servletContext = null; + ServletContext servletContext = webContext.getServletContext(); if (pageContext != null) { @@ -133,8 +133,19 @@ try { - final Configuration config = StripesFilter.getConfiguration(); + Configuration config = (Configuration) servletContext.getAttribute(Configuration.class.getName()); + if (config == null) + { + // avoid NPES, an error has already been logged. + log.warn("Stripes configuration not found for request " + + request.getAttribute("javax.servlet.forward.request_uri") + + " while including " + + request.getRequestURI()); + + return; + } + // First manufacture an ActionBeanContext final ActionBeanContext context = config .getActionBeanContextFactory() @@ -147,7 +158,6 @@ ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution); ctx.setActionBeanContext(context); - ActionBeanContext abc = ctx.getActionBeanContext(); if (pageContext != null) { DispatcherHelper.setPageContext(pageContext); Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java 2008-04-27 18:29:29 UTC (rev 781) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRequestWrapper.java 2008-04-27 18:42:02 UTC (rev 782) @@ -4,6 +4,7 @@ import info.magnolia.context.WebContext; import java.io.IOException; +import java.io.Writer; import java.util.Enumeration; import java.util.Hashtable; import java.util.Locale; @@ -37,6 +38,8 @@ */ private Map<String, String[]> parameterMap; + private Writer out; + /** * Instantiate a new request wrapper. * @param request original HttpServletRequest @@ -48,10 +51,12 @@ public StripesParagraphRequestWrapper( HttpServletRequest request, String servletPath, - Map<String, String[]> paragraphsData) throws StripesServletException + Map<String, String[]> paragraphsData, + Writer out) throws StripesServletException { super(request); this.servletPath = servletPath; + this.out = out; parameterMap = new Hashtable<String, String[]>(); parameterMap.putAll(request.getParameterMap()); @@ -128,7 +133,7 @@ @Override public RequestDispatcher getRequestDispatcher(String path) { - return new MagnoliaRequestDispatcher(path); + return new MagnoliaRequestDispatcher(path, out); } /** @@ -144,13 +149,16 @@ */ private String url; + private Writer out; + /** * Created a new MagnoliaRequestDispatcher for the given url. * @param url url passed to {@link HttpServletRequest#getRequestDispatcher()} */ - public MagnoliaRequestDispatcher(String url) + public MagnoliaRequestDispatcher(String url, Writer out) { this.url = url; + this.out = out; } /** @@ -158,7 +166,7 @@ */ public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException { - ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); + ((WebContext) MgnlContext.getInstance()).include(url, out); } /** @@ -166,7 +174,8 @@ */ public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { - ((WebContext) MgnlContext.getInstance()).include(url, response.getWriter()); + ((WebContext) MgnlContext.getInstance()).include(url, out); } + } } \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml 2008-04-27 18:29:29 UTC (rev 781) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml 2008-04-27 18:42:02 UTC (rev 782) @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <sv:node sv:name="stripes" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl" - xmlns:rep="internal" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" - xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" + xmlns:rep="internal" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:fn="http://www.w3.org/2005/xpath-functions" + xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0"> <sv:property sv:name="jcr:primaryType" sv:type="Name"> <sv:value>mgnl:content</sv:value> @@ -75,48 +74,5 @@ <sv:value>2007-11-15T20:26:33.315+01:00</sv:value> </sv:property> </sv:node> - <sv:node sv:name="extensions"> - <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:value>mix:versionable</sv:value> - </sv:property> - <sv:property sv:name="jcr:uuid" sv:type="String"> - <sv:value>e30e33c9-7093-4f1f-b889-36e4956e648f</sv:value> - </sv:property> - <sv:property sv:name="allow" sv:type="String"> - <sv:value>html,action</sv:value> - </sv:property> - <sv:property sv:name="not" sv:type="String"> - <sv:value>true</sv:value> - </sv:property> - <sv:property sv:name="class" sv:type="String"> - <sv:value>info.magnolia.voting.voters.ExtensionVoter</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="mgnl:activated" sv:type="Boolean"> - <sv:value>false</sv:value> - </sv:property> - <sv:property sv:name="mgnl:activatorid" sv:type="String"> - <sv:value>mgnladmin</sv:value> - </sv:property> - <sv:property sv:name="mgnl:authorid" sv:type="String"> - <sv:value>mgnladmin</sv:value> - </sv:property> - <sv:property sv:name="mgnl:creationdate" sv:type="Date"> - <sv:value>2007-04-25T18:23:31.784+02:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:lastaction" sv:type="Date"> - <sv:value>2007-11-15T20:26:54.756+01:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2007-11-15T20:27:51.247+01:00</sv:value> - </sv:property> - </sv:node> - </sv:node> </sv:node> -</sv:node> +</sv:node> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |