Package models

Examples of models.Project


        return ok();
    }

    @IsAllowed(Operation.READ)
    public static Result unwatch(String userName, String projectName) {
        Project project = Project.findByOwnerAndProjectName(userName, projectName);
        Watch.unwatch(project.asResource());
        return ok();
    }
View Full Code Here


        return ok();
    }

    public static Result toggle(Long projectId, String notificationType) {
        EventType notiType = EventType.valueOf(notificationType);
        Project project = Project.find.byId(projectId);
        User user = UserApp.currentUser();

        if(project == null) {
            return notFound(ErrorViews.NotFound.render("error.notfound.project"));
        }
        if(!AccessControl.isAllowed(user, project.asResource(), Operation.READ)) {
            return forbidden(ErrorViews.Forbidden.render("error.forbidden", project));
        }
        if(!Watch.isWatching(user, project.asResource())) {
            return badRequest(Messages.get("error.notfound.watch"));
        }

        UserProjectNotification upn = UserProjectNotification.findOne(user, project, notiType);
        if(upn == null) { // make the EventType OFF, because default is ON.
View Full Code Here

    @Transactional
    @With(AnonymousCheckAction.class)
    @IsAllowed(Operation.READ)
    public static Result vote(String ownerName, String projectName, Long issueNumber) {

        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
        Issue issue = Issue.findByNumber(project, issueNumber);

        issue.addVoter(UserApp.currentUser());

        Call call = routes.IssueApp.issue(ownerName, projectName, issueNumber);
View Full Code Here

     */
    @Transactional
    @With(AnonymousCheckAction.class)
    @IsAllowed(Operation.READ)
    public static Result unvote(String ownerName, String projectName, Long issueNumber) {
        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
        Issue issue = Issue.findByNumber(project, issueNumber);

        issue.removeVoter(UserApp.currentUser());

        Call call = routes.IssueApp.issue(ownerName, projectName, issueNumber);
View Full Code Here

    private static Result labelsAsJSON(String ownerName, String projectName) {
        if (!request().accepts("application/json")) {
            return status(Http.Status.NOT_ACCEPTABLE);
        }

        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);

        List<Map<String, String>> labels = new ArrayList<>();
        for (IssueLabel label : IssueLabel.findByProject(project)) {
            Map<String, String> labelPropertyMap = new HashMap<>();
            labelPropertyMap.put("id", "" + label.id);
View Full Code Here

    }

    private static Result labelsAsPjax(String ownerName, String projectName){
        response().setHeader("Cache-Control", "no-cache, no-store");

        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
        List<IssueLabel> labels = IssueLabel.findByProject(project);

        return ok(views.html.project.partial_issuelabels_list.render(project, labels));
    }
View Full Code Here

        return ok(views.html.project.partial_issuelabels_list.render(project, labels));
    }

    @IsAllowed(Operation.UPDATE)
    public static Result labelsForm(String ownerName, String projectName){
        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
        List<IssueLabel> labels = IssueLabel.findByProject(project);

        return ok(views.html.project.issuelabels.render(project, labels));
    }
View Full Code Here

     * @return             the response to the request to add a new issue label
     */
    @Transactional
    @IsCreatable(ResourceType.ISSUE_LABEL)
    public static Result newLabel(String ownerName, String projectName) {
        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);

        DynamicForm labelForm = form().bindFromRequest();
        String categoryName = labelForm.get("categoryName");

        IssueLabelCategory category = new IssueLabelCategory();
View Full Code Here

     * @param projectName  the name of a project
     * @return the response to the request for the css styles in text/css.
     */
    @IsAllowed(Operation.READ)
    public static Result labelStyles(String ownerName, String projectName) {
        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
        List<IssueLabel> labels = IssueLabel.findByProject(project);

        String eTag = "\"" + labels.hashCode() + "\"";
        String ifNoneMatchValue = request().getHeader("If-None-Match");

View Full Code Here

    public static Result categories(String ownerName, String projectName) {
        if (!request().accepts("application/json")) {
            return status(Http.Status.NOT_ACCEPTABLE);
        }

        Project project =
            Project.findByOwnerAndProjectName(ownerName, projectName);

        List<Map<String, String>> categories = new ArrayList<>();
        for (IssueLabelCategory category
                : IssueLabelCategory.findByProject(project)) {
View Full Code Here

TOP

Related Classes of models.Project

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.