1. kqwcub
  2. MrCHEN.info-GAE-Blog

Commits

cowboy  committed 63160fc

code 07/06

  • Participants
  • Parent commits 34ec72f
  • Branches default

Comments (0)

Files changed (2)

File src/info/mrchen/gae/blog/service/ArticleService.java

View file
 	}
 
 	public boolean update(String postid, String title, String description, String[] strings) {
-		// TODO Auto-generated method stub
+		Long postID=Long.parseLong(postid);
+		Article a=articleDao.get(postID);
+		a.setTitle(title);
+		a.setContent(new Text(description));
+		articleDao.update(a);
 		return false;
 	}
 

File src/info/mrchen/gae/blog/xmlrpc/handder/MetaWeblogHandler.java

View file
 package info.mrchen.gae.blog.xmlrpc.handder;
 
+import info.mrchen.gae.blog.pojo.Article;
 import info.mrchen.gae.blog.service.ArticleService;
 import info.mrchen.gae.blog.service.CategoryService;
 import info.mrchen.gae.blog.xmlrpc.MetaweblogApiField;
 	}
 
 	public boolean editPost(String blogid, String username, String password, HashMap<String, Object> content, boolean publish) {
-		String postid=(String) content.get(POST_POSTID);
-		articleService.get(Long.parseLong(postid));
-		
-		String title = (String) content.get(POST_TITLE);
+		String postid=(String) content.get(POST_POSTID);		
+		String title= (String) content.get(POST_TITLE);
 		String description = (String) content.get(POST_DESCRIPTION);
-		Long newID = articleService.add(title, description, new String[] {});
-		return true;
+		return articleService.update(postid,title, description, new String[] {});
 	}
 
 	public HashMap<String, Object> getPost(String blogid, String username, String password) {