- Timestamp:
- Sep 20, 2010, 8:51:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/ImageDao.java
r6972 r6980 61 61 62 62 /** 63 * cache 63 * cache to avoid downloading image for each access 64 64 */ 65 65 private HashMap<Integer, List<Image>> cache; … … 71 71 72 72 /** 73 * Constructeur privé, pour n'avoir accès qu'ausingleton73 * Private singleton, to use a singleton 74 74 */ 75 75 private ImageDao() { … … 88 88 89 89 /** 90 * List er toutes lesimages91 * @return la liste desimages90 * Lists all images 91 * @return the list of images 92 92 * @throws IOException 93 93 */ … … 97 97 98 98 /** 99 * Listing des images d'une catégorie100 * @param categoryId l'id de la catégorie101 * @return la liste desimages99 * Listing of the images for a category 100 * @param categoryId the id of the category 101 * @return the list of images 102 102 * @throws IOException 103 103 */ … … 125 125 126 126 /** 127 * Creation d'une image.<br/>128 * Dans l'ordre : <br/>127 * Creation of an image<br/> 128 * Sequence : <br/> 129 129 * <li> 130 * <ul> envoi de la miniature en base64, grace à la méthodeaddchunk.</ul>131 * <ul> envoi de l'image originale en base64, grace à la méthodeaddchunk</ul>132 * <ul>u tilisation de la methode add pour ajouter l'image dans labase<ul>130 * <ul>sending of the thumbnail in base64, thanks to the method addchunk.</ul> 131 * <ul>sending of the image in base64, thanks to the method addchunk</ul> 132 * <ul>using of the add method to add the image to the database<ul> 133 133 * </li> 134 * Pour finir, on vérifie les réponses du webservice.134 * Finally, the response of the webservice is checked 135 135 * 136 * @param image l'image à créer137 * @return true si l'insertiopn de l'image s'est bien passée136 * @param the image to create 137 * @return true if the creation of the image was the successful 138 138 * @throws Exception 139 139 */ 140 140 //TODO ne pas continuer si une des réponses précédentes est négative 141 141 public boolean creer(Image image) throws Exception { 142 // on convertit la miniature en stringbase64142 //thumbnail converted to base64 143 143 BASE64Encoder base64 = new BASE64Encoder(); 144 144 145 145 String thumbnailBase64 = base64.encode(Outil.getBytesFromFile(image.getThumbnail())); 146 // on envoie la miniature et on recupere la reponse146 //sends the thumbnail and gets the result 147 147 Document reponseThumb = (Main.sessionManager.executerReturnDocument("pwg.images.addChunk", "data", 148 148 thumbnailBase64, "type", "thumb", "position", "1", "original_sum", Outil.getMD5Checksum(image … … 167 167 //end 168 168 169 // on ajoute l'image en base et on recupere la reponse169 //add the image in the database and get the result of the webservice 170 170 Document reponseAjout = (Main.sessionManager.executerReturnDocument("pwg.images.add", "file_sum", Outil 171 171 .getMD5Checksum(image.getOriginale().getAbsolutePath()), "thumbnail_sum", Outil.getMD5Checksum(image
Note: See TracChangeset
for help on using the changeset viewer.