{"id":2091,"date":"2010-12-30T12:10:08","date_gmt":"2010-12-30T03:10:08","guid":{"rendered":"http:\/\/www.studioeth.net\/ethBlog\/?p=807"},"modified":"2010-12-30T12:10:08","modified_gmt":"2010-12-30T03:10:08","slug":"flickr-api-%e3%82%92-gwt-2-1-%e3%81%a7%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/inage.ksd6700.net\/?p=2091","title":{"rendered":"Flickr API \u3092 GWT 2.1 \u3067\u4f7f\u7528\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>\n\u6700\u8fd1\u3001<a href=\"http:\/\/oxoxo.me\/\" >oxoxo [\u30bc\u30ed\u30d0\u30a4\u30bc\u30ed]<\/a>\u306e\u30b5\u30a4\u30c8\u3092\u6d41\u884c\u308a\u306eHTML5\uff06GWT\u3067\u3064\u304f\u308d\u3046\u3068\u596e\u95d8\u4e2d\u3002\u305d\u306e\u5099\u5fd8\u9332\u3002<br \/>\n\u25a0Google Web Toolkit 2.1.1\u3067\u3001JSONP \u3092\u5229\u7528\u3057\u3066\u3001flickr\u3078\u306e\u547c\u3073\u51fa\u3057\uff08photoset\u306e\u53d6\u5f97\uff09\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3002<\/p>\n<h4>\u30fb\u6e96\u5099<\/h4>\n<p>\u203bGWT\u3067JSONP\u3092\u4f7f\u3046\u65b9\u6cd5\u306f\u3001<\/p>\n<p><a href=\"http:\/\/google-web-toolkit.googlecode.com\/svn\/javadoc\/2.0\/com\/google\/gwt\/jsonp\/client\/JsonpRequestBuilder.html\">http:\/\/google-web-toolkit.googlecode.com\/svn\/javadoc\/2.0\/com\/google\/gwt\/jsonp\/client\/JsonpRequestBuilder.html<\/a><a href=\"http:\/\/google-web-toolkit.googlecode.com\/svn\/javadoc\/2.0\/com\/google\/gwt\/jsonp\/client\/JsonpRequestBuilder.html\"><br \/>\n<\/a><\/p>\n<p>&lt;ProjectName&gt;.gwt.xml\u306b\u3001\n<\/p>\n<blockquote>\n<p>&lt;inherits name=&#8217;com.google.gwt.jsonp.Jsonp&#8217;\/&gt;<\/p>\n<\/blockquote>\n<p>\n\u3092\u8ffd\u52a0\u3059\u308b\u3002\u305d\u3046\u3057\u306a\u3044\u3068\u3001\n<\/p>\n<blockquote>\n<p><pre>No source code is available for type\ncom.google.gwt.jsonp.client.JsonpRequestBuilder; did you forget to inherit\na required module?\n<\/pre>\n<\/p>\n<\/blockquote>\n<p><pre>\u3068\u3001\u5b9f\u884c\u6642\u306b\u6012\u3089\u308c\u308b\u3002\u6700\u521d\u3001web.xml\u306b\u8ffd\u52a0\u3057\u3066\u3044\u3066\u30cf\u30de\u3063\u305f\u3002\u3002\n<\/pre>\n<h4>\u30fb\u547c\u3073\u51fa\u3057<\/h4>\n<p><\/p>\n<div class=\"codecolorer-container java default\" style=\"overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;\">\n<div class=\"java codecolorer\" style=\"padding:5px;font:normal 12px\/1.4em Monaco, Lucida Console, monospace;white-space:nowrap\">JsonpRequestBuilder builder <span style=\"color: #339933;\">=<\/span> <span style=\"color: #000000; font-weight: bold;\">new<\/span> JsonpRequestBuilder<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><\/p>\n<p>builder.<span style=\"color: #006633;\">setCallbackParam<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">&quot;jsoncallback&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ [1]<\/span><\/p>\n<p>builder.<span style=\"color: #006633;\">requestObject<\/span><span style=\"color: #009900;\">&#40;<\/span>FLICKR_PHOTOSET_URL, <span style=\"color: #666666; font-style: italic;\">\/\/ [2]<\/span><br \/>\n<span style=\"color: #000000; font-weight: bold;\">new<\/span> AsyncCallback<span style=\"color: #339933;\">&amp;<\/span>lt<span style=\"color: #339933;\">;<\/span>FlickrRsp<span style=\"color: #339933;\">&amp;<\/span>gt<span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span><\/p>\n<p><span style=\"color: #000000; font-weight: bold;\">public<\/span> <span style=\"color: #000066; font-weight: bold;\">void<\/span> onFailure<span style=\"color: #009900;\">&#40;<\/span><a href=\"http:\/\/www.google.com\/search?hl=en&amp;q=allinurl%3Athrowable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky\"><span style=\"color: #003399;\">Throwable<\/span><\/a> caught<span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span><br \/>\n<span style=\"color: #666666; font-style: italic;\">\/\/&#8230;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><\/p>\n<p><span style=\"color: #000000; font-weight: bold;\">public<\/span> <span style=\"color: #000066; font-weight: bold;\">void<\/span> onSuccess<span style=\"color: #009900;\">&#40;<\/span>FlickrRsp result<span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span><br \/>\nJsArray<span style=\"color: #339933;\">&amp;<\/span>lt<span style=\"color: #339933;\">;<\/span>FlickrPhoto<span style=\"color: #339933;\">&amp;<\/span>gt<span style=\"color: #339933;\">;<\/span> photos <span style=\"color: #339933;\">=<\/span> result.<span style=\"color: #006633;\">getPhotos<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<a href=\"http:\/\/www.google.com\/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky\"><span style=\"color: #003399;\">String<\/span><\/a> debugOut <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000ff;\">&quot;ids: &quot;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #000000; font-weight: bold;\">for<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000066; font-weight: bold;\">int<\/span> i<span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #339933;\">;<\/span> i <span style=\"color: #339933;\">&amp;<\/span>lt<span style=\"color: #339933;\">;<\/span> photos.<span style=\"color: #006633;\">length<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> i<span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span><br \/>\nFlickrPhoto photo <span style=\"color: #339933;\">=<\/span> photos.<span style=\"color: #006633;\">get<\/span><span style=\"color: #009900;\">&#40;<\/span>i<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\ndebugOut <span style=\"color: #339933;\">+=<\/span> photo.<span style=\"color: #006633;\">getId<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><br \/>\ndbgLabel.<span style=\"color: #006633;\">setText<\/span><span style=\"color: #009900;\">&#40;<\/span>debugOut<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\ndbgLabel.<span style=\"color: #006633;\">setVisible<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000066; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><\/p>\n<p><span style=\"color: #009900;\">&#125;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><br \/>\n<span style=\"color: #666666; font-style: italic;\">\/\/&#8230;<\/span><\/div>\n<\/div>\n<p>\n[1]callback\u95a2\u6570\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>\u7406\u7531\uff1a<\/p>\n<p>\u4f8b\u3048\u3070[2]\u3067\u30bb\u30c3\u30c8\u3059\u308bURL\u3092\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u305f\u3068\u3059\u308b\u3002<\/p>\n<div class=\"codecolorer-container java default\" style=\"overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;\">\n<div class=\"java codecolorer\" style=\"padding:5px;font:normal 12px\/1.4em Monaco, Lucida Console, monospace;white-space:nowrap\"><span style=\"color: #000000; font-weight: bold;\">static<\/span> <span style=\"color: #000000; font-weight: bold;\">final<\/span> <a href=\"http:\/\/www.google.com\/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky\"><span style=\"color: #003399;\">String<\/span><\/a> FLICKR_PHOTOSET_URL <span style=\"color: #339933;\">=<\/span><br \/>\n<span style=\"color: #0000ff;\">&quot;http:\/\/api.flickr.com\/services\/rest\/?method=flickr.photosets.getPhotos&amp;amp;format=json&amp;amp;api_key=xx&amp;amp;photoset_id=xx&quot;<\/span><span style=\"color: #339933;\">;<\/span><\/div>\n<\/div>\n<p>\n\u3059\u308b\u3068\u3001GWT\u306f\u5b9f\u884c\u6642\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306aHTTP GET\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u884c\u3059\u308b\u3002fireBug\u3068CocoaPacketAnalyzer\u3067\u78ba\u8a8d\u3002\n<\/p>\n<blockquote>\n<p>GET \/services\/rest\/?method=flickr.photosets.getPhotos&amp;format=json&amp;api_key=xx&amp;photoset_id=xx&amp;callback=__gwt_jsonp__.I0.onSuccess<\/p>\n<\/blockquote>\n<p>\n\u8981\u306f\u3001\u672b\u5c3e\u306bcallback\u3092\u6307\u5b9a\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u52dd\u624b\u306b\u4ed8\u52a0\u3059\u308b\u3089\u3057\u3044\u3002<br \/>\n\u3057\u304b\u3057\u3001flickr API\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u540d\u306f\u3001jsonFlickrApi \u306a\u306e\u3067\u3001\u95a2\u6570\u540d\u304c\u4e00\u81f4\u305b\u305a\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u547c\u3073\u51fa\u3055\u308c\u305a\u3001TIMEOUT\u3057\u3066\u3057\u307e\u3046\u3002onFailure() \u304c\u547c\u3070\u308c\u308b\u3002\n<\/p>\n<blockquote>\n<p>Failed to send the message. Timeout while calling &lt;url&gt;.<\/p>\n<\/blockquote>\n<p>\n\u305d\u306e\u305f\u3081\u3001\u5148\u8ff0\u306esetCallbackParam\u3067\u3001&#8221;jsoncallback&#8221;\u3092\u5165\u308c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<br \/>\njsoncallback \u306b\u3064\u3044\u3066\u306f\u3001 http:\/\/www.flickr.com\/services\/api\/response.json.html<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aHTTP GET\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u884c\u3055\u308c\u3001onSuccess() \u304c\u30b3\u30fc\u30eb\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002\n<\/p>\n<blockquote>\n<p>GET \/services\/rest\/?method=flickr.photosets.getPhotos&amp;format=json&amp;api_key=xx&amp;photoset_id=xx&amp;jsoncallback=__gwt_jsonp__.I0.onSuccess<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>&#26368;&#36817;&#12289;oxoxo [&#12476;&#12525;&#12496;&#12452;&#12476;&#12525;]&#12398;&#12469;&#12452;&#12488;&#12434;&#27969;&#34892;&#12426;&#12398;HTML5&#65286;GWT&#12391;&#12388;&#12367;&#12429;&#12358;&#12392;&#22894;&#38360;&#20013;&#12290;&#12381;&#12398;&#20633;&#24536;&#37682;&#12290; &#9632;Google Web Toolkit 2.1.1&#12391;&#12289;JSONP &#12434;&#21033;&#29992;&#12375;&#12390;&#12289;flickr&#12408;&#12398;&#21628;&#12403;&#20986;&#12375;&#65288;photos &hellip; <a href=\"http:\/\/iida.work\/ethBlog\/?p=807\">&#32154;&#12365;&#12434;&#35501;&#12416; <span>Flickr API &#12434; GWT 2.1 &#12391;&#20351;&#29992;&#12375;&#12390;&#12415;&#12427;<\/span> <span>&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts\/2091"}],"collection":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2091"}],"version-history":[{"count":4,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts\/2091\/revisions"}],"predecessor-version":[{"id":4369,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=\/wp\/v2\/posts\/2091\/revisions\/4369"}],"wp:attachment":[{"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inage.ksd6700.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}