View web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID" | |
version="3.0" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | |
<display-name>DD4T 2</display-name> | |
<servlet> | |
<servlet-name>dispatcher</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
View dispatcher-servlet.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Sitemap --> | |
<bean id="sitemap" class="com.xxx.xxx.navigation.SitemapImpl"> | |
</bean> | |
<bean id="navigationController" class="com.xxx.xxx.controller.NavigationController"> | |
<property name="navigationViewPath" value="navigation/"/> | |
<property name="publicationResolver" ref="publicationResolver" /> | |
<property name="sitemapFactory" ref="sitemapFactory"/> | |
<property name="sitemap" ref="sitemap"/> | |
</bean> |
View header.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jsp:include page="/mainNavigation" /> |
View SitemapFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SitemapFactory extends Factory { | |
<T extends Sitemap> T findSitemapByUrl(String url, int publicationId, final Class<? extends T> aClass) throws FactoryException; | |
<T extends Sitemap> T deserialize(String source, final Class<? extends T> aClass) throws FactoryException; | |
} | |
public class SitemapFactoryImpl extends BaseFactory implements SitemapFactory { | |
private static final Logger LOG = LoggerFactory.getLogger(PageFactoryImpl.class); | |
private static final SitemapFactoryImpl INSTANCE = new SitemapFactoryImpl(); |
View CustomDataBindFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomDataBindFactory { | |
private static final Logger LOG = LoggerFactory.getLogger(DataBindFactory.class); | |
private static final CustomDataBindFactory INSTANCE = new CustomDataBindFactory(); | |
private CustomDataBinder customDataBinder; | |
private CustomDataBindFactory () { | |
LOG.info("CustomDataBindFactory init."); | |
} |
View CustomDataBinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface CustomDataBinder { | |
<T extends Sitemap> T buildSitemap(String source, final Class<T> aClass) throws SerializationException; | |
} | |
public class CustomDataBinderImpl implements CustomDataBinder { | |
private static final Logger LOG = LoggerFactory.getLogger(CustomDataBinderImpl.class); | |
private static final ObjectMapper GENERIC_MAPPER = new ObjectMapper(); | |
static { | |
GENERIC_MAPPER.configure(MapperFeature.IGNORE_DUPLICATE_MODULE_REGISTRATIONS,true); |
View Sitemap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Sitemap { | |
//Always one root Folder | |
Folder getFolder(); | |
void setFolder(Folder folder); | |
//Example | |
List<BaseItem> getTopNavigation(); | |
} | |
@JsonIgnoreProperties(ignoreUnknown = true) |
View sitemap.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folder": { | |
"id": "tcm:1-2-3", | |
"title": "root", | |
"topnav": "false", | |
"level": "0", | |
"pages": [{ | |
"id": "tcm:1-2-4", | |
"title": "homepage", | |
"topnav": "false", |
NewerOlder