1: public class MetaWeblogHandler:XmlRpcService,IMetaWeblog,IBlogger
2: { 3: #region Constructor
4: public MetaWeblogHandler()
5: { 6: }
7: #endregion
8:
9: #region IMetaWeblog Members
10:
11: public object editPost(string postid, string username, string password, CookComputing.MetaWeblog.Post post, bool publish)
12: { 13: try
14: { 15: if (System.Web.Security.Membership.ValidateUser(username, password))
16: { 17: //edits a post
18: }
19: }
20: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 21: throw new XmlRpcFaultException(0, "User name or password is invalid");
22: }
23:
24: public CategoryInfo[] getCategories(string blogid, string username, string password)
25: { 26: try
27: { 28: if (System.Web.Security.Membership.ValidateUser(username, password))
29: { 30: //Gets the list of categories
31: }
32: }
33: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 34: throw new XmlRpcFaultException(0, "User name or password is invalid");
35: }
36:
37: public CookComputing.MetaWeblog.Post getPost(string postid, string username, string password)
38: { 39: try
40: { 41: if (System.Web.Security.Membership.ValidateUser(username, password))
42: { 43: //Get a single post
44: }
45: }
46: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 47: throw new XmlRpcFaultException(0, "User name or password is invalid");
48: }
49:
50: public CookComputing.MetaWeblog.Post[] getRecentPosts(string blogid, string username, string password, int numberOfPosts)
51: { 52: try
53: { 54: if (System.Web.Security.Membership.ValidateUser(username, password))
55: { 56: //Get a list of recent posts
57: }
58: }
59: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 60: throw new XmlRpcFaultException(0, "User name or password is invalid");
61: }
62:
63: public string newPost(string blogid, string username, string password, CookComputing.MetaWeblog.Post post, bool publish)
64: { 65: try
66: { 67: if (System.Web.Security.Membership.ValidateUser(username, password))
68: { 69: //add a new post
70: }
71: }
72: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 73: throw new XmlRpcFaultException(0, "User name or password is invalid");
74: }
75:
76: public UrlData newMediaObject(string blogid, string username, string password, FileData file)
77: { 78: try
79: { 80: if (System.Web.Security.Membership.ValidateUser(username, password))
81: { 82: //Add the item to your site
83: }
84: }
85: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 86: throw new XmlRpcFaultException(0, "User name or password is invalid");
87: }
88:
89: #endregion
90:
91: #region IBlogger Members
92:
93: public bool deletePost(string appKey, string postid, string username, string password, bool publish)
94: { 95: try
96: { 97: if (System.Web.Security.Membership.ValidateUser(username, password))
98: { 99: //delete the post
100: }
101: }
102: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 103: throw new XmlRpcFaultException(0, "User name or password is invalid");
104: }
105:
106: public object editPost(string appKey, string postid, string username, string password, string content, bool publish)
107: { 108: throw new NotImplementedException();
109: }
110:
111: CookComputing.Blogger.Category[] IBlogger.getCategories(string blogid, string username, string password)
112: { 113: throw new NotImplementedException();
114: }
115:
116: public CookComputing.Blogger.Post getPost(string appKey, string postid, string username, string password)
117: { 118: throw new NotImplementedException();
119: }
120:
121: public CookComputing.Blogger.Post[] getRecentPosts(string appKey, string blogid, string username, string password, int numberOfPosts)
122: { 123: throw new NotImplementedException();
124: }
125:
126: public string getTemplate(string appKey, string blogid, string username, string password, string templateType)
127: { 128: throw new NotImplementedException();
129: }
130:
131: public UserInfo getUserInfo(string appKey, string username, string password)
132: { 133: throw new NotImplementedException();
134: }
135:
136: public BlogInfo[] getUsersBlogs(string appKey, string username, string password)
137: { 138: try
139: { 140: if (System.Web.Security.Membership.ValidateUser(username, password))
141: { 142: //Return the user's blogs
143: }
144: }
145: catch { throw new XmlRpcFaultException(0, "An error occurred while loading information"); } 146: throw new XmlRpcFaultException(0, "User name or password is invalid");
147: }
148:
149: public string newPost(string appKey, string blogid, string username, string password, string content, bool publish)
150: { 151: throw new NotImplementedException();
152: }
153:
154: public bool setTemplate(string appKey, string blogid, string username, string password, string template, string templateType)
155: { 156: throw new NotImplementedException();
157: }
158:
159: #endregion
160: }