Package models

Examples of models.Interest


    }

    public static void delete(Long[] interestsToBeDeleted) {
        if (interestsToBeDeleted != null) {
            for (Long interestId : interestsToBeDeleted) {
                Interest i = Interest.findById(interestId);
                i.delete();
            }
            flash.success("Intérêt(s) supprimé(s)");
        }
        edit();
    }
View Full Code Here


    }

    public static void chooseInterestForMerge(Long[] interestsToBeDeleted) {
        List<Interest> interests = new ArrayList<Interest>(interestsToBeDeleted.length);
        for (Long interestId : interestsToBeDeleted) {
            Interest i = Interest.findById(interestId);
            interests.add(i);
        }
        render("Interests/merge.html", interests);
    }
View Full Code Here

        }
        render("Interests/merge.html", interests);
    }

    public static void merge(@As(",") Long[] interests, Long survivorInterestId) {
        Interest survivorInterest = Interest.findById(survivorInterestId);
        if (interests != null) {
            for (Long interestToBeDeleted : interests) {
                Interest i = Interest.findById(interestToBeDeleted);
                i.merge(survivorInterest);
            }
            flash.success("Intérêts fusionnés");
        }
        edit();
    }
View Full Code Here

        }
        edit();
    }

    public static void rename(Long interestId) {
        Interest interest = Interest.findById(interestId);
        render(interest);
    }
View Full Code Here

        Interest interest = Interest.findById(interestId);
        render(interest);
    }
   
    public static void submitRename(Long interestId,String newNameInterest) {
        Interest interest = Interest.findById(interestId);
        interest.name = newNameInterest;
        interest.save();
        flash.success("l'intérêt a été renommé en '%s'", newNameInterest);
        edit();
    }
View Full Code Here

        test("/api/interests");
    }

    @Test
    public void testInterest() {
        Interest i = Interest.all().first();
        test("/api/interests/"+i.id);
    }
View Full Code Here

        List<Interest> interests = Interest.findAllOrdered();
        renderJSON(interests);
    }

    public static void interest(long id) {
        Interest interest = Interest.findById(id);
        notFoundIfNull(interest);
        renderJSON(interest);
    }
View Full Code Here

TOP

Related Classes of models.Interest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.