Package com.psddev.cms.db

Examples of com.psddev.cms.db.WorkStream


        return "area/dashboard";
    }

    @Override
    protected void doService(final ToolPageContext page) throws IOException, ServletException {
        WorkStream workStream = Query.from(WorkStream.class).where("_id = ?", page.param(UUID.class, "id")).first();
        List<ToolUser> users = workStream.getUsers();

        Collections.sort(users);

        page.writeStart("div", "class", "widget");
            page.writeStart("h1", "class", "icon icon-object-workStream");
                page.writeHtml("Users Working On: ");
                page.writeObjectLabel(workStream);
            page.writeEnd();

            if (users.isEmpty()) {
                page.writeStart("div", "class", "message message-info");
                    page.writeStart("p");
                        page.writeHtml("No users working on this work stream yet!");
                    page.writeEnd();
                page.writeEnd();

            } else {
                page.writeStart("table", "class", "table-striped");
                    page.writeStart("thead");
                        page.writeStart("tr");
                            page.writeStart("th").writeHtml("User").writeEnd();
                            page.writeStart("th").writeHtml("Currently On").writeEnd();
                            page.writeStart("th").writeHtml("Completed").writeEnd();
                        page.writeEnd();
                    page.writeEnd();

                    page.writeStart("tbody");
                        for (ToolUser user : users) {
                            page.writeStart("tr");
                                page.writeStart("td");
                                    page.writeObjectLabel(user);
                                page.writeEnd();

                                page.writeStart("td");
                                    Object currentItem = workStream.getCurrentItem(user);

                                    if (currentItem == null) {
                                        page.writeHtml("N/A");

                                    } else {
                                        page.writeStart("a",
                                                "href", page.objectUrl("/content/edit.jsp", currentItem),
                                                "target", "_top");
                                            page.writeObjectLabel(currentItem);
                                        page.writeEnd();
                                    }
                                page.writeEnd();

                                page.writeStart("td");
                                    page.writeHtml(workStream.countComplete(user));
                                page.writeEnd();
                            page.writeEnd();
                        }
                    page.writeEnd();
                page.writeEnd();
View Full Code Here


    /** Finds an existing object or reserve one. */
    public Object findOrReserve(Collection<ObjectType> validTypes) {
        UUID objectId = param(UUID.class, OBJECT_ID_PARAMETER);
        Object object;
        WorkStream workStream = Query.findById(WorkStream.class, param(UUID.class, "workStreamId"));

        if (!isFormPost() && workStream != null) {
            object = workStream.next(getUser());

        } else {
            object = Query.findById(Object.class, objectId);
        }

View Full Code Here

TOP

Related Classes of com.psddev.cms.db.WorkStream

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.