- Timestamp:
- Apr 20, 2011, 5:17:02 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/TagDaoImpl.java
r9919 r10505 18 18 import fr.mael.jiwigo.transverse.enumeration.TagEnum; 19 19 import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException; 20 import fr.mael.jiwigo.transverse.exception.JiwigoException; 20 21 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 21 22 import fr.mael.jiwigo.transverse.session.SessionManager; … … 52 53 * @throws ProxyAuthenticationException 53 54 */ 54 public List<Tag> list() throws IOException, ProxyAuthenticationException {55 public List<Tag> list() throws JiwigoException { 55 56 Document doc = sessionManager.executeReturnDocument(MethodsEnum.TAGS_ADMIN_LIST.getLabel()); 56 57 // System.out.println(Outil.documentToString(doc)); … … 90 91 * @throws ProxyAuthenticationException 91 92 */ 92 public boolean create(Tag tag) throws ProxyAuthenticationException {93 public boolean create(Tag tag) throws JiwigoException { 93 94 try { 94 return Tools.checkOk(sessionManager.executeReturnDocument(MethodsEnum.ADD_TAG.getLabel(), "name", tag95 .getName()));96 } catch ( IOException e) {95 return Tools.checkOk(sessionManager.executeReturnDocument(MethodsEnum.ADD_TAG.getLabel(), "name", 96 tag.getName())); 97 } catch (FileAlreadyExistsException e) { 97 98 LOG.error(Tools.getStackTrace(e)); 98 } catch (FileAlreadyExistsException e) { 99 e.printStackTrace(); 99 throw new JiwigoException(e); 100 100 } 101 return false;102 101 } 103 102 … … 107 106 * @return the tags list 108 107 * @throws IOException 109 * @throws ProxyAuthenticationException108 * @throws JiwigoException 110 109 */ 111 public List<Tag> tagsForImage(Image image) throws IOException, ProxyAuthenticationException {112 Document doc = sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String113 .valueOf(image.getIdentifier()));110 public List<Tag> tagsForImage(Image image) throws JiwigoException { 111 Document doc = sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", 112 String.valueOf(image.getIdentifier())); 114 113 Element elementImage = (Element) doc.getDocumentElement().getElementsByTagName("image").item(0); 115 114 Element elementTag = (Element) elementImage.getElementsByTagName("tags").item(0);
Note: See TracChangeset
for help on using the changeset viewer.