portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r534967 - in /portals/jetspeed-2/trunk/components/portal-site: ./ src/java/org/apache/jetspeed/portalsite/view/ src/test/org/apache/jetspeed/portalsite/ testdata/pages/ testdata/pages/__subsite-root/_hostname/ testdata/pages/__subsite-root/...
Date Thu, 03 May 2007 19:23:08 GMT
Author: taylor
Date: Thu May  3 12:23:06 2007
New Revision: 534967

URL: http://svn.apache.org/viewvc?view=rev&rev=534967
Log:
https://issues.apache.org/jira/browse/JS2-674
I can now create two types of subsite scenarios based on a profile _control mechanism, in
this case the _hostname:
1. directly off the /_hostname, not using subsites, but we can still discovering pages from
a user + role fallback combo rule
   using this approach also allows fallback to the root / folder and should be considered
optional in future enhancements
2. standard subsite root approach, placing a _control (_hostname) under the __subsite root
and discovering pages from a user + role fallback combo rule
   this is a standard subsite approach that only falls back to the subsite root, thus allowing
content placed in the __subsite_root
   however pages will not be located directly off the root /

note that both of these approaches still can use a page.security file defined in a central
location /page.security

Added:
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/users-page.psml
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/home.psml
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/users-page.psml
    portals/jetspeed-2/trunk/components/portal-site/testdata/pages/page.security
Modified:
    portals/jetspeed-2/trunk/components/portal-site/maven.xml
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
    portals/jetspeed-2/trunk/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java

Modified: portals/jetspeed-2/trunk/components/portal-site/maven.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/maven.xml?view=diff&rev=534967&r1=534966&r2=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/maven.xml (original)
+++ portals/jetspeed-2/trunk/components/portal-site/maven.xml Thu May  3 12:23:06 2007
@@ -17,7 +17,7 @@
 -->
 <project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define">
 
-  <property name='testcase' value='org.apache.jetspeed.components.portalsite.TestPortalSite'/>
+  <property name='testcase' value='org.apache.jetspeed.portalsite.TestPortalSite'/>
 
   <preGoal name="test:test">
     <copy todir="target/testdata">

Modified: portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java?view=diff&rev=534967&r1=534966&r2=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
(original)
+++ portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/portalsite/view/SiteView.java
Thu May  3 12:23:06 2007
@@ -435,7 +435,6 @@
                         // value case as provided by profiler
                         String propertyName = properties[i].getName().toLowerCase();
                         String propertyValue = properties[i].getValue();
-                        
                         // detect duplicate control names which indicates multiple
                         // values: must duplicate locator paths for each value; different
                         // control values are simply appended to all locator paths
@@ -567,7 +566,6 @@
                 addLocatorSearchPathsAt = 0;
             }
         }
-
         return searchPaths;
     }
 

Modified: portals/jetspeed-2/trunk/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java?view=diff&rev=534967&r1=534966&r2=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java
(original)
+++ portals/jetspeed-2/trunk/components/portal-site/src/test/org/apache/jetspeed/portalsite/TestPortalSite.java
Thu May  3 12:23:06 2007
@@ -125,6 +125,42 @@
         assertEquals(rootFolder.getLink("link0.link"), rootLink0);        
     }
 
+    public void testRelativeNavigations() throws Exception
+    {
+        JetspeedProfileLocator locator = new JetspeedProfileLocator();
+
+        locator.init(null, "/");
+        locator.add("hostname", true, false, "dash");
+        locator.add("user", true, false, "joe");
+        locator.add("page", false, false, "home");
+        SiteView profileView = new SiteView(pageManager, locator);
+        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
+        
+        locator = new JetspeedProfileLocator();
+        locator.init(null, "/");
+        locator.add("hostname", true, false, "dash");
+        locator.add("user", true, false, "joe");
+        locator.add("navigation", false, true, "/");
+        locator.add("hostname", true, false, "dash");
+        locator.add("role", true, false, "user");
+        locator.add("page", false, false, "home");
+        profileView = new SiteView(pageManager, locator);
+        assertEquals("/_hostname/dash/_user/joe,/_hostname/dash/_role/user,/_hostname/dash,/",
profileView.getSearchPathsString());
+  
+        locator = new JetspeedProfileLocator();
+        //locator.init(null, "/__subsite-root");
+        locator.init(null, "/");        
+        locator.add("navigation", false, true, "subsite-root");
+        locator.add("hostname", true, false, "localhost");
+        locator.add("user", true, false, "sublocal");
+        locator.add("navigation", false, true, "subsite-root");
+        locator.add("hostname", true, false, "localhost");
+        locator.add("role", true, false, "somerole");
+        locator.add("path", false, false, "home");
+        profileView = new SiteView(pageManager, locator);
+        assertEquals("/__subsite-root/_hostname/localhost/_user/sublocal,/__subsite-root/_hostname/localhost/_role/somerole,/__subsite-root/_hostname/localhost,/__subsite-root",
profileView.getSearchPathsString());                       
+    }
+    
     /**
      * testSiteView - Test SiteView operation
      *
@@ -346,7 +382,6 @@
         locator.add("user", true, false, "joe");
         locator.add("page", false, false, "home");
         profileView = new SiteView(pageManager, locator);
-        System.out.println("DST: PATH = " + profileView.getSearchPathsString());
         assertEquals("/_hostname/dash/_user/joe,/_hostname/dash,/", profileView.getSearchPathsString());
         
         locator = new JetspeedProfileLocator();
@@ -547,7 +582,7 @@
      *
      * @throws Exception
      */
-    public void xtestPotalSiteMenus() throws Exception
+    public void testPotalSiteMenus() throws Exception
     {
         assertNotNull(portalSite);
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
@@ -1079,7 +1114,7 @@
      *
      * @throws Exception
      */
-    public void xtestPotalSiteHiddenPageMenus() throws Exception
+    public void testPotalSiteHiddenPageMenus() throws Exception
     {
         assertNotNull(portalSite);
         PortalSiteSessionContext sessionContext = portalSite.newSessionContext();

Added: portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/users-page.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/users-page.psml?view=auto&rev=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/users-page.psml
(added)
+++ portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_role/somerole/users-page.psml
Thu May  3 12:23:06 2007
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<page id="rolefallbacktest"
+    xmlns="http://portals.apache.org/jetspeed"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd">
+
+  <title>Role Fallback and subsite navigation test</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</page>

Added: portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/home.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/home.psml?view=auto&rev=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/home.psml
(added)
+++ portals/jetspeed-2/trunk/components/portal-site/testdata/pages/__subsite-root/_hostname/localhost/_user/sublocal/home.psml
Thu May  3 12:23:06 2007
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<page id="page30"
+    xmlns="http://portals.apache.org/jetspeed"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd">
+
+  <title>/page0.psml</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</page>

Added: portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/users-page.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/users-page.psml?view=auto&rev=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/users-page.psml
(added)
+++ portals/jetspeed-2/trunk/components/portal-site/testdata/pages/_hostname/dash/_role/user/users-page.psml
Thu May  3 12:23:06 2007
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<page id="rolefallbacktest"
+    xmlns="http://portals.apache.org/jetspeed"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd">
+
+  <title>Role Fallback and subsite navigation test</title>
+  <fragment id="fake" name="fake" type="fake"/>
+</page>

Added: portals/jetspeed-2/trunk/components/portal-site/testdata/pages/page.security
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal-site/testdata/pages/page.security?view=auto&rev=534967
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/testdata/pages/page.security (added)
+++ portals/jetspeed-2/trunk/components/portal-site/testdata/pages/page.security Thu May 
3 12:23:06 2007
@@ -0,0 +1,101 @@
+<?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.
+-->
+<page-security xmlns="http://portals.apache.org/jetspeed"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/page-security.xsd">
+
+  <!-- define global admin constraints -->
+  <security-constraints-def name="admin">
+    <security-constraint>
+      <roles>admin</roles>
+      <permissions>view, edit</permissions>
+    </security-constraint>
+  </security-constraints-def>
+  <global-security-constraints-ref>admin</global-security-constraints-ref>
+
+  <!-- define manager constraints -->
+  <security-constraints-def name="manager">
+    <security-constraint>
+      <roles>manager</roles>
+      <permissions>view</permissions>
+    </security-constraint>
+  </security-constraints-def>
+
+  <!-- define user constraints -->
+  <security-constraints-def name="users">
+    <security-constraint>
+      <roles>user, manager</roles>
+      <permissions>view</permissions>
+    </security-constraint>
+  </security-constraints-def>
+
+  <!-- define public constraints -->
+  <security-constraints-def name="public-view">
+    <security-constraint>
+      <users>*</users>
+      <permissions>view</permissions>
+    </security-constraint>
+  </security-constraints-def>
+  <security-constraints-def name="public-edit">
+    <security-constraint>
+      <roles>user</roles>
+      <permissions>view, edit</permissions>
+    </security-constraint>
+  </security-constraints-def>
+  <security-constraints-def name="AEUV">
+    <security-constraint>
+      <roles>admin</roles>
+      <permissions>view, edit</permissions>
+    </security-constraint>
+    <security-constraint>
+      <roles>user</roles>
+      <permissions>view</permissions>
+    </security-constraint>    
+  </security-constraints-def>
+
+ <security-constraints-def name="dev">
+    <security-constraint>
+      <roles>dev</roles>
+      <permissions>view</permissions>
+    </security-constraint>
+    <security-constraint>
+      <roles>devmgr,admin</roles>
+      <permissions>view, edit</permissions>
+    </security-constraint>
+  </security-constraints-def>
+
+ <security-constraints-def name="devmgr">
+    <security-constraint>
+      <roles>devmgr</roles>
+      <permissions>view</permissions>
+    </security-constraint>
+    <security-constraint>
+      <roles>admin</roles>
+      <permissions>view, edit</permissions>
+    </security-constraint>
+  </security-constraints-def>
+
+  <security-constraints-def name="delegated">
+    <security-constraint>
+      <roles>devmgr</roles>
+      <permissions>view,edit</permissions>
+    </security-constraint>
+  </security-constraints-def>
+ 
+
+</page-security>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message