Ignore:
Timestamp:
Feb 27, 2011, 1:38:04 PM (13 years ago)
Author:
mlg
Message:

Changes function name (to english)
version changed to 0.13.1

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  
    7373    /**
    7474     * Lists all categories
    75      * @param rafraichir true to refresh
    7675     * @param recursive true : recursive listing
    7776     * @return the list of categories
    7877     * @throws IOException
    7978     */
    80     public List<Category> lister(boolean recursive) throws IOException {
    81         return CategoryDao.getInstance(sessionManager).lister(recursive);
     79    public List<Category> list(boolean recursive) throws IOException {
     80        return CategoryDao.getInstance(sessionManager).list(recursive);
    8281    }
    8382
     
    8887     */
    8988    public List<Category> makeTree() throws IOException {
    90         List<Category> list = CategoryDao.getInstance(sessionManager).lister(true);
     89        List<Category> list = CategoryDao.getInstance(sessionManager).list(true);
    9190        for (Category category : list) {
    9291            for (Category category2 : list) {
    93                 if (category2.getIdCategoriesMeres().size() != 1
    94                         && category.getIdentifiant().equals(
    95                                 category2.getIdCategoriesMeres().get(category2.getIdCategoriesMeres().size() - 2))) {
    96                     category.getCategoriesFilles().add(category2);
    97                     category2.getCategoriesMeres().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);
    9897                }
    9998
     
    111110     * @return true if successful
    112111     */
    113     public boolean creer(String nom, Integer parent) {
     112    public boolean create(String nom, Integer parent) {
    114113        Category category = new Category();
    115         category.setParentDirect(parent);
    116         category.setNom(nom);
    117         return CategoryDao.getInstance(sessionManager).creer(category);
     114        category.setDirectParent(parent);
     115        category.setName(nom);
     116        return CategoryDao.getInstance(sessionManager).create(category);
    118117    }
    119118
     
    123122     * @return true if successful
    124123     */
    125     public boolean creer(String nom) {
     124    public boolean create(String nom) {
    126125        Category category = new Category();
    127         category.setNom(nom);
    128         return CategoryDao.getInstance(sessionManager).creer(category);
     126        category.setName(nom);
     127        return CategoryDao.getInstance(sessionManager).create(category);
    129128    }
    130129}
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java

    r9387 r9392  
    7676     * @throws IOException
    7777     */
    78     public List<Comment> lister(Integer imageId) throws IOException {
    79         return CommentDao.getInstance(sessionManager).lister(imageId);
     78    public List<Comment> list(Integer imageId) throws IOException {
     79        return CommentDao.getInstance(sessionManager).list(imageId);
    8080    }
    8181
     
    8888     * @throws IOException
    8989     */
    90     public boolean creer(String content, Integer imageId, String auteur) throws IOException {
    91         Comment commentaire = new Comment();
    92         commentaire.setContent(content);
    93         commentaire.setImageId(imageId);
    94         commentaire.setAuthor(auteur);
    95         return CommentDao.getInstance(sessionManager).creer(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);
    9696    }
    9797
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java

    r9387 r9392  
    99import fr.mael.jiwigo.transverse.session.SessionManager;
    1010import fr.mael.jiwigo.transverse.util.ImagesUtil;
    11 import fr.mael.jiwigo.transverse.util.Outil;
     11import fr.mael.jiwigo.transverse.util.Tools;
    1212
    1313/*
     
    7878     * Lists all images for a category
    7979     * @param categoryId the id of the category
    80      * @param rafraichir true : refresh the list of images
    8180     * @return the list of images
    8281     * @throws IOException
    8382     */
    84     public List<Image> listerParCategory(Integer categoryId, boolean rafraichir) throws IOException {
    85         return ImageDao.getInstance(sessionManager).listerParCategory(categoryId, rafraichir);
     83    public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException {
     84        return ImageDao.getInstance(sessionManager).listByCategory(categoryId, rafraichir);
    8685    }
    8786
     
    9291     * @param originalWidth width for the original image
    9392     * @param originalHeight height for the original image
    94      * @return
     93     * @return true if the image is created
    9594     * @throws Exception
    9695     */
    97     public boolean creer(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
     96    public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
    9897            Double chunckSize, Integer privacyLevel) throws Exception {
    9998        File originalFile = new File(filePath);
    10099        //get the byte array of the original file, to keep metadata
    101         byte[] bytesFichierOriginal = Outil.getBytesFromFile(originalFile);
     100        byte[] bytesFichierOriginal = Tools.getBytesFromFile(originalFile);
    102101
    103102        //resize the picture (or not)
     
    114113            //the methode Outil.enrich will fail, but the procedure has to continue
    115114            try {
    116                 byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System
     115                byte[] fichierEnrichi = Tools.enrich(bytesFichierOriginal, Tools.getBytesFromFile(new File(System
    117116                        .getProperty("java.io.tmpdir")
    118117                        + "/originale.jpg")));
    119                 Outil.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);
     118                Tools.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);
    120119            } catch (Exception e) {
    121120            }
     
    131130        image.setPrivacyLevel(String.valueOf(privacyLevel));
    132131        //now we call the dao to send the image to the webservice
    133         return ImageDao.getInstance(sessionManager).creer(image, chunckSize);
     132        return ImageDao.getInstance(sessionManager).create(image, chunckSize);
    134133    }
    135134
     
    142141     */
    143142    public boolean addTags(Image image, String tagId) throws IOException {
    144         return ImageDao.getInstance(sessionManager).addTags(image.getIdentifiant(), tagId);
     143        return ImageDao.getInstance(sessionManager).addTags(image.getIdentifier(), tagId);
    145144    }
    146145
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java

    r9387 r9392  
    7777     * @throws IOException
    7878     */
    79     public List<Tag> lister() throws IOException {
    80         return TagDao.getInstance(sessionManager).lister();
     79    public List<Tag> list() throws IOException {
     80        return TagDao.getInstance(sessionManager).list();
    8181    }
    8282
     
    8787     * @throws IOException
    8888     */
    89     public boolean creer(String nom) throws IOException {
     89    public boolean create(String nom) throws IOException {
    9090        Tag tag = new Tag();
    91         tag.setNom(nom);
    92         return TagDao.getInstance(sessionManager).creer(tag);
     91        tag.setName(nom);
     92        return TagDao.getInstance(sessionManager).create(tag);
    9393    }
    9494
Note: See TracChangeset for help on using the changeset viewer.