Author: marijan
Date: Mon Aug 20 21:11:50 2012
New Revision: 1375218

URL: http://svn.apache.org/viewvc?rev=1375218&view=rev
Log:
RAVE-695 Create new rave-jcr-ocm module providing JCR based Object Content 
Mapping (OCM) support

- add config skeleton

Added:
    
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
   (with props)
Modified:
    
rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    
rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java

Modified: 
rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml?rev=1375218&r1=1375217&r2=1375218&view=diff
==============================================================================
--- 
rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml
 (original)
+++ 
rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml
 Mon Aug 20 21:11:50 2012
@@ -129,6 +129,7 @@
     <property name="interceptors" ref="interceptors"/>
     <property name="configurationName" value="myConfiguration"/>
     <property name="configurationPath" 
value="classpath:page-configuration.xml"/>
+    <property name="urlMappingsPath" value="classpath:url-configuration.xml"/>
     <property name="configManager" ref="fileConfigurationManager"/>
   </bean>
 

Modified: 
rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java?rev=1375218&r1=1375217&r2=1375218&view=diff
==============================================================================
--- 
rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java
 (original)
+++ 
rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java
 Mon Aug 20 21:11:50 2012
@@ -35,6 +35,7 @@ import org.apache.rave.jcr.config.JcrCon
 import org.apache.rave.jcr.config.model.api.PageConfiguration;
 import org.apache.rave.jcr.config.model.api.PageDefinition;
 import org.apache.rave.jcr.config.model.api.PageFragment;
+import org.apache.rave.jcr.config.url.UrlConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.core.annotation.AnnotationUtils;
@@ -64,6 +65,8 @@ public class HmvcHandlerMethodMappingByC
 
     private String configurationPath;
 
+    private String urlMappingsPath;
+
     /**
      * Used only when JCR config manager is used
      */
@@ -94,12 +97,15 @@ public class HmvcHandlerMethodMappingByC
 
         } else {
             final PageConfiguration configuration = 
configManager.loadConfiguration(configurationPath);
+            final UrlConfig urlConfig = 
configManager.loadUrlConfig(urlMappingsPath, configuration);
+            // TODO use urlConfig
             processConfiguration(configuration);
         }
     }
 
     private void processConfiguration(PageConfiguration configuration) {
         final List<PageDefinition> pageDefinitions = 
configuration.getPageDefinitions();
+
         for (PageDefinition pageDefinition : pageDefinitions) {
             final String controller = pageDefinition.getController();
             log.info("Processing controller [ {} ]", controller);
@@ -210,6 +216,9 @@ public class HmvcHandlerMethodMappingByC
         this.configurationPath = configurationPath;
     }
 
+    public void setUrlMappingsPath(String urlMappingsPath) {
+        this.urlMappingsPath = urlMappingsPath;
+    }
 
     public void setCredentials(Credentials credentials) {
         this.credentials = credentials;

Added: 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml?rev=1375218&view=auto
==============================================================================
--- 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
 (added)
+++ 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
 Mon Aug 20 21:11:50 2012
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+
+<!--
+  <page-definition name="myPage" path="/mypage2" description="My Page" 
displayname="My page" 
controller="org.apache.rave.portal.web.hmvc.example.MyPageController">
+  <page-fragment name="head" path="myHeader" 
controller="org.apache.rave.portal.web.hmvc.example.MyHeaderController"/>
+  <page-fragment name="body" path="myBody" 
controller="org.apache.rave.portal.web.hmvc.example.MyContentController"/>
+  <page-fragment name="footer" path="myFooter" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
+</page-definition>
+-->
+<url-configuration name="default">
+  <url-mapping url="/myPage2" page="myPage">
+    <url-mapping url="myHeader" page="head"/>
+    <url-mapping url="myBody" page="body"/>
+    <url-mapping url="myFooter" page="footer"/>
+  </url-mapping>
+</url-configuration>

Propchange: 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/url-configuration.xml
------------------------------------------------------------------------------
    svn:keywords = Id


Reply via email to