Author: marijan
Date: Wed Aug 15 11:51:48 2012
New Revision: 1373354

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

- use file based configuration within test (and example)
- assign parent
- use controller instead of class

Added:
    rave/sandbox/content-services/demo-portal/src/main/resources/
    
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
   (with props)
    
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/page-configuration.xml
   (with props)
Modified:
    
rave/sandbox/content-services/demo-portal/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/java/org/apache/rave/jcr/config/model/FilePageConfiguration.java
    
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/resources/example_configuration.xml
    
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/test/java/org/apache/rave/jcr/config/FileConfigManagerTest.java
    
rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMappingByConfig.java
    
rave/sandbox/content-services/rave-web-hmvc/src/test/resources/test-config.xml

Added: 
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml?rev=1373354&view=auto
==============================================================================
--- 
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
 (added)
+++ 
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
 Wed Aug 15 11:51:48 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<configuration name="default">
+
+  <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>
+
+</configuration>

Propchange: 
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
rave/sandbox/content-services/demo-portal/src/main/resources/page-configuration.xml
------------------------------------------------------------------------------
    svn:keywords = Id

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=1373354&r1=1373353&r2=1373354&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
 Wed Aug 15 11:51:48 2012
@@ -7,7 +7,7 @@
   "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
+       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
@@ -27,15 +27,15 @@
         http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util.xsd
         http://www.springframework.org/schema/oxm 
http://www.springframework.org/schema/oxm/spring-oxm.xsd";>
 
-    <!--
-    Scans the classpath of this application for @Components to deploy as beans
-    NOTE: only the controllers (api and controller packages) are scanned here 
in dispatcher-servlet.xml. All other
-    org.apache.rave.portal.web.<packages> are scanned in 
web-applicationContext.xml.  This is to prevent duplicate
-    bean scanning of o.a.r.p.web.* components which can cause problems.
-    -->
-    <context:component-scan 
base-package="org.apache.rave.portal.web.controller"/>
-    <context:component-scan base-package="org.apache.rave.portal.web.api"/>
-    <context:component-scan base-package="org.apache.rave.portal.web.hmvc"/>
+  <!--
+  Scans the classpath of this application for @Components to deploy as beans
+  NOTE: only the controllers (api and controller packages) are scanned here in 
dispatcher-servlet.xml. All other
+  org.apache.rave.portal.web.<packages> are scanned in 
web-applicationContext.xml.  This is to prevent duplicate
+  bean scanning of o.a.r.p.web.* components which can cause problems.
+  -->
+  <context:component-scan 
base-package="org.apache.rave.portal.web.controller"/>
+  <context:component-scan base-package="org.apache.rave.portal.web.api"/>
+  <context:component-scan base-package="org.apache.rave.portal.web.hmvc"/>
 
   <!-- Configures the @Controller programming model -->
 
@@ -127,8 +127,13 @@
   <bean name="hmvcHandlerMappingByConfig" 
class="org.apache.rave.portal.web.hmvc.HmvcHandlerMethodMappingByConfig">
     <property name="order" value="-1"/>
     <property name="interceptors" ref="interceptors"/>
+    <property name="configurationName" value="myConfiguration"/>
+    <property name="configurationPath" 
value="classpath:page-configuration.xml"/>
+    <property name="configManager" ref="fileConfigurationManager"/>
   </bean>
 
+  <bean id="fileConfigurationManager" 
class="org.apache.rave.jcr.config.FileConfigManager"/>
+
   <bean name="hmvcHandlerMapping" 
class="org.apache.rave.portal.web.hmvc.HmvcHandlerMethodMapping">
     <property name="order" value="0"/>
     <property name="interceptors" ref="interceptors"/>
@@ -158,7 +163,7 @@
   </bean>
 
   <bean id="beanNameHandlerMapping" 
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
-    <property name="order" value="2" />
+    <property name="order" value="2"/>
     <property name="interceptors" ref="interceptors"/>
   </bean>
 

Modified: 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/java/org/apache/rave/jcr/config/model/FilePageConfiguration.java
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/java/org/apache/rave/jcr/config/model/FilePageConfiguration.java?rev=1373354&r1=1373353&r2=1373354&view=diff
==============================================================================
--- 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/java/org/apache/rave/jcr/config/model/FilePageConfiguration.java
 (original)
+++ 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/java/org/apache/rave/jcr/config/model/FilePageConfiguration.java
 Wed Aug 15 11:51:48 2012
@@ -51,7 +51,7 @@ public class FilePageConfiguration imple
      */
     private boolean initialized;
 
-    private Map<String, PageDefinition> filteredDefinitons;
+    private Map<String, PageDefinition> filteredDefinitions;
     private Map<String, PageFragment> filteredFragments;
 
     private List<PageDefinition> pageDefinitions;
@@ -61,6 +61,7 @@ public class FilePageConfiguration imple
     @Override
     public final void initialize() {
         if (!initialized) {
+            log.info("@@@ initializing PageConfiguration @@@");
             // filter invalid entries (e.g. entries without a name and 
duplicates)
             filterDefinitions();
             filterFragments();
@@ -73,7 +74,7 @@ public class FilePageConfiguration imple
                 final String reference = pageFragment.getReference();
                 if (StringUtils.isNotBlank(reference)) {
                     // lookup parent:
-                    final PageDefinition pageDefinition = 
filteredDefinitons.get(reference);
+                    final PageDefinition pageDefinition = 
filteredDefinitions.get(reference);
                     if (pageDefinition != null) {
                         final PageFragment fragment = 
filteredFragments.get(pageFragment.getName());
                         if (fragment != null) {
@@ -97,10 +98,26 @@ public class FilePageConfiguration imple
                 }
 
             }
+            // set parents:
+            for (PageDefinition pageDefinition : pageDefinitions) {
+                processKids(pageDefinition, pageDefinition.getChildren());
+            }
+            for (PageFragment pageFragment : pageFragments) {
+                processKids(pageFragment, pageFragment.getChildren());
+            }
             initialized = true;
         }
     }
 
+    private void processKids(PageFragment parent, Iterable<PageFragment> 
children) {
+        if (children != null) {
+            for (PageFragment child : children) {
+                child.setParent(parent);
+                processKids(child, child.getChildren());
+            }
+        }
+    }
+
 
     private void mergeFragmentChildren(PageFragment owner, PageFragment 
pageFragment) {
         final List<PageFragment> fragmentChildren = pageFragment.getChildren();
@@ -211,8 +228,8 @@ public class FilePageConfiguration imple
     
//*************************************************************************************
     private void filterDefinitions() {
 
-        filteredDefinitons = new HashMap<String, PageDefinition>();
-        final Iterator<PageDefinition> iterator = pageDefinitions.iterator();
+        filteredDefinitions = new HashMap<String, PageDefinition>();
+        final Iterator<PageDefinition> iterator = 
getPageDefinitions().iterator();
         while (iterator.hasNext()) {
             PageDefinition definition = iterator.next();
             final String definitionName = definition.getName();
@@ -221,18 +238,24 @@ public class FilePageConfiguration imple
                 iterator.remove();
                 continue;
             }
-            if (filteredDefinitons.containsKey(definitionName)) {
+            final String controller = definition.getController();
+            if (StringUtils.isBlank(controller)) {
+                log.warn("*** SKIPPING Pagedefinition because it has no 
controller defined: {}", definition);
+                iterator.remove();
+                continue;
+            }
+            if (filteredDefinitions.containsKey(definitionName)) {
                 log.warn("*** SKIPPING Pagedefinition [{}] because it was 
already defined", definitionName);
                 iterator.remove();
                 continue;
             }
-            filteredDefinitons.put(definitionName, definition);
+            filteredDefinitions.put(definitionName, definition);
         }
     }
 
     private void filterFragments() {
         filteredFragments = new HashMap<String, PageFragment>();
-        final Iterator<PageFragment> iterator = pageFragments.iterator();
+        final Iterator<PageFragment> iterator = getPageFragments().iterator();
         while (iterator.hasNext()) {
             PageFragment fragment = iterator.next();
             final String fragmentName = fragment.getName();
@@ -241,6 +264,12 @@ public class FilePageConfiguration imple
                 iterator.remove();
                 continue;
             }
+            final String controller = fragment.getController();
+            if (StringUtils.isBlank(controller)) {
+                log.warn("*** SKIPPING PageFragment because it has no 
controller defined: {}", fragment);
+                iterator.remove();
+                continue;
+            }
             if (filteredFragments.containsKey(fragmentName)) {
                 log.warn("*** SKIPPING PageFragment [{}] was already defined", 
fragmentName);
                 iterator.remove();

Modified: 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/resources/example_configuration.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/resources/example_configuration.xml?rev=1373354&r1=1373353&r2=1373354&view=diff
==============================================================================
--- 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/resources/example_configuration.xml
 (original)
+++ 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/main/resources/example_configuration.xml
 Wed Aug 15 11:51:48 2012
@@ -23,21 +23,21 @@
   -->
   <page-definition name="standard" description="Page that is being extended by 
other pages"
                    displayname="Standard page"
-                   owner="testUser" type="TEMPLATE" path="/standard">
-    <page-fragment name="menuController" 
class="org.apache.rave.portal.web.hmvc.example.MyMenuController"
+                   owner="testUser" type="TEMPLATE" path="/standard" 
controller="org.apache.rave.portal.web.hmvc.example.MyPageController">
+    <page-fragment name="menuController" 
controller="org.apache.rave.portal.web.hmvc.example.MyMenuController"
                    type="COMPONENT"/>
-    <page-fragment name="header" path="/header">
-      <page-fragment name="headerController" 
class="org.apache.rave.portal.web.hmvc.example.MyHeaderController"
+    <page-fragment name="header" path="/header" 
controller="org.apache.rave.portal.web.hmvc.example.MyHeadController">
+      <page-fragment name="headerController" 
controller="org.apache.rave.portal.web.hmvc.example.MyHeaderController"
                      type="COMPONENT"/>
     </page-fragment>
-    <page-fragment name="footer" path="/footer">
-      <page-fragment name="footerController" 
class="org.apache.rave.portal.web.hmvc.example.MyFooterController"
-                     type="COMPONENT"/>
+    <page-fragment name="footer" path="/footer" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController">
+      <page-fragment name="subfooter" path="/subfooter" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
+
+
     </page-fragment>
   </page-definition>
   <!-- INVALID PAGE DEFINITION (ALREADY DEFINED) -->
-  <page-definition name="standard" description="Page that is being extended by 
other pages"
-                   displayname="Standard page -INVALID"
+  <page-definition name="standard" description="Page that is being extended by 
other pages" displayname="Standard page -INVALID"
                    owner="testUser" type="TEMPLATE" path="/standard">
 
   </page-definition>
@@ -46,12 +46,10 @@
   <!--
       LOGIN PAGE (extends STANDARD page)
   -->
-  <page-fragment name="loginPage" path="/login" description="Login screen" 
parent="standard">
-    <page-fragment name="header" path="/header">
-      <page-fragment name="headerController" 
class="com.test.LoginHeaderController"/>
-    </page-fragment>
-    <page-fragment name="body" path="/body">
-      <page-fragment name="headerController" 
class="com.test.LoginHeaderController"/>
+  <page-fragment name="loginPage" path="/login" description="Login screen" 
parent="standard" controller="com.test.LoginHeaderController">
+    <page-fragment name="header" path="/header" 
controller="com.test.LoginHeaderController"/>
+    <page-fragment name="body" path="/body" 
controller="org.apache.rave.portal.web.hmvc.example.MyBodyController">
+      <page-fragment name="headerController" 
controller="com.test.LoginHeaderController"/>
     </page-fragment>
   </page-fragment>
 
@@ -59,42 +57,38 @@
       ADMIN PAGE (extends ADMIN page, see below)
   -->
   <page-fragment name="userAdminPage" path="/admin/user" description="User 
administration pages"
-                 parent="adminPage">
+                 parent="adminPage" 
controller="org.apache.rave.portal.web.hmvc.example.MyAdminController">
     <!-- @overrides footer-->
-    <page-fragment name="footer" path="/footer">
-      <page-fragment name="footerController" 
class="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
+    <page-fragment name="footer" path="/footer" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController">
+      <page-fragment name="footerController" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
     </page-fragment>
     <!-- @overrides admin header-->
-    <page-fragment name="header" path="/header">
-      <page-fragment name="headerController" 
class="org.apache.rave.portal.web.hmvc.example.MyHeaderController"
-        />
+    <page-fragment name="header" path="/header" 
controller="org.apache.rave.portal.web.hmvc.example.MyHeaderController">
+      <page-fragment name="headerController" 
controller="org.apache.rave.portal.web.hmvc.example.MyHeaderController"/>
     </page-fragment>
     <!-- add body-->
-    <page-fragment name="body" path="/body">
-      <page-fragment name="bodyController" 
class="org.apache.rave.portal.web.hmvc.example.MyBodyController"/>
-
-    </page-fragment>
+    <page-fragment name="body" path="/body" 
controller="org.apache.rave.portal.web.hmvc.example.MyBodyController"/>
   </page-fragment>
   <!-- INVALID USER ADMIN PAGE (ALREADY DEFINED ABOVE)-->
   <page-fragment name="userAdminPage" path="/admin/user" description="User 
administration pages"
-                 parent="adminPage">
+                 parent="adminPage" 
controller="org.apache.rave.portal.web.hmvc.example.MyBodyController">
     <!-- add body-->
-    <page-fragment name="body" path="/body">
-      <page-fragment name="bodyController" 
class="org.apache.rave.portal.web.hmvc.example.MyBodyController"/>
-    </page-fragment>
+    <page-fragment name="body" path="/body" 
controller="org.apache.rave.portal.web.hmvc.example.MyBodyController"/>
   </page-fragment>
 
 
   <!--
       ADMIN PAGE (extends STANDARD page)
   -->
-  <page-fragment name="adminPage" path="/admin" description="Administration 
pages"
+  <page-fragment name="adminPage" path="/admin" description="Administration 
pages" controller="org.apache.rave.portal.web.hmvc.example.MyPageController"
                  parent="standard">
     <!-- @overrides footer-->
-    <page-fragment name="footer" path="/footer"
-                   
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController">
-      <page-fragment name="footerController" 
class="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
+    <page-fragment name="footer" path="/footer" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController">
+      <page-fragment name="footer" path="/subfooter" 
controller="org.apache.rave.portal.web.hmvc.example.MyFooterController"/>
+
     </page-fragment>
+
+
   </page-fragment>
 
 </configuration>

Modified: 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/test/java/org/apache/rave/jcr/config/FileConfigManagerTest.java
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/test/java/org/apache/rave/jcr/config/FileConfigManagerTest.java?rev=1373354&r1=1373353&r2=1373354&view=diff
==============================================================================
--- 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/test/java/org/apache/rave/jcr/config/FileConfigManagerTest.java
 (original)
+++ 
rave/sandbox/content-services/rave-jcr-integration/page-configuration/src/test/java/org/apache/rave/jcr/config/FileConfigManagerTest.java
 Wed Aug 15 11:51:48 2012
@@ -92,7 +92,7 @@ public class FileConfigManagerTest {
         }
 
         assertTrue("Expected that footer has a child nodes", adminFooter != 
null);
-        assertEquals(1, adminFooter.getChildren().size());
+        assertEquals("Expected 1 child node", 1, 
adminFooter.getChildren().size());
         PageFragment userAdminFragment = null;
 
         for (PageFragment fragment : fragments) {
@@ -102,10 +102,16 @@ public class FileConfigManagerTest {
             }
         }
         assertTrue(userAdminFragment != null);
-        assertEquals(3, userAdminFragment.getChildren().size());
-
+        final List<PageFragment> userAdminKids = 
userAdminFragment.getChildren();
+        assertEquals("Expected 3 kids", 3, userAdminKids.size());
+        for (PageFragment userAdminKid : userAdminKids) {
+            final PageFragment parent = userAdminKid.getParent();
+            assertTrue("Expected child fragment to have a parent", parent != 
null);
+            assertEquals(parent.getName(), "userAdminPage");
+        }
     }
 
+
     @Test(expected = InvalidConfigurationException.class)
     public void testLoadConfigFail() throws Exception {
         ConfigManager dao = new FileConfigManager();

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=1373354&r1=1373353&r2=1373354&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
 Wed Aug 15 11:51:48 2012
@@ -24,9 +24,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.rave.jcr.config.model.JcrPageConfiguration;
-import org.apache.rave.jcr.config.model.JcrPageDefinition;
-import org.apache.rave.jcr.config.model.JcrPageFragment;
+import org.apache.rave.jcr.config.ConfigManager;
 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;
@@ -52,42 +50,16 @@ public class HmvcHandlerMethodMappingByC
     private static final Logger log = 
LoggerFactory.getLogger(HmvcHandlerMethodMappingByConfig.class);
 
 
+    private ConfigManager configManager;
+
     private String configurationName;
-    private String user;
-    private String password;
 
-    @Override
-    protected void initHandlerMethods() {
+    private String configurationPath;
 
 
-        log.info("@parsing configuration");
-        // TODO wire & inject configuration manager
-       /*final Session session = new SessionImpl();
-        final ConfigManager manager = new JcrConfigManager(session, 
"/raveconfig");
-        */
-
-        final PageConfiguration configuration = new JcrPageConfiguration();
-        final PageDefinition myPage = new JcrPageDefinition();
-        myPage.setName("myPage");
-        myPage.setPath("/mypage2");
-        
myPage.setController("org.apache.rave.portal.web.hmvc.example.MyPageController");
-        configuration.addPageDefinition(myPage);
-        //add kids:
-        final PageFragment myHeader = new JcrPageFragment();
-        myHeader.setName("head");
-        myHeader.setPath("myHeader");
-        
myHeader.setController("org.apache.rave.portal.web.hmvc.example.MyHeaderController");
-        myPage.addChild(myHeader);
-        final PageFragment myBody = new JcrPageFragment();
-        myBody.setName("body");
-        myBody.setPath("myBody");
-        
myBody.setController("org.apache.rave.portal.web.hmvc.example.MyContentController");
-        myPage.addChild(myBody);
-        final PageFragment myFooter = new JcrPageFragment();
-        myFooter.setName("footer");
-        myFooter.setPath("myFooter");
-        
myFooter.setController("org.apache.rave.portal.web.hmvc.example.MyFooterController");
-        myPage.addChild(myFooter);
+    @Override
+    protected void initHandlerMethods() {
+        final PageConfiguration configuration = 
configManager.loadConfiguration(configurationPath);
         processConfiguration(configuration);
     }
 
@@ -156,7 +128,12 @@ public class HmvcHandlerMethodMappingByC
     }
 
     private Class<?> classFromString(String controller) {
+        if (controller == null) {
+            log.warn("Provided controller class was null");
+            return null;
+        }
         try {
+
             return Class.forName(controller);
         } catch (ClassNotFoundException e) {
             if (log.isDebugEnabled()) {
@@ -185,15 +162,15 @@ public class HmvcHandlerMethodMappingByC
     }
 
 
-    public void setConfigurationName(String configurationName) {
-        this.configurationName = configurationName;
+    public void setConfigManager(ConfigManager configManager) {
+        this.configManager = configManager;
     }
 
-    public void setUser(String user) {
-        this.user = user;
+    public void setConfigurationName(String configurationName) {
+        this.configurationName = configurationName;
     }
 
-    public void setPassword(String password) {
-        this.password = password;
+    public void setConfigurationPath(String configurationPath) {
+        this.configurationPath = configurationPath;
     }
 }
\ No newline at end of file

Added: 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/page-configuration.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-web-hmvc/src/main/resources/page-configuration.xml?rev=1373354&view=auto
==============================================================================
--- 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/page-configuration.xml
 (added)
+++ 
rave/sandbox/content-services/rave-web-hmvc/src/main/resources/page-configuration.xml
 Wed Aug 15 11:51:48 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<configuration name="default">
+
+  <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>
+
+</configuration>

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

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

Modified: 
rave/sandbox/content-services/rave-web-hmvc/src/test/resources/test-config.xml
URL: 
http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-web-hmvc/src/test/resources/test-config.xml?rev=1373354&r1=1373353&r2=1373354&view=diff
==============================================================================
--- 
rave/sandbox/content-services/rave-web-hmvc/src/test/resources/test-config.xml 
(original)
+++ 
rave/sandbox/content-services/rave-web-hmvc/src/test/resources/test-config.xml 
Wed Aug 15 11:51:48 2012
@@ -38,10 +38,11 @@
   <!--<bean name="handlerMapping" 
class="org.apache.rave.portal.web.hmvc.HmvcHandlerMethodMapping" />-->
   <bean name="handlerMapping" 
class="org.apache.rave.portal.web.hmvc.HmvcHandlerMethodMappingByConfig">
     <property name="configurationName" value="myConfiguration"/>
-    <property name="user" value="admin"/>
-    <property name="password" value="admin"/>
+    <property name="configurationPath" 
value="classpath:page-configuration.xml"/>
+    <property name="configManager" ref="fileConfigurationManager"/>
   </bean>
   <bean name="handlerAdapter" 
class="org.apache.rave.portal.web.hmvc.HmvcHandlerMethodHandlerAdapter"/>
+  <bean id="fileConfigurationManager" 
class="org.apache.rave.jcr.config.FileConfigManager"/>
 
 
 </beans>


Reply via email to