Return-Path: Delivered-To: apmail-incubator-abdera-commits-archive@locus.apache.org Received: (qmail 47929 invoked from network); 21 Aug 2007 00:52:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 00:52:18 -0000 Received: (qmail 18817 invoked by uid 500); 21 Aug 2007 00:52:15 -0000 Delivered-To: apmail-incubator-abdera-commits-archive@incubator.apache.org Received: (qmail 18807 invoked by uid 500); 21 Aug 2007 00:52:15 -0000 Mailing-List: contact abdera-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-commits@incubator.apache.org Received: (qmail 18798 invoked by uid 99); 21 Aug 2007 00:52:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 17:52:15 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 00:52:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3F5321A981C; Mon, 20 Aug 2007 17:51:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r567888 [1/4] - in /incubator/abdera/java/trunk: ./ build/ extensions/ extensions/gdata/ extensions/gdata/src/ extensions/gdata/src/main/ extensions/gdata/src/main/java/ extensions/gdata/src/main/java/org/ extensions/gdata/src/main/java/org... Date: Tue, 21 Aug 2007 00:51:29 -0000 To: abdera-commits@incubator.apache.org From: jmsnell@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070821005138.3F5321A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jmsnell Date: Mon Aug 20 17:51:20 2007 New Revision: 567888 URL: http://svn.apache.org/viewvc?rev=567888&view=rev Log: Separate extensions into separate individual components. All extensions that are based on IETF I-D's or RFC's are grouped into the extensions/main, all others are separate. The build will produce individual jars for each extension module. Added: incubator/abdera/java/trunk/extensions/gdata/ incubator/abdera/java/trunk/extensions/gdata/pom.xml incubator/abdera/java/trunk/extensions/gdata/src/ incubator/abdera/java/trunk/extensions/gdata/src/main/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthCredentials.java incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthScheme.java incubator/abdera/java/trunk/extensions/gdata/src/main/resources/ incubator/abdera/java/trunk/extensions/gdata/src/test/ incubator/abdera/java/trunk/extensions/gdata/src/test/java/ incubator/abdera/java/trunk/extensions/gdata/src/test/resources/ incubator/abdera/java/trunk/extensions/geo/ incubator/abdera/java/trunk/extensions/geo/pom.xml incubator/abdera/java/trunk/extensions/geo/src/ incubator/abdera/java/trunk/extensions/geo/src/main/ incubator/abdera/java/trunk/extensions/geo/src/main/java/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Box.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinate.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinates.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/GeoHelper.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Line.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Multiple.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Point.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Polygon.java incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Position.java incubator/abdera/java/trunk/extensions/geo/src/main/resources/ incubator/abdera/java/trunk/extensions/geo/src/test/ incubator/abdera/java/trunk/extensions/geo/src/test/java/ incubator/abdera/java/trunk/extensions/geo/src/test/resources/ incubator/abdera/java/trunk/extensions/json/ incubator/abdera/java/trunk/extensions/json/pom.xml incubator/abdera/java/trunk/extensions/json/src/ incubator/abdera/java/trunk/extensions/json/src/main/ incubator/abdera/java/trunk/extensions/json/src/main/java/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONWriter.java incubator/abdera/java/trunk/extensions/json/src/main/resources/ incubator/abdera/java/trunk/extensions/json/src/main/resources/META-INF/ incubator/abdera/java/trunk/extensions/json/src/main/resources/META-INF/services/ incubator/abdera/java/trunk/extensions/json/src/main/resources/META-INF/services/org.apache.abdera.writer.NamedWriter incubator/abdera/java/trunk/extensions/json/src/test/ incubator/abdera/java/trunk/extensions/json/src/test/java/ incubator/abdera/java/trunk/extensions/json/src/test/resources/ incubator/abdera/java/trunk/extensions/main/ incubator/abdera/java/trunk/extensions/main/pom.xml incubator/abdera/java/trunk/extensions/main/src/ incubator/abdera/java/trunk/extensions/main/src/main/ incubator/abdera/java/trunk/extensions/main/src/main/java/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/bidi/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/bidi/BidiHelper.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/AbstractSelector.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/AcceptSelector.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/Feature.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/FeatureSelector.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/FeaturesExtensionFactory.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/FeaturesHelper.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/Selector.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/features/XPathSelector.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/history/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/history/FeedPagingHelper.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/license/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/license/LicenseHelper.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/ incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/ThreadConstants.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/ThreadExtensionFactory.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java incubator/abdera/java/trunk/extensions/main/src/main/java/org/apache/abdera/ext/thread/Total.java incubator/abdera/java/trunk/extensions/main/src/main/resources/ incubator/abdera/java/trunk/extensions/main/src/main/resources/META-INF/ incubator/abdera/java/trunk/extensions/main/src/main/resources/META-INF/services/ incubator/abdera/java/trunk/extensions/main/src/main/resources/META-INF/services/org.apache.abdera.factory.ExtensionFactory incubator/abdera/java/trunk/extensions/main/src/test/ incubator/abdera/java/trunk/extensions/main/src/test/java/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/bidi/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/bidi/BidiTest.java incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/features/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/features/FeatureTest.java incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/history/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/history/FeedPagingTest.java incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/license/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/license/LicenseTest.java incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/main/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/main/TestSuite.java incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/thread/ incubator/abdera/java/trunk/extensions/main/src/test/java/org/apache/abdera/test/ext/thread/ThreadTest.java incubator/abdera/java/trunk/extensions/main/src/test/resources/ incubator/abdera/java/trunk/extensions/media/ incubator/abdera/java/trunk/extensions/media/pom.xml incubator/abdera/java/trunk/extensions/media/src/ incubator/abdera/java/trunk/extensions/media/src/main/ incubator/abdera/java/trunk/extensions/media/src/main/java/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/ incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaAdult.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaCategory.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaConstants.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaContent.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaCopyright.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaCredit.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaDescription.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaExtensionFactory.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaGroup.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaHash.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaKeywords.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaPlayer.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaRating.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaRestriction.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaText.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaThumbnail.java incubator/abdera/java/trunk/extensions/media/src/main/java/org/apache/abdera/ext/media/MediaTitle.java incubator/abdera/java/trunk/extensions/media/src/main/resources/ incubator/abdera/java/trunk/extensions/media/src/main/resources/META-INF/ incubator/abdera/java/trunk/extensions/media/src/main/resources/META-INF/services/ incubator/abdera/java/trunk/extensions/media/src/main/resources/META-INF/services/org.apache.abdera.factory.ExtensionFactory incubator/abdera/java/trunk/extensions/media/src/test/ incubator/abdera/java/trunk/extensions/media/src/test/java/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/test/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/test/ext/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/test/ext/media/ incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/test/ext/media/MediaTest.java incubator/abdera/java/trunk/extensions/media/src/test/java/org/apache/abdera/test/ext/media/TestSuite.java incubator/abdera/java/trunk/extensions/media/src/test/resources/ incubator/abdera/java/trunk/extensions/opensearch/ incubator/abdera/java/trunk/extensions/opensearch/pom.xml incubator/abdera/java/trunk/extensions/opensearch/src/ incubator/abdera/java/trunk/extensions/opensearch/src/main/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/IntegerElement.java incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchConstants.java incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/OpenSearchExtensionFactory.java incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/Query.java incubator/abdera/java/trunk/extensions/opensearch/src/main/resources/ incubator/abdera/java/trunk/extensions/opensearch/src/main/resources/META-INF/ incubator/abdera/java/trunk/extensions/opensearch/src/main/resources/META-INF/services/ incubator/abdera/java/trunk/extensions/opensearch/src/main/resources/META-INF/services/org.apache.abdera.factory.ExtensionFactory incubator/abdera/java/trunk/extensions/opensearch/src/test/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/ incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java incubator/abdera/java/trunk/extensions/opensearch/src/test/java/org/apache/abdera/test/ext/opensearch/TestSuite.java incubator/abdera/java/trunk/extensions/opensearch/src/test/resources/ incubator/abdera/java/trunk/extensions/opensearch/src/test/resources/opensearch.xml incubator/abdera/java/trunk/extensions/sharing/ incubator/abdera/java/trunk/extensions/sharing/pom.xml incubator/abdera/java/trunk/extensions/sharing/src/ incubator/abdera/java/trunk/extensions/sharing/src/main/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/Conflicts.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/History.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/Related.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/Sharing.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingExtensionFactory.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/Sync.java incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/Unpublished.java incubator/abdera/java/trunk/extensions/sharing/src/main/resources/ incubator/abdera/java/trunk/extensions/sharing/src/main/resources/META-INF/ incubator/abdera/java/trunk/extensions/sharing/src/main/resources/META-INF/services/ incubator/abdera/java/trunk/extensions/sharing/src/main/resources/META-INF/services/org.apache.abdera.factory.ExtensionFactory incubator/abdera/java/trunk/extensions/sharing/src/test/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/TestSuite.java incubator/abdera/java/trunk/extensions/sharing/src/test/resources/ incubator/abdera/java/trunk/extensions/wsse/ incubator/abdera/java/trunk/extensions/wsse/src/ incubator/abdera/java/trunk/extensions/wsse/src/main/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/apache/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/apache/abdera/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/apache/abdera/ext/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/apache/abdera/ext/wsse/ incubator/abdera/java/trunk/extensions/wsse/src/main/java/org/apache/abdera/ext/wsse/WSSEAuthScheme.java incubator/abdera/java/trunk/extensions/wsse/src/main/resources/ incubator/abdera/java/trunk/extensions/wsse/src/test/ incubator/abdera/java/trunk/extensions/wsse/src/test/java/ incubator/abdera/java/trunk/extensions/wsse/src/test/resources/ Removed: incubator/abdera/java/trunk/extensions/pom.xml incubator/abdera/java/trunk/extensions/src/ Modified: incubator/abdera/java/trunk/build/build.xml incubator/abdera/java/trunk/pom.xml Modified: incubator/abdera/java/trunk/build/build.xml URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/build/build.xml?rev=567888&r1=567887&r2=567888&view=diff ============================================================================== --- incubator/abdera/java/trunk/build/build.xml (original) +++ incubator/abdera/java/trunk/build/build.xml Mon Aug 20 17:51:20 2007 @@ -56,13 +56,6 @@ - - - - - - - @@ -85,6 +78,20 @@ + + + + + + + + @@ -273,25 +280,6 @@ - - - - - - - - - - - - - - - - - - - @@ -357,7 +345,8 @@ Make sure the example code compiles... - + @@ -367,7 +356,16 @@ - + + + + @@ -386,9 +384,8 @@ Running Client Tests... - Running Extension Tests... - - + + @@ -420,8 +417,8 @@ - + @@ -647,5 +644,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compiling extension ${ext}... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Building jar for extension ${ext}... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Running tests for extension ${ext}... + Added: incubator/abdera/java/trunk/extensions/gdata/pom.xml URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/gdata/pom.xml?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/gdata/pom.xml (added) +++ incubator/abdera/java/trunk/extensions/gdata/pom.xml Mon Aug 20 17:51:20 2007 @@ -0,0 +1,92 @@ + + + + + org.apache.abdera + abdera + 0.3.0-incubating-SNAPSHOT + + 4.0.0 + abdera-extensions-gdata + jar + Abdera Extensions - GData + 0.3.0-incubating-SNAPSHOT + Atom Specification Extensions - GData + 2006 + http://incubator.apache.org/abdera + + scm:svn:http://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/gdata + scm:svn:https://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/gdata + http://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/gdata + + + + org.apache.abdera + abdera-core + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-parser + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-protocol + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-client + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + json + 1.0 + compile + + + org.apache.ws.commons.axiom + axiom-api + + + org.apache.ws.commons.axiom + axiom-impl + + + stax + stax-api + + + org.codehaus.woodstox + wstx-asl + + + junit + junit + + + Added: incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthCredentials.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthCredentials.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthCredentials.java (added) +++ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthCredentials.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,67 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.gdata; + +import org.apache.commons.httpclient.Credentials; + +/** + *

When using the GoogleLoginAuthScheme with the typical Commons AbderaClient + * UsernamePasswordCredentials, the AuthScheme implementation will request + * a new auth token from the Google server for every request. To make it + * a more efficient, clients can use GoogleLoginAuthCredentials which will + * perform the Google Auth once to get the auth token which will be reused + * for every request.

+ * + *
+ *    GoogleLoginAuthScheme.register();
+ *   
+ *   AbderaClient client = new CommonsClient();
+ *   
+ *   GoogleLoginAuthCredentials credentials = 
+ *     new GoogleLoginAuthCredentials(
+ *       "email", "password", "blogger");
+ *   client.addCredentials(
+ *     "http://beta.blogger.com",
+ *     null, null,
+ *     credentials);
+ *  
+ */ +public final class GoogleLoginAuthCredentials + implements Credentials { + + private final String auth; + private final String service; + + public GoogleLoginAuthCredentials(String auth) { + this.auth = auth; + this.service = null; + } + + public GoogleLoginAuthCredentials(String id, String pwd, String service) { + this.auth = (new GoogleLoginAuthScheme()).getAuth(id, pwd, service); + this.service = service; + } + + public String getAuth() { + return auth; + } + + public String getService() { + return service; + } +} Added: incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthScheme.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthScheme.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthScheme.java (added) +++ incubator/abdera/java/trunk/extensions/gdata/src/main/java/org/apache/abdera/ext/gdata/GoogleLoginAuthScheme.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,159 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.gdata; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.Formatter; + +import org.apache.abdera.protocol.client.AbderaClient; +import org.apache.abdera.protocol.client.ClientResponse; +import org.apache.abdera.protocol.client.RequestOptions; +import org.apache.abdera.util.Version; +import org.apache.commons.httpclient.Credentials; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.UsernamePasswordCredentials; +import org.apache.commons.httpclient.auth.AuthScheme; +import org.apache.commons.httpclient.auth.AuthenticationException; +import org.apache.commons.httpclient.auth.MalformedChallengeException; +import org.apache.commons.httpclient.auth.RFC2617Scheme; +import org.apache.commons.httpclient.methods.StringRequestEntity; + +/** + *

Implements the GoogleLogin auth scheme used by gdata (Blogger, Google Calendar, etc). + * Warning: this scheme is slow!

+ * + *
+ *   GoogleLoginAuthScheme.register();
+ *   
+ *   AbderaClient client = new CommonsClient();
+ *   client.addCredentials(
+ *     "http://beta.blogger.com", 
+ *     null, "GoogleLogin", 
+ *     new UsernamePasswordCredentials(
+ *       "email","password"));
+ * 
+ */ +public class GoogleLoginAuthScheme + extends RFC2617Scheme + implements AuthScheme { + + public static void register(AbderaClient abderaClient, boolean exclusive) { + AbderaClient.registerScheme("GoogleLogin", GoogleLoginAuthScheme.class); + if (exclusive) + ((AbderaClient)abderaClient).setAuthenticationSchemePriority("GoogleLogin"); + else + ((AbderaClient)abderaClient).setAuthenticationSchemeDefaults(); + } + + private String service = null; + + @Override + public void processChallenge( + String challenge) + throws MalformedChallengeException { + super.processChallenge(challenge); + service = getParameter("service"); + } + + public String authenticate( + Credentials credentials, + HttpMethod method) + throws AuthenticationException { + String auth = null; + if (credentials instanceof UsernamePasswordCredentials) { + UsernamePasswordCredentials usercreds = + (UsernamePasswordCredentials) credentials; + String id = usercreds.getUserName(); + String pwd = usercreds.getPassword(); + auth = getAuth(id, pwd); + } else if (credentials instanceof GoogleLoginAuthCredentials) { + GoogleLoginAuthCredentials gcreds = + (GoogleLoginAuthCredentials) credentials; + service = gcreds.getService(); + auth = gcreds.getAuth(); + } else { + throw new AuthenticationException( + "Cannot use credentials for GoogleLogin authentication"); + } + StringBuffer buf = new StringBuffer("GoogleLogin "); + buf.append(auth); + return buf.toString(); + } + + public String authenticate( + Credentials credentials, + String method, + String uri) + throws AuthenticationException { + return authenticate(credentials, null); + } + + public String getSchemeName() { + return "GoogleLogin"; + } + + public boolean isComplete() { + return true; + } + + public boolean isConnectionBased() { + return false; + } + + + protected String getAuth(String id, String pwd) { + return getAuth(id, pwd, service); + } + + protected String getAuth(String id, String pwd, String service) { + try { + AbderaClient abderaClient = new AbderaClient(); + Formatter f = new Formatter(); + f.format( + "Email=%s&Passwd=%s&service=%s&source=%s", + URLEncoder.encode(id, "utf-8"), + URLEncoder.encode(pwd, "utf-8"), + (service != null) ? URLEncoder.encode(service, "utf-8") : "", + URLEncoder.encode(Version.APP_NAME, "utf-8")); + StringRequestEntity stringreq = new StringRequestEntity( + f.toString(),"application/x-www-form-urlencoded","utf-8"); + String uri = "https://www.google.com/accounts/ClientLogin"; + RequestOptions options = abderaClient.getDefaultRequestOptions(); + options.setContentType("application/x-www-form-urlencoded"); + ClientResponse response = abderaClient.post(uri, stringreq, options); + InputStream in = response.getInputStream(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int n = -1; + while ((n = in.read()) != -1) { out.write(n); } + out.flush(); + response.release(); + String auth = new String(out.toByteArray()); + return auth.split("\n")[2].replaceAll("Auth=", "auth="); + } catch (Exception e) {} + return null; + } + + public static String getGoogleLogin(String id, String pwd, String service) { + String auth = (new GoogleLoginAuthScheme()).getAuth(id, pwd, service); + StringBuffer buf = new StringBuffer("GoogleLogin "); + buf.append(auth); + return buf.toString(); + } +} \ No newline at end of file Added: incubator/abdera/java/trunk/extensions/geo/pom.xml URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/pom.xml?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/pom.xml (added) +++ incubator/abdera/java/trunk/extensions/geo/pom.xml Mon Aug 20 17:51:20 2007 @@ -0,0 +1,92 @@ + + + + + org.apache.abdera + abdera + 0.3.0-incubating-SNAPSHOT + + 4.0.0 + abdera-extensions-geo + jar + Abdera Extensions - Geo + 0.3.0-incubating-SNAPSHOT + Atom Specification Extensions - Geo + 2006 + http://incubator.apache.org/abdera + + scm:svn:http://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/geo + scm:svn:https://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/geo + http://svn.apache.org/repos/asf/incubator/abdera/java/trunk/extensions/geo + + + + org.apache.abdera + abdera-core + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-parser + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-protocol + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + abdera-client + 0.3.0-incubating-SNAPSHOT + compile + + + org.apache.abdera + json + 1.0 + compile + + + org.apache.ws.commons.axiom + axiom-api + + + org.apache.ws.commons.axiom + axiom-impl + + + stax + stax-api + + + org.codehaus.woodstox + wstx-asl + + + junit + junit + + + Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Box.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Box.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Box.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Box.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,98 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +public class Box + extends Multiple { + + private static final String TWO_COORDINATES = "A box must have two coordinates"; + private static final long serialVersionUID = 3994252648307511152L; + + public Box() { + super(); + } + + public Box(Multiple multiple) { + super(multiple); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(Point lowerCorner, Point upperCorner) { + super(lowerCorner,upperCorner); + } + + public Box(Coordinate... coordinates) { + super(coordinates); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(Coordinates coordinates) { + super(coordinates); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(String value) { + super(value); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(Multiple... multiples) { + super(multiples); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(Point... points) { + super(points); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Box(double... values) { + super(values); + if (this.coordinates.size() != 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + @Override + public void setCoordinates(Coordinates coordinates) { + super.setCoordinates(coordinates); + if (this.coordinates.size() > 2) + throw new IllegalArgumentException( + TWO_COORDINATES); + } + + public Coordinate getUpperCorner() { + return coordinates.size() > 1 ? coordinates.get(1) : null; + } + + public Coordinate getLowerCorner() { + return coordinates.size() > 0 ? coordinates.get(0) : null; + } +} Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinate.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinate.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinate.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinate.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,130 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +import java.io.Serializable; + +public class Coordinate + implements Serializable, + Cloneable, + Comparable { + + private static final long serialVersionUID = -916272885213668761L; + + private double latitude = 0.0f; + private double longitude = 0.0f; + + public Coordinate() {} + + public Coordinate(double latitude, double longitude) { + setLatitude(latitude); + setLongitude(longitude); + } + + public Coordinate(String value) { + Coordinate c = parse(value); + setLatitude(c.latitude); + setLongitude(c.longitude); + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + if (Double.compare(longitude, 90.0d) > 0) + throw new IllegalArgumentException("Latitude > 90.0 degrees"); + if (Double.compare(longitude, -90.0d) < 0) + throw new IllegalArgumentException("Latitude < 90.0 degrees"); + this.latitude = latitude; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + if (Double.compare(longitude, 180.0d) > 0) + throw new IllegalArgumentException("Longitude > 180.0 degrees"); + if (Double.compare(longitude, -180.0d) < 0) + throw new IllegalArgumentException("Longitude < 180.0 degrees"); + this.longitude = longitude; + } + + public String toString() { + return Double.toString(latitude) + " " + Double.toString(longitude); + } + + public Coordinate clone() { + try { + return (Coordinate) super.clone(); + } catch (CloneNotSupportedException e) { + return new Coordinate(latitude,longitude); // not going to happen + } + } + + @Override + public int hashCode() { + final int PRIME = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(latitude); + result = PRIME * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(longitude); + result = PRIME * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Coordinate other = (Coordinate) obj; + if (Double.doubleToLongBits(latitude) != Double.doubleToLongBits(other.latitude)) + return false; + if (Double.doubleToLongBits(longitude) != Double.doubleToLongBits(other.longitude)) + return false; + return true; + } + + public static Coordinate parse(String value) { + try { + String[] points = value.trim().split("\\s+", 2); + double latitude = Double.parseDouble(points[0].trim()); + double longitude = Double.parseDouble(points[1].trim()); + return new Coordinate(latitude,longitude); + } catch (Throwable t) { + throw new RuntimeException("Error parsing coordinate pair",t); + } + } + + public int compareTo(Coordinate o) { + if (o == null || equals(o)) return 0; + int l1 = Double.compare(latitude, o.latitude); + int l2 = Double.compare(longitude, o.longitude); + if (l1 < 0) return -1; + if (l1 == 0 && l2 < -1) return -1; + if (l1 == 0 && l2 == 0) return 0; + return 1; + } + +} Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinates.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinates.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinates.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Coordinates.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,202 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +public class Coordinates + implements Iterable, + Serializable, + Cloneable, + Comparable{ + + private static final long serialVersionUID = 1640788106113796699L; + protected List coords = new ArrayList(); + + public Coordinates() {} + + public Coordinates(Coordinate... coordinates) { + for (Coordinate coord : coordinates) add(coord); + } + + public Coordinates(Coordinates coordinates) { + coords.addAll(coordinates.coords); + } + + public Coordinates(String value) { + Coordinates cs = parse(value); + this.coords = cs.coords; + } + + public synchronized Coordinate get(int n) { + return coords.get(n); + } + + public synchronized void add(Coordinates coordinates) { + coords.addAll(coordinates.coords); + } + + public synchronized void add(Coordinate coordinate) { + coords.add(coordinate); + } + + public synchronized void add(Coordinate... coordinates) { + for (Coordinate c : coordinates) add(c); + } + + public synchronized void add(double latitude, double longitude) { + coords.add(new Coordinate(latitude,longitude)); + } + + public synchronized void add(String value) { + coords.add(new Coordinate(value)); + } + + public synchronized void remove(Coordinate coordinate) { + if (coords.contains(coordinate)) coords.remove(coordinate); + } + + public synchronized void remove(Coordinate... coordinates) { + for (Coordinate c : coordinates) remove(c); + } + + public synchronized void remove(double latitude, double longitude) { + remove(new Coordinate(latitude,longitude)); + } + + public synchronized void remove(String value) { + remove(new Coordinate(value)); + } + + public synchronized boolean contains(double latitude, double longitude) { + return contains(new Coordinate(latitude,longitude)); + } + + public synchronized boolean contains(String value) { + return contains(new Coordinate(value)); + } + + public synchronized boolean contains(Coordinate coordinate) { + return coords.contains(coordinate); + } + + public synchronized boolean contains(Coordinate... coordinates) { + for (Coordinate c : coordinates) + if (!coords.contains(c)) return false; + return true; + } + + public Iterator iterator() { + return coords.iterator(); + } + + public String toString() { + StringBuffer buf = new StringBuffer(); + for (Coordinate coord : coords) { + if (buf.length() > 0) buf.append(" "); + buf.append(coord); + } + return buf.toString(); + } + + @Override + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ((coords == null) ? 0 : coords.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final Coordinates other = (Coordinates) obj; + if (coords == null) { + if (other.coords != null) + return false; + } else if (!coords.equals(other.coords)) + return false; + return true; + } + + public static Coordinates parse(String value) { + Coordinates cs = new Coordinates(); + try { + String[] points = value.trim().split("\\s+"); + for (int n = 0; n < points.length; n = n + 2) { + double lat = Double.parseDouble(points[n]); + double lon = Double.parseDouble(points[n+1]); + Coordinate c = new Coordinate(lat,lon); + cs.add(c); + } + return cs; + } catch (Throwable t) { + throw new RuntimeException("Error parsing coordinate pairs",t); + } + } + + public int size() { + return coords.size(); + } + + public void clear() { + coords.clear(); + } + + public Coordinates clone() { + try { + return (Coordinates) super.clone(); + } catch (CloneNotSupportedException e) { + return new Coordinates(this); // Not going to happen + } + } + + public Coordinates sort() { + return sort(false); + } + + public Coordinates sort(boolean reverse) { + Coordinates c = clone(); + if (reverse) Collections.sort(c.coords,Collections.reverseOrder()); + else Collections.sort(c.coords); + return c; + } + + public int compareTo(Coordinates o) { + if (o == null || equals(o)) return 0; + if (size() < o.size()) return -1; + if (o.size() < size()) return 1; + for (int n = 0; n < size(); n++) { + Coordinate c1 = coords.get(n); + Coordinate c2 = o.coords.get(n); + int c = c1.compareTo(c2); + if (c != 0) return c; + } + return 0; + } + +} Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/GeoHelper.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/GeoHelper.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/GeoHelper.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/GeoHelper.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,319 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.apache.abdera.model.Element; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.ExtensibleElement; + +/** + * Basic support for the GeoRSS extensions to Atom: http://georss.org/1 + */ +public class GeoHelper { + + public static final String W3C_GEO_NS = "http://www.w3.org/2003/01/geo/wgs84_pos#"; + public static final String SIMPLE_GEO_NS = "http://www.georss.org/georss/10"; + public static final String GML_NS = "http://www.opengis.net/gml"; + + public static final QName QNAME_W3C_POINT = new QName(W3C_GEO_NS, "Point", "geo"); + public static final QName QNAME_W3C_LAT = new QName(W3C_GEO_NS, "lat", "geo"); + public static final QName QNAME_W3C_LONG = new QName(W3C_GEO_NS, "long", "geo"); + + public static final QName QNAME_SIMPLE_POINT = new QName(SIMPLE_GEO_NS, "point", "georss"); + public static final QName QNAME_SIMPLE_LINE = new QName(SIMPLE_GEO_NS, "line", "georss"); + public static final QName QNAME_SIMPLE_POLYGON = new QName(SIMPLE_GEO_NS, "polygon", "georss"); + public static final QName QNAME_SIMPLE_BOX = new QName(SIMPLE_GEO_NS, "box", "georss"); + public static final QName QNAME_WHERE = new QName(SIMPLE_GEO_NS, "where", "georss"); + + public static final QName QNAME_GML_POINT = new QName(GML_NS, "Point", "gml"); + public static final QName QNAME_GML_POS = new QName(GML_NS, "pos", "gml"); + public static final QName QNAME_GML_LINESTRING = new QName(GML_NS, "LineString", "gml"); + public static final QName QNAME_GML_POSLIST = new QName(GML_NS, "posList", "gml"); + public static final QName QNAME_GML_POLYGON = new QName(GML_NS, "Polygon", "gml"); + public static final QName QNAME_GML_EXTERIOR = new QName(GML_NS, "exterior", "gml"); + public static final QName QNAME_GML_LINEARRING = new QName(GML_NS, "LinearRing", "gml"); + public static final QName QNAME_GML_ENVELOPE = new QName(GML_NS, "Envelope", "gml"); + public static final QName QNAME_GML_LOWERCORNER = new QName(GML_NS, "lowerCorner", "gml"); + public static final QName QNAME_GML_UPPERCORNER = new QName(GML_NS, "upperCorner", "gml"); + + public enum Encoding { + SIMPLE, W3C, GML + } + + public static void addPosition( + Entry entry, + Position position) { + addPosition(entry,position,Encoding.SIMPLE); + } + + public static void addPosition( + Entry entry, + Position position, + Encoding encoding) { + switch(encoding) { + case SIMPLE: + addSimplePosition(entry, position); + break; + case GML: + addGmlPosition(entry, position); + break; + case W3C: { + addW3CPosition(entry, position); + break; + } + } + } + + private static void setPositionAttributes(Element pos, Position position) { + if (pos != null) { + if (position.getFeatureTypeTag() != null) + pos.setAttributeValue("featuretypetag", position.getFeatureTypeTag()); + if (position.getRelationshipTag() != null) + pos.setAttributeValue("relationshiptag", position.getRelationshipTag()); + if (position.getElevation() != null) + pos.setAttributeValue("elev", position.getElevation().toString()); + if (position.getFloor() != null) + pos.setAttributeValue("floor", position.getFloor().toString()); + if (position.getRadius() != null) + pos.setAttributeValue("radius", position.getRadius().toString()); + } + } + + private static void addGmlPosition(Entry entry, Position position) { + ExtensibleElement pos = entry.addExtension(QNAME_WHERE); + if (position instanceof Point) { + Point point = (Point) position; + ExtensibleElement p = pos.addExtension(QNAME_GML_POINT); + p.addSimpleExtension(QNAME_GML_POS, point.getCoordinate().toString()); + } else if (position instanceof Line) { + Multiple m = (Multiple) position; + ExtensibleElement p = pos.addExtension(QNAME_GML_LINESTRING); + p.addSimpleExtension(QNAME_GML_POSLIST, m.getCoordinates().toString()); + } else if (position instanceof Polygon) { + Multiple m = (Multiple) position; + ExtensibleElement p = pos.addExtension(QNAME_GML_POLYGON); + p = p.addExtension(QNAME_GML_EXTERIOR); + p = p.addExtension(QNAME_GML_LINEARRING); + p.addSimpleExtension(QNAME_GML_POSLIST, m.getCoordinates().toString()); + } else if (position instanceof Box) { + Box m = (Box) position; + ExtensibleElement p = pos.addExtension(QNAME_GML_ENVELOPE); + if (m.getLowerCorner() != null) + p.addSimpleExtension(QNAME_GML_LOWERCORNER,m.getLowerCorner().toString()); + if (m.getUpperCorner() != null) + p.addSimpleExtension(QNAME_GML_UPPERCORNER, m.getUpperCorner().toString()); + } + setPositionAttributes(pos,position); + } + + private static void addSimplePosition(Entry entry, Position position) { + Element pos = null; + if (position instanceof Point) { + Point point = (Point) position; + pos = + entry.addSimpleExtension( + QNAME_SIMPLE_POINT, + point.getCoordinate().toString()); + } else if (position instanceof Multiple) { + Multiple line = (Multiple) position; + QName qname = position instanceof Line ? QNAME_SIMPLE_LINE : + position instanceof Box ? QNAME_SIMPLE_BOX : + position instanceof Polygon ? QNAME_SIMPLE_POLYGON : null; + if (qname != null) { + pos = + entry.addSimpleExtension( + qname, + line.getCoordinates().toString()); + } + } + setPositionAttributes(pos, position); + } + + private static void addW3CPosition(Entry entry, Position position) { + if (!(position instanceof Point)) + throw new IllegalArgumentException("The W3C Encoding only supports Points"); + Element el = entry.getExtension(QNAME_W3C_LAT); + if (el != null) el.discard(); + el = entry.getExtension(QNAME_W3C_LONG); + if (el != null) el.discard(); + Point point = (Point) position; + + ExtensibleElement p = entry.addExtension(QNAME_W3C_POINT); + p.addSimpleExtension(QNAME_W3C_LAT, Double.toString(point.getCoordinate().getLatitude())); + p.addSimpleExtension(QNAME_W3C_LONG, Double.toString(point.getCoordinate().getLongitude())); + + } + + private static List _getPositions(Entry entry) { + List list = new ArrayList(); + getW3CPosition(entry,list); + getSimplePosition(entry,list); + getGMLPosition(entry, list); + return list; + } + + public static boolean isGeotagged(Entry entry) { + if (entry.getExtensions(QNAME_SIMPLE_POINT).size() > 0) return true; + if (entry.getExtensions(QNAME_SIMPLE_LINE).size() > 0) return true; + if (entry.getExtensions(QNAME_SIMPLE_BOX).size() > 0) return true; + if (entry.getExtensions(QNAME_SIMPLE_POLYGON).size() > 0) return true; + if (entry.getExtensions(QNAME_WHERE).size() > 0) return true; + if (entry.getExtensions(QNAME_W3C_POINT).size() > 0) return true; + if (entry.getExtensions(QNAME_W3C_LAT).size() > 0 && + entry.getExtensions(QNAME_W3C_LONG).size() > 0) return true; + return false; + } + + public static Iterator listPositions(Entry entry) { + return _getPositions(entry).iterator(); + } + + public static Position[] getPositions(Entry entry) { + List positions = _getPositions(entry); + return positions.toArray(new Position[positions.size()]); + } + + private static void getSimplePosition(Entry entry, List list) { + List elements = entry.getExtensions(SIMPLE_GEO_NS); + for (Element element : elements) { + Position pos = null; + QName qname = element.getQName(); + String text = element.getText(); + if (text != null) { + if (qname.equals(QNAME_SIMPLE_POINT)) { + pos = new Point(text.trim()); + } else if (qname.equals(QNAME_SIMPLE_LINE)) { + pos = new Line(text.trim()); + } else if (qname.equals(QNAME_SIMPLE_BOX)) { + pos = new Box(text.trim()); + } else if (qname.equals(QNAME_SIMPLE_POLYGON)) { + pos = new Polygon(text.trim()); + } + } + if (pos != null) { + getPositionAttributes(element, pos); + list.add(pos); + } + } + } + + private static void getGMLPosition(Entry entry, List list) { + List elements = entry.getExtensions(QNAME_WHERE); + for (ExtensibleElement where : elements) { + Position pos = null; + List children = where.getElements(); + for (ExtensibleElement element : children) { + QName qname = element.getQName(); + if (qname.equals(QNAME_GML_POINT)) { + element = traverse( + element, + QNAME_GML_POS); + if (element != null) { + String text = element.getText(); + if (text != null) { + pos = new Point(text.trim()); + } + } + } else if (qname.equals(QNAME_GML_LINESTRING)) { + element = traverse( + element, + QNAME_GML_POSLIST); + if (element != null) { + String text = element.getText(); + if (text != null) { + pos = new Line(text.trim()); + } + } + } else if (qname.equals(QNAME_GML_POLYGON)) { + element = traverse( + element, + QNAME_GML_EXTERIOR, + QNAME_GML_LINEARRING, + QNAME_GML_POSLIST); + if (element != null) { + String text = element.getText(); + if (text != null) { + pos = new Polygon(text.trim()); + } + } + } else if (qname.equals(QNAME_GML_ENVELOPE)) { + String lc = element.getSimpleExtension(QNAME_GML_LOWERCORNER); + String uc = element.getSimpleExtension(QNAME_GML_UPPERCORNER); + if (lc != null && uc != null) { + Coordinate c1 = new Coordinate(lc); + Coordinate c2 = new Coordinate(uc); + pos = new Box(c1,c2); + } + } + if (pos != null) { + getPositionAttributes(element, pos); + list.add(pos); + } + } + } + } + + private static ExtensibleElement traverse(ExtensibleElement element, QName... qnames) { + for (QName qname : qnames) { + element = element.getExtension(qname); + if (element == null) break; + } + return element; + } + + private static void getPositionAttributes(Element pos, Position position) { + if (position != null) { + String featuretypetag = pos.getAttributeValue("featuretypetag"); + String relationshiptag = pos.getAttributeValue("relationshiptag"); + String elevation = pos.getAttributeValue("elev"); + String floor = pos.getAttributeValue("floor"); + String radius = pos.getAttributeValue("radius"); + if (featuretypetag != null) + position.setFeatureTypeTag(featuretypetag); + if (featuretypetag != null) + position.setRelationshipTag(relationshiptag); + if (elevation != null) + position.setElevation(Double.valueOf(elevation)); + if (floor != null) + position.setFloor(Double.valueOf(floor)); + if (radius != null) + position.setRadius(Double.valueOf(radius)); + } + } + + private static void getW3CPosition(Entry entry, List list) { + getW3CPosition((ExtensibleElement)entry, list); + List points = entry.getExtensions(QNAME_W3C_POINT); + for (ExtensibleElement point : points) getW3CPosition(point, list); + } + + private static void getW3CPosition(ExtensibleElement el, List list) { + String slat = el.getSimpleExtension(QNAME_W3C_LAT); + String slong = el.getSimpleExtension(QNAME_W3C_LONG); + if (slat != null && slong != null) { + Point point = new Point(slat.trim() + " " + slong.trim()); + list.add(point); + } + } +} \ No newline at end of file Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Line.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Line.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Line.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Line.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,77 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +public class Line + extends Multiple { + + private static final long serialVersionUID = 2852975001208906285L; + + public Line() { + } + + public Line(Multiple multiple) { + super(multiple); + verify(); + } + + public Line(Point point) { + super(point); + verify(); + } + + public Line(Coordinate... coordinates) { + super(coordinates); + verify(); + } + + public Line(Coordinates coordinates) { + super(coordinates); + verify(); + } + + public Line(String value) { + super(value); + verify(); + } + + public Line(Multiple... multiples) { + super(multiples); + verify(); + } + + public Line(Point... points) { + super(points); + verify(); + } + + public Line(double... values) { + super(values); + verify(); + } + + @Override + public void setCoordinates(Coordinates coordinates) { + super.setCoordinates(coordinates); + verify(); + } + + public void verify() { + super.verify179Rule(); + } +} Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Multiple.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Multiple.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Multiple.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Multiple.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,125 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +import java.util.Iterator; + +public abstract class Multiple + extends Position + implements Iterable { + + protected Coordinates coordinates; + + public Multiple() {} + + public Multiple(Multiple... multiples) { + this.coordinates = new Coordinates(); + for (Multiple m : multiples) + coordinates.add(m.getCoordinates()); + } + + public Multiple(Multiple multiple) { + this(multiple.getCoordinates().clone()); + } + + public Multiple(Point point) { + this(point.getCoordinate().clone()); + } + + public Multiple(Point... points) { + this.coordinates = new Coordinates(); + for (Point p : points) + coordinates.add(p.getCoordinate()); + } + + public Multiple(Coordinates coordinates) { + this.coordinates = coordinates; + } + + public Multiple(Coordinate... coordinates) { + this.coordinates = new Coordinates(coordinates); + } + + public Multiple(String value) { + this.coordinates = new Coordinates(value); + } + + public Multiple(double... values) { + this.coordinates = new Coordinates(); + for (int n = 0; n < values.length; n = n + 2) { + Coordinate c = new Coordinate(values[n],values[n+1]); + this.coordinates.add(c); + } + } + + public Coordinates getCoordinates() { + return coordinates; + } + + public void setCoordinates(Coordinates coordinates) { + this.coordinates = coordinates; + } + + public Iterator iterator() { + return coordinates.iterator(); + } + + @Override + public int hashCode() { + final int PRIME = 31; + int result = super.hashCode(); + result = PRIME * result + ((coordinates == null) ? 0 : coordinates.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + final Multiple other = (Multiple) obj; + if (coordinates == null) { + if (other.coordinates != null) + return false; + } else if (!coordinates.equals(other.coordinates)) + return false; + return true; + } + + public int compareTo(Position o) { + if (o == null || !this.getClass().isInstance(o) || equals(o)) return 0; + return coordinates.compareTo(((Multiple)o).coordinates); + } + + protected void verify179Rule() { + for (Coordinate c1 : getCoordinates()) { + for (Coordinate c2 : getCoordinates()) { + check179(c1.getLatitude(),c2.getLatitude()); + check179(c1.getLongitude(),c2.getLongitude()); + } + } + } + + private void check179(double d1, double d2) { + if (Math.max(d1, d2)-Math.min(d1,d2) > 179) + throw new RuntimeException("Values are greater than 179 degrees"); + } +} Added: incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Point.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Point.java?rev=567888&view=auto ============================================================================== --- incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Point.java (added) +++ incubator/abdera/java/trunk/extensions/geo/src/main/java/org/apache/abdera/ext/geo/Point.java Mon Aug 20 17:51:20 2007 @@ -0,0 +1,91 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. 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. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ +package org.apache.abdera.ext.geo; + +public class Point + extends Position { + + private static final long serialVersionUID = 7540202474168797239L; + + private Coordinate coordinate; + + public Point() {} + + public Point(Point point) { + this.coordinate = point.getCoordinate().clone(); + } + + public Point(Coordinate coordinate) { + this.coordinate = coordinate; + } + + public Point(double latitude, double longitude) { + this.coordinate = new Coordinate(latitude,longitude); + } + + public Point(String value) { + this.coordinate = new Coordinate(value); + } + + public Coordinate getCoordinate() { + return coordinate; + } + + public void setCoordinate(Coordinate coordinate) { + this.coordinate = coordinate; + } + + public void setCoordinate(double latitude, double longitude) { + this.coordinate = new Coordinate(latitude,longitude); + } + + public void setCoordinate(String value) { + this.coordinate = new Coordinate(value); + } + + @Override + public int hashCode() { + final int PRIME = 31; + int result = super.hashCode(); + result = PRIME * result + ((coordinate == null) ? 0 : coordinate.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + final Point other = (Point) obj; + if (coordinate == null) { + if (other.coordinate != null) + return false; + } else if (!coordinate.equals(other.coordinate)) + return false; + return true; + } + + public int compareTo(Position o) { + if (o == null || !(o instanceof Point) || equals(o)) return 0; + return coordinate.compareTo(((Point)o).coordinate); + } + +}