exo-jcr SVN: r308 - in core/trunk: component/database/src/main and 61 other directories.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-20 04:49:45 -0400 (Tue, 20 Oct 2009)
New Revision: 308
Added:
core/trunk/component/database/src/main/resources/
core/trunk/component/database/src/main/resources/conf/
core/trunk/component/database/src/main/resources/conf/portal/
core/trunk/component/database/src/main/resources/conf/standalone/
core/trunk/component/database/src/test/resources/
core/trunk/component/database/src/test/resources/conf/
core/trunk/component/database/src/test/resources/conf/portal/
core/trunk/component/document/src/main/resources/
core/trunk/component/document/src/main/resources/conf/
core/trunk/component/document/src/main/resources/conf/configuration.xml
core/trunk/component/document/src/main/resources/conf/portal/
core/trunk/component/ldap/src/main/resources/conf/
core/trunk/component/ldap/src/main/resources/conf/portal/
core/trunk/component/ldap/src/test/resources/
core/trunk/component/ldap/src/test/resources/conf/
core/trunk/component/ldap/src/test/resources/conf/portal/
core/trunk/component/organization/api/src/main/resources/
core/trunk/component/organization/api/src/main/resources/conf/
core/trunk/component/organization/api/src/main/resources/conf/portal/
core/trunk/component/organization/api/src/test/resources/conf/
core/trunk/component/organization/api/src/test/resources/conf/standalone/
core/trunk/component/organization/jdbc/src/main/resources/
core/trunk/component/organization/jdbc/src/main/resources/conf/
core/trunk/component/organization/jdbc/src/main/resources/conf/portal/
core/trunk/component/organization/jdbc/src/test/resources/
core/trunk/component/organization/jdbc/src/test/resources/conf/
core/trunk/component/organization/jdbc/src/test/resources/conf/portal/
core/trunk/component/organization/ldap/src/main/resources/
core/trunk/component/organization/ldap/src/main/resources/conf/
core/trunk/component/organization/ldap/src/main/resources/conf/portal/
core/trunk/component/organization/ldap/src/test/resources/
core/trunk/component/organization/ldap/src/test/resources/conf/
core/trunk/component/organization/ldap/src/test/resources/conf/portal/
core/trunk/component/script/groovy/src/main/resources/
core/trunk/component/script/groovy/src/main/resources/conf/
core/trunk/component/script/groovy/src/main/resources/conf/portal/
core/trunk/component/script/groovy/src/test/resources/conf/
core/trunk/component/script/groovy/src/test/resources/conf/standalone/
core/trunk/component/security/core/src/main/resources/
core/trunk/component/security/core/src/main/resources/conf/
core/trunk/component/security/core/src/main/resources/conf/portal/
core/trunk/component/security/core/src/test/resources/conf/
core/trunk/component/security/core/src/test/resources/conf/standalone/
core/trunk/component/xml-processing/src/main/resources/conf/
core/trunk/component/xml-processing/src/main/resources/conf/configuration.xml
core/trunk/component/xml-processing/src/main/resources/conf/portal/
core/trunk/component/xml-processing/src/test/resources/conf/
core/trunk/component/xml-processing/src/test/resources/conf/standalone/
Removed:
core/trunk/component/database/src/main/java/conf/portal/
core/trunk/component/database/src/main/java/conf/standalone/
core/trunk/component/database/src/test/java/conf/portal/
core/trunk/component/document/src/main/java/conf/configuration.xml
core/trunk/component/document/src/main/java/conf/portal/
core/trunk/component/ldap/src/main/java/conf/portal/
core/trunk/component/ldap/src/test/java/conf/portal/
core/trunk/component/organization/api/src/main/java/conf/portal/
core/trunk/component/organization/api/src/test/java/conf/standalone/
core/trunk/component/organization/jdbc/src/main/java/conf/portal/
core/trunk/component/organization/jdbc/src/test/java/conf/portal/
core/trunk/component/organization/ldap/src/main/java/conf/portal/
core/trunk/component/organization/ldap/src/test/java/conf/portal/
core/trunk/component/script/groovy/src/main/java/conf/portal/
core/trunk/component/script/groovy/src/test/java/conf/standalone/
core/trunk/component/security/core/src/main/java/conf/portal/
core/trunk/component/security/core/src/test/java/conf/standalone/
core/trunk/component/xml-processing/src/main/java/conf/configuration.xml
core/trunk/component/xml-processing/src/main/java/conf/portal/
core/trunk/component/xml-processing/src/test/java/conf/standalone/
Modified:
core/trunk/pom.xml
Log:
EXOJCR-165 Resources moved from main folder to resource
Copied: core/trunk/component/database/src/main/resources/conf/portal (from rev 293, core/trunk/component/database/src/main/java/conf/portal)
Copied: core/trunk/component/database/src/main/resources/conf/standalone (from rev 293, core/trunk/component/database/src/main/java/conf/standalone)
Copied: core/trunk/component/database/src/test/resources/conf/portal (from rev 293, core/trunk/component/database/src/test/java/conf/portal)
Deleted: core/trunk/component/document/src/main/java/conf/configuration.xml
===================================================================
--- core/trunk/component/document/src/main/java/conf/configuration.xml 2009-10-20 08:19:49 UTC (rev 307)
+++ core/trunk/component/document/src/main/java/conf/configuration.xml 2009-10-20 08:49:45 UTC (rev 308)
@@ -1,40 +0,0 @@
-<?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.
-
--->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <!-- component>
- <key>org.exoplatform.services.document.diff.DiffAlgorithm</key>
- <type>org.exoplatform.services.document.impl.diff.SimpleDiff</type>
- </component -->
-
- <!-- component>
- <key>org.exoplatform.services.document.diff.DiffService</key>
- <type>org.exoplatform.services.document.impl.diff.DiffServiceImpl</type>
- </component -->
-
- <!-- component>
- <key>org.exoplatform.services.document.impl.image.ImageProcessingService</key>
- <type>org.exoplatform.services.document.impl.image.ImageProcessingServiceImpl</type>
- </component -->
-
-</configuration>
Copied: core/trunk/component/document/src/main/resources/conf/configuration.xml (from rev 293, core/trunk/component/document/src/main/java/conf/configuration.xml)
===================================================================
--- core/trunk/component/document/src/main/resources/conf/configuration.xml (rev 0)
+++ core/trunk/component/document/src/main/resources/conf/configuration.xml 2009-10-20 08:49:45 UTC (rev 308)
@@ -0,0 +1,40 @@
+<?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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <!-- component>
+ <key>org.exoplatform.services.document.diff.DiffAlgorithm</key>
+ <type>org.exoplatform.services.document.impl.diff.SimpleDiff</type>
+ </component -->
+
+ <!-- component>
+ <key>org.exoplatform.services.document.diff.DiffService</key>
+ <type>org.exoplatform.services.document.impl.diff.DiffServiceImpl</type>
+ </component -->
+
+ <!-- component>
+ <key>org.exoplatform.services.document.impl.image.ImageProcessingService</key>
+ <type>org.exoplatform.services.document.impl.image.ImageProcessingServiceImpl</type>
+ </component -->
+
+</configuration>
Copied: core/trunk/component/document/src/main/resources/conf/portal (from rev 293, core/trunk/component/document/src/main/java/conf/portal)
Copied: core/trunk/component/ldap/src/main/resources/conf/portal (from rev 293, core/trunk/component/ldap/src/main/java/conf/portal)
Copied: core/trunk/component/ldap/src/test/resources/conf/portal (from rev 293, core/trunk/component/ldap/src/test/java/conf/portal)
Copied: core/trunk/component/organization/api/src/main/resources/conf/portal (from rev 293, core/trunk/component/organization/api/src/main/java/conf/portal)
Copied: core/trunk/component/organization/api/src/test/resources/conf/standalone (from rev 293, core/trunk/component/organization/api/src/test/java/conf/standalone)
Copied: core/trunk/component/organization/jdbc/src/main/resources/conf/portal (from rev 293, core/trunk/component/organization/jdbc/src/main/java/conf/portal)
Copied: core/trunk/component/organization/jdbc/src/test/resources/conf/portal (from rev 293, core/trunk/component/organization/jdbc/src/test/java/conf/portal)
Copied: core/trunk/component/organization/ldap/src/main/resources/conf/portal (from rev 293, core/trunk/component/organization/ldap/src/main/java/conf/portal)
Copied: core/trunk/component/organization/ldap/src/test/resources/conf/portal (from rev 293, core/trunk/component/organization/ldap/src/test/java/conf/portal)
Copied: core/trunk/component/script/groovy/src/main/resources/conf/portal (from rev 293, core/trunk/component/script/groovy/src/main/java/conf/portal)
Copied: core/trunk/component/script/groovy/src/test/resources/conf/standalone (from rev 293, core/trunk/component/script/groovy/src/test/java/conf/standalone)
Copied: core/trunk/component/security/core/src/main/resources/conf/portal (from rev 293, core/trunk/component/security/core/src/main/java/conf/portal)
Copied: core/trunk/component/security/core/src/test/resources/conf/standalone (from rev 293, core/trunk/component/security/core/src/test/java/conf/standalone)
Deleted: core/trunk/component/xml-processing/src/main/java/conf/configuration.xml
===================================================================
--- core/trunk/component/xml-processing/src/main/java/conf/configuration.xml 2009-10-20 08:19:49 UTC (rev 307)
+++ core/trunk/component/xml-processing/src/main/java/conf/configuration.xml 2009-10-20 08:49:45 UTC (rev 308)
@@ -1,89 +0,0 @@
-<?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.
-
--->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <type>org.exoplatform.services.xml.resolving.impl.XMLResolvingServiceImpl</type>
- <component-plugins>
- <component-plugin>
- <name>add.resolving.table</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.xml.resolving.impl.AddXMLResolvingContextPlugin</type>
- <init-params>
- <properties-param>
- <name>xhtml1-transitional.dtd</name>
- <property name="uri" value="dtd/xhtml1-transitional.dtd" />
- <property name="publicId" value="-//W3C//DTD XHTML 1.0 Transitional//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
- </properties-param>
- <properties-param>
- <name>web-app_2_3.dtd</name>
- <property name="uri" value="dtd/web-app_2_3.dtd" />
- <property name="publicId" value="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" />
- <property name="systemId" value="http://java.sun.com/dtd/web-app_2_3.dtd" />
- </properties-param>
- <properties-param>
- <name>datatypes.dtd</name>
- <property name="uri" value="dtd/datatypes.dtd" />
- <property name="systemId" value="http://www.w3.org/2001/datatypes.dtd" />
- </properties-param>
- <properties-param>
- <name>XMLSchema.dtd</name>
- <property name="uri" value="dtd/XMLSchema.dtd" />
- <property name="publicId" value="-//W3C//DTD XMLSCHEMA 200102//EN" />
- <property name="systemId" value="http://www.w3.org/2001/XMLSchema.dtd" />
- </properties-param>
- <properties-param>
- <name>xhtml1-frameset.dtd</name>
- <property name="uri" value="dtd/xhtml1-frameset.dtd" />
- <property name="publicId" value="-//W3C//DTD XHTML 1.0 Frameset//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" />
- </properties-param>
- <properties-param>
- <name>xhtml1-strict.dtd</name>
- <property name="uri" value="dtd/xhtml1-strict.dtd" />
- <property name="publicId" value="-//W3C//DTD XHTML 1.0 Strict//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
- </properties-param>
- <properties-param>
- <name>xhtml-lat1.ent</name>
- <property name="uri" value="dtd/xhtml-lat1.ent" />
- <property name="publicId" value="-//W3C//ENTITIES Latin 1 for XHTML//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" />
- </properties-param>
- <properties-param>
- <name>xhtml-special.ent</name>
- <property name="uri" value="dtd/xhtml-special.ent" />
- <property name="publicId" value="-//W3C//ENTITIES Special for XHTML//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" />
- </properties-param>
- <properties-param>
- <name>xhtml-symbol.ent</name>
- <property name="uri" value="dtd/xhtml-symbol.ent" />
- <property name="publicId" value="-//W3C//ENTITIES Symbols for XHTML//EN" />
- <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" />
- </properties-param>
- </init-params>
- </component-plugin>
- </component-plugins>
- </component>
-</configuration>
Copied: core/trunk/component/xml-processing/src/main/resources/conf/configuration.xml (from rev 293, core/trunk/component/xml-processing/src/main/java/conf/configuration.xml)
===================================================================
--- core/trunk/component/xml-processing/src/main/resources/conf/configuration.xml (rev 0)
+++ core/trunk/component/xml-processing/src/main/resources/conf/configuration.xml 2009-10-20 08:49:45 UTC (rev 308)
@@ -0,0 +1,89 @@
+<?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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.services.xml.resolving.impl.XMLResolvingServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.resolving.table</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.xml.resolving.impl.AddXMLResolvingContextPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>xhtml1-transitional.dtd</name>
+ <property name="uri" value="dtd/xhtml1-transitional.dtd" />
+ <property name="publicId" value="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>web-app_2_3.dtd</name>
+ <property name="uri" value="dtd/web-app_2_3.dtd" />
+ <property name="publicId" value="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" />
+ <property name="systemId" value="http://java.sun.com/dtd/web-app_2_3.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>datatypes.dtd</name>
+ <property name="uri" value="dtd/datatypes.dtd" />
+ <property name="systemId" value="http://www.w3.org/2001/datatypes.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>XMLSchema.dtd</name>
+ <property name="uri" value="dtd/XMLSchema.dtd" />
+ <property name="publicId" value="-//W3C//DTD XMLSCHEMA 200102//EN" />
+ <property name="systemId" value="http://www.w3.org/2001/XMLSchema.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>xhtml1-frameset.dtd</name>
+ <property name="uri" value="dtd/xhtml1-frameset.dtd" />
+ <property name="publicId" value="-//W3C//DTD XHTML 1.0 Frameset//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>xhtml1-strict.dtd</name>
+ <property name="uri" value="dtd/xhtml1-strict.dtd" />
+ <property name="publicId" value="-//W3C//DTD XHTML 1.0 Strict//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
+ </properties-param>
+ <properties-param>
+ <name>xhtml-lat1.ent</name>
+ <property name="uri" value="dtd/xhtml-lat1.ent" />
+ <property name="publicId" value="-//W3C//ENTITIES Latin 1 for XHTML//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" />
+ </properties-param>
+ <properties-param>
+ <name>xhtml-special.ent</name>
+ <property name="uri" value="dtd/xhtml-special.ent" />
+ <property name="publicId" value="-//W3C//ENTITIES Special for XHTML//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" />
+ </properties-param>
+ <properties-param>
+ <name>xhtml-symbol.ent</name>
+ <property name="uri" value="dtd/xhtml-symbol.ent" />
+ <property name="publicId" value="-//W3C//ENTITIES Symbols for XHTML//EN" />
+ <property name="systemId" value="http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+</configuration>
Copied: core/trunk/component/xml-processing/src/main/resources/conf/portal (from rev 293, core/trunk/component/xml-processing/src/main/java/conf/portal)
Copied: core/trunk/component/xml-processing/src/test/resources/conf/standalone (from rev 293, core/trunk/component/xml-processing/src/test/java/conf/standalone)
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-10-20 08:19:49 UTC (rev 307)
+++ core/trunk/pom.xml 2009-10-20 08:49:45 UTC (rev 308)
@@ -357,42 +357,6 @@
</dependencies>
<build>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.groovy</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.groovy</include>
- </includes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.groovy</include>
- </includes>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.groovy</include>
- </includes>
- </testResource>
- </testResources>
<plugins>
<plugin>
14 years, 8 months
exo-jcr SVN: r307 - in kernel/trunk: component/cache/src/main/java and 7 other directories.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-20 04:19:49 -0400 (Tue, 20 Oct 2009)
New Revision: 307
Removed:
kernel/trunk/component/cache/src/main/java/conf/
kernel/trunk/component/cache/src/test/java/conf/
kernel/trunk/component/command/src/main/java/conf/
kernel/trunk/component/common/src/main/java/conf/
kernel/trunk/component/common/src/test/java/conf/
kernel/trunk/component/remote/src/main/java/conf/
kernel/trunk/container/src/main/java/conf/
kernel/trunk/container/src/test/java/conf/
Modified:
kernel/trunk/pom.xml
Log:
EXOJCR-165 conf folder removed
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2009-10-20 08:18:59 UTC (rev 306)
+++ kernel/trunk/pom.xml 2009-10-20 08:19:49 UTC (rev 307)
@@ -221,29 +221,4 @@
</dependency>
</dependencies>
- <build>
- <!--resources>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.drl</include>
- <include>**/*.xsd</include>
- </includes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.drl</include>
- <include>**/*.xsd</include>
- </includes>
- </testResource>
- </testResources-->
- </build>
-
</project>
14 years, 8 months
exo-jcr SVN: r304 - in ws/branches/2.2.x/rest/core: src/main/java/org/exoplatform/services/rest/servlet and 1 other directory.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-19 18:48:23 -0400 (Mon, 19 Oct 2009)
New Revision: 304
Modified:
ws/branches/2.2.x/rest/core/pom.xml
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
Log:
EXOJCR-185 : Add annotation scanning feature
Modified: ws/branches/2.2.x/rest/core/pom.xml
===================================================================
--- ws/branches/2.2.x/rest/core/pom.xml 2009-10-19 15:34:14 UTC (rev 303)
+++ ws/branches/2.2.x/rest/core/pom.xml 2009-10-19 22:48:23 UTC (rev 304)
@@ -75,6 +75,10 @@
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</dependency>
+ <dependency>
+ <groupId>net.sf.scannotation</groupId>
+ <artifactId>scannotation</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 15:34:14 UTC (rev 303)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 22:48:23 UTC (rev 304)
@@ -18,17 +18,31 @@
*/
package org.exoplatform.services.rest.servlet;
+import org.exoplatform.services.log.ExoLogger;
+
+import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.impl.ApplicationDeployer;
import org.exoplatform.services.rest.impl.ProviderBinder;
import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
+import org.scannotation.AnnotationDB;
+import org.scannotation.WarUrlFinder;
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.net.URL;
+import java.util.Map;
+import java.util.Set;
+
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import javax.ws.rs.Path;
import javax.ws.rs.core.Application;
+import javax.ws.rs.ext.Provider;
/**
* Initialize required components of JAX-RS framework and deploy single JAX-RS application.
@@ -39,6 +53,8 @@
public class RestInitializedListener implements ServletContextListener
{
+ private static final Log LOG = ExoLogger.getLogger(RestInitializedListener.class);
+
/**
* {@inheritDoc}
*/
@@ -51,14 +67,25 @@
*/
public void contextInitialized(ServletContextEvent event)
{
+ boolean scan = Boolean.parseBoolean(event.getServletContext().getInitParameter("ws.rs.scan.components"));
String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencySupplier.class.getName());
- DependencySupplier dependencySupplier = null;
- if (dependencyInjectorFQN != null)
+
+ ResourceBinder resources = new ResourceBinderImpl();
+ ApplicationDeployer deployer = new ApplicationDeployer(resources, ProviderBinder.getInstance());
+
+ String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
+ if (applicationFQN != null)
{
+ if (scan)
+ {
+ String msg = "Scan of rest components is disabled cause to specified 'javax.ws.rs.Application'.";
+ LOG.warn(msg);
+ }
try
{
- Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
- dependencySupplier = (DependencySupplier)cl.newInstance();
+ Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
+ Application application = (Application)cl.newInstance();
+ deployer.deploy(application);
}
catch (ClassNotFoundException cnfe)
{
@@ -73,18 +100,59 @@
throw new RuntimeException(iae);
}
}
+ else if (scan)
+ {
+ URL classes = WarUrlFinder.findWebInfClassesPath(event);
+ URL[] libs = WarUrlFinder.findWebInfLibClasspaths(event);
+ AnnotationDB annotationDB = new AnnotationDB();
+ // Disable processing of API, implementation and JAX-RS packages
+ annotationDB.setIgnoredPackages(new String[]{"org.exoplatform.services.rest", "javax.ws.rs"});
+ try
+ {
+ if (classes != null)
+ annotationDB.scanArchives(classes);
+ annotationDB.scanArchives(libs);
- ResourceBinder resources = new ResourceBinderImpl();
- ApplicationDeployer deployer = new ApplicationDeployer(resources, ProviderBinder.getInstance());
+ Map<String, Set<String>> results = annotationDB.getAnnotationIndex();
+ for (String annotation : new String[]{Path.class.getName(), Provider.class.getName(),
+ Filter.class.getName()})
+ {
+ if (results.get(annotation) != null)
+ {
+ for (String fqn : results.get(annotation))
+ {
+ try
+ {
+ Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(fqn);
+ if (cl.isInterface() || Modifier.isAbstract(cl.getModifiers()))
+ {
+ LOG.info("Skip abstract class or interface " + fqn);
+ continue;
+ }
+ deployer.deploy(cl);
+ LOG.info("Deployed component: " + fqn);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
- String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
- if (applicationFQN != null)
+ DependencySupplier dependencySupplier = null;
+ if (dependencyInjectorFQN != null)
{
try
{
- Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
- Application application = (Application)cl.newInstance();
- deployer.deploy(application);
+ Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
+ dependencySupplier = (DependencySupplier)cl.newInstance();
}
catch (ClassNotFoundException cnfe)
{
14 years, 8 months
exo-jcr SVN: r303 - jcr/trunk/component/core.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-19 11:34:14 -0400 (Mon, 19 Oct 2009)
New Revision: 303
Modified:
jcr/trunk/component/core/pom.xml
Log:
EXOJCR-164: JCR core POM rework
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 15:32:45 UTC (rev 302)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 15:34:14 UTC (rev 303)
@@ -189,85 +189,85 @@
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.2-504.jdbc3</version>
- <scope>compile</scope>
+ <scope>test</scope>
</dependency>
<!-- For Oracle 10g support (local-jcr repository) -->
- <dependency>
+ <!-- dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
- <scope>compile</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>ojdbc</groupId>
<artifactId>orai18n</artifactId>
<version>14</version>
- <scope>compile</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency -->
<!-- For IBM DB2 support (local-jcr repository) -->
- <dependency>
+ <!-- dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc</artifactId>
<version>9.1</version>
- <scope>compile</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>9.1</version>
- <scope>compile</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency -->
<!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver) -->
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
- <scope>compile</scope>
+ <scope>test</scope>
</dependency>
<!-- For MS SQL 2005 support (Microsoft JDBC driver) (local-jcr repository) -->
- <dependency>
+ <!-- dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc</artifactId>
<version>9.0</version>
- <scope>compile</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency -->
- <!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository) -->
- <dependency>
- <groupId>com.sybase.jdbc3.jdbc</groupId>
- <artifactId>jconn3</artifactId>
- <version>6.05</version>
- <scope>compile</scope>
- </dependency>
-
<!-- For Apache Derby support (aka JavaDB) -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.2.2.0</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Ingres Database (local repository) -->
- <dependency>
- <groupId>com.ingres.jdbc</groupId>
- <artifactId>iijdbc</artifactId>
- <version>9.2</version>
<scope>test</scope>
</dependency>
<!-- H2 Database -->
- <dependency>
+ <!-- dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.0.74</version>
- <scope>compile</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency -->
+ <!-- Ingres Database (local repository) -->
+ <!-- dependency>
+ <groupId>com.ingres.jdbc</groupId>
+ <artifactId>iijdbc</artifactId>
+ <version>9.2</version>
+ <scope>test</scope>
+ </dependency -->
+
+ <!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository) -->
+ <!-- dependency>
+ <groupId>com.sybase.jdbc3.jdbc</groupId>
+ <artifactId>jconn3</artifactId>
+ <version>6.05</version>
+ <scope>test</scope>
+ </dependency -->
+
<!-- ======================================================================= -->
</dependencies>
@@ -365,8 +365,6 @@
</includes>
<excludes>
<exclude>**/TestQueryUsecases.java</exclude>
- <exclude>**/SpellCheckerTest.java</exclude>
- <exclude>**/TestSimilarity.java</exclude>
<exclude>**/TestImport.java</exclude>
<exclude>**/TestRollbackBigFiles.java</exclude>
<exclude>**/TestErrorMultithreading.java</exclude>
@@ -532,7 +530,7 @@
</profile>
<!-- Use "mvn -Prun-its" to launch them -->
<profile>
- <id>run-its</id>
+ <id>run-tck</id>
<dependencies>
<!-- TCK binaries and deps for repo stub, some eXo API test -->
<dependency>
@@ -602,8 +600,7 @@
<include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
</includes>
</configuration>
- </execution
--->
+ </execution>
<execution>
<id>execution4 - pause 10 sec</id>
<phase>test</phase>
@@ -615,7 +612,7 @@
<include>**/util/Sleeping10Seconds.java</include>
</includes>
</configuration>
- </execution>
+ </execution -->
<execution>
<id>execution5 - integration tests (TCK)</id>
<phase>test</phase>
14 years, 8 months
exo-jcr SVN: r302 - jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-10-19 11:32:45 -0400 (Mon, 19 Oct 2009)
New Revision: 302
Modified:
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/TestApiQueryAll.java
Log:
EXOJCR-180: IndexFormatVersionTest removed from TestApiQueryAll.java
Modified: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/TestApiQueryAll.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/TestApiQueryAll.java 2009-10-19 14:41:18 UTC (rev 301)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/TestApiQueryAll.java 2009-10-19 15:32:45 UTC (rev 302)
@@ -58,7 +58,6 @@
suite.addTestSuite(SynonymProviderTest.class);
suite.addTestSuite(ArrayHitsTest.class);
suite.addTestSuite(ExcerptTest.class);
- suite.addTestSuite(IndexFormatVersionTest.class);
suite.addTestSuite(IndexingRuleTest.class);
suite.addTestSuite(ShareableNodeTest.class);
14 years, 8 months
exo-jcr SVN: r301 - in ws/branches/2.2.x: commons and 22 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-19 10:41:18 -0400 (Mon, 19 Oct 2009)
New Revision: 301
Added:
ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
Removed:
ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java
Modified:
ws/branches/2.2.x/commons/pom.xml
ws/branches/2.2.x/frameworks/json/pom.xml
ws/branches/2.2.x/pom.xml
ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKIN.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKOUT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/COPY.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/LOCK.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MKCOL.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MOVE.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/OPTIONS.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/ORDERPATCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPFIND.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPPATCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/REPORT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/SEARCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNCHECKOUT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNLOCK.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/VERSIONCONTROL.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilterTest.java
Log:
EXOJCR-185 : clean dependencies
Modified: ws/branches/2.2.x/commons/pom.xml
===================================================================
--- ws/branches/2.2.x/commons/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/commons/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -35,7 +35,7 @@
<dependencies>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
+ <artifactId>exo.kernel.commons</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.stream</groupId>
@@ -45,5 +45,10 @@
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: ws/branches/2.2.x/frameworks/json/pom.xml
===================================================================
--- ws/branches/2.2.x/frameworks/json/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/frameworks/json/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -35,8 +35,9 @@
<dependencies>
<dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/branches/2.2.x/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -160,6 +160,11 @@
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
+ <dependency>
+ <groupId>net.sf.scannotation</groupId>
+ <artifactId>scannotation</artifactId>
+ <version>1.0.2</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,26 +25,6 @@
<type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
</component>
<component>
- <type>org.exoplatform.services.rest.impl.RequestDispatcher</type>
+ <type>org.exoplatform.services.rest.impl.ResourceBinderImpl</type>
</component>
- <component>
- <type>org.exoplatform.services.rest.impl.ResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</type>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</target-component>
- <component-plugin>
- <name>ws.rs.jaxb.context</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.rest.impl.provider.JAXBContextComponentPlugin</type>
- <init-params>
- <value-param>
- <name>wadl.application</name>
- <value>org.exoplatform.services.rest.wadl.research.Application</value>
- </value-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
\ No newline at end of file
+</configuration>
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -82,7 +82,7 @@
GenericContainerResponse getContainerResponse();
- DependencySupplier getDependencyInjector();
+ DependencySupplier getDependencySupplier();
/**
* @return See {@link HttpHeaders}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -29,7 +29,7 @@
{
/**
- * Get object of <code>type</code>.
+ * Get object that is approach do description <code>parameter</code>.
*
* @param parameter required parameter description
* @return object of required type or null if instance described by
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -255,7 +255,7 @@
/**
* {@inheritDoc}
*/
- public DependencySupplier getDependencyInjector()
+ public DependencySupplier getDependencySupplier()
{
return depInjector;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -244,7 +244,7 @@
// If parameter not has not annotation then get constructor parameter
// from DependencyInjector, this is out of scope JAX-RS specification.
- if (context.getDependencyInjector() == null)
+ if (context.getDependencySupplier() == null)
{
String msg =
"Can't instantiate resource " + resourceClass
@@ -254,7 +254,7 @@
.type(MediaType.TEXT_PLAIN).build());
}
- Object tmp = context.getDependencyInjector().getInstanceOfType(cp);
+ Object tmp = context.getDependencySupplier().getInstanceOfType(cp);
if (tmp == null)
{
String msg =
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -226,9 +226,9 @@
}
else
{
- if (context.getDependencyInjector() != null)
+ if (context.getDependencySupplier() != null)
{
- Object tmp = context.getDependencyInjector().getInstanceOfType(this);
+ Object tmp = context.getDependencySupplier().getInstanceOfType(this);
if (tmp != null)
{
try
@@ -239,8 +239,7 @@
}
catch (Throwable e)
{
- // TODO check exception type
- throw new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).build());
+ throw new WebApplicationException(e, Response.status(Response.Status.INTERNAL_SERVER_ERROR).build());
}
}
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -19,8 +19,11 @@
package org.exoplatform.services.rest.impl;
import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.FieldInjector;
+import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Parameter;
+import java.lang.annotation.Annotation;
import java.util.HashMap;
/**
@@ -32,8 +35,22 @@
private static final long serialVersionUID = 8212609178539168377L;
+ /**
+ * {@inheritDoc}
+ */
public Object getInstanceOfType(Parameter parameter)
{
+ if (parameter instanceof FieldInjector)
+ {
+ for (Annotation a : parameter.getAnnotations())
+ {
+ // Do not process fields without annotation Inject
+ if (a.annotationType() == Inject.class)
+ {
+ return get(parameter.getParameterClass());
+ }
+ }
+ }
return get(parameter.getParameterClass());
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -39,8 +39,8 @@
@Override
public Object resolve(Parameter parameter, ApplicationContext context) throws Exception
{
- if (context.getDependencyInjector() != null)
- return context.getDependencyInjector().getInstanceOfType(parameter);
+ if (context.getDependencySupplier() != null)
+ return context.getDependencySupplier().getInstanceOfType(parameter);
return null;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -21,6 +21,8 @@
import org.exoplatform.services.rest.DependencySupplier;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.impl.ApplicationDeployer;
+import org.exoplatform.services.rest.impl.ProviderBinder;
import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
@@ -29,26 +31,34 @@
import javax.ws.rs.core.Application;
/**
+ * Initialize required components of JAX-RS framework and deploy single JAX-RS application.
+ *
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id$
*/
public class RestInitializedListener implements ServletContextListener
{
+ /**
+ * {@inheritDoc}
+ */
public void contextDestroyed(ServletContextEvent event)
{
}
+ /**
+ * {@inheritDoc}
+ */
public void contextInitialized(ServletContextEvent event)
{
String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencySupplier.class.getName());
- DependencySupplier dependencyInjector = null;
+ DependencySupplier dependencySupplier = null;
if (dependencyInjectorFQN != null)
{
try
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
- dependencyInjector = (DependencySupplier)cl.newInstance();
+ dependencySupplier = (DependencySupplier)cl.newInstance();
}
catch (ClassNotFoundException cnfe)
{
@@ -64,7 +74,9 @@
}
}
- ResourceBinder binder = new ResourceBinderImpl();
+ ResourceBinder resources = new ResourceBinderImpl();
+ ApplicationDeployer deployer = new ApplicationDeployer(resources, ProviderBinder.getInstance());
+
String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
if (applicationFQN != null)
{
@@ -72,7 +84,7 @@
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
Application application = (Application)cl.newInstance();
-// binder.addApplication(application);
+ deployer.deploy(application);
}
catch (ClassNotFoundException cnfe)
{
@@ -88,7 +100,7 @@
}
}
- RequestHandler handler = new RequestHandlerImpl(binder, dependencyInjector);
+ RequestHandler handler = new RequestHandlerImpl(resources, dependencySupplier);
event.getServletContext().setAttribute(RequestHandler.class.getName(), handler);
}
Added: ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties (rev 0)
+++ ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,9 @@
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.threshold=DEBUG
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=target/container.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n")
\ No newline at end of file
Property changes on: ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,9 +18,13 @@
*/
package org.exoplatform.services.rest.impl;
+import java.util.Properties;
+
import junit.framework.TestCase;
//import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.log.LogConfigurator;
+import org.exoplatform.services.log.impl.Log4JConfigurator;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.ProviderBinder;
@@ -33,8 +37,6 @@
public abstract class BaseTest extends TestCase
{
-// protected StandaloneContainer container;
-
protected ProviderBinder providers;
protected ResourceBinderImpl resources;
@@ -43,51 +45,46 @@
public void setUp() throws Exception
{
-// StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
-// container = StandaloneContainer.getInstance();
resources = new ResourceBinderImpl();
requestHandler = new RequestHandlerImpl(resources, new SimpleDependencySupplier());
requestHandler.init();
-
+
// reset providers to be sure it is clean
ProviderBinder.setInstance(new ProviderBinder());
providers = ProviderBinder.getInstance();
- // Set-up context for tests that are not used full request cycle.
- // Usually context is set-up in RequestHandler
-// ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
+ LogConfigurator lc = new Log4JConfigurator();
+ Properties props = new Properties();
+ props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("conf/log4j.properties"));
+ lc.configure(props);
}
protected void setContext()
{
ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
}
-
+
public void tearDown() throws Exception
{
}
public boolean registry(Object resource) throws Exception
{
- // container.registerComponentInstance(resource);
return resources.bind(resource);
}
public boolean registry(Class<?> resourceClass) throws Exception
{
- // container.registerComponentImplementation(resourceClass.getName(), resourceClass);
return resources.bind(resourceClass);
}
public boolean unregistry(Object resource)
{
- // container.unregisterComponentByInstance(resource);
return resources.unbind(resource.getClass());
}
public boolean unregistry(Class<?> resourceClass)
{
- // container.unregisterComponent(resourceClass.getName());
return resources.unbind(resourceClass);
}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,39 +25,11 @@
<type>org.exoplatform.services.rest.impl.RestInitializer</type>
<init-params>
<values-param>
- <name>ws.rs.entity.provider</name>
+ <name>ws.rest.components</name>
<value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
-<!-- Add own entity providers here -->
- </values-param>
- <values-param>
- <name>ws.rs.request.filter</name>
<value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
-<!-- Add own request filters here -->
+ <value>org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter</value>
</values-param>
- <values-param>
- <name>ws.rs.response.filter</name>
-<!-- Add own response filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.method.filter</name>
- <value>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</value>
-<!-- Add own method filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.jaxb.context</name>
- <value>org.exoplatform.services.rest.wadl.research.Application</value>
-<!-- Add own jaxb context here -->
- </values-param>
</init-params>
</component>
- <component>
- <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerDependencyInjector</type>
- </component>
-
</configuration>
\ No newline at end of file
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -19,6 +19,7 @@
package org.exoplatform.services.rest.ext.filter;
import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.RequestFilter;
@@ -27,8 +28,9 @@
* header.
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+@Filter
public class MethodOverrideFilter implements RequestFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.ext.filter;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.RequestFilter;
@@ -30,8 +31,9 @@
* details see http://www.unix.com.ua/rfc/rfc3986.html#s6.2.2 .
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+@Filter
public final class UriNormalizationFilter implements RequestFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Deleted: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,87 +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.services.rest.ext.method;
-
-import org.exoplatform.container.component.BaseComponentPlugin;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.RequestHandler;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * For injection {@link MethodInvokerFilter} in {@link RequestHandler} at
- * startup.
- *
- * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
- */
-public class MethodInvokerFilterComponentPlugin extends BaseComponentPlugin
-{
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger(MethodInvokerFilterComponentPlugin.class.getName());
-
- /**
- * List of {@link MethodInvokerFilter}.
- */
- private Set<Class<? extends MethodInvokerFilter>> mifs = new HashSet<Class<? extends MethodInvokerFilter>>();
-
- /**
- * @param params initialize parameters from configuration
- * @see InitParams
- */
- @SuppressWarnings("unchecked")
- public MethodInvokerFilterComponentPlugin(InitParams params)
- {
- if (params != null)
- {
- Iterator<ValueParam> i = params.getValueParamIterator();
- while (i.hasNext())
- {
- ValueParam v = i.next();
- try
- {
- mifs.add((Class<? extends MethodInvokerFilter>)Class.forName(v.getValue()));
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + v.getValue(), e);
- }
- }
- }
- }
-
- /**
- * @return get collection of classes MethodInvokerFilter supplied from
- * configuration
- */
- public Set<Class<? extends MethodInvokerFilter>> getFilters()
- {
- return mifs;
- }
-
-}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.ext.method.filter;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
@@ -36,8 +37,9 @@
* use JSR-250 security common annotations. See also https://jsr250.dev.java.net .
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+@Filter
public class MethodAccessFilter implements MethodInvokerFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -34,6 +34,7 @@
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
import javax.xml.namespace.QName;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLEventReader;
@@ -53,6 +54,7 @@
* @author <a href="dkatayev(a)gmail.com">Dmytro Katayev</a>
* @version $Id: HierarchicalPropertyEntityProvider.java
*/
+@Provider
public class HierarchicalPropertyEntityProvider implements EntityProvider<HierarchicalProperty>
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -34,7 +34,7 @@
* SerialInputData is useful for transfer data represented by stream via RMI.
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialInputData implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -36,7 +36,7 @@
* {@link RequestHandler}.
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialRequest implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -31,7 +31,7 @@
*
* @see SerialRequest
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialResponse implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,7 +25,7 @@
* of DOM structure.<br/>
*
* @author Gennady Azarenkov
- * @version $Id: $
+ * @version $Id$
*/
public class XlinkHref
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKIN.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKOUT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/COPY.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/LOCK.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MKCOL.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MOVE.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/OPTIONS.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/ORDERPATCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPFIND.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPPATCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/REPORT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/SEARCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNCHECKOUT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNLOCK.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/VERSIONCONTROL.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -24,11 +24,14 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.FieldInjector;
+import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Parameter;
import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.resource.ResourceContainer;
import org.picocontainer.Startable;
+import java.lang.annotation.Annotation;
import java.util.List;
import javax.ws.rs.core.Application;
@@ -49,7 +52,6 @@
public RestInitializer(ResourceBinder resources, InitParams initParams, ExoContainerContext containerContext)
{
super(resources, ProviderBinder.getInstance());
- ExoContainer container = containerContext.getContainer();
if (initParams != null)
{
for (Object cl : initParams.getValuesParam("ws.rest.components").getValues())
@@ -64,6 +66,8 @@
}
}
}
+
+ ExoContainer container = containerContext.getContainer();
List<Application> applications = container.getComponentInstancesOfType(Application.class);
for (Application a : applications)
{
@@ -75,15 +79,37 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public Object getInstanceOfType(Parameter parameter)
{
- return null;
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+
+ if (parameter instanceof FieldInjector)
+ {
+ for (Annotation a : parameter.getAnnotations())
+ {
+ // Do not process fields without annotation Inject
+ if (a.annotationType() == Inject.class)
+ {
+ return container.getComponentInstanceOfType(parameter.getParameterClass());
+ }
+ }
+ }
+ return container.getComponentInstanceOfType(parameter.getParameterClass());
}
+ /**
+ * {@inheritDoc}
+ */
public void start()
{
}
+ /**
+ * {@inheritDoc}
+ */
public void stop()
{
}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -39,7 +39,7 @@
* This servlet is front-end for the REST engine.
*
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class RestServlet extends AbstractHttpServlet implements Connector
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,42 +1,71 @@
<?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.
- -->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ Copyright (C) 2009 eXo Platform SAS.
- <component>
- <type>org.exoplatform.services.rest.impl.RestInitializer</type>
- <init-params>
- <values-param>
- <name>ws.rest.components</name>
- <value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
- <value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
- <value>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</value>
- </values-param>
- </init-params>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.BaseResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerDependencyInjector</type>
- </component>
+ 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.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.slf4j.Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout" />
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/container.log" />
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ </properties-param>
+ </init-params>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.RestInitializer</type>
+ <init-params>
+ <values-param>
+ <name>ws.rest.components</name>
+ <value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
+ <value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
+ <value>org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter</value>
+ </values-param>
+ </init-params>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.ResourceBinderImpl</type>
+ </component>
+
</configuration>
\ No newline at end of file
Deleted: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,40 +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.services.rest;
-
-import org.exoplatform.container.StandaloneContainer;
-
-import junit.framework.TestCase;
-
-/**
- * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public abstract class BaseTest extends TestCase
-{
-
- protected StandaloneContainer container;
-
- public void setUp() throws Exception
- {
- StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
- container = StandaloneContainer.getInstance();
- }
-
-}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilterTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Copied: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (from rev 292, ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java)
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,45 @@
+/*
+ * 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.services.rest.impl;
+
+import org.exoplatform.container.StandaloneContainer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public abstract class BaseTest extends TestCase
+{
+
+ protected StandaloneContainer container;
+
+ public void setUp() throws Exception
+ {
+ StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
+ container = StandaloneContainer.getInstance();
+ }
+
+ protected void setContext()
+ {
+ ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, ProviderBinder.getInstance()));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,54 @@
+/*
+ * 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.services.rest.impl;
+
+import java.lang.annotation.Annotation;
+
+import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.Parameter;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class DependencySupplierTest extends BaseTest
+{
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ setContext();
+ }
+
+ public static class Component1
+ {
+ // For testing DependencySupplier.
+ }
+
+ public void testDependencySupplier()
+ {
+ DependencySupplier depSupplier =
+ (DependencySupplier)container.getComponentInstanceOfType(DependencySupplier.class);
+ assertNotNull(depSupplier);
+ container.registerComponentInstance(new Component1());
+ Parameter t = new ConstructorParameterImpl(null, new Annotation[0], Component1.class, null, null, false);
+ assertNotNull(depSupplier.getInstanceOfType(t));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,51 @@
+/*
+ * 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.services.rest.impl;
+
+import javax.ws.rs.core.MediaType;
+
+import org.exoplatform.common.util.HierarchicalProperty;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class RestInitializerTest extends BaseTest
+{
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ setContext();
+ }
+
+ // Check does we get all additional component specified in configuration.
+ public void testDeployAdditionalComponents()
+ {
+ ProviderBinder providers = ProviderBinder.getInstance();
+ // XXX Able (no NPE) to use null instead "path" because UriPattern
+ // for filters in null and path will be never checked.
+ assertEquals(1, providers.getRequestFilters(null).size());
+ assertEquals(1, providers.getMethodInvokerFilters(null).size());
+ // -----
+ assertNotNull(providers.getMessageBodyReader(HierarchicalProperty.class, null, null,
+ MediaType.APPLICATION_XML_TYPE));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
14 years, 8 months
exo-jcr SVN: r300 - in jcr/trunk/component/core: src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/spell and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-10-19 09:36:47 -0400 (Mon, 19 Oct 2009)
New Revision: 300
Added:
jcr/trunk/component/core/known-issues.txt
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java
Modified:
jcr/trunk/component/core/pom.xml
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/spell/SpellCheckerTest.java
Log:
EXOJCR-180: TestSimilarity.java added known-issues added
Added: jcr/trunk/component/core/known-issues.txt
===================================================================
--- jcr/trunk/component/core/known-issues.txt (rev 0)
+++ jcr/trunk/component/core/known-issues.txt 2009-10-19 13:36:47 UTC (rev 300)
@@ -0,0 +1,6 @@
+
+// https://jira.jboss.org/jira/browse/EXOJCR-193
+org.exoplatform.services.jcr.impl.core.query.TestSimilarity.java
+
+//https://jira.jboss.org/jira/browse/EXOJCR-192
+org.exoplatform.services.jcr.api.core.query.lucene.spell.SpellCheckerTest.java
\ No newline at end of file
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 13:33:51 UTC (rev 299)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
@@ -365,6 +365,8 @@
</includes>
<excludes>
<exclude>**/TestQueryUsecases.java</exclude>
+ <exclude>**/SpellCheckerTest.java</exclude>
+ <exclude>**/TestSimilarity.java</exclude>
<exclude>**/TestImport.java</exclude>
<exclude>**/TestRollbackBigFiles.java</exclude>
<exclude>**/TestErrorMultithreading.java</exclude>
@@ -600,7 +602,7 @@
<include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
</includes>
</configuration>
- </execution
+ </execution
-->
<execution>
<id>execution4 - pause 10 sec</id>
Modified: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/spell/SpellCheckerTest.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/spell/SpellCheckerTest.java 2009-10-19 13:33:51 UTC (rev 299)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/spell/SpellCheckerTest.java 2009-10-19 13:36:47 UTC (rev 300)
@@ -17,7 +17,11 @@
package org.exoplatform.services.jcr.api.core.query.lucene.spell;
import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import java.util.Calendar;
+
+import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Value;
import javax.jcr.query.Query;
@@ -31,49 +35,6 @@
public class SpellCheckerTest extends AbstractJCRTest
{
- // protected void setUp() throws Exception {
- // super.setUp();
- // if (repository == null) {
- // ClassLoader cl = getClass().getClassLoader();
- // // PropertyConfigurator.configure(cl.getResource("log4j.properties"));
- // // InputStream in = cl.getResourceAsStream("repository.xml");
- // // RepositoryConfig config;
- // // try {
- // // config = RepositoryConfig.create(in, "target/repo-home");
- // // } finally {
- // // in.close();
- // // }
- // // repository = new TransientRepository(config);
- // //session = repository.login(new SimpleCredentials("user",
- // "password".toCharArray()));
- // String text = "the quick brown fox jumps over the lazy dog";
- // session.getRootNode().setProperty("prop", text);
- // session.save();
- // // wait a couple of seconds, refresh interval in test config is 5 seconds
- // try {
- // Thread.sleep(5 * 1000);
- // // perform a dummy check
- // performCheck("quick", "quick");
- // // wait again because refresh is done asynchronous
- // Thread.sleep(1 * 1000);
- // } catch (InterruptedException e) {
- // // ignore
- // }
- // }
- // if (session == null) {
- // session = repository.login(new SimpleCredentials("user",
- // "password".toCharArray()));
- // }
- // }
- //
- // protected void tearDown() throws Exception {
- // if (session != null) {
- // session.logout();
- // }
- // session = null;
- // super.tearDown();
- // }
-
public void testSpellChecker() throws RepositoryException
{
String text = "the quick brown fox jumps over the lazy dog";
@@ -116,6 +77,34 @@
performCheck("quik OR (-foo bar)", "quick OR (-fox bar)");
}
+ public void testSpellCheckerComplexQuery2() throws RepositoryException
+ {
+
+ String text = "the quick brown fox jumps over the lazy dog";
+
+ Node doc = testRootNode.addNode("file", "nt:file");//.setProperty("prop", text);
+ NodeImpl cont = (NodeImpl)doc.addNode("jcr:content", "nt:resource");
+ cont.setProperty("jcr:mimeType", "text/plain");
+ cont.setProperty("jcr:lastModified", Calendar.getInstance());
+ cont.setProperty("jcr:data", text);
+
+ superuser.save();
+ // wait a couple of seconds, refresh interval in test config is 5 seconds
+ try
+ {
+ Thread.sleep(5 * 1000);
+ // perform a dummy check
+ performCheck("quick", "quick");
+ // wait again because refresh is done asynchronous
+ Thread.sleep(1 * 1000);
+ }
+ catch (InterruptedException e)
+ {
+ // ignore
+ }
+ performCheck("quik % # &&& AND (-foo bar)", "quick % # &&& AND (-fox bar)");
+ }
+
public void testSpellCheckerCorrectWords() throws RepositoryException
{
String text = "the quick brown fox jumps over the lazy dog";
@@ -137,6 +126,44 @@
performCheck("quick", "quick");
}
+ public void testSpellCheckerIncorrectWords() throws RepositoryException
+ {
+ String text = "the quick brown fox jumps over the lazy dog";
+ testRootNode.setProperty("prop", text);
+ superuser.save();
+ // wait a couple of seconds, refresh interval in test config is 5 seconds
+ try
+ {
+ Thread.sleep(5 * 1000);
+ // perform a dummy check
+ performCheck("quick", "quick");
+ // wait again because refresh is done asynchronous
+ Thread.sleep(1 * 1000);
+ }
+ catch (InterruptedException e)
+ {
+ // ignore
+ }
+
+ String statement = "gismeteo";
+ QueryManager qm = superuser.getWorkspace().getQueryManager();
+ Query query = qm.createQuery("/jcr:root[rep:spellcheck('" + statement + "')]/(rep:spellcheck())", Query.XPATH);
+ RowIterator rows = query.execute().getRows();
+ assertEquals("no results returned", 1, rows.getSize());
+ Row r = rows.nextRow();
+ Value v = r.getValue("rep:spellcheck()");
+ assertNull("must not return a suggestion", v);
+
+ query =
+ qm.createQuery("select rep:spellcheck() from nt:base where " + "jcr:path = '/' and spellcheck('" + statement
+ + "')", Query.SQL);
+ rows = query.execute().getRows();
+ assertEquals("no results returned", 1, rows.getSize());
+ r = rows.nextRow();
+ v = r.getValue("rep:spellcheck()");
+ assertNull("must not return a suggestion", v);
+ }
+
protected void performCheck(String statement, String expected) throws RepositoryException
{
QueryManager qm = superuser.getWorkspace().getQueryManager();
Added: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java (rev 0)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java 2009-10-19 13:36:47 UTC (rev 300)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.core.query;
+
+import org.exoplatform.services.jcr.api.core.query.AbstractIndexingTest;
+
+import java.util.Calendar;
+
+import javax.jcr.Node;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TestSimilarity.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestSimilarity extends AbstractIndexingTest
+{
+
+ public void testFindSimilarNodes() throws Exception
+ {
+ // base node
+ Node file = testRootNode.addNode("baseFile", "nt:file");
+ Node resource = file.addNode("jcr:content", "nt:resource");
+ resource.setProperty("jcr:lastModified", Calendar.getInstance());
+ resource.setProperty("jcr:encoding", "UTF-8");
+ resource.setProperty("jcr:mimeType", "text/plain");
+ resource
+ .setProperty(
+ "jcr:data",
+ "Similarity is determined by looking up terms that are common to nodes. "
+ + "There are some conditions that must be met for a term to be considered. This is required to limit the number possibly relevant terms."
+ + "Only terms with at least 4 characters are considered."
+ + "Only terms that occur at least 2 times in the source node are considered."
+ + "Only terms that occur in at least 5 nodes are considered.");
+ session.save();
+
+ // target node
+ Node target1 = testRootNode.addNode("target1", "nt:file");
+ Node resource1 = target1.addNode("jcr:content", "nt:resource");
+ resource1.setProperty("jcr:lastModified", Calendar.getInstance());
+ resource1.setProperty("jcr:encoding", "UTF-8");
+ resource1.setProperty("jcr:mimeType", "text/plain");
+ resource1.setProperty("jcr:data", "There is term word.");
+
+ Node target2 = testRootNode.addNode("target2", "nt:file");
+ Node resource2 = target2.addNode("jcr:content", "nt:resource");
+ resource2.setProperty("jcr:lastModified", Calendar.getInstance());
+ resource2.setProperty("jcr:encoding", "UTF-8");
+ resource2.setProperty("jcr:mimeType", "text/plain");
+ resource2.setProperty("jcr:data", "You know what is not here");
+
+ Node target3 = testRootNode.addNode("target3", "nt:file");
+ Node resource3 = target3.addNode("jcr:content", "nt:resource");
+ resource3.setProperty("jcr:lastModified", Calendar.getInstance());
+ resource3.setProperty("jcr:encoding", "UTF-8");
+ resource3.setProperty("jcr:mimeType", "text/plain");
+ resource3.setProperty("jcr:data", "Term occures here");
+
+ session.save();
+
+ //Lets find similar
+
+ // make SQL query
+ QueryManager qman = session.getWorkspace().getQueryManager();
+
+ // Query q =
+ // qman.createQuery("select * from nt:resource where similar(., '/jcr:root/baseFile/jcr:content')", Query.SQL);
+ // QueryResult result = q.execute();
+ // checkResult(result, new Node[]{resource1, resource3});
+
+ //make XPath query
+
+ Query xq =
+ qman.createQuery("//element(*, nt:resource)[rep:similar(., '/jcr:root/baseFile/jcr:content')]", Query.XPATH);
+ QueryResult xres = xq.execute();
+ checkResult(xres, new Node[]{resource1, resource3});
+
+ }
+
+}
14 years, 8 months
exo-jcr SVN: r298 - jcr/trunk/component/core.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-19 09:33:24 -0400 (Mon, 19 Oct 2009)
New Revision: 298
Modified:
jcr/trunk/component/core/pom.xml
Log:
EXOJCR-164: JCR pom license
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-19 13:30:46 UTC (rev 297)
+++ jcr/trunk/component/core/pom.xml 2009-10-19 13:33:24 UTC (rev 298)
@@ -1,15 +1,24 @@
+<!--
- <!--
+ Copyright (C) 2009 eXo Platform SAS.
- 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.
- -->
-<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">
+ 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.
+
+--><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">
+
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -591,7 +600,8 @@
<include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
</includes>
</configuration>
- </execution -->
+ </execution
+-->
<execution>
<id>execution4 - pause 10 sec</id>
<phase>test</phase>
14 years, 8 months