Search This Site

Custom Search

Sunday, November 28, 2010

[bloggerDev] Re: java-client library ( attribute and value parsing )

My content class looks like this.

public class Content {
@Key("@type")
public String type;
// get the src value here.
@Key("@src")
public String src;
// I WANT THE CONTENT VALUE HERE NOT SURE HOW TO GET IT ?
public String contentvalue;
}

After making a GET request i would like to parse it like.

// works.
String lBlogId = EntryValues.id;

// works
String ltitleString =EntryValues.title;

// @todo THIS IS NOT CLEAR.
String content = EntryValues.content.contentvalue;

// works
String lAuthorName = EntryValues.author.name;

//works.
String type=EntryValues.content.type;


Entry class looks like this.

public class BloggerEntry extends Entry {

@Key("published")
public String published;

@Key("summary")
public String summary;

@Key("id")
public String id;

// this will store the content description here.
// this needs to be checked out. using it as only strings works.
@Key("content")
public Content content;

@Key("updated")
public String updated;
}


public class Entry implements Cloneable {

@Key("@gd:etag")
public String etag;

@Key("link")
public List<Link> links;

@Key("title")
public String title;

@Key("author")
public Author author;
}


regards,
ravinder chouhan


On Nov 28, 1:56 am, Brett Morgan <brettmor...@google.com> wrote:
> Hi Ravinder,
>
> Can you supply a cut down version of your code so I can better understand
> what you are asking?
>
> brett
>
> On Sun, Nov 28, 2010 at 2:44 AM, Ravinder <ravinder.chou...@gmail.com>wrote:
>
>
>
> > Hi,
>
> > I am using "data-java-client" to work with blogger feeds.  I would
> > like to parse the <content> tag, both the attibute "type", "src" and
> > value.
>
> > I have made a new class to work with feeds. I can retrieve the "type"
> > by making a String variable key to ("@type"), but i am not sure how to
> > get the content value ?
>
> > Any pointers would be of great help in this regard.
>
> > thanks.
> > ravinder chouhan
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Blogger Developer Group" group.
> > To post to this group, send email to bloggerdev@googlegroups.com.
> > To unsubscribe from this group, send email to
> > bloggerdev+unsubscribe@googlegroups.com<bloggerdev%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/bloggerdev?hl=en.
>
> --
> Brett Morgan
>
> *Developer Programs Engineer, Blogger*

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment