- Timestamp:
- Sep 19, 2010, 9:27:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/TagDao.java
r6964 r6968 9 9 10 10 import fr.mael.jiwigo.Main; 11 import fr.mael.jiwigo.om.Image; 11 12 import fr.mael.jiwigo.om.Tag; 12 13 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum; … … 78 79 Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_TAGS.getLabel()); 79 80 // System.out.println(Outil.documentToString(doc)); 80 Element element = doc.getRootElement().getChild("tags"); 81 return getTagsFromDocument(doc.getRootElement().getChild("tags")); 82 83 } 84 85 /** 86 * COnstructs a list of tags from a document 87 * @param doc the document 88 * @return the list of tags 89 */ 90 private List<Tag> getTagsFromDocument(Element element) { 91 81 92 List<Element> listElement = (List<Element>) element.getChildren("tag"); 82 93 ArrayList<Tag> tags = new ArrayList<Tag>(); … … 86 97 } 87 98 return tags; 99 88 100 } 89 101 … … 103 115 } 104 116 117 /** 118 * Function that returns the tags for an image 119 * @param image the image 120 * @return the tags list 121 * @throws IOException 122 */ 123 public List<Tag> tagsForImage(Image image) throws IOException { 124 Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String 125 .valueOf(image.getIdentifiant())); 126 return getTagsFromDocument(doc.getRootElement().getChild("image").getChild("tags")); 127 } 128 105 129 }
Note: See TracChangeset
for help on using the changeset viewer.