- Timestamp:
- Feb 28, 2011, 7:40:53 PM (13 years ago)
- Location:
- extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java
r9392 r9430 11 11 import fr.mael.jiwigo.transverse.enumeration.CategoryEnum; 12 12 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; 13 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 13 14 import fr.mael.jiwigo.transverse.session.SessionManager; 14 15 import fr.mael.jiwigo.transverse.util.Tools; … … 81 82 * @return the list of categories 82 83 * @throws IOException 84 * @throws ProxyAuthenticationException 83 85 */ 84 public List<Category> list(boolean recursive) throws IOException {86 public List<Category> list(boolean recursive) throws IOException, ProxyAuthenticationException { 85 87 Document doc = sessionManager.executeReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), "recursive", 86 88 String.valueOf(recursive)); … … 112 114 * @param category the category to create 113 115 * @return true if the category is successfully created 116 * @throws ProxyAuthenticationException 114 117 */ 115 public boolean create(Category category) {118 public boolean create(Category category) throws ProxyAuthenticationException { 116 119 try { 117 120 if (category.getDirectParent() != null) { -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java
r9392 r9430 10 10 import fr.mael.jiwigo.om.Comment; 11 11 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; 12 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 12 13 import fr.mael.jiwigo.transverse.session.SessionManager; 13 14 import fr.mael.jiwigo.transverse.util.Tools; … … 80 81 * @return list of comments 81 82 * @throws IOException 83 * @throws ProxyAuthenticationException 82 84 */ 83 public List<Comment> list(Integer idImage) throws IOException {85 public List<Comment> list(Integer idImage) throws IOException, ProxyAuthenticationException { 84 86 Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 85 .valueOf(idImage) ));87 .valueOf(idImage), "comments_per_page", "100")); 86 88 Element element = doc.getRootElement().getChild("image").getChild("comments"); 87 89 List<Element> listElement = (List<Element>) element.getChildren("comment"); … … 103 105 * @return the key 104 106 * @throws IOException 107 * @throws ProxyAuthenticationException 105 108 */ 106 public String getKey(Integer idImage) throws IOException {109 public String getKey(Integer idImage) throws IOException, ProxyAuthenticationException { 107 110 Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 108 111 .valueOf(idImage))); … … 116 119 * @return true if the comment is successfully added 117 120 * @throws IOException 121 * @throws ProxyAuthenticationException 118 122 */ 119 public boolean create(Comment commentaire) throws IOException {123 public boolean create(Comment commentaire) throws IOException, ProxyAuthenticationException { 120 124 String key = getKey(commentaire.getImageId()); 121 125 try { -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
r9394 r9430 13 13 import fr.mael.jiwigo.om.Image; 14 14 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; 15 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 15 16 import fr.mael.jiwigo.transverse.exception.WrongChunkSizeException; 16 17 import fr.mael.jiwigo.transverse.session.SessionManager; … … 98 99 * @return the list of images 99 100 * @throws IOException 100 */ 101 public List<Image> list(boolean refresh) throws IOException { 101 * @throws ProxyAuthenticationException 102 */ 103 public List<Image> list(boolean refresh) throws IOException, ProxyAuthenticationException { 102 104 return listByCategory(null, refresh); 103 105 } … … 108 110 * @return the list of images 109 111 * @throws IOException 110 */ 111 public List<Image> listByCategory(Integer categoryId, boolean refresh) throws IOException { 112 * @throws ProxyAuthenticationException 113 */ 114 public List<Image> listByCategory(Integer categoryId, boolean refresh) throws IOException, 115 ProxyAuthenticationException { 112 116 if (refresh || cache.get(categoryId) == null) { 113 117 Document doc = null; … … 207 211 * @param tagId ids of the tags 208 212 * @throws IOException 209 */ 210 public boolean addTags(Integer imageId, String tagId) throws IOException { 213 * @throws ProxyAuthenticationException 214 */ 215 public boolean addTags(Integer imageId, String tagId) throws IOException, ProxyAuthenticationException { 211 216 Document doc = sessionManager.executeReturnDocument(MethodsEnum.SET_INFO.getLabel(), "image_id", String 212 217 .valueOf(imageId), "tag_ids", tagId); … … 248 253 * @return the list of images matching the string 249 254 * @throws IOException 250 */ 251 public List<Image> search(String searchString) throws IOException { 255 * @throws ProxyAuthenticationException 256 */ 257 public List<Image> search(String searchString) throws IOException, ProxyAuthenticationException { 252 258 Document doc = sessionManager.executeReturnDocument(MethodsEnum.SEARCH.getLabel(), "query", searchString); 253 259 LOG.debug(doc); -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/TagDao.java
r9392 r9430 12 12 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; 13 13 import fr.mael.jiwigo.transverse.enumeration.TagEnum; 14 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 14 15 import fr.mael.jiwigo.transverse.session.SessionManager; 15 16 import fr.mael.jiwigo.transverse.util.Tools; … … 53 54 * @return the list of tags 54 55 * @throws IOException 56 * @throws ProxyAuthenticationException 55 57 */ 56 public List<Tag> list() throws IOException {58 public List<Tag> list() throws IOException, ProxyAuthenticationException { 57 59 Document doc = sessionManager.executeReturnDocument(MethodsEnum.TAGS_ADMIN_LIST.getLabel()); 58 60 // System.out.println(Outil.documentToString(doc)); … … 84 86 * @param tag the tag to create 85 87 * @return true if the tag as been successfully created 88 * @throws ProxyAuthenticationException 86 89 */ 87 public boolean create(Tag tag) {90 public boolean create(Tag tag) throws ProxyAuthenticationException { 88 91 try { 89 92 return Tools.checkOk(sessionManager.executeReturnDocument(MethodsEnum.ADD_TAG.getLabel(), "name", tag … … 100 103 * @return the tags list 101 104 * @throws IOException 105 * @throws ProxyAuthenticationException 102 106 */ 103 public List<Tag> tagsForImage(Image image) throws IOException {107 public List<Tag> tagsForImage(Image image) throws IOException, ProxyAuthenticationException { 104 108 Document doc = sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 105 109 .valueOf(image.getIdentifier()));
Note: See TracChangeset
for help on using the changeset viewer.