You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@portals.apache.org by rw...@apache.org on 2010/04/20 11:26:03 UTC

svn commit: r935843 - in /portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site: site.xml xdoc/guide-content-mapping-psml.xml xdoc/navigation.xml

Author: rwatler
Date: Tue Apr 20 09:26:03 2010
New Revision: 935843

URL: http://svn.apache.org/viewvc?rev=935843&view=rev
Log:
JS2-1105: document Portal Site content and request URL mapping

Added:
    portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-content-mapping-psml.xml
Modified:
    portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/site.xml
    portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/navigation.xml

Modified: portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/site.xml
URL: http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/site.xml?rev=935843&r1=935842&r2=935843&view=diff
==============================================================================
--- portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/site.xml (original)
+++ portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/site.xml Tue Apr 20 09:26:03 2010
@@ -84,6 +84,7 @@
     	</menu>
 
     	<menu name="PSML Configuration">
+    		<item name="Content and Request URL Mapping" href="guide-content-mapping-psml.html" />
     		<item name="Menus" href="guide-menus-declarative-psml.html" />
     		<item name="PSML Declarative Security" href="guide-security-declarative-psml.html" />
 		</menu>

Added: portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-content-mapping-psml.xml
URL: http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-content-mapping-psml.xml?rev=935843&view=auto
==============================================================================
--- portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-content-mapping-psml.xml (added)
+++ portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-content-mapping-psml.xml Tue Apr 20 09:26:03 2010
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<!--
+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.
+-->
+<document>
+  <properties>
+    <title>Guide to Content Mapping for PSML</title>
+    <subtitle>Guide to Content Mapping for PSML</subtitle>
+    <authors>
+      <person name="Randy Watler" email="rwatler@apache.org"/>
+    </authors>
+  </properties>
+  <body>
+<section name="Content and Request URL Mapping">
+<p>
+The Jetspeed Portal implements request URL mapping features to support portlets designed to display content from repositories or other web sites. This makes it possible to augment the portal URL space with virtual PSML pages and hierarchies that mirror the paths or URL structure of the content source. These features are implemented by the <a href="guide-menus-declarative-psml.html#Portal_Site_Component">Portal Site Component</a> within the portal.
+</p>
+<p>
+While accessing and displaying the content is a responsibility left to portlets, the <a href="guide-menus-declarative-psml.html#Portal_Site_Component">Portal Site Component</a> uses <a href="../devguide/guide-psml.html#Dynamic_Page">dynamic page</a> templates within the portal to present content as portal pages. In addition, the request URL is mapped into a content access path that is passed as a request attribute to portlets, (see <code>PortalReservedParameters.PATH_ATTRIBUTE</code> and <code>PortalReservedParameters.CONTENT_PATH_ATTRIBUTE</code>). By default, matching <a href="../devguide/guide-psml.html#Page">concrete pages</a> defined in the PSML are matched by requests first. If unmatched, requests are then classified by the <a href="#Content_and_Request_URL_Mapping_Configuration">Content Type Mapper</a> implementation registered with the Portal Site Component. The provided implementation decomposes the request URL into a content access path and content type if it is re
 cognized as a content request. This information is subsequently used by the Portal Site Component to find the most specific <a href="../devguide/guide-psml.html#Dynamic_Page">dynamic page</a> that can be addressed by the path on the request URL. Fallback <a href="../devguide/guide-psml.html#Dynamic_Page">dynamic page</a> selection is performed by searching in parent PSML <a href="../devguide/guide-psml.html#Dynamic_Page">folders</a> and matching wildcard, '*', dynamic page content types.
+</p>
+</section>
+<section name="Content and Request URL Mapping Configuration">
+<p>
+The Portal Site content mapping is configured using a Content Type Mapper implementation specified in the portal Spring configuration, (typically in the page-manager.xml assembly file). The provided implementation matches request URLs using Perl regular expression patterns to determine content and system request access paths and dynamic page content types. As with other portal configurations, this object can be replaced with a custom implementation that might leverage external repository or web site information to classify the portal request. 
+</p>
+<p>Example provided Content Type Mapper configuration:</p>
+<source><![CDATA[
+  <bean id="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper" 
+       name="portalSiteContentTypeMapper"
+       class="org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl">
+       <!-- content type mapping -->
+       <constructor-arg index="0">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+                   <constructor-arg index="0"><value>\w[.](\w+)&#36;</value></constructor-arg> <!-- use &#36; for '$' -->
+                   <constructor-arg index="1"><value>&#36;1</value></constructor-arg> <!-- use &#36; for '$' -->
+               </bean>
+           </list>
+       </constructor-arg>
+       <!-- dynamic page path mapping -->
+       <constructor-arg index="1">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>/preview/</value></constructor-arg>
+                   <constructor-arg index="1"><value>/</value></constructor-arg>
+               </bean>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>.domain.com</value></constructor-arg>
+                   <constructor-arg index="1"><value>doc</value></constructor-arg>
+                   <constructor-arg index="2"><value>/(?:draft|scratch)/</value></constructor-arg>
+                   <constructor-arg index="3"><value>/pub/</value></constructor-arg>
+               </bean>
+           </list>
+       </constructor-arg>
+       <!-- system page path mapping -->
+       <constructor-arg index="2">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>/preview/</value></constructor-arg>
+                   <constructor-arg index="1"><value>/</value></constructor-arg>
+               </bean>
+           </list>
+       </constructor-arg>
+       <!-- external content path mapping -->
+       <constructor-arg index="3">
+           <list>
+               <bean class="org.apache.jetspeed.portalsite.impl.RequestPathMapping">
+                   <constructor-arg index="0"><value>[.](\w+)&#36;</value></constructor-arg> <!-- use &#36; for '$' -->
+                   <constructor-arg index="1"><value></value></constructor-arg>
+               </bean>
+           </list>
+       </constructor-arg>
+       <!-- enable content type fallback -->
+       <constructor-arg index="4"><value>true</value></constructor-arg>
+  </bean>
+]]></source>
+<p>
+The above configuration specifies the following content and request URL mapping:
+<ul>
+  <li>Content types are taken from the request URL file extension.</li>
+  <li>Dynamic page request paths are modified by stripping the '/preview' prefix.</li>
+  <li>Dynamic page request paths for 'doc' content types against the '.domain.com' servers are modified by replacing the '/draft' and '/scratch' prefix with '/pub'.</li>
+  <li>Concrete portal page and folder request paths, (i.e. system pages), are also modified by stripping the '/preview' prefix</li>
+  <li>Content page content access paths types are constructed from the request URL by stripping the file extension.</li>
+  <li>Wildcard dynamic page content type fallback is enabled.</li>
+</ul>
+See the <a href="../apidocs/index.html">javadoc</a> for the following classes for more information on configuring these Spring beans:
+<ul>
+  <li><a href="../apidocs/org/apache/jetspeed/portalsite/impl/ContentTypeMapping.html"><code>org.apache.jetspeed.portalsite.impl.ContentTypeMapping</code></a></li>
+  <li><a href="../apidocs/org/apache/jetspeed/portalsite/impl/PortalSiteContentTypeMapperImpl.html"><code>org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl</code></a></li>
+  <li><a href="../apidocs/org/apache/jetspeed/portalsite/impl/RequestPathMapping.html"><code>org.apache.jetspeed.portalsite.impl.RequestPathMapping</code></a></li>
+</ul>
+</p>
+</section>
+</body>
+</document>

Modified: portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/navigation.xml
URL: http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/navigation.xml?rev=935843&r1=935842&r2=935843&view=diff
==============================================================================
--- portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/navigation.xml (original)
+++ portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/navigation.xml Tue Apr 20 09:26:03 2010
@@ -65,6 +65,7 @@
     	</menu>
 
     	<menu name="PSML Configuration">
+    		<item name="Content and Request URL Mapping" href="deployguide/guide-content-mapping-psml.html" />
     		<item name="Menus" href="deployguide/guide-menus-declarative-psml.html" />
     		<item name="PSML Declarative Security" href="deployguide/guide-security-declarative-psml.html" />
 		</menu>