aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/examples/metaWeblog/apis
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-11-21 15:17:04 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-11-21 15:17:04 +0000
commit9b83e3396180d0dbcb23ec3d71adb198eae7629b (patch)
tree01ea5352514acfede892ada48c58ec7f28be2a8e /actionwebservice/examples/metaWeblog/apis
parent440f2890af5462402d1a77daaf1751a66742b974 (diff)
downloadrails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.tar.gz
rails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.tar.bz2
rails-9b83e3396180d0dbcb23ec3d71adb198eae7629b.zip
Ousted ActionWebService from Rails 2.0
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/examples/metaWeblog/apis')
-rw-r--r--actionwebservice/examples/metaWeblog/apis/blogger_api.rb60
-rw-r--r--actionwebservice/examples/metaWeblog/apis/blogger_service.rb34
-rw-r--r--actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb67
-rw-r--r--actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb48
4 files changed, 0 insertions, 209 deletions
diff --git a/actionwebservice/examples/metaWeblog/apis/blogger_api.rb b/actionwebservice/examples/metaWeblog/apis/blogger_api.rb
deleted file mode 100644
index 9f85a2391e..0000000000
--- a/actionwebservice/examples/metaWeblog/apis/blogger_api.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# see the blogger API spec at http://www.blogger.com/developers/api/1_docs/
-# note that the method signatures are subtly different to metaWeblog, they
-# are not identical. take care to ensure you handle the different semantics
-# properly if you want to support blogger API too, to get maximum compatibility.
-#
-
-module Blog
- class Blog < ActionWebService::Struct
- member :url, :string
- member :blogid, :string
- member :blogName, :string
- end
-
- class User < ActionWebService::Struct
- member :nickname, :string
- member :userid, :string
- member :url, :string
- member :email, :string
- member :lastname, :string
- member :firstname, :string
- end
-end
-
-#
-# blogger
-#
-class BloggerAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :newPost, :returns => [:string], :expects => [
- {:appkey=>:string},
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:content=>:string},
- {:publish=>:bool}
- ]
-
- api_method :editPost, :returns => [:bool], :expects => [
- {:appkey=>:string},
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:content=>:string},
- {:publish=>:bool}
- ]
-
- api_method :getUsersBlogs, :returns => [[Blog::Blog]], :expects => [
- {:appkey=>:string},
- {:username=>:string},
- {:password=>:string}
- ]
-
- api_method :getUserInfo, :returns => [Blog::User], :expects => [
- {:appkey=>:string},
- {:username=>:string},
- {:password=>:string}
- ]
-end
diff --git a/actionwebservice/examples/metaWeblog/apis/blogger_service.rb b/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
deleted file mode 100644
index b79b53e6f7..0000000000
--- a/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'blogger_api'
-
-class BloggerService < ActionWebService::Base
- web_service_api BloggerAPI
-
- def initialize
- @postid = 0
- end
-
- def newPost(key, id, user, pw, content, publish)
- $stderr.puts "id=#{id} user=#{user} pw=#{pw}, content=#{content.inspect} [#{publish}]"
- (@postid += 1).to_s
- end
-
- def editPost(key, post_id, user, pw, content, publish)
- $stderr.puts "id=#{post_id} user=#{user} pw=#{pw} content=#{content.inspect} [#{publish}]"
- true
- end
-
- def getUsersBlogs(key, user, pw)
- $stderr.puts "getting blogs for #{user}"
- blog = Blog::Blog.new(
- :url =>'http://blog',
- :blogid => 'myblog',
- :blogName => 'My Blog'
- )
- [blog]
- end
-
- def getUserInfo(key, user, pw)
- $stderr.puts "getting user info for #{user}"
- Blog::User.new(:nickname => 'user', :email => 'user@test.com')
- end
-end
diff --git a/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb b/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb
deleted file mode 100644
index adef12a20f..0000000000
--- a/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# here lie structures, cousins of those on http://www.xmlrpc.com/metaWeblog
-# but they don't necessarily the real world reflect
-# so if you do, find that your client complains:
-# please tell, of problems you suffered through
-#
-
-module Blog
- class Post < ActionWebService::Struct
- member :title, :string
- member :link, :string
- member :description, :string
- member :author, :string
- member :category, :string
- member :comments, :string
- member :guid, :string
- member :pubDate, :string
- end
-
- class Category < ActionWebService::Struct
- member :description, :string
- member :htmlUrl, :string
- member :rssUrl, :string
- end
-end
-
-#
-# metaWeblog
-#
-class MetaWeblogAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :newPost, :returns => [:string], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:struct=>Blog::Post},
- {:publish=>:bool}
- ]
-
- api_method :editPost, :returns => [:bool], :expects => [
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:struct=>Blog::Post},
- {:publish=>:bool},
- ]
-
- api_method :getPost, :returns => [Blog::Post], :expects => [
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- ]
-
- api_method :getCategories, :returns => [[Blog::Category]], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- ]
-
- api_method :getRecentPosts, :returns => [[Blog::Post]], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:numberOfPosts=>:int},
- ]
-end
diff --git a/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb b/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb
deleted file mode 100644
index 9c66558f1b..0000000000
--- a/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'meta_weblog_api'
-
-class MetaWeblogService < ActionWebService::Base
- web_service_api MetaWeblogAPI
-
- def initialize
- @postid = 0
- end
-
- def newPost(id, user, pw, struct, publish)
- $stderr.puts "id=#{id} user=#{user} pw=#{pw}, struct=#{struct.inspect} [#{publish}]"
- (@postid += 1).to_s
- end
-
- def editPost(post_id, user, pw, struct, publish)
- $stderr.puts "id=#{post_id} user=#{user} pw=#{pw} struct=#{struct.inspect} [#{publish}]"
- true
- end
-
- def getPost(post_id, user, pw)
- $stderr.puts "get post #{post_id}"
- Blog::Post.new(:title => 'hello world', :description => 'first post!')
- end
-
- def getCategories(id, user, pw)
- $stderr.puts "categories for #{user}"
- cat = Blog::Category.new(
- :description => 'Tech',
- :htmlUrl => 'http://blog/tech',
- :rssUrl => 'http://blog/tech.rss')
- [cat]
- end
-
- def getRecentPosts(id, user, pw, num)
- $stderr.puts "recent #{num} posts for #{user} on blog #{id}"
- post1 = Blog::Post.new(
- :title => 'first post!',
- :link => 'http://blog.xeraph.org/testOne.html',
- :description => 'this is the first post'
- )
- post2 = Blog::Post.new(
- :title => 'second post!',
- :link => 'http://blog.xeraph.org/testTwo.html',
- :description => 'this is the second post'
- )
- [post1, post2]
- end
-end