From: <fg...@us...> - 2007-08-13 09:12:49
|
Revision: 395 http://openutils.svn.sourceforge.net/openutils/?rev=395&view=rev Author: fgiust Date: 2007-08-13 02:12:49 -0700 (Mon, 13 Aug 2007) Log Message: ----------- update to magnolia 3.1-m1 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java Removed Paths: ------------- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.MIMEMapping.action.xml Property Changed: ---------------- trunk/openutils-mgnlstripes/ Property changes on: trunk/openutils-mgnlstripes ___________________________________________________________________ Name: svn:ignore - .checkstyle + target .settings .checkstyle .classpath .project Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-08-10 07:01:44 UTC (rev 394) +++ trunk/openutils-mgnlstripes/pom.xml 2007-08-13 09:12:49 UTC (rev 395) @@ -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> @@ -11,12 +12,24 @@ <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> <version>0.1-SNAPSHOT</version> - <licenses> - <license> - <name>GPL v3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> + <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> @@ -26,12 +39,12 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>3.1-SNAPSHOT</version> + <version>3.1-m3</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>3.1-SNAPSHOT</version> + <version>3.1-m3</version> </dependency> <dependency> <groupId>javax.servlet</groupId> Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-08-10 07:01:44 UTC (rev 394) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-08-13 09:12:49 UTC (rev 395) @@ -35,26 +35,40 @@ // Only process the class if it's properly annotated if (binding != null) { - registerSpringParagraph(binding); + String dialogName = actionNameToParagraphName(binding); + registerSpringParagraph(dialogName, binding); super.addActionBean(clazz); } } /** + * Generate a paragraph name from a Stripes binding. This method will take the last token after "/", strip any + * extension and convert everything to lowercase. + * @param binding Stripe action binding + * @return paragraph name + */ + protected String actionNameToParagraphName(String binding) + { + String dialogName = StringUtils.lowerCase(StringUtils.substringBeforeLast(StringUtils.substringAfterLast( + binding, + "/"), ".")); + return dialogName; + } + + /** * Registers a Magnolia paragraph which will delegate to a Stripe action. + * @param name dialog name * @param binding Stripes action binding */ @SuppressWarnings("unchecked") - private void registerSpringParagraph(String binding) + private void registerSpringParagraph(String name, String binding) { Paragraph paragraph = new Paragraph(); - String dialogName = actionNameToParagraphName(binding); - - paragraph.setName(dialogName); - paragraph.setTitle("paragraph." + dialogName + ".title"); - paragraph.setDescription("paragraph." + dialogName + ".description"); - paragraph.setDialog(dialogName); + paragraph.setName(name); + paragraph.setTitle("paragraph." + name + ".title"); + paragraph.setDescription("paragraph." + name + ".description"); + paragraph.setDialog(name); paragraph.setTemplatePath(binding); paragraph.setType("stripes"); @@ -62,18 +76,4 @@ ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); } - /** - * Generate a paragraph name from a Stripes binding. This method will take the last token after "/", strip any - * extension and convert everything to lowercase. - * @param binding Stripe action binding - * @return paragraph name - */ - protected String actionNameToParagraphName(String binding) - { - String dialogName = StringUtils.lowerCase(StringUtils.substringBeforeLast(StringUtils.substringAfterLast( - binding, - "/"), ".")); - return dialogName; - } - } Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-08-10 07:01:44 UTC (rev 394) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-08-13 09:12:49 UTC (rev 395) @@ -1,31 +1,24 @@ package it.openutils.magnoliastripes; -import info.magnolia.cms.module.RegisterException; -import info.magnolia.module.admininterface.AbstractAdminModule; +import info.magnolia.module.ModuleLifecycle; +import info.magnolia.module.ModuleLifecycleContext; /** - * Stripes module. Extends AbstractAdminModule which will take care of registering the Stripes paragraph renderer. + * Stripes module. * @author fgiust * @version $Id: $ */ -public class StripesModule extends AbstractAdminModule +public class StripesModule implements ModuleLifecycle { /** * {@inheritDoc} */ @Override - public void onInit() + public void start(ModuleLifecycleContext moduleLifecycleContext) { + // anything to do? } - /** - * {@inheritDoc} - */ - @Override - protected void onRegister(int registerState) throws RegisterException - { - // nothing to do - } } \ No newline at end of file Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-08-13 09:12:49 UTC (rev 395) @@ -0,0 +1,67 @@ +package it.openutils.magnoliastripes.setup; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.ItemType; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AbstractRepositoryTask; +import info.magnolia.module.delta.TaskExecutionException; + +import javax.jcr.RepositoryException; + + +/** + * Task that adds a mime mapping to <code>server/MIMIMapping</code>. + * @author fgiust + * @version $Revision: $ ($Author: $) + */ +public class AddMimeMappingTask extends AbstractRepositoryTask +{ + + /** + * Extension (without the <code>.</code>) + */ + private String extension; + + /** + * mime type. + */ + private String mime; + + /** + * Icon path. + */ + private String icon; + + /** + * @param extension Extension (without the <code>.</code>) + * @param mime mime type. + * @param icon Icon path. + */ + public AddMimeMappingTask(String extension, String mime, String icon) + { + super("Add mime mapping task", "Adds a MIME mapping for the " + extension + " extension"); + this.extension = extension; + this.mime = mime; + this.icon = icon; + } + + /** + * {@inheritDoc} + */ + @Override + protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException + { + HierarchyManager hm = ctx.getHierarchyManager(ContentRepository.CONFIG); + Content mimeNode = hm.getContent("/server/MIMEMapping"); + + if (!mimeNode.hasContent(extension)) + { + Content m = mimeNode.createContent(extension, ItemType.CONTENTNODE); + m.createNodeData("mime-type").setValue(mime); + m.createNodeData("icon").setValue(icon); + } + } + +} Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-08-13 09:12:49 UTC (rev 395) @@ -0,0 +1,30 @@ +package it.openutils.magnoliastripes.setup; + +import info.magnolia.module.DefaultModuleVersionHandler; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.Task; + +import java.util.List; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class StripesModuleVersionHandler extends DefaultModuleVersionHandler +{ + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + protected List<Task> getBasicInstallTasks(InstallContext installContext) + { + List<Task> installTasks = super.getBasicInstallTasks(installContext); + + installTasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); + + return installTasks; + } +} Modified: trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml 2007-08-10 07:01:44 UTC (rev 394) +++ trunk/openutils-mgnlstripes/src/main/resources/META-INF/magnolia/stripes.xml 2007-08-13 09:12:49 UTC (rev 395) @@ -4,6 +4,6 @@ <name>stripes</name> <displayName>stripes</displayName> <description>Stripes integration module</description> - <class>it.openutils.magnoliastripes.StripesModule</class> - <version>0.1</version> + <versionHandler>it.openutils.magnoliastripes.setup.StripesModuleVersionHandler</versionHandler> + <version>${project.version}</version> </module> Deleted: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.MIMEMapping.action.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.MIMEMapping.action.xml 2007-08-10 07:01:44 UTC (rev 394) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.MIMEMapping.action.xml 2007-08-13 09:12:49 UTC (rev 395) @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sv:node sv:name="action" 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:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0"> - <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>c0a3cfb0-2f94-4924-8da2-0f152c825891</sv:value> - </sv:property> - <sv:property sv:name="icon" sv:type="String"> - <sv:value>/.resources/file-icons/htm.png</sv:value> - </sv:property> - <sv:property sv:name="mime-type" sv:type="String"> - <sv:value>text/html</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:uuid" sv:type="String"> - <sv:value>11cf3c7b-3a09-4983-8761-867a1a8cdd14</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:lastaction" sv:type="Date"> - <sv:value>2007-07-29T20:52:47.861+01:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:creationdate" sv:type="String"> - <sv:value>2004-11-02T15:34:17.212+01:00</sv:value> - </sv:property> - <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> - <sv:value>2007-07-29T20:52:47.928+01:00</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: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:node> -</sv:node> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-12-02 16:46:11
|
Revision: 510 http://openutils.svn.sourceforge.net/openutils/?rev=510&view=rev Author: fgiust Date: 2007-12-02 08:46:09 -0800 (Sun, 02 Dec 2007) Log Message: ----------- update to magnolia 3.5-rc2 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml Removed Paths: ------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:46:09 UTC (rev 510) @@ -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> @@ -10,7 +11,13 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>0.3-SNAPSHOT</version> + <version>3.5-SNAPSHOT</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> <build> <resources> <resource> @@ -44,12 +51,12 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>3.1-m3</version> + <version>3.5-rc2</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>3.1-m3</version> + <version>3.5-rc2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -77,4 +84,17 @@ </exclusions> </dependency> </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> </project> Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,179 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.beans.runtime.Document; +import info.magnolia.cms.beans.runtime.MultipartForm; +import info.magnolia.context.Context; +import info.magnolia.context.MgnlContext; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.action.FileBean; +import net.sourceforge.stripes.controller.FileUploadLimitExceededException; +import net.sourceforge.stripes.controller.multipart.MultipartWrapper; + +import org.apache.commons.io.IOUtils; + + +/** + * An implementation of MultipartWrapper that delegates to the standard magnolia multipart form handling. + * @author fgiust + * @version $Id: $ + */ +public class MagnoliaMultipartWrapper implements MultipartWrapper +{ + + /** + * Nothing to do here {@inheritDoc} + */ + public void build(HttpServletRequest request, File tempDir, long maxPostSize) throws IOException, + FileUploadLimitExceededException + { + // nothing to do, already provided by magnolia + + } + + private MultipartForm getForm() + { + return (MultipartForm) MgnlContext.getAttribute(MultipartForm.REQUEST_ATTRIBUTE_NAME, Context.LOCAL_SCOPE); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getParameterNames() + { + return getForm().getParameterNames(); + } + + /** + * {@inheritDoc} + */ + public String[] getParameterValues(String name) + { + return getForm().getParameterValues(name); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getFileParameterNames() + { + return new IteratorEnumeration(getForm().getDocuments().keySet().iterator()); + } + + /** + * {@inheritDoc} + */ + public FileBean getFileParameterValue(String name) + { + final Document item = getForm().getDocument(name); + if (item == null) + { + return null; + } + else + { + // Use an anonymous inner subclass of FileBean that overrides all the + // methods that rely on having a File present, to use the FileItem + // created by commons upload instead. + return new FileBean(null, item.getType(), item.getFileNameWithExtension()) + { + + @Override + public long getSize() + { + return item.getLength(); + } + + @Override + public InputStream getInputStream() throws IOException + { + return item.getStream(); + } + + @Override + public void save(File toFile) throws IOException + { + OutputStream os = null; + InputStream is = null; + try + { + os = new BufferedOutputStream(new FileOutputStream(toFile)); + is = item.getStream(); + IOUtils.copyLarge(is, os); + + delete(); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + else + { + IOException ioe = new IOException("Problem saving uploaded file."); + ioe.initCause(e); + throw ioe; + } + } + finally + { + IOUtils.closeQuietly(is); + IOUtils.closeQuietly(os); + } + } + + @Override + public void delete() throws IOException + { + item.delete(); + } + }; + } + } + + /** + * Little helper class to create an enumeration as per the interface. + */ + private static class IteratorEnumeration implements Enumeration<String> + { + + Iterator<String> iterator; + + /** + * Constructs an enumeration that consumes from the underlying iterator. + */ + IteratorEnumeration(Iterator<String> iterator) + { + this.iterator = iterator; + } + + /** + * Returns true if more elements can be consumed, false otherwise. + */ + public boolean hasMoreElements() + { + return this.iterator.hasNext(); + } + + /** + * Gets the next element out of the iterator. + */ + public String nextElement() + { + return this.iterator.next(); + } + } +} Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-12-02 16:46:09 UTC (rev 510) @@ -2,6 +2,10 @@ import info.magnolia.cms.beans.config.Paragraph; import info.magnolia.cms.beans.config.ParagraphManager; + +import java.util.HashSet; +import java.util.Set; + import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.controller.NameBasedActionResolver; @@ -22,9 +26,14 @@ /** * Logger. */ - private Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); + private static Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); /** + * Configured Stripes paragraphs. + */ + private static Set<Paragraph> paragraphs = new HashSet<Paragraph>(); + + /** * {@inheritDoc} */ @Override @@ -36,7 +45,7 @@ if (binding != null) { String dialogName = actionNameToParagraphName(binding); - registerSpringParagraph(dialogName, binding); + collectStripesParagraphs(dialogName, binding); super.addActionBean(clazz); } } @@ -61,7 +70,7 @@ * @param binding Stripes action binding */ @SuppressWarnings("unchecked") - private void registerSpringParagraph(String name, String binding) + private void collectStripesParagraphs(String name, String binding) { Paragraph paragraph = new Paragraph(); @@ -71,9 +80,20 @@ paragraph.setDialog(name); paragraph.setTemplatePath(binding); paragraph.setType("stripes"); + paragraphs.add(paragraph); log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); } + @SuppressWarnings("unchecked") + public static void registerParagraphs() + { + for (Paragraph paragraph : paragraphs) + { + log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ + ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); + } + } + } Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,96 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.filters.MgnlFilter; +import info.magnolia.context.MgnlContext; +import info.magnolia.context.WebContext; +import info.magnolia.voting.Voter; +import info.magnolia.voting.Voting; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.controller.StripesFilter; +import net.sourceforge.stripes.controller.StripesRequestWrapper; +import net.sourceforge.stripes.exception.StripesServletException; + +import org.apache.commons.lang.ArrayUtils; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class StripesMagnoliaFilter extends StripesFilter implements MgnlFilter +{ + + private String name; + + private Voter[] bypasses = new Voter[0]; + + private boolean enabled = true; + + public boolean bypasses(HttpServletRequest request) + { + if (!isEnabled()) + { + return true; + } + if (MgnlContext.hasInstance()) + { + return Voting.Factory.getDefaultVoting().vote(bypasses, request) > 0; + } + return false; + } + + public Voter[] getBypasses() + { + return this.bypasses; + } + + public void addBypass(Voter voter) + { + this.bypasses = (Voter[]) ArrayUtils.add(this.bypasses, voter); + } + + public String getName() + { + return this.name; + } + + public void setName(String name) + { + this.name = name; + } + + public boolean isEnabled() + { + return this.enabled; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + /** + * Wraps the HttpServletRequest with a StripesServletRequest. This is done to ensure that any form posts that + * contain file uploads get handled appropriately. + * @param servletRequest the HttpServletRequest handed to the dispatcher by the container + * @return an instance of StripesRequestWrapper, which is an HttpServletRequestWrapper + * @throws StripesServletException if the wrapper cannot be constructed + */ + @Override + protected StripesRequestWrapper wrapRequest(HttpServletRequest servletRequest) throws StripesServletException + { + StripesRequestWrapper srw = new StripesRequestWrapper(servletRequest); + + if (MgnlContext.hasInstance()) + { + // be sure that the request wrapper gets setted in mgnlcontext too + WebContext webContext = (WebContext) MgnlContext.getInstance(); + webContext.init(servletRequest, webContext.getResponse(), webContext.getServletContext()); + } + + return srw; + } + +} Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-12-02 16:46:09 UTC (rev 510) @@ -1,23 +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} - */ - public void start(ModuleLifecycleContext moduleLifecycleContext) - { - // anything to do? - } - -} \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-12-02 16:46:09 UTC (rev 510) @@ -207,12 +207,13 @@ } else { - throw new RuntimeException("ActionBean execution threw an exception.", ite.getTargetException()); + Throwable targetEx = ite.getTargetException(); + throw new RuntimeException(targetEx.getClass().getName() + ": " + targetEx.getMessage(), targetEx); } } catch (Exception e) { - throw new RuntimeException("Exception encountered processing request.", e); + throw new RuntimeException("Exception encountered processing request: " + e.getMessage(), e); } finally { Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-12-02 16:46:09 UTC (rev 510) @@ -1,67 +0,0 @@ -package it.openutils.magnoliastripes.setup; - -import info.magnolia.cms.beans.config.ContentRepository; -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.AbstractRepositoryTask; -import info.magnolia.module.delta.TaskExecutionException; - -import javax.jcr.RepositoryException; - - -/** - * Task that adds a mime mapping to <code>server/MIMIMapping</code>. - * @author fgiust - * @version $Revision: $ ($Author: $) - */ -public class AddMimeMappingTask extends AbstractRepositoryTask -{ - - /** - * Extension (without the <code>.</code>) - */ - private String extension; - - /** - * mime type. - */ - private String mime; - - /** - * Icon path. - */ - private String icon; - - /** - * @param extension Extension (without the <code>.</code>) - * @param mime mime type. - * @param icon Icon path. - */ - public AddMimeMappingTask(String extension, String mime, String icon) - { - super("Add mime mapping task", "Adds a MIME mapping for the " + extension + " extension"); - this.extension = extension; - this.mime = mime; - this.icon = icon; - } - - /** - * {@inheritDoc} - */ - @Override - protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException - { - HierarchyManager hm = ctx.getHierarchyManager(ContentRepository.CONFIG); - Content mimeNode = hm.getContent("/server/MIMEMapping"); - - if (!mimeNode.hasContent(extension)) - { - Content m = mimeNode.createContent(extension, ItemType.CONTENTNODE); - m.createNodeData("mime-type").setValue(mime); - m.createNodeData("icon").setValue(icon); - } - } - -} Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-12-02 16:46:09 UTC (rev 510) @@ -2,6 +2,8 @@ import info.magnolia.module.DefaultModuleVersionHandler; import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AddMimeMappingTask; +import info.magnolia.module.delta.FilterOrderingTask; import info.magnolia.module.delta.Task; import java.util.List; @@ -21,10 +23,14 @@ @Override protected List<Task> getBasicInstallTasks(InstallContext installContext) { - List<Task> installTasks = super.getBasicInstallTasks(installContext); + List<Task> tasks = super.getBasicInstallTasks(installContext); - installTasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); + tasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); - return installTasks; + tasks.add(new FilterOrderingTask( + "stripes", + new String[]{"context", "login", "uriSecurity", "multipartRequest" })); + + return tasks; } } Added: 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 (rev 0) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,122 @@ +<?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: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> + </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>871bc964-af22-4713-a1d7-a71c80ffcf2f</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>it.openutils.magnoliastripes.StripesMagnoliaFilter</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="Boolean"> + <sv:value>true</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>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>2006-07-28T23:39:30.812+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-10-04T23:04:20.237+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2007-10-04T23:05:02.810+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="bypasses"> + <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>6cc0bc00-3efa-41be-9278-70f2f93d23c6</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>superuser</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:21:02.097+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-04-25T18:57:19.876+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <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> Property changes on: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |