Re: Passing URL parameters to a feed component?

2008-03-25 Thread Skip Schuler
Thanks much, appreciate the clarification! This looks like a programming
model I can work with :-)

On 3/22/08, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote:

 Skip Schuler wrote:
  So the thing is that I need to implement the Servlet interface, is that
  right?
 


 No you don't need to implement the Servlet interface. The workspace
 admin app does more than producing feeds and that's why it implements
 the Servlet interface in addition to the Collection interface used to
 produce feeds.

 The following options are available for what you want to do:

 A. Implement o.a.t.sca.implementation.data.api.Collection

 This is a high level interface allowing you to produce feeds out of
 collections of data items, without having to deal with the details of
 ATOM or RSS in your code.

 It has a query method, which will be invoked when the service is invoked
 with query parameters.

 The Tuscany tutorial's ShoppingCart [1] shows an example, I just added
 code to it showing how to implement that query() method.

 B. Implement o.a.t.sca.binding.atom.collection.Collection

 That interface allows you to work with the ATOM feed directly if you
 need to, represented as an o.a.abdera.model.Feed model object. It also
 has a query method.

 The feed-aggregator sample [2] shows how to implement that query method,
 and http://localhost:8083/atomAggregator?title=whatever now returns a
 feed of articles with titles containing 'whatever'.

 C. Implement o.a.t.sca.binding.rss.collection.Collection to produce RSS
 feeds and in your code work with the RSS feed directly, represented as
 com.sun.syndication.feed.synd.SyndFeed model objects.

 This is similar to (B) but for RSS feeds, with a query method as well.

 Options (B) and (C) are available starting with Tuscany 1.2 release,
 which we are in the middle of releasing. I'd suggest to try 1.2 release
 candidate 1 as soon as it's available (probably today watch for any
 announcement from Luciano).

 You'll see notable changes in 1.2 as it now uses Apache Abdera instead
 of ROME to provide better support for ATOM.

 [1]

 http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/tutorial/assets/services/ShoppingCartImpl.java
 [2]

 http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator/src/main/java/feed/AggregatorImpl.java
 --

 Jean-Sebastien


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Passing URL parameters to a feed component?

2008-03-22 Thread Jean-Sebastien Delfino

Skip Schuler wrote:

So the thing is that I need to implement the Servlet interface, is that
right?



No you don't need to implement the Servlet interface. The workspace 
admin app does more than producing feeds and that's why it implements 
the Servlet interface in addition to the Collection interface used to 
produce feeds.


The following options are available for what you want to do:

A. Implement o.a.t.sca.implementation.data.api.Collection

This is a high level interface allowing you to produce feeds out of 
collections of data items, without having to deal with the details of 
ATOM or RSS in your code.


It has a query method, which will be invoked when the service is invoked 
with query parameters.


The Tuscany tutorial's ShoppingCart [1] shows an example, I just added 
code to it showing how to implement that query() method.


B. Implement o.a.t.sca.binding.atom.collection.Collection

That interface allows you to work with the ATOM feed directly if you 
need to, represented as an o.a.abdera.model.Feed model object. It also 
has a query method.


The feed-aggregator sample [2] shows how to implement that query method, 
and http://localhost:8083/atomAggregator?title=whatever now returns a 
feed of articles with titles containing 'whatever'.


C. Implement o.a.t.sca.binding.rss.collection.Collection to produce RSS 
feeds and in your code work with the RSS feed directly, represented as 
com.sun.syndication.feed.synd.SyndFeed model objects.


This is similar to (B) but for RSS feeds, with a query method as well.

Options (B) and (C) are available starting with Tuscany 1.2 release, 
which we are in the middle of releasing. I'd suggest to try 1.2 release 
candidate 1 as soon as it's available (probably today watch for any 
announcement from Luciano).


You'll see notable changes in 1.2 as it now uses Apache Abdera instead 
of ROME to provide better support for ATOM.


[1] 
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/tutorial/assets/services/ShoppingCartImpl.java
[2] 
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/feed-aggregator/src/main/java/feed/AggregatorImpl.java

--
Jean-Sebastien

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Passing URL parameters to a feed component?

2008-03-21 Thread Raymond Feng

Hi,

Let's assume you have a service exposed over feed binding as follows:

component name=...
   implementation.java class=test.MyServiceImpl/
   service name=...
   tuscany:binding.rss uri=http://localhost:8083/rssAggregator/
   /service
/component

Do you expect that your component impl test.MyServiceImpl gets the 
parameters from the URL and provide functions based on the parameters? For 
example, http://localhost:8083/rssAggregator?p1=v1p2=v2, are you looking 
for a way to make p1 and p2 available to test.MyServiceImpl?


Thanks,
Raymond
--
From: Skip Schuler [EMAIL PROTECTED]
Sent: Thursday, March 20, 2008 3:49 PM
To: tuscany-user tuscany-user@ws.apache.org
Subject: Passing URL parameters to a feed component?


Hi,

I have some data I want to expose as a feed (atom/rss). I've seen the
feed-aggregator-sample, and it works great. Here's my question:

How can I pass a URL parameter to my feed implementation? I'd like to 
adapt
the feed based on some URL parameter, but am a bit unsure how to best 
access

it from inside the feed component.


Thanks,
Skip



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Passing URL parameters to a feed component?

2008-03-21 Thread Skip Schuler
Hi,

Raymond, you are right, that is exactly what I'm looking for (e.g. to
personalize the feed, or take some value from a page and pass to the feed).

Where can I find workspace-admin and this CompositeImageCollectionImpl? I
can not see it in the 1.1-incubating distribution.


Thanks,
Skip

On Fri, Mar 21, 2008 at 11:11 AM, Luciano Resende [EMAIL PROTECTED]
wrote:

 We do have some support for passing queryStrings today on the atom
 binding. See workspace-admin, probably around
 CompositeImageCollectionImpl.java.

 On Fri, Mar 21, 2008 at 10:58 AM, Raymond Feng [EMAIL PROTECTED]
 wrote:
  Hi,
 
   Let's assume you have a service exposed over feed binding as follows:
 
   component name=...
  implementation.java class=test.MyServiceImpl/
  service name=...
  tuscany:binding.rss uri=http://localhost:8083/rssAggregator/
  /service
   /component
 
   Do you expect that your component impl test.MyServiceImpl gets the
   parameters from the URL and provide functions based on the parameters?
 For
   example, http://localhost:8083/rssAggregator?p1=v1p2=v2, are you
 looking
   for a way to make p1 and p2 available to test.MyServiceImpl?
 
   Thanks,
   Raymond
   --
   From: Skip Schuler [EMAIL PROTECTED]
   Sent: Thursday, March 20, 2008 3:49 PM
   To: tuscany-user tuscany-user@ws.apache.org
   Subject: Passing URL parameters to a feed component?
 
 
 
Hi,
   
I have some data I want to expose as a feed (atom/rss). I've seen the
feed-aggregator-sample, and it works great. Here's my question:
   
How can I pass a URL parameter to my feed implementation? I'd like to
adapt
the feed based on some URL parameter, but am a bit unsure how to best
access
it from inside the feed component.
   
   
Thanks,
Skip
   
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 --
 Luciano Resende
 Apache Tuscany Committer
 http://people.apache.org/~lresende http://people.apache.org/%7Elresende
 http://lresende.blogspot.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]