I created a simple blossom module which define a prototype template.
This is the module definition.
[code]package axioma.magnolia.furla.module;
import org.slf4j.*;
import info.magnolia.module.*;
import info.magnolia.module.blossom.module.BlossomModuleSupport;
public class DocumentaleModule extends BlossomModuleSupport implements
ModuleLifecycle {
private static DocumentaleModule INSTANCE;
private static final Logger LOGGER =
LoggerFactory.getLogger(DocumentaleModule.class);
public DocumentaleModule() {
INSTANCE = this;
}
public void start(ModuleLifecycleContext moduleLifecycleContext) {
LOGGER.info(getClass().getSimpleName() + " is starting");
// initRootWebApplicationContext("classpath:spring-main.xml");
// initBlossomDispatcherServlet("blossom",
"classpath:blossom-servlet.xml");
}
public void stop(ModuleLifecycleContext moduleLifecycleContext) {
LOGGER.info(getClass().getSimpleName() + " is stopping");
// destroyDispatcherServlets();
// closeRootWebApplicationContext();
}
public static DocumentaleModule getInstance() {
return INSTANCE;
}
}[/code]
and this is the template definition
[code]package axioma.magnolia.furla.module;
import javax.jcr.Node;
import info.magnolia.module.blossom.annotation.*;
import info.magnolia.module.blossom.dialog.TabBuilder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Template(visible = true, id = "documentale:pages/main", title = "Documentale")
@Controller
public class SingleColumnTemplate {
@Area("mainArea")
@Controller
public static class MainArea {
@TabFactory("Content")
public void contentTab(TabBuilder tab) {
}
@RequestMapping("/main/mainArea")
public String render() {
return "areas/main.jsp";
}
}
@Available
public boolean isAvailable(Node xpNode) {
return true;
}
}[/code]
I see the module in the configuration but when I create a new page it never
propose me my template.
What can be wrong ?
Here the blossmo-servlet.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:annotation-config />
<context:component-scan base-package="axioma.magnolia.furla.module"
use-default-filters="false">
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.Template" />
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.Area" />
<context:include-filter type="annotation"
expression="info.magnolia.module.blossom.annotation.DialogFactory" />
</context:component-scan>
<bean
class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="customArgumentResolver">
<bean
class="info.magnolia.module.blossom.web.BlossomWebArgumentResolver" />
</property>
</bean>
<bean
class="info.magnolia.module.blossom.preexecution.BlossomHandlerMapping">
<property name="targetHandlerMappings">
<list>
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property
name="useDefaultSuffixPattern" value="false" />
</bean>
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
</list>
</property>
</bean>
<bean
class="info.magnolia.module.blossom.view.UuidRedirectViewResolver">
<property name="order" value="1" />
</bean>
<!-- JSP - renders all views that end with .jsp -->
<bean class="info.magnolia.module.blossom.view.TemplateViewResolver">
<property name="order" value="2" />
<property name="prefix" value="/WEB-INF/templates/" />
<property name="viewNames" value="*.jsp" />
<property name="viewRenderer">
<bean
class="info.magnolia.module.blossom.view.JspTemplateViewRenderer" />
</property>
</bean>
<!-- Renders all views that end with .ftl -->
<bean class="info.magnolia.module.blossom.view.TemplateViewResolver">
<property name="order" value="3" />
<property name="prefix" value="/WEB-INF/templates/" />
<property name="viewNames" value="*.ftl" />
<property name="viewRenderer">
<bean
class="info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer">
<property name="contextAttributes">
<map>
<entry key="cms">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property
name="name" value="cms" />
<property
name="componentClass" value="info.magnolia.templating.freemarker.Directives" />
</bean>
</entry>
<entry key="cmsfn">
<bean
class="info.magnolia.rendering.renderer.ContextAttributeConfiguration">
<property
name="name" value="cmsfn" />
<property
name="componentClass"
value="info.magnolia.templating.functions.TemplatingFunctions" />
</bean>
</entry>
</map>
</property>
</bean>
</property>
</bean>
</beans>[/code]
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=99667228-9289-44aa-ae68-c30a7ebbd80b
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------