You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by ug...@apache.org on 2007/06/08 16:10:11 UTC
svn commit: r545512 [1/2] - in /labs/nucleus: ./ branches/ tags/ trunk/
trunk/.settings/ trunk/src/ trunk/src/main/ trunk/src/main/java/
trunk/src/main/java/org/ trunk/src/main/java/org/apache/
trunk/src/main/java/org/apache/labs/ trunk/src/main/java/o...
Author: ugo
Date: Fri Jun 8 07:10:08 2007
New Revision: 545512
URL: http://svn.apache.org/viewvc?view=rev&rev=545512
Log:
Initial import of Nucleus.
Added:
labs/nucleus/
labs/nucleus/LICENSE.txt (with props)
labs/nucleus/NOTICE.txt (with props)
labs/nucleus/README.txt (with props)
labs/nucleus/branches/
labs/nucleus/doap.xml (with props)
labs/nucleus/tags/
labs/nucleus/trunk/
labs/nucleus/trunk/.classpath (with props)
labs/nucleus/trunk/.project (with props)
labs/nucleus/trunk/.settings/
labs/nucleus/trunk/.settings/org.eclipse.jdt.core.prefs
labs/nucleus/trunk/pom.xml (with props)
labs/nucleus/trunk/src/
labs/nucleus/trunk/src/main/
labs/nucleus/trunk/src/main/java/
labs/nucleus/trunk/src/main/java/org/
labs/nucleus/trunk/src/main/java/org/apache/
labs/nucleus/trunk/src/main/java/org/apache/labs/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java (with props)
labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java (with props)
labs/nucleus/trunk/src/main/resources/
labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml (with props)
labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml (with props)
labs/nucleus/trunk/src/main/resources/log4j.properties (with props)
labs/nucleus/trunk/src/main/resources/targetResolver.conf
labs/nucleus/trunk/src/main/webapp/
labs/nucleus/trunk/src/main/webapp/WEB-INF/
labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml (with props)
labs/nucleus/trunk/src/test/
labs/nucleus/trunk/src/test/java/
labs/nucleus/trunk/src/test/java/org/
labs/nucleus/trunk/src/test/java/org/apache/
labs/nucleus/trunk/src/test/java/org/apache/abdera/
labs/nucleus/trunk/src/test/java/org/apache/abdera/test/
labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/
labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java (with props)
labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java (with props)
labs/nucleus/trunk/src/test/java/org/apache/labs/
labs/nucleus/trunk/src/test/java/org/apache/labs/nucleus/
labs/nucleus/trunk/src/test/java/org/apache/labs/nucleus/test/
labs/nucleus/trunk/src/test/java/org/apache/labs/nucleus/test/BlogTargetResolver.java (with props)
labs/nucleus/trunk/src/test/java/org/apache/labs/nucleus/test/BlogservTest.java (with props)
labs/nucleus/trunk/src/test/java/org/apache/labs/nucleus/test/FileBasedBlogStore.java (with props)
labs/nucleus/trunk/src/test/resources/
labs/nucleus/trunk/src/test/resources/applicationContext.xml (with props)
labs/nucleus/trunk/var/
labs/nucleus/trunk/var/blogs/
labs/nucleus/trunk/var/blogs/abc/
labs/nucleus/trunk/var/blogs/bbc/
labs/nucleus/trunk/var/blogs/bbc/1.xml (with props)
labs/nucleus/trunk/var/blogs/bbc/2.xml (with props)
labs/nucleus/trunk/var/blogs/cbs/
labs/nucleus/trunk/var/blogs/cnn/
Added: labs/nucleus/LICENSE.txt
URL: http://svn.apache.org/viewvc/labs/nucleus/LICENSE.txt?view=auto&rev=545512
==============================================================================
--- labs/nucleus/LICENSE.txt (added)
+++ labs/nucleus/LICENSE.txt Fri Jun 8 07:10:08 2007
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Propchange: labs/nucleus/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/LICENSE.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/LICENSE.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/NOTICE.txt
URL: http://svn.apache.org/viewvc/labs/nucleus/NOTICE.txt?view=auto&rev=545512
==============================================================================
--- labs/nucleus/NOTICE.txt (added)
+++ labs/nucleus/NOTICE.txt Fri Jun 8 07:10:08 2007
@@ -0,0 +1,5 @@
+Nucleus
+Copyright 2007 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
Propchange: labs/nucleus/NOTICE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/NOTICE.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/NOTICE.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/README.txt
URL: http://svn.apache.org/viewvc/labs/nucleus/README.txt?view=auto&rev=545512
==============================================================================
--- labs/nucleus/README.txt (added)
+++ labs/nucleus/README.txt Fri Jun 8 07:10:08 2007
@@ -0,0 +1,56 @@
+Nucleus
+=======
+
+ nuácleáus, n. pl. nuácleái
+ 3. Physics. the positively charged mass within an atom, composed of
+ neutrons and protons, and possessing most of the mass but occupying only
+ a small fraction of the volume of the atom.
+
+What is this?
+-------------
+
+Nucleus is a Java framework for building content stores based on the
+principles of REST [1] as embodied in the Atom Publishing Protocol [2].
+
+The implementation leverages the Apache Abdera (Incubating) [3] project to do
+the heavy Atom lifting, but provides the following beyond what is provided
+by Abdera:
+
+- A framework for plugging different physical storage implementations
+- A framework for plugging different caching implementations.
+- A framework for plugging different AAA (Authentication, Authorization and
+ Auditing) implementations.
+
+Nucleus uses the Spring Framework [4] to implement a lightweight,
+component-oriented, configurable container.
+
+How can i contribute?
+---------------------
+
+To build the project, you need Maven 2 [5] and a recent checkout of
+the Abdera source tree [6].
+
+First you must build and install Abdera from its sources by executing:
+
+ mvn -Dmaven.test.skip=true install
+
+From the Nucleus source tree, you can start up the server using the
+following command:
+
+ mvn jetty:run
+
+There is currently no documentation at all (apart from the code itself
+and a bunch of unit tests ;-).
+
+To discuss the project, please use the Apache Labs mailing list as
+described in http://labs.apache.org/mail.html.
+
+
+Thanks for your interest in Nucleus.
+
+[1] http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
+[2] http://www.ietf.org/html.charters/atompub-charter.html
+[3] http://incubator.apache.org/abdera/
+[4] http://www.springframework.org/
+[5] http://maven.apache.org/
+[6] http://svn.apache.org/repos/asf/incubator/abdera/java/trunk
\ No newline at end of file
Propchange: labs/nucleus/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/README.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/doap.xml
URL: http://svn.apache.org/viewvc/labs/nucleus/doap.xml?view=auto&rev=545512
==============================================================================
--- labs/nucleus/doap.xml (added)
+++ labs/nucleus/doap.xml Fri Jun 8 07:10:08 2007
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://usefulinc.com/ns/doap#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:labs="http://labs.apache.org/doap-ext/1.0#"
+ xmlns:projects="http://projects.apache.org/ns/asfext#">
+ <Project rdf:about="http://labs.apache.org/labs#nucleus">
+ <name>Nucleus</name>
+ <shortname>nucleus</shortname>
+ <shortdesc xml:lang="en">Atom-based content storage framework</shortdesc>
+ <description xml:lang="en">
+Nucleus is a Java framework for building content stores based on the principles of REST as embodied in the Atom Publishing Protocol.
+
+The implementation leverages the Apache Abdera (Incubating) project to do the heavy Atom lifting, but provides the following beyond what is provided by Abdera:
+
+- A framework for plugging different physical storage implementations
+- A framework for plugging different caching implementations.
+- A framework for plugging different AAA (Authentication, Authorization and Auditing) implementations.
+
+Nucleus uses the Spring Framework to provide a lightweight, component-oriented, configurable container.
+ </description>
+ <homepage rdf:resource="http://labs.apache.org/nucleus/"/>
+ <license rdf:resource="http://usefulinc.com/doap/licenses/asl20"/>
+ <created>2007-5-24</created>
+ <labs:status>active</labs:status>
+ <maintainer>
+ <foaf:Person rdf:about="http://people.apache.org/~ugo#me">
+ <foaf:name>Ugo Cei</foaf:name>
+ <foaf:homepage rdf:resource="http://people.apache.org/~ugo"/>
+ <foaf:mbox_sha1sum>b0b3845ec9617f4efe9fb83079d1486b9c820570</foaf:mbox_sha1sum>
+ </foaf:Person>
+ </maintainer>
+ <repository>
+ <SVNRepository>
+ <location rdf:resource="http://svn.apache.org/repos/asf/labs/nucleus/"/>
+ <browse rdf:resource="http://svn.apache.org/viewvc/labs/nucleus/"/>
+ </SVNRepository>
+ </repository>
+ <programming-language>Java</programming-language>
+ </Project>
+</rdf:RDF>
Propchange: labs/nucleus/doap.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/doap.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/doap.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: labs/nucleus/trunk/.classpath
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/.classpath?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/.classpath (added)
+++ labs/nucleus/trunk/.classpath Fri Jun 8 07:10:08 2007
@@ -0,0 +1,45 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-parser/0.3.0-incubating-SNAPSHOT/abdera-parser-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1-beta-7/jaxen-1.1-beta-7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xom/xom/1.0b3/xom-1.0b3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-client/0.3.0-incubating-SNAPSHOT/abdera-client-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.6.0/xalan-2.6.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.0/jdom-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/ccil/cowan/tagsoup/tagsoup/0.9.7/tagsoup-0.9.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-protocol/0.3.0-incubating-SNAPSHOT/abdera-protocol-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/woodstox/wstx-asl/2.0.5/wstx-asl-2.0.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.0.0rc0/jetty-6.0.0rc0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/1.1/geronimo-activation_1.0.2_spec-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/spring/2.0.5/spring-2.0.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-i18n/0.3.0-incubating-SNAPSHOT/abdera-i18n-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-api/1.2.1/axiom-api-1.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.0.0rc0/servlet-api-2.5-6.0.0rc0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.0.0rc0/jetty-util-6.0.0rc0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0/commons-httpclient-3.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-core/0.3.0-incubating-SNAPSHOT/abdera-core-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.9/log4j-1.2.9.jar"/>
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.5.2/dom4j-1.5.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jaxme/jaxme-api/0.3/jaxme-api-0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/abdera/abdera-server/0.3.0-incubating-SNAPSHOT/abdera-server-0.3.0-incubating-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax/1.1.2-dev/stax-1.1.2-dev.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ws/commons/axiom/axiom-impl/1.2.1/axiom-impl-1.2.1.jar"/>
+</classpath>
\ No newline at end of file
Propchange: labs/nucleus/trunk/.classpath
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/.classpath
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/.classpath
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/.project
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/.project?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/.project (added)
+++ labs/nucleus/trunk/.project Fri Jun 8 07:10:08 2007
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>nucleus</name>
+ <comment>A RESTful pluggable store</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Propchange: labs/nucleus/trunk/.project
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/.project
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/.project
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/.settings/org.eclipse.jdt.core.prefs (added)
+++ labs/nucleus/trunk/.settings/org.eclipse.jdt.core.prefs Fri Jun 8 07:10:08 2007
@@ -0,0 +1,5 @@
+#Fri Jun 08 15:43:58 CEST 2007
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: labs/nucleus/trunk/pom.xml
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/pom.xml?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/pom.xml (added)
+++ labs/nucleus/trunk/pom.xml Fri Jun 8 07:10:08 2007
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<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>
+ <groupId>org.apache.labs</groupId>
+ <artifactId>nucleus</artifactId>
+ <version>0.0.1</version>
+ <description>A RESTful pluggable store</description>
+ <inceptionYear>2006</inceptionYear>
+
+ <!--
+ <repositories>
+ <repository>
+ <id>apache-incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
+ -->
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.abdera</groupId>
+ <artifactId>abdera-server</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.abdera</groupId>
+ <artifactId>abdera-client</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.0.0rc0</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- This shouldn't be needed, but without it Maven will pull down version 1.2
+ because it's specified in commons-httpclient's POM. -->
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: labs/nucleus/trunk/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.server;
+
+import java.util.Map;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.protocol.server.ServiceContext;
+import org.apache.abdera.protocol.server.auth.SubjectResolver;
+import org.apache.abdera.protocol.server.provider.ProviderManager;
+import org.apache.abdera.protocol.server.provider.TargetResolver;
+import org.apache.abdera.protocol.server.servlet.RequestHandlerManager;
+
+/**
+ *
+ * @version $Id$
+ */
+public class SpringBasedServiceContext implements ServiceContext {
+
+ private Abdera abdera;
+ private ProviderManager providerManager;
+ private RequestHandlerManager requestHandlerManager;
+ private SubjectResolver subjectResolver;
+ private TargetResolver targetResolver;
+
+ public void init(Abdera abdera, Map<String, String> properties) {
+ // Should never be called
+ }
+
+ public Abdera getAbdera() {
+ return this.abdera;
+ }
+
+ public void setAbdera(Abdera abdera) {
+ this.abdera = abdera;
+ }
+
+ public String getProperty(String name) {
+ // There are no properties
+ return null;
+ }
+
+ public String[] getPropertyNames() {
+ return new String[0];
+ }
+
+ public ProviderManager getProviderManager() {
+ return this.providerManager;
+ }
+
+ public void setProviderManager(ProviderManager providerManager) {
+ this.providerManager = providerManager;
+ }
+
+ public RequestHandlerManager getRequestHandlerManager() {
+ return this.requestHandlerManager;
+ }
+
+ public void setRequestHandlerManager(RequestHandlerManager requestHandlerManager) {
+ this.requestHandlerManager = requestHandlerManager;
+ }
+
+ public SubjectResolver getSubjectResolver() {
+ return this.subjectResolver;
+ }
+
+ public void setSubjectResolver(SubjectResolver subjectResolver) {
+ this.subjectResolver = subjectResolver;
+ }
+
+ public void setTargetResolver(TargetResolver targetResovler) {
+ this.targetResolver = targetResovler;
+ }
+
+ public TargetResolver getTargetResolver(String contextPath) {
+ this.targetResolver.setContextPath(contextPath);
+ return this.targetResolver;
+ }
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/SpringBasedServiceContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.server.provider;
+
+import org.apache.abdera.protocol.server.provider.Provider;
+import org.apache.abdera.protocol.server.provider.ProviderManager;
+
+
+/**
+ * An implementation of {@link org.apache.abdera.protocol.server.provider.ProviderManager} that relies on Spring
+ * configuration to select a suitable {@link org.apache.abdera.protocol.server.provider.Provider}.
+ *
+ * @version $Id$
+ */
+public class SpringProviderManager implements ProviderManager {
+
+ private Provider provider;
+
+ public void setProvider(Provider provider) {
+ this.provider = provider;
+ }
+
+ public Provider getProvider() {
+ return this.provider;
+ }
+
+ public void release(Provider provider) {
+ // Nothing to do
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/provider/SpringProviderManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.server.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.abdera.protocol.server.ServiceContext;
+import org.apache.abdera.protocol.server.servlet.RequestHandler;
+import org.apache.abdera.protocol.server.servlet.RequestHandlerManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Sample APP servlet.
+ *
+ * @version $Id$
+ */
+public class NucleusServlet
+extends HttpServlet {
+
+ private static final long serialVersionUID = 2393643907128535158L;
+
+ private final static Log logger = LogFactory.getLog(NucleusServlet.class);
+
+ public static final String APPLICATION_CONTEXT_LOCATION_PARAMETER = "appCtxLocation";
+
+ private ApplicationContext appCtx;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ ServletContext context = config.getServletContext();
+ if (context != null) {
+ try {
+ appCtx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
+ } catch (IllegalStateException e) {
+ logger.error(e);
+ throw new ServletException(e);
+ }
+ } else {
+ appCtx = new ClassPathXmlApplicationContext(config.getInitParameter(APPLICATION_CONTEXT_LOCATION_PARAMETER));
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("Application context set");
+ }
+ }
+
+ @Override
+ protected void service(
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException {
+ ServiceContext context = (ServiceContext) appCtx.getBean("serviceContext");
+ RequestHandlerManager manager = context.getRequestHandlerManager();
+ RequestHandler handler = manager.getRequestHandler();
+ try {
+ handler.process(context, request, response);
+ } catch (Throwable t) {
+ logger.error("Error servicing request", t);
+ response.setContentType("text/plain");
+ PrintWriter out = response.getWriter();
+ out.println(t);
+ t.printStackTrace(out);
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ } finally {
+ manager.release(handler);
+ }
+ }
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/server/servlet/NucleusServlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store;
+
+/**
+ *
+ * @version $Id$
+ */
+public class EntryNotFoundException extends StoreException {
+
+ public EntryNotFoundException() {
+ }
+
+ public EntryNotFoundException(String message) {
+ super(message);
+ }
+
+ public EntryNotFoundException(Throwable cause) {
+ super(cause);
+ }
+
+ public EntryNotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/EntryNotFoundException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store;
+
+import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.model.Collection;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+
+/**
+ *
+ * @version $Id$
+ */
+public interface Store {
+
+ java.util.Collection<String> listWorkspaces() throws StoreException;
+
+ java.util.Collection<Collection> listCollections(String workspace) throws StoreException;
+
+ Entry createEntry(IRI iri, Entry entry, String slug) throws StoreException;
+
+ Entry getEntry(IRI iri) throws StoreException;
+
+ Entry updateEntry(IRI iri, Entry entry) throws StoreException;
+
+ Feed getEntries(IRI iri);
+
+ void deleteEntry(IRI uri);
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/Store.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store;
+
+/**
+ *
+ * @version $Id$
+ */
+public class StoreException extends RuntimeException {
+
+ public StoreException() {
+ }
+
+ public StoreException(String message) {
+ super(message);
+ }
+
+ public StoreException(Throwable cause) {
+ super(cause);
+ }
+
+ public StoreException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store;
+
+import java.net.URL;
+
+import org.apache.abdera.Abdera;
+import org.apache.abdera.factory.Factory;
+import org.apache.abdera.i18n.iri.IRISyntaxException;
+import org.apache.abdera.model.Collection;
+import org.apache.abdera.model.Document;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.abdera.model.Service;
+import org.apache.abdera.model.Workspace;
+import org.apache.abdera.protocol.server.provider.AbstractProvider;
+import org.apache.abdera.protocol.server.provider.AbstractResponseContext;
+import org.apache.abdera.protocol.server.provider.BaseResponseContext;
+import org.apache.abdera.protocol.server.provider.EmptyResponseContext;
+import org.apache.abdera.protocol.server.provider.RequestContext;
+import org.apache.abdera.protocol.server.provider.ResponseContext;
+import org.apache.abdera.util.EntityTag;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+/**
+ * A provider that serves file-based blog entries.
+ *
+ * @version $Id$
+ */
+public class StoreProvider extends AbstractProvider {
+
+ private Log logger = LogFactory.getLog(StoreProvider.class);
+
+ private EntityTag service_etag = new EntityTag("service");
+
+ private Store store;
+
+ public void setStore(Store store) {
+ this.store = store;
+ }
+
+ public ResponseContext getService(RequestContext request) {
+ boolean full = true;
+ Abdera abdera = request.getServiceContext().getAbdera();
+ Factory factory = abdera.getFactory();
+ Service service = factory.newService();
+ java.util.Collection<String> workspaces = store.listWorkspaces();
+ for (String wsName : workspaces) {
+ Workspace workspace = service.addWorkspace(wsName);
+ java.util.Collection<Collection> collections = store.listCollections(wsName);
+ for (Collection coll : collections) {
+ org.apache.abdera.model.Collection collection;
+ try {
+ collection = workspace.addCollection(coll.getTitle(), wsName + '/' + coll.getTitle() + '/');
+ collection.setAccept("entry");
+ collection.addCategories().setFixed(false);
+ } catch (IRISyntaxException e) {
+ throw new StoreException(e);
+ }
+ }
+ }
+ Document<Service> doc = service.getDocument();
+ AbstractResponseContext rc;
+ rc = full ?
+ new BaseResponseContext<Document<Service>>(doc) :
+ new EmptyResponseContext(200);
+ rc.setEntityTag(service_etag);
+ return rc;
+ }
+
+ public ResponseContext createEntry(RequestContext request) {
+ try {
+ Document<Entry> document = request.getDocument();
+ Entry entry = document.getRoot();
+ store.createEntry(request.getUri(), entry, request.getSlug());
+ Document<Service> doc = entry.getDocument();
+ AbstractResponseContext rc;
+ rc = new BaseResponseContext<Document<Service>>(doc);
+ rc.setStatus(201);
+ rc.setEntityTag(new EntityTag(entry.getId().toString()));
+ rc.setLocation(new URL(request.getResolvedUri().toURL(), request.getSlug()).toString());
+ return rc;
+ } catch (Exception e) {
+ logger.error(e);
+ throw new StoreException(e);
+ }
+ }
+
+ public ResponseContext deleteEntry(RequestContext request) {
+ if (logger.isTraceEnabled()) {
+ logger.trace("StoreProvider.deleteEntry(" + request.getUri() + ")");
+ }
+ store.deleteEntry(request.getUri());
+ // TODO: return 400 when entry not found
+ AbstractResponseContext rc = new EmptyResponseContext(200);
+ return rc;
+ }
+
+ public ResponseContext deleteMedia(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResponseContext entryPost(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResponseContext getCategories(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResponseContext getEntry(RequestContext request) {
+ boolean full = true;
+ if (logger.isTraceEnabled()) {
+ logger.trace("StoreProvider.getEntry(" + request.getUri() + ", " + full + ")");
+ }
+ try {
+ Entry entry = store.getEntry(request.getUri());
+ Document<Entry> doc = entry.getDocument();
+ AbstractResponseContext rc;
+ rc = full ?
+ new BaseResponseContext<Document<Entry>>(doc) :
+ new EmptyResponseContext(200);
+ try {
+ rc.setEntityTag(new EntityTag(entry.getId().toString()));
+ } catch (IRISyntaxException e) {
+ throw new StoreException(e);
+ }
+ return rc;
+ } catch (EntryNotFoundException e) {
+ return new EmptyResponseContext(404);
+ }
+ }
+
+ public ResponseContext getFeed(RequestContext request) {
+ boolean full = true;
+ if (logger.isTraceEnabled()) {
+ logger.trace("StoreProvider.getFeed(" + request.getUri() + ", " + full + ")");
+ }
+ Feed feed = store.getEntries(request.getUri());
+ Document<Feed> doc = feed.getDocument();
+ AbstractResponseContext rc;
+ rc = full ?
+ new BaseResponseContext<Document<Feed>>(doc) :
+ new EmptyResponseContext(200);
+ try {
+ rc.setEntityTag(new EntityTag(feed.getId().toString()));
+ } catch (IRISyntaxException e) {
+ throw new StoreException(e);
+ }
+ return rc;
+ }
+
+ public ResponseContext getMedia(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResponseContext mediaPost(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResponseContext updateEntry(RequestContext request) {
+ if (logger.isTraceEnabled()) {
+ logger.trace("StoreProvider.updateEntry(" + request.getUri() + ")");
+ }
+ try {
+ Document<Entry> document = request.getDocument();
+ Entry entry = document.getRoot();
+ entry = store.updateEntry(request.getUri(), entry);
+ Document<Entry> doc = entry.getDocument();
+ AbstractResponseContext rc = new BaseResponseContext<Document<Entry>>(doc);
+ rc.setEntityTag(new EntityTag(entry.getId().toString()));
+ return rc;
+ } catch (Exception e) {
+ logger.error(e);
+ throw new StoreException(e);
+ }
+ }
+
+ public ResponseContext updateMedia(RequestContext request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected int getDefaultPageSize() {
+ return 15;
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/StoreProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store.beans;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.abdera.protocol.server.provider.TargetType;
+import org.apache.abdera.protocol.server.util.RegexTargetResolver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @version $Id$
+ */
+public class ConfigurableRegexTargetResolver extends RegexTargetResolver {
+
+ private final static Log logger = LogFactory.getLog(ConfigurableRegexTargetResolver.class);
+
+ public ConfigurableRegexTargetResolver() {
+ super("");
+ }
+
+ public void setConfiguration(InputStream in) throws IOException {
+ BufferedReader br = new BufferedReader(new InputStreamReader(in));
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ if ("".equals(line.trim()) || line.startsWith("#")) {
+ continue;
+ }
+ String[] fields = line.split("\\t+");
+ if (fields.length < 2) {
+ logger.warn("Invalid configuration line: {" + line + "}.");
+ continue;
+ }
+ TargetType type = TargetType.get(fields[1]);
+ if (type == null) {
+ logger.warn("No such target type: {" + fields[1] + "}");
+ continue;
+ }
+ setPattern(fields[0], type);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Set pattern: " + fields[0] + " => " + type);
+ }
+ }
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/ConfigurableRegexTargetResolver.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java (added)
+++ labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.labs.nucleus.store.beans;
+
+import java.util.Collection;
+
+import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.Feed;
+import org.apache.labs.nucleus.store.Store;
+import org.apache.labs.nucleus.store.StoreException;
+
+
+
+public class SimpleStore implements Store {
+
+ public Entry createEntry(IRI iri, Entry entry, String slug) throws StoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void deleteEntry(IRI uri) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Feed getEntries(IRI iri) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Entry getEntry(IRI iri) throws StoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Collection<org.apache.abdera.model.Collection> listCollections(String workspace) throws StoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Collection<String> listWorkspaces() throws StoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Entry updateEntry(IRI iri, Entry entry) throws StoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/java/org/apache/labs/nucleus/store/beans/SimpleStore.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml (added)
+++ labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml Fri Jun 8 07:10:08 2007
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
+ <property name="contextOverride" value="true"/>
+ <property name="properties">
+ <value>nucleus.targetresolver.configuration=classpath:targetResolver.conf</value>
+ </property>
+ </bean>
+
+ <bean name="abdera" class="org.apache.abdera.Abdera"/>
+
+ <bean name="serviceContext" class="org.apache.labs.nucleus.server.SpringBasedServiceContext">
+ <property name="abdera" ref="abdera"/>
+ <property name="providerManager" ref="providerManager"/>
+ <property name="requestHandlerManager">
+ <bean class="org.apache.abdera.protocol.server.servlet.DefaultRequestHandlerManager"/>
+ </property>
+ <property name="subjectResolver">
+ <bean class="org.apache.abdera.protocol.server.util.SimpleSubjectResolver"/>
+ </property>
+ <property name="targetResolver" ref="targetResolver"/>
+ </bean>
+
+ <bean name="providerManager" class="org.apache.labs.nucleus.server.provider.SpringProviderManager">
+ <property name="provider" ref="provider"/>
+ </bean>
+
+ <bean name="provider" class="org.apache.labs.nucleus.store.StoreProvider" autowire="byType">
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/resources/baseApplicationContext.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml (added)
+++ labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml Fri Jun 8 07:10:08 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean name="targetResolver" class="org.apache.labs.nucleus.store.beans.ConfigurableRegexTargetResolver">
+ <property name="configuration" value="${nucleus.targetresolver.configuration}"/>
+ </bean>
+
+ <bean name="store" class="org.apache.labs.nucleus.store.beans.SimpleStore"/>
+
+</beans>
\ No newline at end of file
Propchange: labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/resources/defaultStoreBeans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: labs/nucleus/trunk/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/resources/log4j.properties?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/resources/log4j.properties (added)
+++ labs/nucleus/trunk/src/main/resources/log4j.properties Fri Jun 8 07:10:08 2007
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+log4j.debug=false
+
+log4j.rootLogger=INFO,Stdout
+
+log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
+
+log4j.logger.org.springframework=warn
+
+log4j.logger.org.apache.labs.nucleus=trace
+log4j.logger.org.apache.abdera=debug
Propchange: labs/nucleus/trunk/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Added: labs/nucleus/trunk/src/main/resources/targetResolver.conf
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/resources/targetResolver.conf?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/resources/targetResolver.conf (added)
+++ labs/nucleus/trunk/src/main/resources/targetResolver.conf Fri Jun 8 07:10:08 2007
@@ -0,0 +1,14 @@
+#
+# Sample target resolver configuration file. Each line must consist
+# of two fields separated by one or more TAB characters.
+# First field is a regular expression that is matched against the request URI.
+# Second field is a target type and can be one of:
+# SERVICE, COLLECTION, ENTRY, MEDIA, CATEGORIES
+#
+# Blank lines and lines starting with a hash sign ('#') are ignored.
+#
+# $Id: targetResolver.conf 1366 2007-05-18 15:24:26Z u.cei $
+
+/(\?[^#]*)? SERVICE
+/atom/([^/#?]+)/? COLLECTION
+/atom/([^/#?]+)/([^/#?]+)(\?[^#]*)? ENTRY
\ No newline at end of file
Added: labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml (added)
+++ labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml Fri Jun 8 07:10:08 2007
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <!-- Location of the Spring application context configuration file -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ classpath:baseApplicationContext.xml
+ classpath:defaultStoreBeans.xml
+ </param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>nucleus</servlet-name>
+ <servlet-class>org.apache.labs.nucleus.server.servlet.NucleusServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>nucleus</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Propchange: labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java (added)
+++ labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.abdera.test.client;
+
+import junit.framework.TestCase;
+
+public abstract class JettyTest extends TestCase {
+
+ protected JettyTest() {}
+
+ protected static void getServletHandler(String... servletMappings) {
+ for (int n = 0; n < servletMappings.length; n = n + 2) {
+ String name = servletMappings[n];
+ String root = servletMappings[n+1];
+ JettyUtil.addServlet(name, root);
+ }
+ }
+
+ protected abstract void getServletHandler();
+
+ protected String getBase() {
+ return "http://localhost:" + JettyUtil.getPort();
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ getServletHandler();
+ JettyUtil.start();
+ }
+
+ public void tearDown() throws Exception {
+ //JettyUtil.stop();
+ }
+}
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java
URL: http://svn.apache.org/viewvc/labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java?view=auto&rev=545512
==============================================================================
--- labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java (added)
+++ labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java Fri Jun 8 07:10:08 2007
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.abdera.test.client;
+
+import java.util.Map;
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.servlet.ServletHandler;
+import org.mortbay.jetty.servlet.ServletHolder;
+
+public class JettyUtil {
+
+ private static final String PORT_PROP = "abdera.test.client.port";
+
+ private static int PORT = 8080;
+ private static Server server = null;
+ private static ServletHandler handler = null;
+
+ public static int getPort() {
+ if (System.getProperty(PORT_PROP) != null) {
+ PORT = Integer.parseInt(System.getProperty(PORT_PROP));
+ }
+ return PORT;
+ }
+
+ private static void initServer() throws Exception {
+ server = new Server();
+ Connector connector = new SocketConnector();
+ connector.setPort(getPort());
+ server.setConnectors(new Connector[]{connector});
+ handler = new ServletHandler();
+ server.setHandler(handler);
+ handler.initialize();
+ }
+
+ public static ServletHolder addServlet(String _class, String path) {
+ try {
+ if (server == null) initServer();
+ } catch (Exception e) {}
+ return handler.addServletWithMapping(_class, path);
+ }
+
+ public static void addServlet(String _class, String path, Map<String, String> parameters) {
+ ServletHolder holder = addServlet(_class, path);
+ holder.setInitParameters(parameters);
+ }
+
+ public static void start() throws Exception {
+ if (server == null) initServer();
+ if (server.isRunning()) return;
+ server.start();
+ }
+
+ public static void stop() throws Exception {
+ if (server == null) return;
+ server.stop();
+ server = null;
+ }
+
+ public static boolean isRunning() {
+ return (server != null);
+ }
+
+}
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: labs/nucleus/trunk/src/test/java/org/apache/abdera/test/client/JettyUtil.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org