Java Reference
In-Depth Information
flexibility as required by Flickr's feeds. With that said, we can now safely
take a look at the ok() function, called by the syndication service upon
successful completion of the download:
{
void ok(Object state, Value ret)
int x, int y = getScreenSize();
Flow content = new Flow(getStyle("default"));
content.setPreferredSize(-100, -100);
content.add(createHeaderText("Search results:"));
foreach (Value item : ret) {
Picture pict = getPicture(item.content[3][1][1].url,
x - 10, y - (y/3), "png8");
pict.setFlags(LINEFEED | VISIBLE);
content.add(pict);
addText(content,"Author: " + item.author);
}
prompt.pop();
Shell shell = new Shell(content);
shell.setStyle(getStyle("maxi"));
pushShell(shell);
current = null;
shell.updateMenu();
}
As the download finishes, the service calls ok() passing in a Value
object that contains the entire feed, already parsed and transformed
into a nice in-memory object tree, which you can navigate using the
standard object.property notation. Here is how each item looks in
the memory:
iid=51fcc129779ccb934a63c910fd529e6d,
title=l_c27c2a5980eb5b47e3762c1473af9788,
link=http://www.flickr.com/photos/27243990@N04/2785553064/,
created=1219359794000,
modified=1219359779013,
author=erika.chavez14,
content=(
type=page,
pg=1,
left=0,
val=(
erika.chavez14 posted a photo:,
(type=image,
url=farm4.static.flickr.com/3093/2785553064_e9ea28b5fa_m.jpg,
width=240,
height=180),
(type=image,
url=farm4.static.flickr.com/3093/2785553064_d0494e50db_o.jpg)
)
)
Search WWH ::




Custom Search