Changeset 10699 for extensions
- Timestamp:
- Apr 30, 2011, 1:40:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/impl/ImageDaoImpl.java
r10505 r10699 222 222 private List<Image> getImagesFromElement(Element element) { 223 223 // List<Element> listElement = (List<Element>) element.getChildren("image"); 224 System.out.println(Tools.documentToString(element)); 224 225 NodeList listImages = element.getElementsByTagName("image"); 225 226 ArrayList<Image> images = new ArrayList<Image>(); … … 238 239 myImage.setName(Tools.getStringValueDom(im, "name")); 239 240 Element elementCategories = (Element) im.getElementsByTagName("categories").item(0); 240 Element elementCategory = (Element) elementCategories.getElementsByTagName("category").item(0); 241 myImage.setIdCategory(Integer.valueOf(elementCategory.getAttribute("id"))); 242 if (myImage.getName() == null) { 243 myImage.setName(myImage.getFile()); 241 if (elementCategories != null) { 242 Element elementCategory = (Element) elementCategories.getElementsByTagName("category").item(0); 243 myImage.setIdCategory(Integer.valueOf(elementCategory.getAttribute("id"))); 244 if (myImage.getName() == null) { 245 myImage.setName(myImage.getFile()); 246 } 244 247 } 245 248 images.add(myImage);
Note: See TracChangeset
for help on using the changeset viewer.