Package com.sparc.knappsack.exceptions

Examples of com.sparc.knappsack.exceptions.EntityNotFoundException


    @PreAuthorize("isDomainAdmin(#id) or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/requestsPending/{id}", method = RequestMethod.GET)
    public String requestsPending(@PathVariable Long id, Model model) {
        Domain domain = domainService.get(id);
        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while viewing pending invites: %s", id));
        }
        model.addAttribute("domainType", domain.getDomainType().name());
        model.addAttribute("domainName", domain.getName());
        model.addAttribute("domainId", domain.getId());
View Full Code Here


    @PreAuthorize("hasDomainConfigurationAccess(#domainId) or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/domainConfiguration/{domainId}", method = RequestMethod.GET)
    public String domainConfiguration(Model model, @PathVariable Long domainId) {
        Domain domain = domainService.get(domainId);
        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while viewing DomainConfiguration page: %s", domainId));
        }
        DomainConfiguration domainConfiguration = domain.getDomainConfiguration() == null ? new DomainConfiguration() : domain.getDomainConfiguration();
        DomainConfigurationForm domainConfigurationForm = getDomainConfigurationForm(domain.getId(), domainConfiguration);

        model.addAttribute("domain", domain);
View Full Code Here

    @PreAuthorize("hasDomainConfigurationAccess(#domainConfigurationForm.domainId) or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/saveDomainConfiguration", method = RequestMethod.POST)
    public String saveDomainConfiguration(Model model, @ModelAttribute DomainConfigurationForm domainConfigurationForm) {
        Domain domain = domainService.get(domainConfigurationForm.getDomainId());
        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while saving DomainConfiguration: %s", domainConfigurationForm.getDomainId()));
        }
        model.addAttribute("domain", domain);

        DomainConfiguration domainConfiguration = getDomainConfiguration(domain, domainConfigurationForm);
        domainConfigurationService.update(domainConfiguration);
View Full Code Here

            model.addAttribute("isEdit", true);

            model.addAttribute("customBrandingEnabled", organizationService.isCustomBrandingEnabled(existingOrg));
            return "manager/manageOrganizationTH";
        }
        throw new EntityNotFoundException(String.format("Organization not found: %s", id));
    }
View Full Code Here

    }

    protected void checkRequiredEntity(EntityService entityService, Long id) {
        if (entityService != null) {
            if (!entityService.doesEntityExist(id)) {
                throw new EntityNotFoundException();
            }
        } else {
            throw new RuntimeException("EntityService not found while checking if entity exists");
        }
    }
View Full Code Here

            }
            model.addAttribute("appStates", appStates);

            return "manager/manageApplicationVersionTH";
        } else {
            throw new EntityNotFoundException(String.format("Group Entity not found for Application: %s", application.getId()));
        }
    }
View Full Code Here

    }

    public void checkRequiredEntity(EntityService entityService, Long id) {
        if (entityService != null) {
            if (!entityService.doesEntityExist(id)) {
                throw new EntityNotFoundException();
            }
        } else {
            throw new RuntimeException("EntityService not found while checking if entity exists");
        }
    }
View Full Code Here

            if (domain != null) {
                setSideBarNavAttribute(model, domain.getDomainType());
            }
        } else {
            log.info(String.format("Domain not found with id: %s", domainId));
            throw new EntityNotFoundException(String.format("Domain not found with id: %s", domainId));
        }

        return "manager/manageDomainRegionsTH";
    }
View Full Code Here

    @PreAuthorize("isDomainAdmin(#id) or hasRole('ROLE_ADMIN')")
    @RequestMapping(value = "/manager/invitesPending/{id}", method = RequestMethod.GET)
    public String invitesPending(Model model, @PathVariable Long id) {
        Domain domain = domainService.get(id);
        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while viewing pending invites: %s", id));
        }
        initModel(model, domain);

        List<Invitation> invitations = invitationService.getAll(domain.getId());
        List<InviteeForm> inviteeForms = new ArrayList<InviteeForm>();
View Full Code Here

        if (user == null) {
            return false;
        }
        ApplicationVersion applicationVersion = applicationVersionService.get(applicationVersionId);
        if (applicationVersion == null || applicationVersion.getApplication() == null) {
            throw new EntityNotFoundException();
        }

        return canEditApplication(applicationVersion.getApplication().getId());
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.exceptions.EntityNotFoundException

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.