- Timestamp:
- Sep 1, 2010, 6:48:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java
r6821 r6831 52 52 */ 53 53 private static CategoryDao instance; 54 /**55 * Cache. non utilisé pour le moment56 */57 private List<Category> cache;58 54 59 55 /** … … 81 77 * @throws IOException 82 78 */ 83 public List<Category> lister(boolean rafraichir, boolean recursive) throws IOException { 84 if (cache == null || rafraichir) { 85 Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), 86 "recursive", String.valueOf(recursive)); 87 Element element = doc.getRootElement().getChild("categories"); 88 List<Element> listElement = (List<Element>) element.getChildren("category"); 89 ArrayList<Category> categories = new ArrayList<Category>(); 90 for (Element cat : listElement) { 91 Category myCat = new Category(cat); 92 categories.add(myCat); 93 } 94 this.cache = categories; 79 public List<Category> lister(boolean recursive) throws IOException { 80 Document doc = Main.sessionManager.executerReturnDocument(MethodsEnum.LISTER_CATEGORIES.getLabel(), 81 "recursive", String.valueOf(recursive)); 82 Element element = doc.getRootElement().getChild("categories"); 83 List<Element> listElement = (List<Element>) element.getChildren("category"); 84 ArrayList<Category> categories = new ArrayList<Category>(); 85 for (Element cat : listElement) { 86 Category myCat = new Category(cat); 87 categories.add(myCat); 95 88 } 96 return ca che;89 return categories; 97 90 } 98 91
Note: See TracChangeset
for help on using the changeset viewer.