Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@minotaur.apache.org Received: (qmail 10202 invoked from network); 8 Jun 2009 14:01:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jun 2009 14:01:42 -0000 Received: (qmail 94982 invoked by uid 500); 8 Jun 2009 14:01:54 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 94931 invoked by uid 500); 8 Jun 2009 14:01:54 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 94913 invoked by uid 99); 8 Jun 2009 14:01:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jun 2009 14:01:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jun 2009 14:01:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8AE602388849; Mon, 8 Jun 2009 14:01:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r782630 [1/2] - in /incubator/sling/trunk/contrib/scripting/jsp-taglib-atom: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/sling/ src/main/java/org/apache/sling/atom/ src/main/java/or... Date: Mon, 08 Jun 2009 14:01:21 -0000 To: sling-commits@incubator.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090608140122.8AE602388849@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmeschbe Date: Mon Jun 8 14:01:19 2009 New Revision: 782630 URL: http://svn.apache.org/viewvc?rev=782630&view=rev Log: SLING-985 Import Atom (Abdera based) JSP tag library (Thanks Lars Trieloff) Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/ (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCreditTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaDescriptionTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaGroupTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaHashTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaKeywordsTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaPlayerTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaRatingTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaRestrictionTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaTextTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaThumbnailTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaTitleTagHandler.java (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/DISCLAIMER (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/LICENSE (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/NOTICE (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/atom.tld (with props) incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/resources/META-INF/mediarss.tld (with props) Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jun 8 14:01:19 2009 @@ -0,0 +1,4 @@ +.classpath +.project +.settings +target Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE Mon Jun 8 14:01:19 2009 @@ -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: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/LICENSE ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE Mon Jun 8 14:01:19 2009 @@ -0,0 +1,8 @@ +Apache Sling Atom Tag Library +Copyright 2009 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +Apache Sling is based on source code originally developed +by Day Software (http://www.day.com/). Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/NOTICE ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt Mon Jun 8 14:01:19 2009 @@ -0,0 +1,37 @@ +Apache Sling Atom Tag Library + +Core Tag Library for Apache Sling Atom support + +Disclaimer +========== +Apache Sling is an effort undergoing incubation at The Apache Software Foundation (ASF), +sponsored by the Apache Jackrabbit PMC. Incubation is required of all newly accepted +projects until a further review indicates that the infrastructure, communications, +and decision making process have stabilized in a manner consistent with other +successful ASF projects. While incubation status is not necessarily a reflection of +the completeness or stability of the code, it does indicate that the project has yet +to be fully endorsed by the ASF. + +Getting Started +=============== + +This component uses a Maven 2 (http://maven.apache.org/) build +environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/) +2.0.7 or later. We recommend to use the latest Maven version. + +If you have Maven 2 installed, you can compile and +package the jar using the following command: + + mvn package + +See the Maven 2 documentation for other build features. + +The latest source code for this component is available in the +Subversion (http://subversion.tigris.org/) source repository of +the Apache Software Foundation. If you have Subversion installed, +you can checkout the latest source using the following command: + + svn checkout http://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom + +See the Subversion documentation for other source control features. + Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/README.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml Mon Jun 8 14:01:19 2009 @@ -0,0 +1,109 @@ + + + + + 4.0.0 + + org.apache.sling + sling + 5-incubator + ../../../parent/pom.xml + + + + org.apache.sling.atom.taglib + + 0.9.0-incubator-SNAPSHOT + bundle + + Apache Sling Atom Tag Library + + Core Tag Library for Apache Sling Atom support + + + + scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom + scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom + http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom + + + + + + org.apache.felix + maven-bundle-plugin + + true + + + + org.apache.sling.atom.taglib.*;version=${pom.version} + + + + + + + + + + javax.servlet + servlet-api + + + javax.servlet + jsp-api + 2.0 + + + org.apache.sling + org.apache.sling.api + + 2.0.4-incubator + provided + + + org.apache.sling + org.apache.sling.scripting.jsp + + 2.0.2-incubator + + + org.slf4j + slf4j-api + + + + org.apache.abdera + abdera-core + 1.0-SNAPSHOT + + + org.apache.abdera + abdera-extensions-media + + 1.0-SNAPSHOT + + + org.apache.abdera + abdera-extensions-opensearch + + 1.0-SNAPSHOT + + + Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,114 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.tagext.BodyTagSupport; + +import org.apache.abdera.Abdera; +import org.apache.abdera.ext.media.MediaExtensionFactory; +import org.apache.abdera.ext.opensearch.model.OpenSearchExtensionFactory; +import org.apache.abdera.factory.Factory; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.apache.abdera.parser.stax.FOMFactory; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class AbstractAbderaHandler extends BodyTagSupport { + + private static final long serialVersionUID = 1L; + + public AbstractAbderaHandler() { + super(); + } + + protected Abdera getAbdera() { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + return getAbdera(request); + } + + protected Abdera getAbdera(SlingHttpServletRequest request) { + Abdera abdera; + if (request.getAttribute("abdera") != null + && (request.getAttribute("abdera") instanceof Abdera)) { + abdera = (Abdera) request.getAttribute("abdera"); + } else { + + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader osgiClassloader = getClass().getClassLoader(); + + Thread.currentThread().setContextClassLoader(osgiClassloader); + + abdera = new Abdera(); + new FOMFactory(); + Factory f = abdera.getFactory(); + if (f instanceof FOMFactory) { + FOMFactory ff = (FOMFactory) f; + // I know this sucks, but due to the OSGi-fication Abdera does + // not pick up extension factories automatically. + ff.registerExtension(new MediaExtensionFactory()); + ff.registerExtension(new OpenSearchExtensionFactory()); + } + + Thread.currentThread().setContextClassLoader(classLoader); + + request.setAttribute("abdera", abdera); + } + return abdera; + } + + protected Feed getFeed(SlingHttpServletRequest request) { + Feed feed; + if (request.getAttribute("feed") != null + && (request.getAttribute("feed") instanceof Feed)) { + feed = (Feed) request.getAttribute("feed"); + } else { + feed = getAbdera().newFeed(); + request.setAttribute("feed", feed); + } + return feed; + } + + protected Feed getFeed() { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + return getFeed(request); + } + + protected Entry getEntry() { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + if (request.getAttribute("entry") instanceof Entry) { + return (Entry) request.getAttribute("entry"); + } + return null; + } + + protected void setEntry(Entry entry) { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + request.setAttribute("entry", entry); + } + + protected void clearEntry() { + setEntry(null); + } + + protected boolean hasEntry() { + return getEntry() != null; + } + +} \ No newline at end of file Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AbstractAbderaHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,75 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.model.Person; + +public class AuthorTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String email; + + private String name; + + private String uri; + + @Override + public int doEndTag() throws JspException { + Person author = getAbdera().getFactory().newAuthor(); + author.setEmail(email); + author.setName(name); + author.setUri(uri); + + if (hasEntry()) { + getEntry().addAuthor(author); + } else { + getFeed().addAuthor(author); + } + + return super.doEndTag(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/AuthorTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,75 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.model.Category; + +public class CategoryTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String label; + + private String scheme; + + private String term; + + @Override + public int doEndTag() throws JspException { + Category category = getAbdera().getFactory().newCategory(); + category.setLabel(label); + category.setScheme(scheme); + category.setTerm(term); + + if (hasEntry()) { + getEntry().addCategory(category); + } else { + getFeed().addCategory(category); + } + + return super.doEndTag(); + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + public String getTerm() { + return term; + } + + public void setTerm(String term) { + this.term = term; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/CategoryTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,39 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +public class ContentTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + @Override + public int doEndTag() throws JspException { + getEntry().setContentAsHtml(getBodyContent().getString()); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContentTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,75 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.model.Person; + +public class ContributorTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String email; + + private String name; + + private String uri; + + @Override + public int doEndTag() throws JspException { + Person contributor = getAbdera().getFactory().newContributor(); + contributor.setEmail(email); + contributor.setName(name); + contributor.setUri(uri); + + if (hasEntry()) { + getEntry().addAuthor(contributor); + } else { + getFeed().addAuthor(contributor); + } + + return super.doEndTag(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/ContributorTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,104 @@ +/* + * 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.sling.atom.taglib; + +import java.util.Date; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.i18n.text.UrlEncoding; +import org.apache.abdera.model.Entry; + +public class EntryTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private boolean draft; + + private Date edited; + + private String id; + + private Date published; + + private Date updated; + + @Override + public int doEndTag() throws JspException { + Entry entry = getEntry(); + if (draft) entry.setDraft(draft); + if (edited != null) entry.setEdited(edited); + if (id != null) entry.setId(UrlEncoding.encode(id)); + if (published != null) entry.setPublished(published); + if (updated != null) entry.setUpdated(updated); + + clearEntry(); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + Entry entry = getFeed().addEntry(); + + setEntry(entry); + return EVAL_BODY_INCLUDE; + } + + public boolean isDraft() { + return draft; + } + + public void setDraft(boolean draft) { + this.draft = draft; + } + + public Date getEdited() { + return edited; + } + + public void setEdited(Date edited) { + this.edited = edited; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Date getPublished() { + return published; + } + + public void setPublished(Date published) { + this.published = published; + } + + public Date getUpdated() { + return updated; + } + + public void setUpdated(Date updated) { + this.updated = updated; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/EntryTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,144 @@ +/* + * 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.sling.atom.taglib; + +import java.io.IOException; +import java.util.Date; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.model.Feed; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.SlingHttpServletResponse; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class FeedTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String baseUri; + + private String icon; + + private String id; + + private String logo; + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo; + } + + private String language; + + private Date updated = new Date(); + + public String getBaseUri() { + return baseUri; + } + + public void setBaseUri(String baseUri) { + this.baseUri = baseUri; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public Date getUpdated() { + return updated; + } + + public void setUpdated(Date updated) { + this.updated = updated; + } + + @Override + public int doEndTag() throws JspException { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + final SlingHttpServletResponse response = TagUtil.getResponse(pageContext); + // get the current feed + Feed feed = getFeed(request); + + // we need tags for that + /* + * feed.addEntry(null); + */ + + // write the feed + try { + response.setContentType("application/atom+xml"); + + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader( + getClass().getClassLoader()); + try { + feed.writeTo(response.getOutputStream()); + } finally { + Thread.currentThread().setContextClassLoader(classLoader); + } + } catch (IOException e) { + throw new JspException("Unable to write feed", e); + } catch (Exception e) { + throw new JspException("Unable to write feed", e); + } + return super.doEndTag(); + } + + @Override + public int doStartTag() { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + // create a feed + Feed feed = getFeed(request); + + // setting basic feed properties + feed.setBaseUri(baseUri); + feed.setIcon(icon); + feed.setId(id); + feed.setLanguage(language); + feed.setLogo(logo); + feed.setUpdated(updated); + + return EVAL_BODY_INCLUDE; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/FeedTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java Mon Jun 8 14:01:19 2009 @@ -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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.BodyContent; + +import org.apache.abdera.model.Generator; + +public class GeneratorTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String uri; + + private String version; + + @Override + public int doEndTag() throws JspException { + Generator generator = getAbdera().getFactory().newGenerator(); + if (uri != null) generator.setUri(uri); + if (version != null) generator.setVersion(version); + BodyContent bc = getBodyContent(); + generator.setText(bc.getString()); + + getFeed().setGenerator(generator); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/GeneratorTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,98 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.model.Link; + +public class LinkTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String href; + + private String rel; + + private String type; + + private String lang; + + private long length; + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public String getRel() { + return rel; + } + + public void setRel(String rel) { + this.rel = rel; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public long getLength() { + return length; + } + + public void setLength(long length) { + this.length = length; + } + + @Override + public int doEndTag() throws JspException { + Link link = getAbdera().getFactory().newLink(); + + link.setHref(href.replaceAll(" ", "%20")); + if (rel != null) link.setRel(rel); + if (type != null) link.setMimeType(type); + if (lang != null) link.setHrefLang(lang); + if (length != 0) link.setLength(length); + + if (hasEntry()) { + getEntry().addLink(link); + } else { + getFeed().addLink(link); + } + + return super.doEndTag(); + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/LinkTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,43 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +public class RightsTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + @Override + public int doEndTag() throws JspException { + if (hasEntry()) { + getEntry().setRightsAsHtml(getBodyContent().getString()); + } else { + getFeed().setRightsAsHtml(getBodyContent().getString()); + } + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/RightsTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,39 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +public class SubtitleTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + @Override + public int doEndTag() throws JspException { + getFeed().setSubtitleAsHtml(getBodyContent().getString()); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SubtitleTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,39 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +public class SummaryTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + @Override + public int doEndTag() throws JspException { + getEntry().setSummaryAsHtml(getBodyContent().getString()); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/SummaryTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,43 @@ +/* + * 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.sling.atom.taglib; + +import javax.servlet.jsp.JspException; + +public class TitleTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + @Override + public int doEndTag() throws JspException { + if (hasEntry()) { + getEntry().setTitleAsHtml(getBodyContent().getString()); + } else { + getFeed().setTitleAsHtml(getBodyContent().getString()); + } + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/TitleTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,90 @@ +/* + * 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.sling.atom.taglib.media; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.ext.media.MediaCategory; +import org.apache.abdera.ext.media.MediaConstants; +import org.apache.abdera.ext.media.MediaContent; +import org.apache.abdera.ext.media.MediaGroup; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.atom.taglib.AbstractAbderaHandler; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class MediaCategoryTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String scheme; + + private String label; + + @Override + public int doEndTag() throws JspException { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + + MediaCategory category; + + if (request.getAttribute("content") != null + && request.getAttribute("content") instanceof MediaContent) { + category = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.CATEGORY); + } else if (request.getAttribute("group") != null + && request.getAttribute("group") instanceof MediaGroup) { + category = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.CATEGORY); + } else if (request.getAttribute("entry") != null + && request.getAttribute("entry") instanceof Entry) { + category = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.CATEGORY); + } else { + category = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.CATEGORY); + } + + // set the body content + category.setText(getBodyContent().getString()); + // set the scheme + if (scheme != null) category.setScheme(scheme); + if (label != null) category.setLabel(label); + + return super.doEndTag(); + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCategoryTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,213 @@ +/* + * 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.sling.atom.taglib.media; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.ext.media.MediaConstants; +import org.apache.abdera.ext.media.MediaContent; +import org.apache.abdera.ext.media.MediaGroup; +import org.apache.abdera.ext.media.MediaConstants.Expression; +import org.apache.abdera.ext.media.MediaConstants.Medium; +import org.apache.abdera.model.Entry; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.atom.taglib.AbstractAbderaHandler; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class MediaContentTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String url; + + private long fileSize; + + private String type; + + private String medium; + + private String isDefault; + + private String expression; + + private int bitrate; + + private double samplingrate; + + private int framerate; + + private int channels; + + private int duration; + + private int height; + + private int width; + + @Override + public int doEndTag() throws JspException { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + // clear out the group + request.setAttribute("content", null); + + return super.doEndTag(); + } + + @Override + public int doStartTag() { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + + MediaContent content; + if (request.getAttribute("group") instanceof MediaGroup) { + MediaGroup group = (MediaGroup) request.getAttribute("group"); + content = group.addExtension(MediaConstants.CONTENT); + } else { + Entry entry = getEntry(); + content = entry.addExtension(MediaConstants.CONTENT); + } + if (url != null) { + content.setUrl(url.replaceAll(" ", "%20")); + } + if (fileSize != 0) { + content.setFilesize(fileSize); + } + if (type != null) { + content.setType(type); + } + if (medium != null) content.setMedium(Medium.valueOf(medium)); + if (expression != null) + content.setExpression(Expression.valueOf(expression)); + if (bitrate != 0) content.setBitrate(bitrate); + if (samplingrate != 0) content.setSamplingRate(samplingrate); + if (framerate != 0) content.setFramerate(framerate); + if (channels != 0) content.setChannels(channels); + if (duration != 0) content.setDuration(duration); + if (height != 0) content.setHeight(height); + if (width != 0) content.setWidth(width); + + request.setAttribute("content", content); + + return EVAL_BODY_INCLUDE; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public long getFileSize() { + return fileSize; + } + + public void setFileSize(long fileSize) { + this.fileSize = fileSize; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMedium() { + return medium; + } + + public void setMedium(String medium) { + this.medium = medium; + } + + public String getIsDefault() { + return isDefault; + } + + public void setIsDefault(String isDefault) { + this.isDefault = isDefault; + } + + public String getExpression() { + return expression; + } + + public void setExpression(String expression) { + this.expression = expression; + } + + public int getBitrate() { + return bitrate; + } + + public void setBitrate(int bitrate) { + this.bitrate = bitrate; + } + + public double getSamplingrate() { + return samplingrate; + } + + public void setSamplingrate(double samplingrate) { + this.samplingrate = samplingrate; + } + + public int getFramerate() { + return framerate; + } + + public void setFramerate(int framerate) { + this.framerate = framerate; + } + + public int getChannels() { + return channels; + } + + public void setChannels(int channels) { + this.channels = channels; + } + + public int getDuration() { + return duration; + } + + public void setDuration(int duration) { + this.duration = duration; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaContentTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,79 @@ +/* + * 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.sling.atom.taglib.media; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.ext.media.MediaConstants; +import org.apache.abdera.ext.media.MediaContent; +import org.apache.abdera.ext.media.MediaCopyright; +import org.apache.abdera.ext.media.MediaGroup; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.atom.taglib.AbstractAbderaHandler; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class MediaCopyrightTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String url; + + @Override + public int doEndTag() throws JspException { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + + MediaCopyright copyright; + + if (request.getAttribute("content") != null + && request.getAttribute("content") instanceof MediaContent) { + copyright = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.COPYRIGHT); + } else if (request.getAttribute("group") != null + && request.getAttribute("group") instanceof MediaGroup) { + copyright = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.COPYRIGHT); + } else if (request.getAttribute("entry") != null + && request.getAttribute("entry") instanceof Entry) { + copyright = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.COPYRIGHT); + } else { + copyright = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.COPYRIGHT); + } + + // set the body content + copyright.setText(getBodyContent().getString()); + // set the scheme + if (url != null) copyright.setUrl(url); + + return super.doEndTag(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +} Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCopyrightTagHandler.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCreditTagHandler.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCreditTagHandler.java?rev=782630&view=auto ============================================================================== --- incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCreditTagHandler.java (added) +++ incubator/sling/trunk/contrib/scripting/jsp-taglib-atom/src/main/java/org/apache/sling/atom/taglib/media/MediaCreditTagHandler.java Mon Jun 8 14:01:19 2009 @@ -0,0 +1,90 @@ +/* + * 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.sling.atom.taglib.media; + +import javax.servlet.jsp.JspException; + +import org.apache.abdera.ext.media.MediaConstants; +import org.apache.abdera.ext.media.MediaContent; +import org.apache.abdera.ext.media.MediaCredit; +import org.apache.abdera.ext.media.MediaGroup; +import org.apache.abdera.model.Entry; +import org.apache.abdera.model.Feed; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.atom.taglib.AbstractAbderaHandler; +import org.apache.sling.scripting.jsp.util.TagUtil; + +public class MediaCreditTagHandler extends AbstractAbderaHandler { + + private static final long serialVersionUID = 1L; + + private String scheme; + + private String role; + + @Override + public int doEndTag() throws JspException { + final SlingHttpServletRequest request = TagUtil.getRequest(pageContext); + + MediaCredit credit; + + if (request.getAttribute("content") != null + && request.getAttribute("content") instanceof MediaContent) { + credit = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.CREDIT); + } else if (request.getAttribute("group") != null + && request.getAttribute("group") instanceof MediaGroup) { + credit = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.CREDIT); + } else if (request.getAttribute("entry") != null + && request.getAttribute("entry") instanceof Entry) { + credit = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.CREDIT); + } else { + credit = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.CREDIT); + } + + // set the body content + credit.setText(getBodyContent().getString()); + // set the scheme + if (scheme != null) credit.setScheme(scheme); + if (role != null) credit.setRole(role); + + return super.doEndTag(); + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getScheme() { + return scheme; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + @Override + public int doStartTag() { + return EVAL_BODY_BUFFERED; + } + +}