Commit 45836576 authored by Matija Obreza's avatar Matija Obreza
Browse files

Added sitemesh <content> block extractor

parent 399e4046
package org.genesys2.sitemesh3;
import org.sitemesh.SiteMeshContext;
import org.sitemesh.content.ContentProperty;
import org.sitemesh.content.tagrules.TagRuleBundle;
import org.sitemesh.content.tagrules.html.ContentBlockExtractingRule;
import org.sitemesh.tagprocessor.State;
/**
* Add only the "content" block extractor
*/
public class ContentTagRuleBundle implements TagRuleBundle {
public void install(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {
// <content> blocks
defaultState.addRule("content", new ContentBlockExtractingRule(contentProperty.getChild("page")));
}
public void cleanUp(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {
// No op.
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
<content-processor>
<tag-rule-bundle class="org.genesys2.sitemesh3.ContentTagRuleBundle" />
</content-processor>
<mime-type>text/html</mime-type>
<mapping path="/welcome" decorator="/WEB-INF/decorator/entry.jsp" />
<mapping path="/*" decorator="/WEB-INF/decorator/main.jsp" />
<mapping path="/html/*" exclude="true" />
<mapping path="*/ajax/*" exclude="true" />
</sitemesh>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment