You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by ta...@apache.org on 2010/05/14 06:41:50 UTC
svn commit: r944108 - in /portals/applications/sandbox/content/trunk: ./
etc/ etc/assembly/ etc/pages/ pages/
src/main/java/org/apache/portals/applications/content/
src/main/java/org/apache/portals/applications/content/beans/
src/main/webapp/WEB-INF/ s...
Author: taylor
Date: Fri May 14 04:41:50 2010
New Revision: 944108
URL: http://svn.apache.org/viewvc?rev=944108&view=rev
Log:
experimenting with dpsml and jcr
Added:
portals/applications/sandbox/content/trunk/etc/
portals/applications/sandbox/content/trunk/etc/assembly/
portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml (with props)
portals/applications/sandbox/content/trunk/etc/pages/
portals/applications/sandbox/content/trunk/etc/pages/jcr-content.dpsml
portals/applications/sandbox/content/trunk/pages/
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java (with props)
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java (with props)
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java (with props)
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java (with props)
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp (with props)
Modified:
portals/applications/sandbox/content/trunk/pom.xml
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml
Added: portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml (added)
+++ portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml Fri May 14 04:41:50 2010
@@ -0,0 +1,464 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <!-- XML/Castor PageManager -->
+
+ <bean id="xmlDocumentHandlerFactory" class="org.apache.jetspeed.page.document.psml.DocumentHandlerFactoryImpl">
+ <meta key="j2:cat" value="xmlPageManager or pageSerializer" />
+ <constructor-arg>
+ <map>
+ <entry key=".psml">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>.psml</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.PageImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key=".tpsml">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>.tpsml</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.PageTemplateImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key=".dpsml">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>.dpsml</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.DynamicPageImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key=".fpsml">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>.fpsml</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.FragmentDefinitionImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key=".link">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>.link</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.LinkImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key="folder.metadata">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>folder.metadata</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ <entry key="page.security">
+ <bean class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler">
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>/JETSPEED-INF/castor/page-mapping.xml</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <value>page.security</value>
+ </constructor-arg>
+ <constructor-arg index="3">
+ <value>org.apache.jetspeed.om.page.psml.PageSecurityImpl</value>
+ </constructor-arg>
+ <constructor-arg index="4">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="5">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+ </entry>
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <bean id="xmlFolderHandler" class="org.apache.jetspeed.page.document.psml.FileSystemFolderHandler">
+ <meta key="j2:cat" value="xmlPageManager or pageSerializer" />
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>${psml.pages.path}</value>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <ref bean="xmlDocumentHandlerFactory" />
+ </constructor-arg>
+ <constructor-arg index="3">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ </bean>
+
+ <bean name="xmlPageManager" class="org.apache.jetspeed.page.psml.CastorXmlPageManager" init-method="init" destroy-method="destroy">
+ <meta key="j2:cat" value="xmlPageManager or pageSerializer" />
+ <constructor-arg index="0">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <ref bean="xmlDocumentHandlerFactory" />
+ </constructor-arg>
+ <constructor-arg index="2">
+ <ref bean="xmlFolderHandler" />
+ </constructor-arg>
+ <constructor-arg index="3">
+ <ref bean="PageFileCache" />
+ </constructor-arg>
+ <!-- permissions security enabled flag, default=false -->
+ <constructor-arg index="4">
+ <value>${page.manager.permissions.security}</value>
+ </constructor-arg>
+ <!-- constraints security enabled flag, default=true -->
+ <constructor-arg index="5">
+ <value>${page.manager.constraints.security}</value>
+ </constructor-arg>
+ </bean>
+
+ <!-- End XML/Castor PageManager -->
+
+ <!-- Database PageManager -->
+
+ <bean id="dbPageManagerImpl" class="org.apache.jetspeed.page.impl.DatabasePageManager" init-method="init" destroy-method="destroy">
+ <meta key="j2:cat" value="dbPageManager or pageSerializer" />
+ <!-- OJB configuration file resource path -->
+ <constructor-arg index="0">
+ <value>JETSPEED-INF/ojb/page-manager-repository.xml</value>
+ </constructor-arg>
+ <!-- fragment id generator -->
+ <constructor-arg index="1">
+ <ref bean="IdGenerator" />
+ </constructor-arg>
+ <!-- permissions security enabled flag, default=false -->
+ <constructor-arg index="2">
+ <value>${page.manager.permissions.security}</value>
+ </constructor-arg>
+ <!-- constraints security enabled flag, default=true -->
+ <constructor-arg index="3">
+ <value>${page.manager.constraints.security}</value>
+ </constructor-arg>
+ <!-- folder/page/link cache -->
+ <constructor-arg index="4">
+ <ref bean="pageManagerOidCache"/>
+ </constructor-arg>
+ <!-- folder/page/link path cache -->
+ <constructor-arg index="5">
+ <ref bean="pageManagerPathCache"/>
+ </constructor-arg>
+ <!-- fragment properties cache -->
+ <constructor-arg index="6">
+ <ref bean="pageManagerPropertiesCache"/>
+ </constructor-arg>
+ <!-- fragment properties path cache -->
+ <constructor-arg index="7">
+ <ref bean="pageManagerPropertiesPathCache"/>
+ </constructor-arg>
+ <!-- principal fragment properties cache -->
+ <constructor-arg index="8">
+ <ref bean="pageManagerPrincipalPropertiesCache"/>
+ </constructor-arg>
+ <!-- principal fragment properties path cache -->
+ <constructor-arg index="9">
+ <ref bean="pageManagerPrincipalPropertiesPathCache"/>
+ </constructor-arg>
+ </bean>
+
+ <bean id="dbPageManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
+ <meta key="j2:cat" value="dbPageManager or pageSerializer" />
+ <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" />
+ <property name="transactionManager">
+ <ref bean="transactionManager" />
+ </property>
+ <property name="proxyInterfaces">
+ <value>org.apache.jetspeed.page.PageManager</value>
+ </property>
+ <property name="target">
+ <ref bean="dbPageManagerImpl" />
+ </property>
+ <property name="transactionAttributes">
+ <props>
+ <!--
+ note: set cache transaction method name patterns in pageManagerInterceptor
+ for methods that directly or indirectly add cache transactions so that
+ they can properly rollback and cleanup thread local storage
+ -->
+ <prop key="*">PROPAGATION_SUPPORTS</prop>
+ <prop key="*Exists">PROPAGATION_SUPPORTS</prop>
+ <prop key="addListener">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ <prop key="checkConstraint">PROPAGATION_SUPPORTS</prop>
+ <prop key="cleanupRequestCache">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="copy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ <prop key="create*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ <prop key="deep*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ <prop key="get*">PROPAGATION_SUPPORTS,+java.lang.SecurityException</prop>
+ <prop key="getConstraintsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="getNodeReapingInterval">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="getPermissionsEnabled">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="isDistributed">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="new*">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="notifyUpdatedNode">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ <prop key="removeListener">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="reset">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="shutdown">PROPAGATION_NOT_SUPPORTED</prop>
+ <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+ </props>
+ </property>
+ <property name="preInterceptors">
+ <list>
+ <bean class="org.apache.jetspeed.util.interceptors.PageManagerInterceptor">
+ <!--
+ set cache transaction method name patterns for methods that
+ directly or indirectly add cache transactions so that they
+ can properly rollback and cleanup thread local storage
+ -->
+ <constructor-arg>
+ <list>
+ <value>update*</value>
+ <value>addPages</value>
+ </list>
+ </constructor-arg>
+ </bean>
+ </list>
+ </property>
+ <!-- Replace support:
+ <property name="preInterceptors">
+ <list>
+ <bean id="methodReplayInterceptor" class="org.apache.jetspeed.util.interceptors.MethodReplayInterceptor">
+ <property name="retryCount" value="3"/>
+ <property name="retryInterval" value="500"/>
+ <property name="replayDecisionMaker">
+ <bean class="org.apache.jetspeed.util.interceptors.TransactionalMethodReplayDecisionMaker">
+ <property name="sqlErrorCodes">
+ <value>9999, 400, -80</value>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+ -->
+ </bean>
+
+ <!-- Inject Page Manager Proxy into Page Manager -->
+ <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+ <meta key="j2:cat" value="dbPageManager or pageSerializer" />
+ <property name="targetObject">
+ <ref bean="dbPageManagerImpl" />
+ </property>
+ <property name="targetMethod">
+ <value>setPageManagerProxy</value>
+ </property>
+ <property name="arguments">
+ <list>
+ <ref bean="dbPageManager" />
+ </list>
+ </property>
+ </bean>
+
+ <!-- End Database PageManager -->
+
+ <!-- FactoryBean selecting which PageManager to use -->
+
+ <bean class="org.springframework.beans.factory.config.BeanReferenceFactoryBean">
+ <meta key="j2:cat" value="xmlPageManager" />
+ <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" />
+ <property name="targetBeanName" value="xmlPageManager" />
+ </bean>
+
+ <bean class="org.springframework.beans.factory.config.BeanReferenceFactoryBean">
+ <meta key="j2:cat" value="dbPageManager" />
+ <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" />
+ <property name="targetBeanName" value="dbPageManager" />
+ </bean>
+
+ <bean class="org.apache.jetspeed.components.factorybeans.NullReferenceFactoryBean">
+ <meta key="j2:cat" value="noPageManager" />
+ <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" />
+ <property name="objectType" value="org.apache.jetspeed.page.PageManager"></property>
+ </bean>
+
+ <!-- PortalSite -->
+ <bean id="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper" name="portalSiteContentTypeMapper"
+ class="org.apache.jetspeed.portalsite.impl.PortalSiteContentTypeMapperImpl">
+ <meta key="j2:cat" value="default" />
+ <constructor-arg index="0">
+ <list>
+ <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+ <constructor-arg index="0">
+ <value>^/content/.*\w[.](\w+)$</value> <!-- use $ for '$' -->
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>$1</value> <!-- use $ for '$' -->
+ </constructor-arg>
+ </bean>
+ <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+ <constructor-arg index="0">
+ <value>^/content/</value>
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>html</value>
+ </constructor-arg>
+ </bean>
+ <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+ <constructor-arg index="0">
+ <value>^/news/.*\w[.](\w+)$</value> <!-- use $ for '$' -->
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>$1</value> <!-- use $ for '$' -->
+ </constructor-arg>
+ </bean>
+ <bean class="org.apache.jetspeed.portalsite.impl.ContentTypeMapping">
+ <constructor-arg index="0">
+ <value>^/news/</value>
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>html</value>
+ </constructor-arg>
+ </bean>
+ </list>
+ </constructor-arg>
+ </bean>
+ <bean id="org.apache.jetspeed.portalsite.PortalSite" name="portalSite"
+ class="org.apache.jetspeed.portalsite.impl.PortalSiteImpl">
+ <meta key="j2:cat" value="default" />
+ <constructor-arg index="0">
+ <ref bean="org.apache.jetspeed.page.PageManager" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <ref bean="org.apache.jetspeed.portalsite.PortalSiteContentTypeMapper"/>
+ </constructor-arg>
+ </bean>
+
+ <!-- PageSerializer, source: xmlPageManager, dest: dbPageMmanager -->
+ <bean id="org.apache.jetspeed.page.PageSerializer" class="org.apache.jetspeed.page.PageSerializerImpl">
+ <meta key="j2:cat" value="pageSerializer" />
+ <constructor-arg index="0">
+ <ref bean="xmlPageManager" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <ref bean="dbPageManager" />
+ </constructor-arg>
+ </bean>
+
+ <!-- PageLayoutComponent -->
+ <bean id="org.apache.jetspeed.layout.PageLayoutComponent"
+ class="org.apache.jetspeed.layout.impl.PageLayoutComponentImpl">
+ <meta key="j2:cat" value="default" />
+ <constructor-arg index="0">
+ <ref bean="org.apache.jetspeed.page.PageManager" />
+ </constructor-arg>
+ <constructor-arg index="1">
+ <value>jetspeed-layouts::VelocityOneColumn</value>
+ </constructor-arg>
+ </bean>
+
+</beans>
Propchange: portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/etc/assembly/page-manager.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: portals/applications/sandbox/content/trunk/etc/pages/jcr-content.dpsml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/etc/pages/jcr-content.dpsml?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/etc/pages/jcr-content.dpsml (added)
+++ portals/applications/sandbox/content/trunk/etc/pages/jcr-content.dpsml Fri May 14 04:41:50 2010
@@ -0,0 +1,47 @@
+<?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.
+-->
+<dynamic-page id="jcr-content" content-type="*"
+ 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.2/schemas/dpsml.xsd">
+
+ <title>CMS Content</title>
+
+ <fragment id="dcms-1-layout" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
+ <property name="sizes" value="80%,20%" />
+ <fragment id="dcms-2-content" type="portlet" name="apa-content::NewsItemPortlet">
+ <property name="row" value="0" />
+ <property name="column" value="0" />
+ <preference name="SRC">
+ <value>/content/documents/en/news/</value>
+ </preference>
+ <preference name="PORTALPATH">
+ <value>/news/</value>
+ </preference>
+ </fragment>
+ <fragment-reference id="dcms-3-wp-reference" refid="wp-definition">
+ <property name="row" value="0"/>
+ <property name="column" value="1"/>
+ </fragment-reference>
+ </fragment>
+
+ <security-constraints>
+ <security-constraints-ref>public-view</security-constraints-ref>
+ </security-constraints>
+
+</dynamic-page>
Modified: portals/applications/sandbox/content/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/pom.xml?rev=944108&r1=944107&r2=944108&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/pom.xml (original)
+++ portals/applications/sandbox/content/trunk/pom.xml Fri May 14 04:41:50 2010
@@ -42,6 +42,7 @@
<commons-lang.version>2.4</commons-lang.version>
<slf4j.version>1.5.6</slf4j.version>
<log4j.version>1.2.14</log4j.version>
+ <jetspeed.version>2.2.1</jetspeed.version>
</properties>
<dependencies>
@@ -52,6 +53,13 @@
<version>${javax.servlet.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-api</artifactId>
+ <version>${jetspeed.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.portals</groupId>
@@ -99,6 +107,22 @@
<version>${jackrabbit.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.hippoecm</groupId>
+ <artifactId>hippo-ecm-repository-connector</artifactId>
+ <version>2.12.06</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hippoecm</groupId>
+ <artifactId>hippo-ecm-api</artifactId>
+ <version>2.12.06</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1</version>
+ </dependency>
+
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
Added: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java (added)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java Fri May 14 04:41:50 2010
@@ -0,0 +1,68 @@
+package org.apache.portals.applications.content;
+
+import java.util.Map;
+
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.portals.messaging.PortletMessaging;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DynamicContentPortlet extends GenericContentPortlet
+{
+ private final static Logger log = LoggerFactory.getLogger(DynamicContentPortlet.class);
+
+ @Override
+ protected String getContentPath(RenderRequest request) throws PortletException
+ {
+ RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
+
+ // get source web content URL, parameters, and method to view
+ String sourceURL = null;
+ Map sourceParams = null;
+ boolean sourcePostMethod = false;
+ Object msg = PortletMessaging.receive(request, getClass().getName());
+ if (msg != null)
+ {
+ // view rewritten action URL page
+// sourceURL = webContentPage.getUrl();
+// sourceParams = webContentPage.getParams();
+// sourcePostMethod = webContentPage.isPost();
+ }
+ else
+ {
+ // load and validate preferences, (base url and portal base path
+ // should both end in a "/" path separator to ensure that relative
+ // urls in the content resolve predictably)
+ String baseURL = request.getPreferences().getValue("SRC", null);
+ String portalBasePath = request.getPreferences().getValue("PORTALPATH", null);
+ if ((baseURL == null) || (portalBasePath == null))
+ {
+ throw new PortletException("Required SRC and PORTALPATH preferences not set");
+ }
+ if (!baseURL.endsWith("/"))
+ {
+ baseURL += "/";
+ }
+ if (!portalBasePath.startsWith("/"))
+ {
+ portalBasePath = "/"+portalBasePath;
+ }
+ if (!portalBasePath.endsWith("/"))
+ {
+ portalBasePath += "/";
+ }
+ // view content page based on portal request URL
+ String portalRequestPath = rc.getPath();
+ if (!portalRequestPath.startsWith(portalBasePath))
+ {
+ throw new PortletException("Unable to map portal request path: "+portalRequestPath+" onto portal base path: "+portalBasePath);
+ }
+ sourceURL = baseURL+portalRequestPath.substring(portalBasePath.length());
+ }
+ return sourceURL;
+ }
+
+}
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/DynamicContentPortlet.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java?rev=944108&r1=944107&r2=944108&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java (original)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java Fri May 14 04:41:50 2010
@@ -42,6 +42,12 @@ public class GenericContentPortlet exten
{
private Repository repository;
+ protected String getContentPath(RenderRequest request) throws PortletException
+ {
+ String contentPath = request.getPreferences().getValue("contentPath", "");
+ return contentPath;
+ }
+
@Override
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
{
@@ -52,7 +58,7 @@ public class GenericContentPortlet exten
{
session = getSession(request);
ObjectContentManager ocm = OCMUtils.createObjectContentManager(session, getMappingAnnotatedBeanClasses(request));
- String contentPath = request.getPreferences().getValue("contentPath", "");
+ String contentPath = getContentPath(request);
Object contentBean = ocm.getObject(contentPath);
request.setAttribute("contentBean", contentBean);
}
Added: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java (added)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java Fri May 14 04:41:50 2010
@@ -0,0 +1,6 @@
+package org.apache.portals.applications.content;
+
+public class NewsItemPortlet extends DynamicContentPortlet
+{
+
+}
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/NewsItemPortlet.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java (added)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java Fri May 14 04:41:50 2010
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.portals.applications.content.beans;
+
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
+/**
+ * NewsItem from One Hippo Live Site
+ *
+ * @version $Id$
+ */
+@Node(jcrType="onehippo:newsitem", discriminator=false)
+public class NewsItem {
+
+ protected String title;
+ protected String summary;
+ protected String introduction;
+ protected String body;
+
+ @Field(jcrName="onehippo:title")
+ public String getTitle() {
+ return this.title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Field(jcrName="onehippo:summary")
+ public String getSummary() {
+ return this.summary;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ @Field(jcrName="onehippo:introduction")
+ public String getIntroduction() {
+ return this.introduction;
+ }
+
+ public void setIntroduction(String introduction) {
+ this.introduction = introduction;
+ }
+
+
+}
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsItem.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java (added)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java Fri May 14 04:41:50 2010
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+package org.apache.portals.applications.content.beans;
+
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
+/**
+ * TextPage
+ *
+ * @version $Id$
+ */
+@Node(jcrType="demosite:textpage", discriminator=false)
+public class NewsPage {
+
+ protected String title;
+ protected String summary;
+
+ @Field(jcrName="demosite:title")
+ public String getTitle() {
+ return this.title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Field(jcrName="demosite:summary")
+ public String getSummary() {
+ return this.title;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+}
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/beans/NewsPage.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=944108&r1=944107&r2=944108&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml Fri May 14 04:41:50 2010
@@ -72,6 +72,60 @@
</preference>
</portlet-preferences>
</portlet>
+
+ <portlet>
+ <description>News Item Portlet</description>
+ <portlet-name>NewsItemPortlet</portlet-name>
+ <display-name>News Item Content</display-name>
+ <portlet-class>org.apache.portals.applications.content.NewsItemPortlet</portlet-class>
+ <init-param>
+ <name>ViewPage</name>
+ <value>/WEB-INF/view/news-item-view.jsp</value>
+ </init-param>
+ <init-param>
+ <name>EditPage</name>
+ <value>/WEB-INF/view/generic-content-edit.jsp</value>
+ </init-param>
+ <init-param>
+ <name>HelpPage</name>
+ <value>/WEB-INF/view/generic-content-help.jsp</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <portlet-info>
+ <title>News Item</title>
+ <short-title>News</short-title>
+ <keywords>content,news,newsitem,item</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>repositoryURL</name>
+ <value>rmi://127.0.0.1:1199/hipporepository</value>
+ </preference>
+ <preference>
+ <name>repositoryUsername</name>
+ <value>admin</value>
+ </preference>
+ <preference>
+ <name>repositoryPassword</name>
+ <value>admin</value>
+ </preference>
+ <preference>
+ <name>contentBeanType</name>
+ <value>org.apache.portals.applications.content.beans.NewsItem</value>
+ </preference>
+ <preference>
+ <name>contentPath</name>
+ <value>/content/documents/en/news/2008/03/bluesunrise/bluesunrise</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
<custom-portlet-mode>
<description>Custom About Mode</description>
Added: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp?rev=944108&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp (added)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp Fri May 14 04:41:50 2010
@@ -0,0 +1,32 @@
+<%--
+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.
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+
+<h1>News Item</h1>
+<hr/>
+<table>
+ <tr>
+ <th>Title:</th>
+ <td>${contentBean.title}</td>
+ </tr>
+ <tr>
+ <th>Introduction:</th>
+ <td>${contentBean.introduction}</td>
+ </tr>
+</table>
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/news-item-view.jsp
------------------------------------------------------------------------------
svn:keywords = Id