Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.ManagerChecklist


    @RequestMapping(value = "/manager/checklist")
    public
    @ResponseBody
    ManagerChecklist getManagerChecklist() {
        ManagerChecklist managerChecklist = new ManagerChecklist();
        Long orgId;
        User user = userService.getUserFromSecurityContext();
        if (user.getActiveOrganization() != null && user.isActiveOrganizationAdmin()) {
            orgId = user.getActiveOrganization().getId();
            managerChecklist = managerChecklistService.getManagerChecklist(orgId);
View Full Code Here


    @Autowired(required = true)
    private InvitationService invitationService;

    @Override
    public ManagerChecklist getManagerChecklist(Long organizationId) {
        ManagerChecklist managerChecklist = new ManagerChecklist();
        managerChecklist.setOrganizationId(organizationId);

        Long appCount = organizationService.countOrganizationApps(organizationId);
        boolean hasApps = appCount > 0;
        managerChecklist.setHasApps(hasApps);

        Long appVersionCount = organizationService.countOrganizationAppVersions(organizationId);
        boolean hasAppVersions = appVersionCount > 0;
        managerChecklist.setHasAppVersions(hasAppVersions);

        Long groupCount = organizationService.countOrganizationGroups(organizationId);
        boolean hasGroups = groupCount > 0;
        managerChecklist.setHasGroups(hasGroups);

        Long organizationUserCount = organizationService.countOrganizationUsers(organizationId, true);
        Long organizationInvitationCount = invitationService.countAll(organizationId);
        boolean hasOrganizationUsers = organizationUserCount > 1 || organizationInvitationCount > 0;
        managerChecklist.setHasOrganizationUsers(hasOrganizationUsers);

        if (appCount == 1) {
            Application application = organizationService.getAllOrganizationApplications(organizationId).get(0);
            managerChecklist.setApplicationId(application.getId());
        }

        if (groupCount == 1) {
            Group group = organizationService.get(organizationId).getGroups().get(0);
            managerChecklist.setGroupId(group.getId());
        }
        return managerChecklist;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.ManagerChecklist

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.