abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takasho <taka...@gmail.com>
Subject Re: How do I add app:accept to a collection?
Date Tue, 22 Jan 2008 13:18:10 GMT
Hi David,

It looks like I had my terminology wrong. Thanks for the examples I
will use the collection class instead as that was what I was trying to
achieve.

Thanks,

Takasho

On 22/01/2008, David Calavera <david.calavera@gmail.com> wrote:
> Hi Takasho,
>
> the easiest way to add an extension to a feed is using the
> "addSimpleExtension" method:
>
>     feed.addSimpleExtension(QName, value);
>     feed.addSimpleExtension(namespace, element_name, preffix, value);
>
> By the way, why do you want to add the accept element to a feed?
> If you are trying to create a service document you should use the Collection
> class. I.e:
>
> Service service = new Abdera().getFactory().getService();
> Workspace ws = service.addWorkspace("title");
> Collection cn = ws.addCollection("title", "url");
> *cn.setAccept(Strings array);
>
> *Regards.
>
> On Jan 22, 2008 12:18 PM, Takasho <takasho@gmail.com> wrote:
>
> > Hi All,
> >
> > Just a quick mail to ask how I add the app:accept element to a
> > feed/collection.
> >
> > I have looked through the online docs and the atompub spec to find
> > that it should be regarded as external markup but I haven't found an
> > explanation on how to add it to a feed I am creating with Abdera.
> >
> > Very simply:
> >
> > Abdera abdera = new Abdera();
> > Factory factory = abdera.getFactory();
> > Feed feed = factory.newFeed();
> > feed.addAuthor("Takasho");
> > feed.setTitle("sample");
> > feed.addCategory("Category1");
> > feed.addCategory("Category2");
> > feed.addCategory("Category3");
> > // Now add app:accept
> >
> > I am assuming it is done with Qnames and extensions but I've not been
> > able to generate what I want, such as:
> >
> > <app:accept>application/xml,image/jpeg,image/png</app:accept>
> >
> > Along with appropriate xmlns added to the top feed element:
> >
> > <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="
> > http://purl.org/atom/app#">
> >
> > I think thats right, please correct me if I'm wrong,
> >
> > Thanks,
> >
> > Takasho
> >
>
>
>
> --
> David Calavera
> http://www.thinkincode.net
>

Mime
View raw message