gatein SVN: r942 - in components/sso/trunk/packaging/opensso: src and 16 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-05 16:59:00 -0500 (Sat, 05 Dec 2009)
New Revision: 942
Added:
components/sso/trunk/packaging/opensso/pom.xml
components/sso/trunk/packaging/opensso/src/
components/sso/trunk/packaging/opensso/src/main/
components/sso/trunk/packaging/opensso/src/main/config/
components/sso/trunk/packaging/opensso/src/main/config/gatein/
components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/
components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/META-INF/
components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/webui/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/jsp/
components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/jsp/login.jsp
components/sso/trunk/packaging/opensso/src/main/config/plugin/
components/sso/trunk/packaging/opensso/src/main/config/plugin/config/
components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/
components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/default/
components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml
Log:
opensso integration (code backup for first successful run)
Added: components/sso/trunk/packaging/opensso/pom.xml
===================================================================
--- components/sso/trunk/packaging/opensso/pom.xml (rev 0)
+++ components/sso/trunk/packaging/opensso/pom.xml 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,196 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>packaging</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>trunk-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>opensso-pkg</artifactId>
+ <packaging>jar</packaging>
+ <name>OpenSSO Agent and Server Packages</name>
+
+ <dependencies>
+ <!-- gatein installation dependencies -->
+ <!-- -
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>auth-callback</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>agent</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jasig.cas</groupId>
+ <artifactId>cas-client-core</artifactId>
+ </dependency>
+ -->
+
+ <!-- cas server plugin installation dependencies -->
+ <!--
+ <dependency>
+ <groupId>org.gatein.sso</groupId>
+ <artifactId>gatein-cas-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+ -->
+ </dependencies>
+
+ <profiles>
+ <!-- Install the CAS Agent into the Gatein Server -->
+ <profile>
+ <id>gatein-opensso-install</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.40</version>
+ <executions>
+ <execution>
+ <id>agent-package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <echo message="Preparing the OpenSSO Agent for GateIn"/>
+
+ <!-- setup the directory for cas agent artifact -->
+ <delete dir="${basedir}/target/gatein"/>
+ <mkdir dir="${basedir}/target/gatein"/>
+
+ <unjar src="${gatein.location}/deploy/gatein.ear/02portal.war"
+ dest="${basedir}/target/gatein/portal.war" overwrite="true"/>
+
+ <!-- override the core artifacts -->
+ <copy todir="${basedir}/target/gatein/portal.war" overwrite="true">
+ <fileset dir="${basedir}/src/main/config/gatein/portal.war"/>
+ </copy>
+
+ <!-- jar it back up -->
+ <jar destfile="${basedir}/target/gatein/02portal.war" basedir="${basedir}/target/gatein/portal.war"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>agent-install</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <echo message="Deploying the OpenSSO Agent for GateIn"/>
+
+ <copy file="${basedir}/target/gatein/02portal.war"
+ todir="${gatein.location}/deploy/gatein.ear"
+ overwrite="true"/>
+
+ <copy file="${basedir}/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml"
+ tofile="${gatein.location}/deploy/gatein.ear/META-INF/gatein-jboss-beans.xml"
+ overwrite="true"/>
+
+ <!-- Deploy the Authentication Callback RESTful service -->
+ <copy file="${settings.localRepository}/org/gatein/sso/auth-callback/${project.version}/auth-callback-${project.version}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <!-- Deploy the SSO Agent -->
+ <copy file="${settings.localRepository}/org/gatein/sso/agent/${project.version}/agent-${project.version}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+
+ <!-- Deploy OpenSSO Agent dependencies -->
+ <copy file="${settings.localRepository}/opensso/openssoclientsdk/${version.opensso}/openssoclientsdk-${version.opensso}.jar"
+ todir="${gatein.location}/deploy/gatein.ear/lib"
+ overwrite="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- Install the OpenSSO Plugin into an OpenSSO Server -->
+ <profile>
+ <id>plugin-opensso-install</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.40</version>
+ <executions>
+ <execution>
+ <id>plugin-tomcat-package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <echo message="Preparing the OpenSSO Plugin for Tomcat 6.0.2......"/>
+
+ <!-- setup the directory for the plugin artifacts -->
+ <delete dir="${basedir}/target/plugin"/>
+ <mkdir dir="${basedir}/target/plugin"/>
+
+ <!-- prepare the plugin configuration -->
+ <copy todir="${basedir}/target/plugin/webapps/opensso/config/auth/default">
+ <fileset dir="${basedir}/src/main/config/plugin/config/auth/default"/>
+ </copy>
+
+ <!-- prepare the plugin jar -->
+ <copy tofile="${basedir}/target/plugin/webapps/opensso/WEB-INF/lib/gatein-opensso-plugin.jar"
+ file="${settings.localRepository}/org/gatein/sso/gatein-opensso-plugin/${project.version}/gatein-opensso-plugin-${project.version}.jar"
+ overwrite="true"/>
+
+ <!-- copy thirdparty dependency -->
+ <copy tofile="${basedir}/target/plugin/webapps/opensso/WEB-INF/lib/commons-httpclient.jar"
+ file="${settings.localRepository}/commons-httpclient/commons-httpclient/${version.commons-httpclient}/commons-httpclient-${version.commons-httpclient}.jar"
+ overwrite="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>plugin-tomcat-install</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+ <echo message="Starting OpenSSO Plugin Deployment into Tomcat 6.0.2......"/>
+
+ <!-- jar plugin -->
+ <jar destfile="${basedir}/target/plugin.jar" basedir="${basedir}/target/plugin"/>
+
+ <!-- explode the jar to install the plugin -->
+ <unjar src="${basedir}/target/plugin.jar" dest="${tomcat60.location}" overwrite="true"/>
+
+ <!-- cleanup -->
+ <delete dir="${tomcat60.location}/META-INF"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
+
Added: components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/gatein/gatein.ear/META-INF/gatein-jboss-beans.xml 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,29 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <application-policy xmlns="urn:jboss:security-beans:1.0" name="gatein-domain">
+ <!--
+ <authentication>
+ <login-module code="org.exoplatform.web.security.PortalLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ <login-module code="org.exoplatform.services.security.jaas.SharedStateLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ </authentication>
+ -->
+ <authentication>
+ <login-module code="org.gatein.sso.agent.login.SSOLoginModule" flag="required"></login-module>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required">
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+</deployment>
Added: components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/WEB-INF/web.xml 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>portal</display-name>
+
+ <context-param>
+ <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsWorkspace</param-name>
+ <param-value>portal</param-value>
+ <description>Binary assets workspace name</description>
+ </context-param>
+
+ <context-param>
+ <param-name>org.exoplatform.frameworks.jcr.command.web.fckeditor.digitalAssetsPath</param-name>
+ <param-value>/</param-value>
+ <description>Binary assets path</description>
+ </context-param>
+
+ <!-- ================================================================== -->
+ <!-- RESOURCE FILTER TO CACHE MERGED JAVASCRIPT AND CSS -->
+ <!-- ================================================================== -->
+ <filter>
+ <filter-name>GenericFilter</filter-name>
+ <filter-class>org.exoplatform.web.filter.GenericFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+ <filter-class>org.exoplatform.frameworks.jcr.web.ThreadLocalSessionProviderInitializedFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>SetCurrentIdentityFilter</filter-name>
+ <filter-class>org.exoplatform.services.security.web.SetCurrentIdentityFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>RestEncodingFilter</filter-name>
+ <filter-class>org.exoplatform.services.rest.servlet.RestEncodingFilter</filter-class>
+ <init-param>
+ <param-name>REQUEST_ENCODING</param-name>
+ <param-value>UTF-8</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>CacheUserProfileFilter</filter-name>
+ <filter-class>org.exoplatform.web.CacheUserProfileFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>GenericFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>/javascript/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>SetCurrentIdentityFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>CacheUserProfileFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>RestEncodingFilter</filter-name>
+ <url-pattern>/rest/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ThreadLocalSessionProviderInitializedFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- ================================================================== -->
+ <!-- LISTENER -->
+ <!-- ================================================================== -->
+ <listener>
+ <listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.portal.application.PortalSessionListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+ </listener>
+ <!-- ================================================================== -->
+ <!-- SERVLET -->
+ <!-- ================================================================== -->
+ <servlet>
+ <servlet-name>portal</servlet-name>
+ <servlet-class>org.exoplatform.portal.application.PortalController</servlet-class>
+ <init-param>
+ <param-name>webui.configuration</param-name>
+ <param-value>app:/WEB-INF/webui-configuration.xml</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>RestServer</servlet-name>
+ <description>eXo - Platform REST Server</description>
+ <servlet-class>org.exoplatform.services.rest.servlet.RestServlet</servlet-class>
+ <load-on-startup>4</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>javascript</servlet-name>
+ <servlet-class>org.exoplatform.portal.webui.javascript.JavascriptServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Controller</servlet-name>
+ <servlet-class>org.exoplatform.frameworks.jcr.web.CommandControllerServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- SSO Integration -->
+ <!--
+ <servlet>
+ <servlet-name>PortalLoginController</servlet-name>
+ <servlet-class>org.exoplatform.web.login.PortalLoginController</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <servlet-class>org.exoplatform.web.login.InitiateLoginServlet</servlet-class>
+ </servlet>
+ -->
+ <servlet>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
+ <init-param>
+ <param-name>casServerUrl</param-name>
+ <param-value>http://localhost:8888/cas</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet>
+ <servlet-name>ErrorLoginServlet</servlet-name>
+ <servlet-class>org.exoplatform.web.login.ErrorLoginServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <!-- ================================================================= -->
+ <servlet-mapping>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <url-pattern>/initiatelogin</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ErrorLoginServlet</servlet-name>
+ <url-pattern>/errorlogin</url-pattern>
+ </servlet-mapping>
+
+ <!-- SSO Integration -->
+ <!--
+ <servlet-mapping>
+ <servlet-name>PortalLoginController</servlet-name>
+ <url-pattern>/login</url-pattern>
+ </servlet-mapping>
+ -->
+
+ <servlet-mapping>
+ <servlet-name>javascript</servlet-name>
+ <url-pattern>/javascript/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/private/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/public/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/admin/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/service</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/command/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>RestServer</servlet-name>
+ <url-pattern>/rest/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Controller</servlet-name>
+ <url-pattern>/connector</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+ <!-- The Welcome File List for IBM WebSphere -->
+
+ <welcome-file-list>
+ <welcome-file>/index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>user authentication</web-resource-name>
+ <url-pattern>/private/*</url-pattern>
+ <http-method>POST</http-method>
+ <http-method>GET</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>users</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>admin authentication</web-resource-name>
+ <url-pattern>/admin/*</url-pattern>
+ <http-method>POST</http-method>
+ <http-method>GET</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>admin</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>gatein-domain</realm-name>
+ <form-login-config>
+ <form-login-page>/initiatelogin</form-login-page>
+ <form-error-page>/errorlogin</form-error-page>
+ </form-login-config>
+ </login-config>
+ <security-role>
+ <description>a simple user role</description>
+ <role-name>users</role-name>
+ </security-role>
+ <security-role>
+ <description>the admin role</description>
+ <role-name>admin</role-name>
+ </security-role>
+</web-app>
\ No newline at end of file
Added: components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/groovy/portal/webui/UILoginForm.gtmpl 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,87 @@
+<%
+ import org.exoplatform.web.application.JavascriptManager;
+ import javax.servlet.http.HttpSession;
+ def rcontext = _ctx.getRequestContext();
+ JavascriptManager jsmanager = rcontext.getJavascriptManager();
+ jsmanager.importJavascript('eXo.portal.UIPortalControl');
+ jsmanager.addCustomizedOnLoadScript('document.getElementById("UIPortalComponentLogin").username.focus();');
+ HttpSession session = rcontext.getRequest().getSession();
+ String requestPath = rcontext.getRequestContextPath() + "/private/" + rcontext.getPortalOwner();
+ session.setAttribute("initialURI", requestPath);
+%>
+<div class="UILoginForm">
+ <div class="LoginDecorator">
+ <div class="TopLeftLoginDecorator">
+ <div class="TopRightLoginDecorator">
+ <div class="TopCenterLoginDecorator">
+ <div class="SigninTitle"><%=_ctx.appRes("UILoginForm.label.Signin")%></div>
+ </div>
+ </div>
+ </div>
+ <div class="MiddleLeftLoginDecorator">
+ <div class="MiddleRightLoginDecorator">
+ <div class="LoginDecoratorBackground">
+ <div class="LoginDetailBox">
+ <% uiform.begin(); %>
+ <!--<form class="UIForm" id="$uicomponent.id" name="loginForm" action="<%= rcontext.getRequestContextPath() + "/login"%>" method="post" style="margin: 0px;">
+ <input type="hidden" name="<%= uiform.ACTION %>" value=""/>-->
+ <input type="hidden" name="uri" value="<%=session.getAttribute("initialURI"); %>"/>
+ <div class="VerticalLayout">
+ <table class="UIFormGrid">
+ <tr class="UserNameField">
+ <td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.UserName")%></td>
+ <td><% uiform.renderChild(0)%></td>
+ </tr>
+ <tr class="PasswordField" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
+ <td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.password")%></td>
+ <td><% uiform.renderChild(1)%></td>
+ </tr>
+ <tr class="RememberField" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
+ <td class="FieldLabel"><% uiform.renderChild(2)%></td>
+ <td><%=_ctx.appRes("UILoginForm.label.RememberOnComputer")%></td>
+ </tr>
+ </table>
+ <div class="ForgetPass"><a href="<%= uicomponent.event("ForgetPassword") %>"><%=_ctx.appRes("UILoginForm.label.forgot")%></a></div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="login(this);" id="UIPortalLoginFormAction" class="ActionButton SimpleStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="#"><%=_ctx.appRes("UILoginForm.label.Signin");%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div onclick="<%=uicomponent.event("Close");%>" class="ActionButton SimpleStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes("UILoginForm.label.Discard")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <%uiform.end()%>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="BottomLeftLoginDecorator">
+ <div class="BottomRightLoginDecorator">
+ <div class="BottomCenterLoginDecorator"><span></span></div>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+ <%=uicomponent.event("Close");%>
+ window.location = 'http://localhost:8888/opensso/UI/Login?realm=gatein&goto=http://localhost...';
+</script>
Added: components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/jsp/login.jsp
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/jsp/login.jsp (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/gatein/portal.war/login/jsp/login.jsp 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,39 @@
+<%--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+--%>
+
+<%@ page import="java.net.URLEncoder"%>
+<%@ page import="javax.servlet.http.Cookie"%>
+<%@ page import="org.exoplatform.container.PortalContainer"%>
+<%@ page import="org.exoplatform.services.resources.ResourceBundleService"%>
+<%@ page import="java.util.ResourceBundle"%>
+<%@ page import="org.exoplatform.web.login.InitiateLoginServlet"%>
+<%@ page language="java" %>
+<%@ page contentType="text/html; charset=utf-8" %>
+
+<html>
+ <head>
+ <script type="text/javascript">
+ window.location = 'http://localhost:8888/opensso/UI/Login?realm=gatein&goto=http://localhost...';
+ </script>
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
Added: components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml
===================================================================
--- components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml (rev 0)
+++ components/sso/trunk/packaging/opensso/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml 2009-12-05 21:59:00 UTC (rev 942)
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding="UTF-8"?>
+
+<!DOCTYPE ModuleProperties PUBLIC "=//iPlanet//Authentication Module Properties XML Interface 1.0 DTD//EN"
+ "jar://com/sun/identity/authentication/Auth_Module_Properties.dtd">
+
+<ModuleProperties moduleName="AuthenticationPlugin" version="1.0" >
+ <Callbacks length="2" order="1" timeout="60"
+ header="GateIn OpenSSO Login" >
+ <NameCallback>
+ <Prompt>
+ Username
+ </Prompt>
+ </NameCallback>
+ <PasswordCallback echoPassword="false" >
+ <Prompt>
+ Password
+ </Prompt>
+ </PasswordCallback>
+ </Callbacks>
+</ModuleProperties>
15 years, 1 month
gatein SVN: r941 - in components/sso/trunk: agent and 11 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-05 16:57:24 -0500 (Sat, 05 Dec 2009)
New Revision: 941
Added:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
components/sso/trunk/agent/src/main/resources/
components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/
components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/
components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/
components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/default/
components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml
Removed:
components/sso/trunk/gatein-opensso-plugin/src/main/config/AuthenticationPlugin.xml
components/sso/trunk/gatein-opensso-plugin/target/
Modified:
components/sso/trunk/.classpath
components/sso/trunk/agent/pom.xml
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
components/sso/trunk/gatein-opensso-plugin/pom.xml
components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
components/sso/trunk/packaging/pom.xml
components/sso/trunk/pom.xml
Log:
opensso integration (code backup for first successful run)
Modified: components/sso/trunk/.classpath
===================================================================
--- components/sso/trunk/.classpath 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/.classpath 2009-12-05 21:57:24 UTC (rev 941)
@@ -7,18 +7,17 @@
<classpathentry kind="src" path="gatein-cas-plugin/src/main/java"/>
<classpathentry kind="src" path="gatein-cas-plugin/src/test/java"/>
<classpathentry kind="src" path="gatein-josso-plugin/src/main/java"/>
- <!-- <classpathentry kind="src" path="gatein-opensso-plugin/src/main/java"/> -->
+ <classpathentry kind="src" path="gatein-opensso-plugin/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4.jar" sourcepath="M2_REPO/org/jasig/cas/cas-server-core/3.3.4/cas-server-core-3.3.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar" sourcepath="M2_REPO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/picocontainer/picocontainer/1.1/picocontainer-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
- <!--
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/opensso/amserver/8.0/amserver-8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/opensso/opensso/8.0/opensso-8.0.jar"/>
- -->
+ <classpathentry kind="var" path="M2_REPO/opensso/openssoclientsdk/8.0/openssoclientsdk-8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jasig/cas/cas-client-core/3.1.9/cas-client-core-3.1.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/josso/josso-basic-authscheme/1.8.1/josso-basic-authscheme-1.8.1.jar"/>
Modified: components/sso/trunk/agent/pom.xml
===================================================================
--- components/sso/trunk/agent/pom.xml 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/agent/pom.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -37,6 +37,11 @@
<artifactId>exo.core.component.organization.api</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-client-core</artifactId>
@@ -57,7 +62,7 @@
<dependency>
<groupId>org.josso</groupId>
<artifactId>josso-protocol-client</artifactId>
- </dependency>
+ </dependency>
</dependencies>
<build>
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-05 21:57:24 UTC (rev 941)
@@ -32,6 +32,7 @@
import org.exoplatform.web.login.InitiateLoginServlet;
import org.gatein.sso.agent.cas.CASAgent;
+import org.gatein.sso.agent.opensso.OpenSSOAgent;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -87,5 +88,10 @@
{
//TODO: fix the JOSSO Agent. This will need to the new client side JOSSO stack that can run on 5.1.0.GA
}
- }
+ else
+ {
+ //See if an OpenSSO Token was used
+ OpenSSOAgent.getInstance().validateTicket(httpRequest);
+ }
+ }
}
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/opensso/OpenSSOAgent.java 2009-12-05 21:57:24 UTC (rev 941)
@@ -0,0 +1,184 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.gatein.sso.agent.opensso;
+
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.Cookie;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.exoplatform.web.security.Credentials;
+import org.gatein.sso.agent.GenericSSOAgent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class OpenSSOAgent
+{
+ private static Logger log = Logger.getLogger(OpenSSOAgent.class);
+ private static OpenSSOAgent singleton;
+
+ private String cookieName;
+ private String openSSOUrl;
+
+ private OpenSSOAgent()
+ {
+ //TODO: make this part of externally configured properties
+ this.cookieName = "iPlanetDirectoryPro";
+ this.openSSOUrl = "http://localhost:8888/opensso";
+ }
+
+ public static OpenSSOAgent getInstance()
+ {
+ if(OpenSSOAgent.singleton == null)
+ {
+ synchronized(OpenSSOAgent.class)
+ {
+ if(OpenSSOAgent.singleton == null)
+ {
+ OpenSSOAgent.singleton = new OpenSSOAgent();
+ }
+ }
+ }
+ return OpenSSOAgent.singleton;
+ }
+
+ public String getCookieName()
+ {
+ return cookieName;
+ }
+
+ public void setCookieName(String cookieName)
+ {
+ this.cookieName = cookieName;
+ }
+
+ public String getOpenSSOUrl()
+ {
+ return openSSOUrl;
+ }
+
+ public void setOpenSSOUrl(String openSSOUrl)
+ {
+ this.openSSOUrl = openSSOUrl;
+ }
+
+ public void validateTicket(HttpServletRequest httpRequest) throws Exception
+ {
+ String token = null;
+ Cookie[] cookies = httpRequest.getCookies();
+ for(Cookie cookie: cookies)
+ {
+ if(cookie.getName().equals(this.cookieName))
+ {
+ token = cookie.getValue();
+ break;
+ }
+ }
+
+ if(token != null)
+ {
+ boolean isValid = this.isTokenValid(token);
+
+ if(!isValid)
+ {
+ throw new IllegalStateException("OpenSSO Token is not valid!!");
+ }
+
+ String subject = this.getSubject(token);
+ if(subject != null)
+ {
+ Credentials credentials = new Credentials(subject, "");
+ httpRequest.getSession().setAttribute(GenericSSOAgent.CREDENTIALS, credentials);
+ }
+ }
+ }
+
+ private boolean isTokenValid(String token) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ PostMethod post = null;
+ try
+ {
+ String url = this.openSSOUrl+"/identity/isTokenValid";
+ post = new PostMethod(url);
+ post.addParameter("tokenid", token);
+
+ int status = client.executeMethod(post);
+ String response = post.getResponseBodyAsString();
+
+ log.info("-------------------------------------------------------");
+ log.info("Status: "+status);
+ log.info("Response: "+response);
+ log.info("-------------------------------------------------------");
+
+ if(response.contains(Boolean.TRUE.toString()))
+ {
+ return true;
+ }
+
+ return false;
+ }
+ finally
+ {
+ if(post != null)
+ {
+ post.releaseConnection();
+ }
+ }
+ }
+
+ private String getSubject(String token) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ PostMethod post = null;
+ try
+ {
+ String url = this.openSSOUrl+"/identity/attributes";
+ post = new PostMethod(url);
+ post.addParameter("subjectid", token);
+ post.addParameter("attributes_names", "uid");
+
+ int status = client.executeMethod(post);
+ String response = post.getResponseBodyAsString();
+
+ log.debug("Must Just Read the uid attribute-------------------------------------------------------");
+ log.debug("Status: "+status);
+ log.debug("Response: "+response);
+
+
+ return "demo";
+ }
+ finally
+ {
+ if(post != null)
+ {
+ post.releaseConnection();
+ }
+ }
+ }
+}
Modified: components/sso/trunk/gatein-opensso-plugin/pom.xml
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/pom.xml 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/gatein-opensso-plugin/pom.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -23,7 +23,11 @@
<dependency>
<groupId>opensso</groupId>
<artifactId>amserver</artifactId>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
</dependencies>
<build>
Deleted: components/sso/trunk/gatein-opensso-plugin/src/main/config/AuthenticationPlugin.xml
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/src/main/config/AuthenticationPlugin.xml 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/gatein-opensso-plugin/src/main/config/AuthenticationPlugin.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -1,20 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-
-<!DOCTYPE ModuleProperties PUBLIC "=//iPlanet//Authentication Module Properties XML Interface 1.0 DTD//EN"
- "jar://com/sun/identity/authentication/Auth_Module_Properties.dtd">
-
-<ModuleProperties moduleName="AuthenticationPlugin" version="1.0" >
- <Callbacks length="2" order="1" timeout="60"
- header="GateIn OpenSSO Login" >
- <NameCallback>
- <Prompt>
- Username
- </Prompt>
- </NameCallback>
- <PasswordCallback echoPassword="false" >
- <Prompt>
- Password
- </Prompt>
- </PasswordCallback>
- </Callbacks>
-</ModuleProperties>
Added: components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml (rev 0)
+++ components/sso/trunk/gatein-opensso-plugin/src/main/config/plugin/config/auth/default/AuthenticationPlugin.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding="UTF-8"?>
+
+<!DOCTYPE ModuleProperties PUBLIC "=//iPlanet//Authentication Module Properties XML Interface 1.0 DTD//EN"
+ "jar://com/sun/identity/authentication/Auth_Module_Properties.dtd">
+
+<ModuleProperties moduleName="AuthenticationPlugin" version="1.0" >
+ <Callbacks length="2" order="1" timeout="60"
+ header="GateIn OpenSSO Login" >
+ <NameCallback>
+ <Prompt>
+ Username
+ </Prompt>
+ </NameCallback>
+ <PasswordCallback echoPassword="false" >
+ <Prompt>
+ Password
+ </Prompt>
+ </PasswordCallback>
+ </Callbacks>
+</ModuleProperties>
Modified: components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java
===================================================================
--- components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/gatein-opensso-plugin/src/main/java/org/gatein/sso/opensso/plugin/AuthenticationPlugin.java 2009-12-05 21:57:24 UTC (rev 941)
@@ -1,24 +1,24 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.sso.opensso.plugin;
import java.util.Map;
@@ -28,7 +28,8 @@
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
-import org.apache.log4j.Logger;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
import com.sun.identity.authentication.spi.AMLoginModule;
import com.sun.identity.authentication.spi.AuthLoginException;
@@ -39,43 +40,140 @@
*/
public class AuthenticationPlugin extends AMLoginModule
{
- private static Logger log = Logger.getLogger(AuthenticationPlugin.class);
-
+ private String gateInHost;
+ private String gateInPort;
+ private String gateInContext;
+
+ public String getGateInHost()
+ {
+ return gateInHost;
+ }
+
+ public void setGateInHost(String gateInHost)
+ {
+ this.gateInHost = gateInHost;
+ }
+
+ public String getGateInPort()
+ {
+ return gateInPort;
+ }
+
+ public void setGateInPort(String gateInPort)
+ {
+ this.gateInPort = gateInPort;
+ }
+
+ public String getGateInContext()
+ {
+ return gateInContext;
+ }
+
+ public void setGateInContext(String gateInContext)
+ {
+ this.gateInContext = gateInContext;
+ }
+
public AuthenticationPlugin()
{
-
+
}
-
- public void init(Subject subject, Map sharedState, Map options)
+
+ public void init(Subject subject, Map sharedState, Map options)
{
-
+ //TODO: make this configurable
+ this.gateInHost = "localhost";
+ this.gateInPort = "8080";
+ this.gateInContext = "portal";
}
+
+ public int process(Callback[] callbacks, int state) throws AuthLoginException
+ {
+ try
+ {
+ System.out.println("---------------------------------------------------------------------");
+ System.out.println("Performing GateIn Login..............................................");
+ System.out.println("---------------------------------------------------------------------");
- public int process(Callback[] callbacks, int state) throws AuthLoginException
- {
- System.out.println("---------------------------------------------------------------------");
- System.out.println("Performing GateIn Login..............................................");
- System.out.println("---------------------------------------------------------------------");
-
- for(int i=0; i<callbacks.length; i++)
+ String username = null;
+ String password = null;
+ for (int i = 0; i < callbacks.length; i++)
+ {
+ Callback callback = callbacks[i];
+
+ if (callback instanceof NameCallback)
+ {
+ username = ((NameCallback) callback).getName();
+ System.out.println("Username: " + username);
+ }
+ else if (callback instanceof PasswordCallback)
+ {
+ password = new String(((PasswordCallback) callback).getPassword());
+ System.out.println("Password: " + password);
+ }
+ }
+
+ StringBuilder urlBuffer = new StringBuilder();
+ urlBuffer.append("http://" + this.gateInHost + ":" + this.gateInPort + "/"
+ + this.gateInContext + "/rest/sso/authcallback/auth/" + username + "/"
+ + password);
+
+ System.out.println("-------------------------------------------------------------------");
+ System.out.println("REST Request=" + urlBuffer.toString());
+ System.out.println("-------------------------------------------------------------------");
+
+ System.out.println("About to execute REST call........");
+ boolean success = this.executeRemoteCall(urlBuffer.toString());
+
+ System.out.println("REST Call was a success....("+success+")");
+
+ return ISAuthConstants.LOGIN_SUCCEED;
+ }
+ catch(Throwable e)
{
- Callback callback = callbacks[i];
-
- if(callback instanceof NameCallback)
+ System.out.println("------------------------------------------------------");
+ System.out.println("Exception :"+e.toString());
+ System.out.println("Message :"+e.getMessage());
+ System.out.println("------------------------------------------------------");
+ e.printStackTrace();
+ throw new AuthLoginException(e);
+ }
+ }
+
+ public Principal getPrincipal()
+ {
+ return new GateInPrincipal("demo");
+ }
+
+ private boolean executeRemoteCall(String authUrl) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ GetMethod method = null;
+ try
+ {
+ method = new GetMethod(authUrl);
+
+ int status = client.executeMethod(method);
+ String response = method.getResponseBodyAsString();
+
+ switch (status)
{
- System.out.println("Username: "+((NameCallback)callback).getName());
+ case 200:
+ if (response.equals(Boolean.TRUE.toString()))
+ {
+ return true;
+ }
+ break;
}
- else if(callback instanceof PasswordCallback)
+
+ return false;
+ }
+ finally
+ {
+ if (method != null)
{
- System.out.println("Password: "+new String(((PasswordCallback)callback).getPassword()));
+ method.releaseConnection();
}
}
-
- return ISAuthConstants.LOGIN_SUCCEED;
- }
-
- public Principal getPrincipal()
- {
- return new GateInPrincipal("user");
- }
+ }
}
Modified: components/sso/trunk/packaging/pom.xml
===================================================================
--- components/sso/trunk/packaging/pom.xml 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/packaging/pom.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -14,6 +14,7 @@
<modules>
<module>cas</module>
+ <module>opensso</module>
</modules>
</project>
Modified: components/sso/trunk/pom.xml
===================================================================
--- components/sso/trunk/pom.xml 2009-12-05 10:22:20 UTC (rev 940)
+++ components/sso/trunk/pom.xml 2009-12-05 21:57:24 UTC (rev 941)
@@ -31,7 +31,7 @@
<module>auth-callback</module>
<module>gatein-cas-plugin</module>
<module>gatein-josso-plugin</module>
- <!-- <module>gatein-opensso-plugin</module> -->
+ <module>gatein-opensso-plugin</module>
<module>packaging</module>
</modules>
@@ -102,7 +102,7 @@
<groupId>opensso</groupId>
<artifactId>amserver</artifactId>
<version>${version.opensso}</version>
- </dependency>
+ </dependency>
<!-- josso -->
<dependency>
15 years, 1 month
gatein SVN: r940 - portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-05 05:22:20 -0500 (Sat, 05 Dec 2009)
New Revision: 940
Modified:
portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
Log:
need gatein servlet there
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml 2009-12-05 05:32:23 UTC (rev 939)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml 2009-12-05 10:22:20 UTC (rev 940)
@@ -36,4 +36,15 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ </servlet-mapping>
+
</web-app>
15 years, 1 month
gatein SVN: r939 - in components/wsrp/trunk/producer/src: main/java/org/gatein/registration/impl and 4 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-05 00:32:23 -0500 (Sat, 05 Dec 2009)
New Revision: 939
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPropertyValidator.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
Log:
- More generification.
- Fixed improper parameter type in RegistrationPolicy.validateRegistrationDataFor.
- Fixed improper package name in javadoc.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/AbstractRegistrationPersistenceManager.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -27,6 +27,7 @@
import org.gatein.registration.spi.ConsumerSPI;
import org.gatein.registration.spi.RegistrationSPI;
+import javax.xml.namespace.QName;
import java.util.Map;
/**
@@ -94,7 +95,7 @@
consumer.removeRegistration(registration);
}
- public Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException
+ public Registration addRegistrationFor(String consumerId, Map<QName, Object> registrationProperties) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
ParameterValidation.throwIllegalArgExceptionIfNull(registrationProperties, "Registration properties");
@@ -144,7 +145,7 @@
protected abstract RegistrationSPI internalRemoveRegistration(String registrationId);
- protected abstract RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map registrationProperties);
+ protected abstract RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties);
protected abstract void internalAddConsumer(ConsumerSPI consumer);
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -63,7 +63,7 @@
* @return the consumer registrations
* @throws RegistrationException
*/
- Collection<? extends Registration> getRegistrations() throws RegistrationException;
+ Collection<Registration> getRegistrations() throws RegistrationException;
/**
* Returns the group that this consumer belongs to.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationManager.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationManager.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -23,6 +23,7 @@
package org.gatein.registration;
+import javax.xml.namespace.QName;
import java.util.Collection;
import java.util.Map;
@@ -43,7 +44,7 @@
void setPersistenceManager(RegistrationPersistenceManager persistenceManager);
- Registration addRegistrationTo(String consumerName, Map registrationProperties, boolean createConsumerIfNeeded)
+ Registration addRegistrationTo(String consumerName, Map<QName, Object> registrationProperties, boolean createConsumerIfNeeded)
throws RegistrationException;
Consumer createConsumer(String name) throws RegistrationException, InvalidConsumerDataException;
@@ -69,13 +70,13 @@
ConsumerGroup getConsumerGroup(String groupName) throws RegistrationException;
- Collection getConsumerGroups() throws RegistrationException;
+ Collection<? extends ConsumerGroup> getConsumerGroups() throws RegistrationException;
void removeConsumerGroup(ConsumerGroup group) throws RegistrationException;
void removeConsumerGroup(String name) throws RegistrationException;
- Collection getConsumers() throws RegistrationException;
+ Collection<? extends Consumer> getConsumers() throws RegistrationException;
void clear() throws RegistrationException;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPersistenceManager.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -23,6 +23,7 @@
package org.gatein.registration;
+import javax.xml.namespace.QName;
import java.util.Collection;
import java.util.Map;
@@ -75,7 +76,7 @@
*/
Consumer getConsumerById(String consumerId) throws IllegalArgumentException, RegistrationException;
- Registration addRegistrationFor(String consumerId, Map registrationProperties) throws RegistrationException;
+ Registration addRegistrationFor(String consumerId, Map<QName, Object> registrationProperties) throws RegistrationException;
Collection<? extends ConsumerGroup> getConsumerGroups();
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -51,7 +51,7 @@
* @throws IllegalArgumentException if any of the registration properties is invalid for the specified Consumer
* @throws RegistrationException if an exception occured in the registration service
*/
- void validateRegistrationDataFor(Map<QName, ? extends PropertyDescription> registrationProperties, String consumerIdentity)
+ void validateRegistrationDataFor(Map<QName, Object> registrationProperties, String consumerIdentity)
throws IllegalArgumentException, RegistrationException;
/**
@@ -91,7 +91,7 @@
* Consumer identity and decides that they are not in a proper state
* @throws IllegalArgumentException if the specified Consumer name if <code>null</code> or empty
*/
- String getConsumerIdFrom(String consumerName, Map registrationProperties)
+ String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties)
throws IllegalArgumentException, InvalidConsumerDataException;
/**
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -49,7 +49,7 @@
private String registrationHandle;
- public RegistrationImpl(String key, ConsumerSPI consumer, RegistrationStatus status, Map properties)
+ RegistrationImpl(String key, ConsumerSPI consumer, RegistrationStatus status, Map<QName, Object> properties)
{
this.key = key;
this.consumer = consumer;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -82,7 +82,7 @@
this.persistenceManager = persistenceManager;
}
- public Registration addRegistrationTo(String consumerName, Map registrationProperties, boolean createConsumerIfNeeded)
+ public Registration addRegistrationTo(String consumerName, Map<QName, Object> registrationProperties, boolean createConsumerIfNeeded)
throws RegistrationException
{
// the policy determines the identity of the consumer based on the given information (note that this might be obsoleted by using WS-Security)
@@ -278,7 +278,7 @@
}
}
- public Collection getConsumerGroups()
+ public Collection<? extends ConsumerGroup> getConsumerGroups()
{
return persistenceManager.getConsumerGroups();
}
@@ -301,7 +301,7 @@
removeConsumerGroup(getConsumerGroup(name));
}
- public Collection getConsumers()
+ public Collection<? extends Consumer> getConsumers()
{
return persistenceManager.getConsumers();
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -34,6 +34,7 @@
import org.gatein.registration.spi.ConsumerSPI;
import org.gatein.registration.spi.RegistrationSPI;
+import javax.xml.namespace.QName;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -51,17 +52,17 @@
private Map<String, ConsumerGroupSPI> groups = new HashMap<String, ConsumerGroupSPI>();
private Map<String, RegistrationSPI> registrations = new HashMap<String, RegistrationSPI>();
- public Collection<? extends Consumer> getConsumers()
+ public Collection<ConsumerSPI> getConsumers()
{
return Collections.unmodifiableCollection(consumers.values());
}
- public Collection<? extends Registration> getRegistrations()
+ public Collection<RegistrationSPI> getRegistrations()
{
return Collections.unmodifiableCollection(registrations.values());
}
- public Collection<? extends ConsumerGroup> getConsumerGroups()
+ public Collection<ConsumerGroupSPI> getConsumerGroups()
{
return Collections.unmodifiableCollection(groups.values());
}
@@ -100,12 +101,12 @@
}
@Override
- protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map registrationProperties)
+ protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map<QName, Object> registrationProperties)
{
return newRegistrationSPI(consumer, registrationProperties, "" + lastRegistrationId++);
}
- public RegistrationSPI newRegistrationSPI(ConsumerSPI consumer, Map registrationProperties, String registrationKey)
+ public RegistrationSPI newRegistrationSPI(ConsumerSPI consumer, Map<QName, Object> registrationProperties, String registrationKey)
{
return new RegistrationImpl(registrationKey, consumer, RegistrationStatus.PENDING, registrationProperties);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -27,12 +27,12 @@
import org.gatein.registration.Consumer;
import org.gatein.registration.DuplicateRegistrationException;
import org.gatein.registration.InvalidConsumerDataException;
-import org.gatein.wsrp.registration.PropertyDescription;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.RegistrationStatus;
+import org.gatein.wsrp.registration.PropertyDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -80,7 +80,7 @@
* @throws DuplicateRegistrationException if a Consumer with the same identity has already registered with the same
* registration properties.
*/
- public void validateRegistrationDataFor(Map<QName, ? extends PropertyDescription> registrationProperties, String consumerIdentity)
+ public void validateRegistrationDataFor(Map<QName, Object> registrationProperties, String consumerIdentity)
throws IllegalArgumentException, RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(registrationProperties, "Registration properties");
@@ -137,9 +137,8 @@
{
// allow the new registration only if the registration properties are different that existing registrations
// for this consumer...
- for (Object o : consumer.getRegistrations())
+ for (Registration registration : consumer.getRegistrations())
{
- Registration registration = (Registration)o;
if (registration.hasEqualProperties(registrationProperties))
{
throw new DuplicateRegistrationException("Consumer named '" + consumer.getName()
@@ -164,7 +163,7 @@
}
/** Simply returns the given consumer name, trusted (!) to be unique. */
- public String getConsumerIdFrom(String consumerName, Map registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
+ public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
return consumerName;
@@ -175,7 +174,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
- Consumer consumer = manager.getConsumerByIdentity(getConsumerIdFrom(consumerName, Collections.EMPTY_MAP));
+ Consumer consumer = manager.getConsumerByIdentity(getConsumerIdFrom(consumerName, Collections.<QName, Object>emptyMap()));
if (consumer != null)
{
throw new DuplicateRegistrationException("A Consumer named '" + consumerName + "' has already been registered.");
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPropertyValidator.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPropertyValidator.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPropertyValidator.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -27,7 +27,7 @@
/**
* An interface providing an entry point for WSRP deployers to plug their registration property validation mechanism in
- * {@link org.jboss.portal.registration.policies.DefaultRegistrationPolicy}. Implementations of this interface
+ * {@link org.gatein.registration.policies.DefaultRegistrationPolicy}. Implementations of this interface
* <strong>MUST</strong> provide a no-argument constructor for instantiation from the class name.
*
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -212,7 +212,7 @@
{
Registration registration = producer.getRegistrationManager().getRegistration(registrationHandle);
- Map properties = createRegistrationProperties(registrationData);
+ Map<QName, Object> properties = createRegistrationProperties(registrationData);
// check that the given registration properties are acceptable according to expectations and policy
ProducerRegistrationRequirements req = producer.getProducerRegistrationRequirements();
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -42,7 +42,7 @@
{
/** . */
- private Map registrationProperties;
+ private Map<QName, Object> registrationProperties;
public abstract RegistrationPersistenceManager getManager();
@@ -56,7 +56,7 @@
public void setUp() throws Exception
{
- registrationProperties = new HashMap();
+ registrationProperties = new HashMap<QName, Object>();
registrationProperties.put(new QName("prop1"), "value1");
registrationProperties.put(new QName("prop2"), "value2");
}
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -24,8 +24,8 @@
public class DefaultRegistrationPolicyTestCase extends TestCase
{
DefaultRegistrationPolicy policy;
- Map registrationProperties;
- HashMap<QName, PropertyDescription> expectations;
+ Map<QName, Object> registrationProperties;
+ Map<QName, PropertyDescription> expectations;
private static final String CONSUMER = "consumer";
private static final QName PROP1 = new QName("prop1");
private static final QName PROP2 = new QName("prop2");
@@ -45,7 +45,7 @@
policy.setManager(manager);
- registrationProperties = new HashMap();
+ registrationProperties = new HashMap<QName, Object>();
registrationProperties.put(PROP1, "value1");
registrationProperties.put(PROP2, "value2");
@@ -67,7 +67,7 @@
try
{
- policy.validateRegistrationDataFor(Collections.EMPTY_MAP, null);
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), null);
fail("null data cannot be validated");
}
catch (IllegalArgumentException e)
@@ -80,7 +80,7 @@
{
try
{
- policy.validateRegistrationDataFor(Collections.EMPTY_MAP, "foo");
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), "foo");
}
catch (RegistrationException e)
{
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -42,7 +42,7 @@
{
private RegistrationManager manager;
- private Map registrationProperties;
+ private Map<QName, Object> registrationProperties;
protected void setUp() throws Exception
{
@@ -54,7 +54,7 @@
policy.setManager(manager);
//todo: registration properties setup will need to be updated when property validation is implemented
- registrationProperties = new HashMap();
+ registrationProperties = new HashMap<QName, Object>();
registrationProperties.put(new QName("prop1"), "value1");
registrationProperties.put(new QName("prop2"), "value2");
}
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationTestCase.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -27,7 +27,6 @@
import org.gatein.registration.impl.RegistrationManagerImpl;
import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
-import org.gatein.wsrp.registration.PropertyDescription;
import javax.xml.namespace.QName;
import java.util.HashMap;
@@ -41,14 +40,14 @@
public class RegistrationTestCase extends TestCase
{
private Registration registration;
- private Map registrationProperties;
+ private Map<QName, Object> registrationProperties;
protected void setUp() throws Exception
{
RegistrationManager manager = new RegistrationManagerImpl();
RegistrationPolicy policy = new DefaultRegistrationPolicy()
{
- public void validateRegistrationDataFor(Map<QName, ? extends PropertyDescription> registrationProperties, String consumerIdentity) throws IllegalArgumentException, RegistrationException, DuplicateRegistrationException
+ public void validateRegistrationDataFor(Map<QName, Object> registrationProperties, String consumerIdentity) throws IllegalArgumentException, RegistrationException, DuplicateRegistrationException
{
// accept any registration data here
}
@@ -57,7 +56,7 @@
manager.setPersistenceManager(new RegistrationPersistenceManagerImpl());
policy.setManager(manager);
- registrationProperties = new HashMap();
+ registrationProperties = new HashMap<QName, Object>();
registrationProperties.put(new QName("prop1"), "value1");
registrationProperties.put(new QName("prop2"), "value2");
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2009-12-05 01:01:21 UTC (rev 938)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2009-12-05 05:32:23 UTC (rev 939)
@@ -39,7 +39,7 @@
*/
public class TestRegistrationPolicy implements RegistrationPolicy
{
- public void validateRegistrationDataFor(Map<QName, ? extends PropertyDescription> registrationProperties, String consumerIdentity) throws IllegalArgumentException, RegistrationException
+ public void validateRegistrationDataFor(Map<QName, Object> registrationProperties, String consumerIdentity) throws IllegalArgumentException, RegistrationException
{
}
@@ -53,7 +53,7 @@
return null;
}
- public String getConsumerIdFrom(String consumerName, Map registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
+ public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
{
return null;
}
15 years, 1 month
gatein SVN: r938 - in portal/trunk: component/application-registry and 9 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 20:01:21 -0500 (Fri, 04 Dec 2009)
New Revision: 938
Modified:
portal/trunk/component/application-registry/pom.xml
portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticImpl.java
portal/trunk/component/portal/pom.xml
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
Log:
- updated to mop 1.0.0-Beta12
- updated to chromattic 1.0.0-beta10
- removed the direct Node usage hack and instead use the org.chromattic.ntdef package that has builtin node type support
Modified: portal/trunk/component/application-registry/pom.xml
===================================================================
--- portal/trunk/component/application-registry/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/pom.xml 2009-12-05 01:01:21 UTC (rev 938)
@@ -55,6 +55,12 @@
</dependency>
<dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.ntdef</artifactId>
+ <version>${version.chromattic}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-api</artifactId>
<version>${org.gatein.pc.version}</version>
Modified: portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-05 01:01:21 UTC (rev 938)
@@ -81,7 +81,7 @@
</propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
- <childNodeDefinition name="resources" defaultPrimaryType="nt:folder" autoCreated="false" mandatory="true"
+ <childNodeDefinition name="resources" defaultPrimaryType="nt:folder" autoCreated="true" mandatory="true"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>nt:folder</requiredPrimaryType>
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -22,6 +22,8 @@
import org.apache.shindig.common.uri.Uri;
import org.apache.shindig.gadgets.spec.GadgetSpec;
import org.apache.shindig.gadgets.spec.ModulePrefs;
+import org.chromattic.ntdef.NTFolder;
+import org.chromattic.ntdef.Resource;
import org.exoplatform.application.gadget.impl.GadgetDefinition;
import org.exoplatform.application.gadget.impl.GadgetRegistry;
import org.exoplatform.application.gadget.impl.LocalGadgetData;
@@ -30,11 +32,9 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.common.net.URLTools;
-import javax.jcr.Node;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URL;
-import java.util.Calendar;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -59,7 +59,7 @@
private boolean local;
/** Used temporarily when importing resources. */
- private Node folder;
+ private NTFolder folder;
protected LocalImporter(
String name,
@@ -169,7 +169,7 @@
data.setFileName(fileName);
// Import resource
- folder = data.getNode().addNode("resources", "nt:folder");
+ folder = data.getResources();
String folderPath = getParent(gadgetPath);
visitChildren(folderPath);
folder = null;
@@ -195,24 +195,20 @@
{
String mimeType = getMimeType(name);
- //
- Node file = folder.addNode(name, "nt:file");
- Node resource = file.addNode("jcr:content", "nt:resource");
- resource.setProperty("jcr:data", new ByteArrayInputStream(content));
- resource.setProperty("jcr:lastModified", Calendar.getInstance());
- resource.setProperty("jcr:mimeType", mimeType);
-
// We can detect encoding for XML files
+ String encoding = null;
if ("application/xml".equals(mimeType))
{
- String encoding = EncodingDetector.detect(new ByteArrayInputStream(content));
- resource.setProperty("jcr:encoding", encoding);
+ encoding = EncodingDetector.detect(new ByteArrayInputStream(content));
}
+
+ //
+ folder.createFile(name, new Resource(mimeType, encoding, content));
}
}
else
{
- folder = folder.addNode(name, "nt:folder");
+ folder = folder.createFolder(name);
visitChildren(resourcePath);
folder = folder.getParent();
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -21,19 +21,20 @@
import org.apache.shindig.common.uri.Uri;
import org.apache.shindig.gadgets.spec.GadgetSpec;
import org.apache.shindig.gadgets.spec.ModulePrefs;
-import org.chromattic.api.UndeclaredRepositoryException;
import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
+import org.chromattic.ntdef.NTFile;
+import org.chromattic.ntdef.Resource;
import org.exoplatform.application.gadget.EncodingDetector;
import org.exoplatform.application.registry.impl.NodeAware;
-import org.gatein.common.io.IOTools;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
+import org.chromattic.ntdef.NTFolder;
+
import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Calendar;
+import java.util.Date;
/**
@@ -44,9 +45,6 @@
public abstract class LocalGadgetData extends GadgetData implements NodeAware
{
- /** Temporary hack, use with care. */
- private Node node;
-
@ManyToOne
public abstract GadgetDefinition getDefinition();
@@ -55,27 +53,24 @@
public abstract void setFileName(String fileName);
- public void setNode(Node node)
- {
- this.node = node;
- }
+ @OneToOne
+ @MappedBy("resources")
+ public abstract NTFolder getResources();
- public Node getNode()
- {
- return node;
+ private NTFile getGadgetContent() {
+ String fileName = getFileName();
+ NTFolder resources = getResources();
+ return resources.getFile(fileName);
}
public void setSource(String gadgetXML) throws Exception
{
-
// Get the definition
GadgetDefinition def = getDefinition();
// Get the related content
GadgetSpec spec = new GadgetSpec(Uri.parse("http://www.gatein.org"), gadgetXML);
ModulePrefs prefs = spec.getModulePrefs();
- String fileName = getFileName();
- Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
byte[] bytes = gadgetXML.getBytes();
String encoding = EncodingDetector.detect(new ByteArrayInputStream(bytes));
@@ -86,66 +81,22 @@
def.setReferenceURL(prefs.getTitleUrl().toString());
// Update content
- contentNode.setProperty("jcr:encoding", encoding);
- contentNode.setProperty("jcr:data", new ByteArrayInputStream(bytes));
- contentNode.setProperty("jcr:mimeType", "application/xml");
- contentNode.setProperty("jcr:lastModified", Calendar.getInstance());
+ NTFile content = getGadgetContent();
+ content.setContentResource(new Resource("application/xml", encoding, bytes));
}
public String getSource() throws Exception
{
- String fileName = getFileName();
- Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
- InputStream in = contentNode.getProperty("jcr:data").getStream();
- String encoding = contentNode.getProperty("jcr:encoding").getString();
- byte[] bytes = IOTools.getBytes(in);
+ NTFile content = getGadgetContent();
+ Resource res = content.getContentResource();
+ String encoding = res.getEncoding();
+ byte[] bytes = res.getData();
return new String(bytes, encoding);
}
- public Calendar getLastModified()
+ public Date getLastModified()
{
- try
- {
- String fileName = getFileName();
- Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
- return contentNode.getProperty("jcr:lastModified").getDate();
- }
- catch (RepositoryException e)
- {
- throw new UndeclaredRepositoryException(e);
- }
+ NTFile content = getGadgetContent();
+ return content.getLastModified();
}
-
- private static String getProperty(Node node, String name, String defaultValue) throws Exception
- {
- if (node.hasProperty(name))
- {
- return node.getProperty(name).getString();
- }
- else
- {
- return defaultValue;
- }
- }
-
- private static Calendar getCalendarProperty(Node node, String name) throws Exception
- {
- if (node.hasProperty(name))
- {
- return node.getProperty(name).getDate();
- }
- else
- {
- return null;
- }
- }
-
-
-/*
- @OneToOne
- @MappedBy("folder")
- public abstract NTFolder getFolder();
-
- public abstract void setFolder(NTFolder folder);
-*/
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -18,16 +18,11 @@
*/
package org.exoplatform.application.gadget.impl;
-import org.exoplatform.application.gadget.EncodingDetector;
import org.exoplatform.application.gadget.Gadget;
import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.gadget.Source;
import org.exoplatform.application.gadget.SourceStorage;
-import org.gatein.common.io.IOTools;
-import javax.jcr.Node;
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
import java.util.Calendar;
/**
@@ -41,10 +36,6 @@
public SourceStorageImpl(GadgetRegistryService gadgetRegistryService)
{
-
- // resources/Calculator.xml
- // resources/rssAggregator.xml
-
this.gadgetRegistryService = (GadgetRegistryServiceImpl)gadgetRegistryService;
}
@@ -64,7 +55,8 @@
{
LocalGadgetData localData = (LocalGadgetData)data;
String content = localData.getSource();
- Calendar lastModified = localData.getLastModified();
+ Calendar lastModified = Calendar.getInstance();
+ lastModified.setTime(localData.getLastModified());
//
Source source = new Source(gadget.getName());
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.application.registry.impl;
-import org.chromattic.core.DomainSession;
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.container.xml.InitParams;
@@ -39,6 +38,6 @@
@Override
protected void onOpenSession(SessionContext context) {
- context.getSession().addEventListener(new Injector(registry, (DomainSession)context.getSession()));
+ context.getSession().addEventListener(new Injector(registry));
}
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -19,10 +19,7 @@
package org.exoplatform.application.registry.impl;
import org.chromattic.api.event.LifeCycleListener;
-import org.chromattic.core.DomainSession;
-import javax.jcr.Node;
-
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -34,12 +31,12 @@
private final ApplicationRegistryServiceImpl registry;
/** . */
- private final DomainSession session;
+// private final DomainSession session;
- public Injector(ApplicationRegistryServiceImpl registry, DomainSession session)
+ public Injector(ApplicationRegistryServiceImpl registry/*, DomainSession session*/)
{
this.registry = registry;
- this.session = session;
+// this.session = session;
}
public void created(Object o)
@@ -48,11 +45,13 @@
public void loaded(String id, String path, String name, Object o)
{
+/*
if (o instanceof NodeAware)
{
Node node = session.getNode(o);
((NodeAware)o).setNode(node);
}
+*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -61,11 +60,13 @@
public void added(String id, String path, String name, Object o)
{
+/*
if (o instanceof NodeAware)
{
Node node = session.getNode(o);
((NodeAware)o).setNode(node);
}
+*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -74,10 +75,12 @@
public void removed(String id, String path, String name, Object o)
{
+/*
if (o instanceof NodeAware)
{
((NodeAware)o).setNode(null);
}
+*/
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = null;
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticImpl.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticImpl.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticImpl.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -20,7 +20,6 @@
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticSession;
-import org.chromattic.api.SessionTask;
import javax.jcr.Credentials;
@@ -70,14 +69,4 @@
{
throw new UnsupportedOperationException();
}
-
- public void execute(SessionTask task) throws Throwable
- {
- throw new UnsupportedOperationException();
- }
-
- public void stop()
- {
- throw new UnsupportedOperationException();
- }
}
Modified: portal/trunk/component/portal/pom.xml
===================================================================
--- portal/trunk/component/portal/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/portal/pom.xml 2009-12-05 01:01:21 UTC (rev 938)
@@ -100,6 +100,13 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <version>${version.chromattic}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-12-05 01:01:21 UTC (rev 938)
@@ -323,7 +323,7 @@
throw new Error(e);
}
Class<O> mappedClass = (Class<O>)mapping.get(type);
- return session.createQueryBuilder().from(mappedClass).<O> where(statement).get().iterator();
+ return session.createQueryBuilder().from(mappedClass).<O> where(statement).get().objects();
}
private static final Map<ObjectType<?>, Class> mapping = new HashMap<ObjectType<?>, Class>();
Modified: portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-12-05 01:01:21 UTC (rev 938)
@@ -111,6 +111,7 @@
addDependency(new Project("org.chromattic", "chromattic.spi", "jar", chromatticVersion)).
addDependency(new Project("org.chromattic", "chromattic.core", "jar", chromatticVersion)).
addDependency(new Project("org.chromattic", "chromattic.apt", "jar", chromatticVersion)).
+ addDependency(new Project("org.chromattic", "chromattic.ntdef", "jar", chromatticVersion)).
addDependency(new Project("org.reflext", "reflext.api", "jar", reflectVersion)).
addDependency(new Project("org.reflext", "reflext.core", "jar", reflectVersion)).
addDependency(new Project("org.reflext", "reflext.spi", "jar", reflectVersion)).
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/pom.xml 2009-12-05 01:01:21 UTC (rev 938)
@@ -48,12 +48,12 @@
<org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
<org.picketlink.idm>1.0.0.CR1</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
- <org.gatein.mop.version>1.0.0-Beta11</org.gatein.mop.version>
+ <org.gatein.mop.version>1.0.0-Beta12</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
<org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
- <version.chromattic>1.0.0-beta8</version.chromattic>
+ <version.chromattic>1.0.0-beta10</version.chromattic>
<version.reflect>1.0.0-beta4</version.reflect>
<!-- ************** -->
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 23:25:44 UTC (rev 937)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-05 01:01:21 UTC (rev 938)
@@ -545,6 +545,9 @@
<value>org.exoplatform.application.gadget.impl.GadgetDefinition</value>
<value>org.exoplatform.application.gadget.impl.LocalGadgetData</value>
<value>org.exoplatform.application.gadget.impl.RemoteGadgetData</value>
+ <value>org.chromattic.ntdef.NTFile</value>
+ <value>org.chromattic.ntdef.NTFolder</value>
+ <value>org.chromattic.ntdef.NTResource</value>
</values-param>
</init-params>
</component-plugin>
15 years, 1 month
gatein SVN: r937 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 18:25:44 -0500 (Fri, 04 Dec 2009)
New Revision: 937
Modified:
components/mop/trunk/api/pom.xml
components/mop/trunk/core/pom.xml
components/mop/trunk/pom.xml
components/mop/trunk/spi/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2009-12-04 23:25:31 UTC (rev 936)
+++ components/mop/trunk/api/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12</version>
+ <version>1.0.0-Beta13-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2009-12-04 23:25:31 UTC (rev 936)
+++ components/mop/trunk/core/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12</version>
+ <version>1.0.0-Beta13-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2009-12-04 23:25:31 UTC (rev 936)
+++ components/mop/trunk/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12</version>
+ <version>1.0.0-Beta13-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GateIn - MOP</name>
<description>Model Object for Portal</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/tags/1.0.0-B...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.0.0-Beta12</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.0.0-Beta12</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/trunk/</url>
</scm>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2009-12-04 23:25:31 UTC (rev 936)
+++ components/mop/trunk/spi/pom.xml 2009-12-04 23:25:44 UTC (rev 937)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12</version>
+ <version>1.0.0-Beta13-SNAPSHOT</version>
</parent>
<!-- ****************** -->
15 years, 1 month
gatein SVN: r936 - components/mop/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 18:25:31 -0500 (Fri, 04 Dec 2009)
New Revision: 936
Added:
components/mop/tags/1.0.0-Beta12/
Log:
[maven-scm] copy for tag 1.0.0-Beta12
Copied: components/mop/tags/1.0.0-Beta12 (from rev 935, components/mop/trunk)
15 years, 1 month
gatein SVN: r935 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 18:25:12 -0500 (Fri, 04 Dec 2009)
New Revision: 935
Modified:
components/mop/trunk/api/pom.xml
components/mop/trunk/core/pom.xml
components/mop/trunk/pom.xml
components/mop/trunk/spi/pom.xml
Log:
[maven-release-plugin] prepare release 1.0.0-Beta12
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2009-12-04 23:22:29 UTC (rev 934)
+++ components/mop/trunk/api/pom.xml 2009-12-04 23:25:12 UTC (rev 935)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12-SNAPSHOT</version>
+ <version>1.0.0-Beta12</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2009-12-04 23:22:29 UTC (rev 934)
+++ components/mop/trunk/core/pom.xml 2009-12-04 23:25:12 UTC (rev 935)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12-SNAPSHOT</version>
+ <version>1.0.0-Beta12</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2009-12-04 23:22:29 UTC (rev 934)
+++ components/mop/trunk/pom.xml 2009-12-04 23:25:12 UTC (rev 935)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12-SNAPSHOT</version>
+ <version>1.0.0-Beta12</version>
<packaging>pom</packaging>
<name>GateIn - MOP</name>
<description>Model Object for Portal</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/trunk/</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/trunk/</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/tags/1.0.0-B...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.0.0-Beta12</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.0.0-Beta12</url>
</scm>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2009-12-04 23:22:29 UTC (rev 934)
+++ components/mop/trunk/spi/pom.xml 2009-12-04 23:25:12 UTC (rev 935)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.0-Beta12-SNAPSHOT</version>
+ <version>1.0.0-Beta12</version>
</parent>
<!-- ****************** -->
15 years, 1 month
gatein SVN: r934 - in components/mop/trunk/core: src/main/java/org/gatein/mop/core/api and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 18:22:29 -0500 (Fri, 04 Dec 2009)
New Revision: 934
Modified:
components/mop/trunk/core/pom.xml
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
Log:
update to chromattic 1.0.0-beta9
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2009-12-04 20:11:50 UTC (rev 933)
+++ components/mop/trunk/core/pom.xml 2009-12-04 23:22:29 UTC (rev 934)
@@ -56,17 +56,14 @@
<dependency>
<groupId>org.chromattic</groupId>
+ <version>1.0.0-beta9</version>
<artifactId>chromattic.api</artifactId>
</dependency>
<dependency>
<groupId>org.chromattic</groupId>
- <artifactId>chromattic.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.chromattic</groupId>
<artifactId>chromattic.apt</artifactId>
+ <version>1.0.0-beta9</version>
<scope>compile</scope>
</dependency>
@@ -82,9 +79,24 @@
</dependency>
-->
+ <!-- should remove it, it's because of usage : org.chromattic.common.AbstractFilterIterator -->
<dependency>
<groupId>org.chromattic</groupId>
+ <artifactId>chromattic.common</artifactId>
+ <version>1.0.0-beta9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <version>1.0.0-beta9</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.chromattic</groupId>
<artifactId>chromattic.exo</artifactId>
+ <version>1.0.0-beta9</version>
<scope>test</scope>
</dependency>
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2009-12-04 20:11:50 UTC (rev 933)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2009-12-04 23:22:29 UTC (rev 934)
@@ -186,7 +186,7 @@
public <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O> type, String statement)
{
Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
- return session.createQueryBuilder().from(impl).<O>where(statement).get().iterator();
+ return session.createQueryBuilder().from(impl).<O>where(statement).get().objects();
}
public String pathOf(WorkspaceObject o)
15 years, 1 month
gatein SVN: r933 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/gadget/impl and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 15:11:50 -0500 (Fri, 04 Dec 2009)
New Revision: 933
Added:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java
Removed:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/MOPApplicationRegistryService.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/
Modified:
portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
Log:
- rename mop package to impl package in application registry (as it's not related to mop)
- rename MOPApplicationRegistryService to ApplicationRegistryServiceImpl
Modified: portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-04 19:58:27 UTC (rev 932)
+++ portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-04 20:11:50 UTC (rev 933)
@@ -37,7 +37,7 @@
<component>
<key>org.exoplatform.application.registry.ApplicationRegistryService</key>
- <type>org.exoplatform.application.registry.mop.MOPApplicationRegistryService</type>
+ <type>org.exoplatform.application.registry.impl.ApplicationRegistryServiceImpl</type>
</component>
</configuration>
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2009-12-04 19:58:27 UTC (rev 932)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -22,7 +22,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.application.gadget.Gadget;
import org.exoplatform.application.gadget.GadgetRegistryService;
-import org.exoplatform.application.registry.mop.ApplicationRegistryChromatticLifeCycle;
+import org.exoplatform.application.registry.impl.ApplicationRegistryChromatticLifeCycle;
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.ChromatticManager;
import org.exoplatform.container.xml.InitParams;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 19:58:27 UTC (rev 932)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -26,7 +26,7 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.Property;
import org.exoplatform.application.gadget.EncodingDetector;
-import org.exoplatform.application.registry.mop.NodeAware;
+import org.exoplatform.application.registry.impl.NodeAware;
import org.gatein.common.io.IOTools;
import javax.jcr.Node;
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl (from rev 929, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop)
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,44 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.core.DomainSession;
-import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
-import org.exoplatform.commons.chromattic.SessionContext;
-import org.exoplatform.container.xml.InitParams;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ApplicationRegistryChromatticLifeCycle extends ChromatticLifeCycle
-{
-
- /** . */
- MOPApplicationRegistryService registry;
-
- public ApplicationRegistryChromatticLifeCycle(InitParams params) {
- super(params);
- }
-
- @Override
- protected void onOpenSession(SessionContext context) {
- context.getSession().addEventListener(new Injector(registry, (DomainSession)context.getSession()));
- }
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.core.DomainSession;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.xml.InitParams;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ApplicationRegistryChromatticLifeCycle extends ChromatticLifeCycle
+{
+
+ /** . */
+ ApplicationRegistryServiceImpl registry;
+
+ public ApplicationRegistryChromatticLifeCycle(InitParams params) {
+ super(params);
+ }
+
+ @Override
+ protected void onOpenSession(SessionContext context) {
+ context.getSession().addEventListener(new Injector(registry, (DomainSession)context.getSession()));
+ }
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,755 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.application.registry.Application;
+import org.exoplatform.application.registry.ApplicationCategoriesPlugins;
+import org.exoplatform.application.registry.ApplicationCategory;
+import org.exoplatform.application.registry.ApplicationRegistryService;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.gatein.common.i18n.LocalizedString;
+import org.gatein.common.util.Tools;
+import org.gatein.mop.api.content.ContentType;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.api.info.MetaInfo;
+import org.gatein.pc.api.info.PortletInfo;
+import org.picocontainer.Startable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * The fundamental reason that motives to use tasks is because of the JMX access that does not
+ * setup a context and therefore the task either reuse the existing context setup by the portal
+ * or create a temporary context when accessed by JMX.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ApplicationRegistryServiceImpl implements ApplicationRegistryService, Startable
+{
+
+ /** . */
+ private static final String REMOTE_CATEGORY_NAME = "remote";
+
+ /** . */
+ private List<ApplicationCategoriesPlugins> plugins;
+
+ /** . */
+ private final ChromatticManager manager;
+
+ /** . */
+ private final ChromatticLifeCycle lifeCycle;
+
+ /** . */
+ final POMSessionManager mopManager;
+
+ public ApplicationRegistryServiceImpl(ChromatticManager manager, POMSessionManager mopManager)
+ {
+ ApplicationRegistryChromatticLifeCycle lifeCycle = (ApplicationRegistryChromatticLifeCycle)manager.getLifeCycle("app");
+ lifeCycle.registry = this;
+
+ //
+ this.manager = manager;
+ this.lifeCycle = lifeCycle;
+ this.mopManager = mopManager;
+ }
+
+ public ContentRegistry getContentRegistry()
+ {
+ ChromatticSession session = lifeCycle.getChromattic().openSession();
+ ContentRegistry registry = session.findByPath(ContentRegistry.class, "registry");
+ if (registry == null)
+ {
+ registry = session.insert(ContentRegistry.class, "registry");
+ }
+ return registry;
+ }
+
+ public void initListener(ComponentPlugin com) throws Exception
+ {
+ if (com instanceof ApplicationCategoriesPlugins)
+ {
+ if (plugins == null)
+ {
+ plugins = new ArrayList<ApplicationCategoriesPlugins>();
+ }
+ plugins.add((ApplicationCategoriesPlugins)com);
+ }
+ }
+
+ public List<ApplicationCategory> getApplicationCategories(
+ final Comparator<ApplicationCategory> sortComparator,
+ String accessUser,
+ final ApplicationType<?>... appTypes) throws Exception
+ {
+ final List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
+
+ //
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ for (CategoryDefinition categoryDef : registry.getCategoryList())
+ {
+ ApplicationCategory category = load(categoryDef, appTypes);
+ categories.add(category);
+ }
+
+ //
+ if (sortComparator != null)
+ {
+ Collections.sort(categories, sortComparator);
+ }
+/*
+ }
+ });
+*/
+
+ //
+ return categories;
+ }
+
+ public List<ApplicationCategory> getApplicationCategories(String accessUser, ApplicationType<?>... appTypes) throws Exception
+ {
+ return getApplicationCategories(null, accessUser, appTypes);
+ }
+
+ public List<ApplicationCategory> getApplicationCategories() throws Exception
+ {
+ return getApplicationCategories(null);
+ }
+
+ public List<ApplicationCategory> getApplicationCategories(Comparator<ApplicationCategory> sortComparator) throws Exception
+ {
+ return getApplicationCategories(sortComparator, null);
+ }
+
+ public ApplicationCategory getApplicationCategory(final String name) throws Exception
+ {
+ final AtomicReference<ApplicationCategory> a = new AtomicReference<ApplicationCategory>();
+
+ //
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(name);
+ if (categoryDef != null)
+ {
+ ApplicationCategory applicationCategory = load(categoryDef);
+ a.set(applicationCategory);
+ }
+/*
+ }
+ });
+*/
+
+ //
+ return a.get();
+ }
+
+ public void save(final ApplicationCategory category) throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = category.getName();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ categoryDef = registry.createCategory(categoryName);
+ }
+
+ //
+ categoryDef.setDisplayName(category.getDisplayName());
+ categoryDef.setCreationDate(category.getCreatedDate());
+ categoryDef.setLastModificationDate(category.getModifiedDate());
+ categoryDef.setDescription(category.getDescription());
+ categoryDef.setAccessPermissions(category.getAccessPermissions());
+ }
+/*
+ });
+ }
+*/
+
+ public void remove(final ApplicationCategory category) throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+ registry.getCategoryMap().remove(category.getName());
+/*
+ }
+ });
+*/
+ }
+
+ public List<Application> getApplications(ApplicationCategory category, ApplicationType<?>... appTypes) throws Exception
+ {
+ return getApplications(category, null, appTypes);
+ }
+
+ public List<Application> getApplications(
+ final ApplicationCategory category,
+ final Comparator<Application> sortComparator,
+ final ApplicationType<?>... appTypes) throws Exception
+ {
+ final AtomicReference<List<Application>> ref = new AtomicReference<List<Application>>();
+
+ //
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(category.getName());
+ List<Application> applications = load(categoryDef, appTypes).getApplications();
+
+ //
+ if (sortComparator != null)
+ {
+ Collections.sort(applications, sortComparator);
+ }
+
+ //
+ ref.set(applications);
+/*
+ }
+ });
+*/
+
+ //
+ return ref.get();
+ }
+
+ public List<Application> getAllApplications() throws Exception
+ {
+ List<Application> applications = new ArrayList<Application>();
+ List<ApplicationCategory> categories = getApplicationCategories();
+ for (ApplicationCategory category : categories)
+ {
+ applications.addAll(getApplications(category));
+ }
+ return applications;
+ }
+
+ public Application getApplication(String id) throws Exception
+ {
+ String[] fragments = id.split("/");
+ if (fragments.length < 2)
+ {
+ throw new Exception("Invalid Application Id: [" + id + "]");
+ }
+ return getApplication(fragments[0], fragments[1]);
+ }
+
+ public Application getApplication(final String category, final String name) throws Exception
+ {
+ final AtomicReference<Application> ref = new AtomicReference<Application>();
+
+ //
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(category);
+ if (categoryDef != null)
+ {
+ ContentDefinition contentDef = categoryDef.getContentMap().get(name);
+ if (contentDef != null)
+ {
+ ref.set(load(contentDef));
+ }
+ }
+/*
+ }
+ });
+*/
+
+ //
+ return ref.get();
+ }
+
+ public void save(final ApplicationCategory category, final Application application) throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = category.getName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ categoryDef = registry.createCategory(categoryName);
+ save(category, categoryDef);
+ }
+
+ //
+ ContentDefinition contentDef = null;
+ CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
+ String applicationName = application.getApplicationName();
+ if (applicationCategoryDef != null)
+ {
+ contentDef = applicationCategoryDef.getContentMap().get(applicationName);
+ }
+ if (contentDef == null)
+ {
+ String contentId = application.getContentId();
+ ContentType<?> contentType = application.getType().getContentType();
+ String definitionName = application.getApplicationName();
+ contentDef = categoryDef.createContent(definitionName, contentType, contentId);
+ }
+ else
+ {
+ // A JCR move actually
+ categoryDef.getContentList().add(contentDef);
+ }
+
+ // Update state
+ save(application, contentDef);
+/*
+ }
+ });
+*/
+ }
+
+ public void update(final Application application) throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = application.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
+ if (contentDef == null)
+ {
+ throw new IllegalStateException();
+ }
+
+ // Update state
+ save(application, contentDef);
+/*
+ }
+ });
+*/
+ }
+
+ public void remove(final Application app) throws Exception
+ {
+ if (app == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = app.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+
+ //
+ if (categoryDef != null)
+ {
+
+ String contentName = app.getApplicationName();
+ categoryDef.getContentMap().remove(contentName);
+ }
+/*
+ }
+ });
+*/
+ }
+
+ public void importExoGadgets() throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
+
+ //
+ if (eXoGadgets != null)
+ {
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add(UserACL.EVERYONE);
+ String categoryName = "Gadgets";
+
+ //
+ CategoryDefinition category = registry.getCategory(categoryName);
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ category.setDescription(categoryName);
+ category.setAccessPermissions(permissions);
+ }
+
+ //
+ for (Gadget ele : eXoGadgets)
+ {
+ ContentDefinition app = category.getContentMap().get(ele.getName());
+ if (app == null)
+ {
+ app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
+ app.setDisplayName(ele.getTitle());
+ app.setDescription(ele.getDescription());
+ app.setAccessPermissions(permissions);
+ }
+ }
+ }
+/*
+ }
+ });
+*/
+ }
+
+ public void importAllPortlets() throws Exception
+ {
+/*
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+*/
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
+ Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
+
+ //
+ for (org.gatein.pc.api.Portlet portlet : portlets)
+ {
+ PortletInfo info = portlet.getInfo();
+ String portletApplicationName = info.getApplicationName();
+ String portletName = info.getName();
+
+ // Need to sanitize portlet and application names in case they contain characters that would
+ // cause an improper Application name
+ portletApplicationName = portletApplicationName.replace('/', '_');
+ portletName = portletName.replace('/', '_');
+
+ LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
+
+ String[] categoryNames = null;
+ if (keywordsLS != null)
+ {
+ String keywords = keywordsLS.getDefaultString();
+ if (keywords != null && keywords.length() != 0)
+ {
+ categoryNames = keywords.split(",");
+ }
+ }
+
+ if (categoryNames == null || categoryNames.length == 0)
+ {
+ categoryNames = new String[]{portletApplicationName};
+ }
+
+ if (portlet.isRemote())
+ {
+ categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
+ }
+
+ //
+ for (String categoryName : categoryNames)
+ {
+ categoryName = categoryName.trim();
+
+ //
+ CategoryDefinition category = registry.getCategory(categoryName);
+
+ //
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ }
+
+ //
+ ContentDefinition app = category.getContentMap().get(portletName);
+ if (app == null)
+ {
+ LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
+ LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+
+ // julien: ????
+ // getLocalizedStringValue(descriptionLS, portletName);
+
+ ContentType<?> contentType;
+ String contentId;
+ if (portlet.isRemote())
+ {
+ contentType = WSRP.CONTENT_TYPE;
+ contentId = portlet.getContext().getId();
+ }
+ else
+ {
+ contentType = Portlet.CONTENT_TYPE;
+ contentId = info.getApplicationName() + "/" + info.getName();
+ }
+
+
+ //
+ app = category.createContent(portletName, contentType, contentId);
+ app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
+ app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
+ }
+ }
+ }
+/*
+ }
+ });
+*/
+ }
+
+ private boolean isApplicationType(Application app, ApplicationType<?>... appTypes)
+ {
+ if (appTypes == null || appTypes.length == 0)
+ {
+ return true;
+ }
+ for (ApplicationType<?> appType : appTypes)
+ {
+ if (appType.equals(app.getType()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void save(ApplicationCategory category, CategoryDefinition categoryDef)
+ {
+ categoryDef.setDisplayName(category.getDisplayName());
+ categoryDef.setDescription(category.getDescription());
+ categoryDef.setAccessPermissions(category.getAccessPermissions());
+ categoryDef.setCreationDate(category.getCreatedDate());
+ categoryDef.setLastModificationDate(category.getModifiedDate());
+ }
+
+ private ApplicationCategory load(CategoryDefinition categoryDef, ApplicationType<?>... appTypes)
+ {
+ ApplicationCategory category = new ApplicationCategory();
+
+ //
+ category.setName(categoryDef.getName());
+ category.setDisplayName(categoryDef.getDisplayName());
+ category.setDescription(categoryDef.getDescription());
+ category.setAccessPermissions(new ArrayList<String>(categoryDef.getAccessPermissions()));
+ category.setCreatedDate(categoryDef.getCreationDate());
+ category.setModifiedDate(categoryDef.getLastModificationDate());
+
+ //
+ for (ContentDefinition contentDef : categoryDef.getContentList())
+ {
+ Application application = load(contentDef);
+ if (isApplicationType(application, appTypes))
+ {
+ category.getApplications().add(application);
+ }
+ }
+
+ //
+ return category;
+ }
+
+ private void save(Application application, ContentDefinition contentDef)
+ {
+ contentDef.setDisplayName(application.getDisplayName());
+ contentDef.setDescription(application.getDescription());
+ contentDef.setAccessPermissions(application.getAccessPermissions());
+ contentDef.setCreationDate(application.getCreatedDate());
+ contentDef.setLastModificationDate(application.getModifiedDate());
+ }
+
+ private Application load(ContentDefinition contentDef)
+ {
+ ContentType<?> contentType = contentDef.getCustomization().getType();
+ ApplicationType<?> applicationType = ApplicationType.getType(contentType);
+
+ //
+ Application application = new Application();
+ application.setId(contentDef.getCategory().getName() + "/" + contentDef.getName());
+ application.setCategoryName(contentDef.getCategory().getName());
+ application.setType(applicationType);
+ application.setApplicationName(contentDef.getName());
+ application.setIconURL(getApplicationIconURL(contentDef));
+ application.setDisplayName(contentDef.getDisplayName());
+ application.setDescription(contentDef.getDescription());
+ application.setAccessPermissions(new ArrayList<String>(contentDef.getAccessPermissions()));
+ application.setCreatedDate(contentDef.getCreationDate());
+ application.setModifiedDate(contentDef.getLastModificationDate());
+ application.setStorageId(contentDef.getCustomization().getId());
+ application.setContentId(contentDef.getCustomization().getContentId());
+ return application;
+ }
+
+ private String getLocalizedStringValue(LocalizedString localizedString, String portletName)
+ {
+ if (localizedString == null || localizedString.getDefaultString() == null)
+ {
+ return portletName;
+ }
+ else
+ {
+ return localizedString.getDefaultString();
+ }
+ }
+
+ private static String getApplicationIconURL(ContentDefinition contentDef)
+ {
+ Customization customization = contentDef.getCustomization();
+ if (customization != null)
+ {
+ ContentType type = customization.getType();
+ String contentId = customization.getContentId();
+ if (type == Portlet.CONTENT_TYPE)
+ {
+ String[] chunks = contentId.split("/");
+ if (chunks.length == 2)
+ {
+ return "/" + chunks[0] + "/skin/DefaultSkin/portletIcons/" + chunks[1] + ".png";
+ }
+ }
+ else if (type == org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE)
+ {
+ return "/" + "eXoGadgets" + "/skin/DefaultSkin/portletIcons/" + contentId + ".png";
+ }
+ }
+
+ //
+ return null;
+ }
+
+ public void start()
+ {
+ if (plugins != null)
+ {
+// POMSession session = pomMGr.openSession();
+// SessionContext context = lifeCycle.openContext();
+ manager.beginRequest();
+ boolean save = false;
+ try
+ {
+ for (ApplicationCategoriesPlugins plugin : plugins)
+ {
+ plugin.run();
+ }
+ save = true;
+ }
+ catch (Exception e)
+ {
+ // log.error(e);
+ e.printStackTrace();
+ }
+ finally
+ {
+ // lifeCycle.closeContext(context, true);
+ manager.endRequest(true);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ }
+}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,143 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.Name;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.Property;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.gatein.mop.api.content.ContentType;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.Workspace;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@NodeMapping(name = "mop:contentcategory")
-public abstract class CategoryDefinition
-{
-
- /** The injected workspace. */
- public MOPApplicationRegistryService registry;
-
- @Name
- public abstract String getName();
-
- @Property(name = "displayname")
- public abstract String getDisplayName();
-
- public abstract void setDisplayName(String displayName);
-
- @Property(name = "description")
- public abstract String getDescription();
-
- public abstract void setDescription(String description);
-
- @Property(name = "creationdate")
- public abstract Date getCreationDate();
-
- public abstract void setCreationDate(Date date);
-
- @Property(name = "lastmodificationdate")
- public abstract Date getLastModificationDate();
-
- public abstract void setLastModificationDate(Date date);
-
- @Property(name = "accesspermissions")
- public abstract List<String> getAccessPermissions();
-
- public abstract void setAccessPermissions(List<String> accessPermissions);
-
- @OneToMany
- public abstract List<ContentDefinition> getContentList();
-
- @OneToMany
- public abstract Map<String, ContentDefinition> getContentMap();
-
- @Create
- public abstract ContentDefinition create();
-
- /**
- * Create a content definition for the target content.
- *
- * @param definitionName the definition name
- * @param contentType the target content type
- * @param contentId the target content id
- * @return the content definion
- */
- public ContentDefinition createContent(
- String definitionName,
- ContentType<?> contentType,
- String contentId)
- {
- if (definitionName == null)
- {
- throw new NullPointerException("No null definition name accepted");
- }
- if (contentType == null)
- {
- throw new NullPointerException("No null content type accepted");
- }
- if (contentId == null)
- {
- throw new NullPointerException("No null content id accepted");
- }
-
- //
- POMSession session = registry.mopManager.getSession();
-
- //
- Workspace workspace = session.getWorkspace();
-
- //
- Customization customization = workspace.getCustomization(definitionName);
-
- //
- if (customization == null)
- {
- workspace.customize(definitionName, contentType, contentId, null);
- }
- else if (customization.getContentId().equals(contentId))
- {
- // Do nothing here
- }
- else
- {
- throw new IllegalArgumentException("Cannot create a content with a content id " + contentId +
- " with an existing different content id " + customization.getContentId());
- }
-
- //
- ContentDefinition content = create();
-
- //
- Map<String, ContentDefinition> contents = getContentMap();
- contents.put(definitionName, content);
-
- //
- return content;
- }
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/CategoryDefinition.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,143 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.Name;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.portal.pom.config.POMSession;
+import org.gatein.mop.api.content.ContentType;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.Workspace;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "app:contentcategory")
+public abstract class CategoryDefinition
+{
+
+ /** The injected workspace. */
+ public ApplicationRegistryServiceImpl registry;
+
+ @Name
+ public abstract String getName();
+
+ @Property(name = "displayname")
+ public abstract String getDisplayName();
+
+ public abstract void setDisplayName(String displayName);
+
+ @Property(name = "description")
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ @Property(name = "creationdate")
+ public abstract Date getCreationDate();
+
+ public abstract void setCreationDate(Date date);
+
+ @Property(name = "lastmodificationdate")
+ public abstract Date getLastModificationDate();
+
+ public abstract void setLastModificationDate(Date date);
+
+ @Property(name = "accesspermissions")
+ public abstract List<String> getAccessPermissions();
+
+ public abstract void setAccessPermissions(List<String> accessPermissions);
+
+ @OneToMany
+ public abstract List<ContentDefinition> getContentList();
+
+ @OneToMany
+ public abstract Map<String, ContentDefinition> getContentMap();
+
+ @Create
+ public abstract ContentDefinition create();
+
+ /**
+ * Create a content definition for the target content.
+ *
+ * @param definitionName the definition name
+ * @param contentType the target content type
+ * @param contentId the target content id
+ * @return the content definion
+ */
+ public ContentDefinition createContent(
+ String definitionName,
+ ContentType<?> contentType,
+ String contentId)
+ {
+ if (definitionName == null)
+ {
+ throw new NullPointerException("No null definition name accepted");
+ }
+ if (contentType == null)
+ {
+ throw new NullPointerException("No null content type accepted");
+ }
+ if (contentId == null)
+ {
+ throw new NullPointerException("No null content id accepted");
+ }
+
+ //
+ POMSession session = registry.mopManager.getSession();
+
+ //
+ Workspace workspace = session.getWorkspace();
+
+ //
+ Customization customization = workspace.getCustomization(definitionName);
+
+ //
+ if (customization == null)
+ {
+ workspace.customize(definitionName, contentType, contentId, null);
+ }
+ else if (customization.getContentId().equals(contentId))
+ {
+ // Do nothing here
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot create a content with a content id " + contentId +
+ " with an existing different content id " + customization.getContentId());
+ }
+
+ //
+ ContentDefinition content = create();
+
+ //
+ Map<String, ContentDefinition> contents = getContentMap();
+ contents.put(definitionName, content);
+
+ //
+ return content;
+ }
+}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,88 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.api.annotations.Id;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.Name;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.Property;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.Workspace;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@NodeMapping(name = "mop:content")
-public abstract class ContentDefinition
-{
-
- @Id
- public abstract String getId();
-
- @Name
- public abstract String getName();
-
- @Property(name = "displayname")
- public abstract String getDisplayName();
-
- public abstract void setDisplayName(String displayName);
-
- @Property(name = "description")
- public abstract String getDescription();
-
- public abstract void setDescription(String description);
-
- @Property(name = "creationdate")
- public abstract Date getCreationDate();
-
- public abstract void setCreationDate(Date date);
-
- @Property(name = "lastmodificationdate")
- public abstract Date getLastModificationDate();
-
- public abstract void setLastModificationDate(Date date);
-
- @Property(name = "accesspermissions")
- public abstract List<String> getAccessPermissions();
-
- public abstract void setAccessPermissions(List<String> accessPermissions);
-
- @ManyToOne
- public abstract CategoryDefinition getCategory();
-
- public Customization getCustomization()
- {
- CategoryDefinition category = getCategory();
- POMSession session = category.registry.mopManager.getSession();
- Workspace workspace = session.getWorkspace();
- String name = getName();
- return workspace.getCustomization(name);
- }
-
-
-
-
-
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentDefinition.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,88 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.Name;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.portal.pom.config.POMSession;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.Workspace;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "app:content")
+public abstract class ContentDefinition
+{
+
+ @Id
+ public abstract String getId();
+
+ @Name
+ public abstract String getName();
+
+ @Property(name = "displayname")
+ public abstract String getDisplayName();
+
+ public abstract void setDisplayName(String displayName);
+
+ @Property(name = "description")
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ @Property(name = "creationdate")
+ public abstract Date getCreationDate();
+
+ public abstract void setCreationDate(Date date);
+
+ @Property(name = "lastmodificationdate")
+ public abstract Date getLastModificationDate();
+
+ public abstract void setLastModificationDate(Date date);
+
+ @Property(name = "accesspermissions")
+ public abstract List<String> getAccessPermissions();
+
+ public abstract void setAccessPermissions(List<String> accessPermissions);
+
+ @ManyToOne
+ public abstract CategoryDefinition getCategory();
+
+ public Customization getCustomization()
+ {
+ CategoryDefinition category = getCategory();
+ POMSession session = category.registry.mopManager.getSession();
+ Workspace workspace = session.getWorkspace();
+ String name = getName();
+ return workspace.getCustomization(name);
+ }
+
+
+
+
+
+}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,62 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@NodeMapping(name = "mop:contentregistry")
-public abstract class ContentRegistry
-{
-
- @OneToMany
- public abstract List<CategoryDefinition> getCategoryList();
-
- @OneToMany
- public abstract Map<String, CategoryDefinition> getCategoryMap();
-
- @Create
- public abstract CategoryDefinition create();
-
- public CategoryDefinition getCategory(String categoryName)
- {
- return getCategoryMap().get(categoryName);
- }
-
- public CategoryDefinition createCategory(String categoryName)
- {
- Map<String, CategoryDefinition> categories = getCategoryMap();
- if (categories.containsKey(categoryName))
- {
- throw new IllegalArgumentException("Duplicate category " + categoryName);
- }
- CategoryDefinition category = create();
- categories.put(categoryName, category);
- return category;
- }
-
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ContentRegistry.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,62 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "app:contentregistry")
+public abstract class ContentRegistry
+{
+
+ @OneToMany
+ public abstract List<CategoryDefinition> getCategoryList();
+
+ @OneToMany
+ public abstract Map<String, CategoryDefinition> getCategoryMap();
+
+ @Create
+ public abstract CategoryDefinition create();
+
+ public CategoryDefinition getCategory(String categoryName)
+ {
+ return getCategoryMap().get(categoryName);
+ }
+
+ public CategoryDefinition createCategory(String categoryName)
+ {
+ Map<String, CategoryDefinition> categories = getCategoryMap();
+ if (categories.containsKey(categoryName))
+ {
+ throw new IllegalArgumentException("Duplicate category " + categoryName);
+ }
+ CategoryDefinition category = create();
+ categories.put(categoryName, category);
+ return category;
+ }
+
+}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,86 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.api.event.LifeCycleListener;
-import org.chromattic.core.DomainSession;
-
-import javax.jcr.Node;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class Injector implements LifeCycleListener
-{
-
- /** . */
- private final MOPApplicationRegistryService registry;
-
- /** . */
- private final DomainSession session;
-
- public Injector(MOPApplicationRegistryService registry, DomainSession session)
- {
- this.registry = registry;
- this.session = session;
- }
-
- public void created(Object o)
- {
- }
-
- public void loaded(String id, String path, String name, Object o)
- {
- if (o instanceof NodeAware)
- {
- Node node = session.getNode(o);
- ((NodeAware)o).setNode(node);
- }
- if (o instanceof CategoryDefinition)
- {
- ((CategoryDefinition)o).registry = registry;
- }
- }
-
- public void added(String id, String path, String name, Object o)
- {
- if (o instanceof NodeAware)
- {
- Node node = session.getNode(o);
- ((NodeAware)o).setNode(node);
- }
- if (o instanceof CategoryDefinition)
- {
- ((CategoryDefinition)o).registry = registry;
- }
- }
-
- public void removed(String id, String path, String name, Object o)
- {
- if (o instanceof NodeAware)
- {
- ((NodeAware)o).setNode(null);
- }
- if (o instanceof CategoryDefinition)
- {
- ((CategoryDefinition)o).registry = null;
- }
- }
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/Injector.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,86 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import org.chromattic.api.event.LifeCycleListener;
+import org.chromattic.core.DomainSession;
+
+import javax.jcr.Node;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class Injector implements LifeCycleListener
+{
+
+ /** . */
+ private final ApplicationRegistryServiceImpl registry;
+
+ /** . */
+ private final DomainSession session;
+
+ public Injector(ApplicationRegistryServiceImpl registry, DomainSession session)
+ {
+ this.registry = registry;
+ this.session = session;
+ }
+
+ public void created(Object o)
+ {
+ }
+
+ public void loaded(String id, String path, String name, Object o)
+ {
+ if (o instanceof NodeAware)
+ {
+ Node node = session.getNode(o);
+ ((NodeAware)o).setNode(node);
+ }
+ if (o instanceof CategoryDefinition)
+ {
+ ((CategoryDefinition)o).registry = registry;
+ }
+ }
+
+ public void added(String id, String path, String name, Object o)
+ {
+ if (o instanceof NodeAware)
+ {
+ Node node = session.getNode(o);
+ ((NodeAware)o).setNode(node);
+ }
+ if (o instanceof CategoryDefinition)
+ {
+ ((CategoryDefinition)o).registry = registry;
+ }
+ }
+
+ public void removed(String id, String path, String name, Object o)
+ {
+ if (o instanceof NodeAware)
+ {
+ ((NodeAware)o).setNode(null);
+ }
+ if (o instanceof CategoryDefinition)
+ {
+ ((CategoryDefinition)o).registry = null;
+ }
+ }
+}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/MOPApplicationRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/MOPApplicationRegistryService.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,755 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import org.chromattic.api.ChromatticSession;
-import org.exoplatform.application.gadget.Gadget;
-import org.exoplatform.application.gadget.GadgetRegistryService;
-import org.exoplatform.application.registry.Application;
-import org.exoplatform.application.registry.ApplicationCategoriesPlugins;
-import org.exoplatform.application.registry.ApplicationCategory;
-import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
-import org.exoplatform.commons.chromattic.ChromatticManager;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.container.component.ComponentPlugin;
-import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-import org.gatein.common.i18n.LocalizedString;
-import org.gatein.common.util.Tools;
-import org.gatein.mop.api.content.ContentType;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.pc.api.PortletInvoker;
-import org.gatein.pc.api.info.MetaInfo;
-import org.gatein.pc.api.info.PortletInfo;
-import org.picocontainer.Startable;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * The fundamental reason that motives to use tasks is because of the JMX access that does not
- * setup a context and therefore the task either reuse the existing context setup by the portal
- * or create a temporary context when accessed by JMX.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class MOPApplicationRegistryService implements ApplicationRegistryService, Startable
-{
-
- /** . */
- private static final String REMOTE_CATEGORY_NAME = "remote";
-
- /** . */
- private List<ApplicationCategoriesPlugins> plugins;
-
- /** . */
- private final ChromatticManager manager;
-
- /** . */
- private final ChromatticLifeCycle lifeCycle;
-
- /** . */
- final POMSessionManager mopManager;
-
- public MOPApplicationRegistryService(ChromatticManager manager, POMSessionManager mopManager)
- {
- ApplicationRegistryChromatticLifeCycle lifeCycle = (ApplicationRegistryChromatticLifeCycle)manager.getLifeCycle("app");
- lifeCycle.registry = this;
-
- //
- this.manager = manager;
- this.lifeCycle = lifeCycle;
- this.mopManager = mopManager;
- }
-
- public ContentRegistry getContentRegistry()
- {
- ChromatticSession session = lifeCycle.getChromattic().openSession();
- ContentRegistry registry = session.findByPath(ContentRegistry.class, "registry");
- if (registry == null)
- {
- registry = session.insert(ContentRegistry.class, "registry");
- }
- return registry;
- }
-
- public void initListener(ComponentPlugin com) throws Exception
- {
- if (com instanceof ApplicationCategoriesPlugins)
- {
- if (plugins == null)
- {
- plugins = new ArrayList<ApplicationCategoriesPlugins>();
- }
- plugins.add((ApplicationCategoriesPlugins)com);
- }
- }
-
- public List<ApplicationCategory> getApplicationCategories(
- final Comparator<ApplicationCategory> sortComparator,
- String accessUser,
- final ApplicationType<?>... appTypes) throws Exception
- {
- final List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
-
- //
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- for (CategoryDefinition categoryDef : registry.getCategoryList())
- {
- ApplicationCategory category = load(categoryDef, appTypes);
- categories.add(category);
- }
-
- //
- if (sortComparator != null)
- {
- Collections.sort(categories, sortComparator);
- }
-/*
- }
- });
-*/
-
- //
- return categories;
- }
-
- public List<ApplicationCategory> getApplicationCategories(String accessUser, ApplicationType<?>... appTypes) throws Exception
- {
- return getApplicationCategories(null, accessUser, appTypes);
- }
-
- public List<ApplicationCategory> getApplicationCategories() throws Exception
- {
- return getApplicationCategories(null);
- }
-
- public List<ApplicationCategory> getApplicationCategories(Comparator<ApplicationCategory> sortComparator) throws Exception
- {
- return getApplicationCategories(sortComparator, null);
- }
-
- public ApplicationCategory getApplicationCategory(final String name) throws Exception
- {
- final AtomicReference<ApplicationCategory> a = new AtomicReference<ApplicationCategory>();
-
- //
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- CategoryDefinition categoryDef = registry.getCategory(name);
- if (categoryDef != null)
- {
- ApplicationCategory applicationCategory = load(categoryDef);
- a.set(applicationCategory);
- }
-/*
- }
- });
-*/
-
- //
- return a.get();
- }
-
- public void save(final ApplicationCategory category) throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- String categoryName = category.getName();
-
- //
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- categoryDef = registry.createCategory(categoryName);
- }
-
- //
- categoryDef.setDisplayName(category.getDisplayName());
- categoryDef.setCreationDate(category.getCreatedDate());
- categoryDef.setLastModificationDate(category.getModifiedDate());
- categoryDef.setDescription(category.getDescription());
- categoryDef.setAccessPermissions(category.getAccessPermissions());
- }
-/*
- });
- }
-*/
-
- public void remove(final ApplicationCategory category) throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
- registry.getCategoryMap().remove(category.getName());
-/*
- }
- });
-*/
- }
-
- public List<Application> getApplications(ApplicationCategory category, ApplicationType<?>... appTypes) throws Exception
- {
- return getApplications(category, null, appTypes);
- }
-
- public List<Application> getApplications(
- final ApplicationCategory category,
- final Comparator<Application> sortComparator,
- final ApplicationType<?>... appTypes) throws Exception
- {
- final AtomicReference<List<Application>> ref = new AtomicReference<List<Application>>();
-
- //
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- CategoryDefinition categoryDef = registry.getCategory(category.getName());
- List<Application> applications = load(categoryDef, appTypes).getApplications();
-
- //
- if (sortComparator != null)
- {
- Collections.sort(applications, sortComparator);
- }
-
- //
- ref.set(applications);
-/*
- }
- });
-*/
-
- //
- return ref.get();
- }
-
- public List<Application> getAllApplications() throws Exception
- {
- List<Application> applications = new ArrayList<Application>();
- List<ApplicationCategory> categories = getApplicationCategories();
- for (ApplicationCategory category : categories)
- {
- applications.addAll(getApplications(category));
- }
- return applications;
- }
-
- public Application getApplication(String id) throws Exception
- {
- String[] fragments = id.split("/");
- if (fragments.length < 2)
- {
- throw new Exception("Invalid Application Id: [" + id + "]");
- }
- return getApplication(fragments[0], fragments[1]);
- }
-
- public Application getApplication(final String category, final String name) throws Exception
- {
- final AtomicReference<Application> ref = new AtomicReference<Application>();
-
- //
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- CategoryDefinition categoryDef = registry.getCategory(category);
- if (categoryDef != null)
- {
- ContentDefinition contentDef = categoryDef.getContentMap().get(name);
- if (contentDef != null)
- {
- ref.set(load(contentDef));
- }
- }
-/*
- }
- });
-*/
-
- //
- return ref.get();
- }
-
- public void save(final ApplicationCategory category, final Application application) throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- String categoryName = category.getName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- categoryDef = registry.createCategory(categoryName);
- save(category, categoryDef);
- }
-
- //
- ContentDefinition contentDef = null;
- CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
- String applicationName = application.getApplicationName();
- if (applicationCategoryDef != null)
- {
- contentDef = applicationCategoryDef.getContentMap().get(applicationName);
- }
- if (contentDef == null)
- {
- String contentId = application.getContentId();
- ContentType<?> contentType = application.getType().getContentType();
- String definitionName = application.getApplicationName();
- contentDef = categoryDef.createContent(definitionName, contentType, contentId);
- }
- else
- {
- // A JCR move actually
- categoryDef.getContentList().add(contentDef);
- }
-
- // Update state
- save(application, contentDef);
-/*
- }
- });
-*/
- }
-
- public void update(final Application application) throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- String categoryName = application.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- throw new IllegalStateException();
- }
-
- //
- ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
- if (contentDef == null)
- {
- throw new IllegalStateException();
- }
-
- // Update state
- save(application, contentDef);
-/*
- }
- });
-*/
- }
-
- public void remove(final Application app) throws Exception
- {
- if (app == null)
- {
- throw new NullPointerException();
- }
-
- //
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- String categoryName = app.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
-
- //
- if (categoryDef != null)
- {
-
- String contentName = app.getApplicationName();
- categoryDef.getContentMap().remove(contentName);
- }
-/*
- }
- });
-*/
- }
-
- public void importExoGadgets() throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
- List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
-
- //
- if (eXoGadgets != null)
- {
- ArrayList<String> permissions = new ArrayList<String>();
- permissions.add(UserACL.EVERYONE);
- String categoryName = "Gadgets";
-
- //
- CategoryDefinition category = registry.getCategory(categoryName);
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- category.setDescription(categoryName);
- category.setAccessPermissions(permissions);
- }
-
- //
- for (Gadget ele : eXoGadgets)
- {
- ContentDefinition app = category.getContentMap().get(ele.getName());
- if (app == null)
- {
- app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
- app.setDisplayName(ele.getTitle());
- app.setDescription(ele.getDescription());
- app.setAccessPermissions(permissions);
- }
- }
- }
-/*
- }
- });
-*/
- }
-
- public void importAllPortlets() throws Exception
- {
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
- Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
-
- //
- for (org.gatein.pc.api.Portlet portlet : portlets)
- {
- PortletInfo info = portlet.getInfo();
- String portletApplicationName = info.getApplicationName();
- String portletName = info.getName();
-
- // Need to sanitize portlet and application names in case they contain characters that would
- // cause an improper Application name
- portletApplicationName = portletApplicationName.replace('/', '_');
- portletName = portletName.replace('/', '_');
-
- LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
-
- String[] categoryNames = null;
- if (keywordsLS != null)
- {
- String keywords = keywordsLS.getDefaultString();
- if (keywords != null && keywords.length() != 0)
- {
- categoryNames = keywords.split(",");
- }
- }
-
- if (categoryNames == null || categoryNames.length == 0)
- {
- categoryNames = new String[]{portletApplicationName};
- }
-
- if (portlet.isRemote())
- {
- categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
- }
-
- //
- for (String categoryName : categoryNames)
- {
- categoryName = categoryName.trim();
-
- //
- CategoryDefinition category = registry.getCategory(categoryName);
-
- //
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- }
-
- //
- ContentDefinition app = category.getContentMap().get(portletName);
- if (app == null)
- {
- LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-
- // julien: ????
- // getLocalizedStringValue(descriptionLS, portletName);
-
- ContentType<?> contentType;
- String contentId;
- if (portlet.isRemote())
- {
- contentType = WSRP.CONTENT_TYPE;
- contentId = portlet.getContext().getId();
- }
- else
- {
- contentType = Portlet.CONTENT_TYPE;
- contentId = info.getApplicationName() + "/" + info.getName();
- }
-
-
- //
- app = category.createContent(portletName, contentType, contentId);
- app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
- app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
- }
- }
- }
-/*
- }
- });
-*/
- }
-
- private boolean isApplicationType(Application app, ApplicationType<?>... appTypes)
- {
- if (appTypes == null || appTypes.length == 0)
- {
- return true;
- }
- for (ApplicationType<?> appType : appTypes)
- {
- if (appType.equals(app.getType()))
- {
- return true;
- }
- }
- return false;
- }
-
- private void save(ApplicationCategory category, CategoryDefinition categoryDef)
- {
- categoryDef.setDisplayName(category.getDisplayName());
- categoryDef.setDescription(category.getDescription());
- categoryDef.setAccessPermissions(category.getAccessPermissions());
- categoryDef.setCreationDate(category.getCreatedDate());
- categoryDef.setLastModificationDate(category.getModifiedDate());
- }
-
- private ApplicationCategory load(CategoryDefinition categoryDef, ApplicationType<?>... appTypes)
- {
- ApplicationCategory category = new ApplicationCategory();
-
- //
- category.setName(categoryDef.getName());
- category.setDisplayName(categoryDef.getDisplayName());
- category.setDescription(categoryDef.getDescription());
- category.setAccessPermissions(new ArrayList<String>(categoryDef.getAccessPermissions()));
- category.setCreatedDate(categoryDef.getCreationDate());
- category.setModifiedDate(categoryDef.getLastModificationDate());
-
- //
- for (ContentDefinition contentDef : categoryDef.getContentList())
- {
- Application application = load(contentDef);
- if (isApplicationType(application, appTypes))
- {
- category.getApplications().add(application);
- }
- }
-
- //
- return category;
- }
-
- private void save(Application application, ContentDefinition contentDef)
- {
- contentDef.setDisplayName(application.getDisplayName());
- contentDef.setDescription(application.getDescription());
- contentDef.setAccessPermissions(application.getAccessPermissions());
- contentDef.setCreationDate(application.getCreatedDate());
- contentDef.setLastModificationDate(application.getModifiedDate());
- }
-
- private Application load(ContentDefinition contentDef)
- {
- ContentType<?> contentType = contentDef.getCustomization().getType();
- ApplicationType<?> applicationType = ApplicationType.getType(contentType);
-
- //
- Application application = new Application();
- application.setId(contentDef.getCategory().getName() + "/" + contentDef.getName());
- application.setCategoryName(contentDef.getCategory().getName());
- application.setType(applicationType);
- application.setApplicationName(contentDef.getName());
- application.setIconURL(getApplicationIconURL(contentDef));
- application.setDisplayName(contentDef.getDisplayName());
- application.setDescription(contentDef.getDescription());
- application.setAccessPermissions(new ArrayList<String>(contentDef.getAccessPermissions()));
- application.setCreatedDate(contentDef.getCreationDate());
- application.setModifiedDate(contentDef.getLastModificationDate());
- application.setStorageId(contentDef.getCustomization().getId());
- application.setContentId(contentDef.getCustomization().getContentId());
- return application;
- }
-
- private String getLocalizedStringValue(LocalizedString localizedString, String portletName)
- {
- if (localizedString == null || localizedString.getDefaultString() == null)
- {
- return portletName;
- }
- else
- {
- return localizedString.getDefaultString();
- }
- }
-
- private static String getApplicationIconURL(ContentDefinition contentDef)
- {
- Customization customization = contentDef.getCustomization();
- if (customization != null)
- {
- ContentType type = customization.getType();
- String contentId = customization.getContentId();
- if (type == Portlet.CONTENT_TYPE)
- {
- String[] chunks = contentId.split("/");
- if (chunks.length == 2)
- {
- return "/" + chunks[0] + "/skin/DefaultSkin/portletIcons/" + chunks[1] + ".png";
- }
- }
- else if (type == org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE)
- {
- return "/" + "eXoGadgets" + "/skin/DefaultSkin/portletIcons/" + contentId + ".png";
- }
- }
-
- //
- return null;
- }
-
- public void start()
- {
- if (plugins != null)
- {
-// POMSession session = pomMGr.openSession();
-// SessionContext context = lifeCycle.openContext();
- manager.beginRequest();
- boolean save = false;
- try
- {
- for (ApplicationCategoriesPlugins plugin : plugins)
- {
- plugin.run();
- }
- save = true;
- }
- catch (Exception e)
- {
- // log.error(e);
- e.printStackTrace();
- }
- finally
- {
- // lifeCycle.closeContext(context, true);
- manager.endRequest(true);
- }
- }
- }
-
- public void stop()
- {
- }
-}
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.application.registry.mop;
-
-import javax.jcr.Node;
-
-/**
- * Temporary hack.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public interface NodeAware
-{
- void setNode(Node node);
-}
Copied: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java (from rev 932, portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java)
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/NodeAware.java 2009-12-04 20:11:50 UTC (rev 933)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.application.registry.impl;
+
+import javax.jcr.Node;
+
+/**
+ * Temporary hack.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface NodeAware
+{
+ void setNode(Node node);
+}
Modified: portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml 2009-12-04 19:58:27 UTC (rev 932)
+++ portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml 2009-12-04 20:11:50 UTC (rev 933)
@@ -30,7 +30,7 @@
</component>
<component>
<key>org.exoplatform.application.registry.ApplicationRegistryService</key>
- <type>org.exoplatform.application.registry.mop.MOPApplicationRegistryService</type>
+ <type>org.exoplatform.application.registry.impl.ApplicationRegistryServiceImpl</type>
<component-plugins>
<component-plugin>
<name>new.portal.portlets.registry</name>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 19:58:27 UTC (rev 932)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 20:11:50 UTC (rev 933)
@@ -66,7 +66,7 @@
<component>
<key>org.exoplatform.application.registry.ApplicationRegistryService</key>
- <type>org.exoplatform.application.registry.mop.MOPApplicationRegistryService</type>
+ <type>org.exoplatform.application.registry.impl.ApplicationRegistryServiceImpl</type>
<component-plugins>
<component-plugin>
<name>new.portal.portlets.registry</name>
@@ -526,7 +526,7 @@
<component-plugin>
<name>chromattic</name>
<set-method>addLifeCycle</set-method>
- <type>org.exoplatform.application.registry.mop.ApplicationRegistryChromatticLifeCycle</type>
+ <type>org.exoplatform.application.registry.impl.ApplicationRegistryChromatticLifeCycle</type>
<init-params>
<value-param>
<name>name</name>
@@ -538,9 +538,9 @@
</value-param>
<values-param>
<name>entities</name>
- <value>org.exoplatform.application.registry.mop.ContentRegistry</value>
- <value>org.exoplatform.application.registry.mop.CategoryDefinition</value>
- <value>org.exoplatform.application.registry.mop.ContentDefinition</value>
+ <value>org.exoplatform.application.registry.impl.ContentRegistry</value>
+ <value>org.exoplatform.application.registry.impl.CategoryDefinition</value>
+ <value>org.exoplatform.application.registry.impl.ContentDefinition</value>
<value>org.exoplatform.application.gadget.impl.GadgetRegistry</value>
<value>org.exoplatform.application.gadget.impl.GadgetDefinition</value>
<value>org.exoplatform.application.gadget.impl.LocalGadgetData</value>
15 years, 1 month