Package info.jtrac.domain

Examples of info.jtrac.domain.Counts


                + " where item.loggedBy.id = ? and item.space.id = ? group by item.status", new Object[] {user.getId(), space.getId()});
        List<Object[]> assignedToList = ht.find("select status, count(item) from Item item"
                + " where item.assignedTo.id = ? and item.space.id = ? group by item.status", new Object[] {user.getId(), space.getId()});
        List<Object[]> statusList = ht.find("select status, count(item) from Item item"
                + " where item.space.id = ? group by item.status", space.getId());
        Counts c = new Counts(true);
        for(Object[] oa : loggedByList) {
            c.addLoggedByMe((Integer) oa[0], (Long) oa[1]);
        }
        for(Object[] oa : assignedToList) {
            c.addAssignedToMe((Integer) oa[0], (Long) oa[1]);
        }
        for(Object[] oa : statusList) {
            c.addTotal((Integer) oa[0], (Long) oa[1]);
        }
        return c;
    }
View Full Code Here


        CountsHolder ch = jtrac.loadCountsForUser(u);
        assertEquals(1, ch.getTotalAssignedToMe());
        assertEquals(1, ch.getTotalLoggedByMe());
        assertEquals(1, ch.getTotalTotal());
       
        Counts c = ch.getCounts().get(s.getId());
        assertEquals(1, c.getLoggedByMe());
        assertEquals(1, c.getAssignedToMe());
        assertEquals(1, c.getTotal());
    }
View Full Code Here

            table.add(hideAssigned);

            table.add(new ListView("dashboardRows", spaceRoles) {
                protected void populateItem(final ListItem listItem) {
                    UserSpaceRole usr = (UserSpaceRole) listItem.getModelObject();
                    Counts counts = countsHolder.getCounts().get(usr.getSpace().getId());
                    if (counts == null) {
                        counts = new Counts(false); // this can happen if fresh space
                    }
                    DashboardRowPanel dashboardRow = new DashboardRowPanel("dashboardRow", usr, counts);                   
                    listItem.add(dashboardRow);
                }
            });
View Full Code Here

            }
        });       
       
        add(new IndicatingAjaxLink("link") {
            public void onClick(AjaxRequestTarget target) {
                Counts tempCounts = counts;               
                // avoid hitting the database again if re-expanding
                if (!tempCounts.isDetailed()) {                   
                    tempCounts = getJtrac().loadCountsForUserSpace(user, space);                   
                }
                DashboardRowExpandedPanel dashboardRow = new DashboardRowExpandedPanel("dashboardRow", usr, tempCounts);
                DashboardRowPanel.this.replaceWith(dashboardRow);
                target.addComponent(dashboardRow);
View Full Code Here

TOP

Related Classes of info.jtrac.domain.Counts

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.