- Timestamp:
- Feb 27, 2011, 1:38:04 PM (13 years ago)
- Location:
- extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CategoryService.java
r9387 r9392 73 73 /** 74 74 * Lists all categories 75 * @param rafraichir true to refresh76 75 * @param recursive true : recursive listing 77 76 * @return the list of categories 78 77 * @throws IOException 79 78 */ 80 public List<Category> list er(boolean recursive) throws IOException {81 return CategoryDao.getInstance(sessionManager).list er(recursive);79 public List<Category> list(boolean recursive) throws IOException { 80 return CategoryDao.getInstance(sessionManager).list(recursive); 82 81 } 83 82 … … 88 87 */ 89 88 public List<Category> makeTree() throws IOException { 90 List<Category> list = CategoryDao.getInstance(sessionManager).list er(true);89 List<Category> list = CategoryDao.getInstance(sessionManager).list(true); 91 90 for (Category category : list) { 92 91 for (Category category2 : list) { 93 if (category2.getId CategoriesMeres().size() != 194 && category.getIdentifi ant().equals(95 category2.getId CategoriesMeres().get(category2.getIdCategoriesMeres().size() - 2))) {96 category.getC ategoriesFilles().add(category2);97 category2.get CategoriesMeres().add(category);92 if (category2.getIdParentCategories().size() != 1 93 && category.getIdentifier().equals( 94 category2.getIdParentCategories().get(category2.getIdParentCategories().size() - 2))) { 95 category.getChildCategories().add(category2); 96 category2.getParentCategories().add(category); 98 97 } 99 98 … … 111 110 * @return true if successful 112 111 */ 113 public boolean cre er(String nom, Integer parent) {112 public boolean create(String nom, Integer parent) { 114 113 Category category = new Category(); 115 category.set ParentDirect(parent);116 category.setN om(nom);117 return CategoryDao.getInstance(sessionManager).cre er(category);114 category.setDirectParent(parent); 115 category.setName(nom); 116 return CategoryDao.getInstance(sessionManager).create(category); 118 117 } 119 118 … … 123 122 * @return true if successful 124 123 */ 125 public boolean cre er(String nom) {124 public boolean create(String nom) { 126 125 Category category = new Category(); 127 category.setN om(nom);128 return CategoryDao.getInstance(sessionManager).cre er(category);126 category.setName(nom); 127 return CategoryDao.getInstance(sessionManager).create(category); 129 128 } 130 129 } -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java
r9387 r9392 76 76 * @throws IOException 77 77 */ 78 public List<Comment> list er(Integer imageId) throws IOException {79 return CommentDao.getInstance(sessionManager).list er(imageId);78 public List<Comment> list(Integer imageId) throws IOException { 79 return CommentDao.getInstance(sessionManager).list(imageId); 80 80 } 81 81 … … 88 88 * @throws IOException 89 89 */ 90 public boolean cre er(String content, Integer imageId, String auteur) throws IOException {91 Comment comment aire= new Comment();92 comment aire.setContent(content);93 comment aire.setImageId(imageId);94 comment aire.setAuthor(auteur);95 return CommentDao.getInstance(sessionManager).cre er(commentaire);90 public boolean create(String content, Integer imageId, String auteur) throws IOException { 91 Comment comment = new Comment(); 92 comment.setContent(content); 93 comment.setImageId(imageId); 94 comment.setAuthor(auteur); 95 return CommentDao.getInstance(sessionManager).create(comment); 96 96 } 97 97 -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java
r9387 r9392 9 9 import fr.mael.jiwigo.transverse.session.SessionManager; 10 10 import fr.mael.jiwigo.transverse.util.ImagesUtil; 11 import fr.mael.jiwigo.transverse.util. Outil;11 import fr.mael.jiwigo.transverse.util.Tools; 12 12 13 13 /* … … 78 78 * Lists all images for a category 79 79 * @param categoryId the id of the category 80 * @param rafraichir true : refresh the list of images81 80 * @return the list of images 82 81 * @throws IOException 83 82 */ 84 public List<Image> list erParCategory(Integer categoryId, boolean rafraichir) throws IOException {85 return ImageDao.getInstance(sessionManager).list erParCategory(categoryId, rafraichir);83 public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException { 84 return ImageDao.getInstance(sessionManager).listByCategory(categoryId, rafraichir); 86 85 } 87 86 … … 92 91 * @param originalWidth width for the original image 93 92 * @param originalHeight height for the original image 94 * @return 93 * @return true if the image is created 95 94 * @throws Exception 96 95 */ 97 public boolean cre er(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,96 public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight, 98 97 Double chunckSize, Integer privacyLevel) throws Exception { 99 98 File originalFile = new File(filePath); 100 99 //get the byte array of the original file, to keep metadata 101 byte[] bytesFichierOriginal = Outil.getBytesFromFile(originalFile);100 byte[] bytesFichierOriginal = Tools.getBytesFromFile(originalFile); 102 101 103 102 //resize the picture (or not) … … 114 113 //the methode Outil.enrich will fail, but the procedure has to continue 115 114 try { 116 byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System115 byte[] fichierEnrichi = Tools.enrich(bytesFichierOriginal, Tools.getBytesFromFile(new File(System 117 116 .getProperty("java.io.tmpdir") 118 117 + "/originale.jpg"))); 119 Outil.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);118 Tools.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi); 120 119 } catch (Exception e) { 121 120 } … … 131 130 image.setPrivacyLevel(String.valueOf(privacyLevel)); 132 131 //now we call the dao to send the image to the webservice 133 return ImageDao.getInstance(sessionManager).cre er(image, chunckSize);132 return ImageDao.getInstance(sessionManager).create(image, chunckSize); 134 133 } 135 134 … … 142 141 */ 143 142 public boolean addTags(Image image, String tagId) throws IOException { 144 return ImageDao.getInstance(sessionManager).addTags(image.getIdentifi ant(), tagId);143 return ImageDao.getInstance(sessionManager).addTags(image.getIdentifier(), tagId); 145 144 } 146 145 -
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java
r9387 r9392 77 77 * @throws IOException 78 78 */ 79 public List<Tag> list er() throws IOException {80 return TagDao.getInstance(sessionManager).list er();79 public List<Tag> list() throws IOException { 80 return TagDao.getInstance(sessionManager).list(); 81 81 } 82 82 … … 87 87 * @throws IOException 88 88 */ 89 public boolean cre er(String nom) throws IOException {89 public boolean create(String nom) throws IOException { 90 90 Tag tag = new Tag(); 91 tag.setN om(nom);92 return TagDao.getInstance(sessionManager).cre er(tag);91 tag.setName(nom); 92 return TagDao.getInstance(sessionManager).create(tag); 93 93 } 94 94
Note: See TracChangeset
for help on using the changeset viewer.