- Timestamp:
- Feb 27, 2011, 1:38:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java
r9387 r9392 11 11 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; 12 12 import fr.mael.jiwigo.transverse.session.SessionManager; 13 import fr.mael.jiwigo.transverse.util. Outil;13 import fr.mael.jiwigo.transverse.util.Tools; 14 14 15 15 /* … … 81 81 * @throws IOException 82 82 */ 83 public List<Comment> list er(Integer idImage) throws IOException {84 Document doc = (sessionManager.execute rReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String83 public List<Comment> list(Integer idImage) throws IOException { 84 Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 85 85 .valueOf(idImage))); 86 86 Element element = doc.getRootElement().getChild("image").getChild("comments"); … … 89 89 for (Element com : listElement) { 90 90 Comment myCom = new Comment(); 91 myCom.setIdentifi ant(Integer.valueOf(com.getAttributeValue("id")));91 myCom.setIdentifier(Integer.valueOf(com.getAttributeValue("id"))); 92 92 myCom.setDate(com.getAttributeValue("date")); 93 93 myCom.setAuthor(com.getChildText("author")); … … 105 105 */ 106 106 public String getKey(Integer idImage) throws IOException { 107 Document doc = (sessionManager.execute rReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String107 Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 108 108 .valueOf(idImage))); 109 109 String key = doc.getRootElement().getChild("image").getChild("comment_post").getAttributeValue("key"); … … 117 117 * @throws IOException 118 118 */ 119 public boolean cre er(Comment commentaire) throws IOException {119 public boolean create(Comment commentaire) throws IOException { 120 120 String key = getKey(commentaire.getImageId()); 121 121 try { … … 124 124 e.printStackTrace(); 125 125 } 126 return Outil.checkOk(sessionManager.executerReturnDocument(MethodsEnum.AJOUTER_COMMENTAIRE.getLabel(),126 return Tools.checkOk(sessionManager.executeReturnDocument(MethodsEnum.AJOUTER_COMMENTAIRE.getLabel(), 127 127 "image_id", String.valueOf(commentaire.getImageId()), "author", commentaire.getAuthor(), "content", 128 128 commentaire.getContent(), "key", key));
Note: See TracChangeset
for help on using the changeset viewer.