Package org.apache.rave.rest.exception

Examples of org.apache.rave.rest.exception.ResourceNotFoundException


    }

    private org.apache.rave.model.Widget getFromService(String id) {
        org.apache.rave.model.Widget widget = widgetService.getWidget(id);
        if(widget == null) {
            throw new ResourceNotFoundException("Could not find widget with ID " + id);
        }
        return widget;
    }
View Full Code Here


                break;
            }
        }

        if(match == null) {
            throw new ResourceNotFoundException(regionWidgetId);
        }

        return match;
    }
View Full Code Here

    public PageLayout getPageLayout(String code) {

        org.apache.rave.model.PageLayout fromDb = pageLayoutService.getPageLayoutByCode(code);

        if(fromDb == null) {
            throw new ResourceNotFoundException(code);
        }

        return new PageLayout(fromDb);
    }
View Full Code Here

                pages = Arrays.asList(pageService.getPersonProfilePage(contextId));
            } else {
                pages = pageService.getPages(context, contextId);
            }
        } catch (Exception e) {
            throw new ResourceNotFoundException(contextId);
        }
        if (pages == null) {
            throw new ResourceNotFoundException(contextId);
        }
        return convert(pages, pages.size());
    }
View Full Code Here

    @Override
    public Page getPage(String id) {
        logger.debug("Retrieving page for export: " + id);
        org.apache.rave.model.Page fromDb = pageService.getPage(id);
        if (fromDb == null) {
            throw new ResourceNotFoundException(id);
        }

        return new Page(fromDb);
    }
View Full Code Here

    public Person getPerson(String id) {
        org.apache.rave.model.Person person = userService.getUserById(id);
        if (person != null) {
            return new Person(person);
        } else {
            throw new ResourceNotFoundException(id);
        }
    }
View Full Code Here

        if("portal".equals(context)) {
            try{
                String userId = SELF.equals(identifier) ? userService.getAuthenticatedUser().getId() : identifier;
                pages = pageService.getAllUserPages(userId);
            }catch(Exception e){
                throw new ResourceNotFoundException(identifier);
            }
        } else if("profile".equals(context)) {
            try{
                pages = Arrays.asList(pageService.getPersonProfilePage(identifier));
            }catch(Exception e){
                throw new ResourceNotFoundException(identifier);
            }
        } else {
            throw new ResourceNotFoundException("Context "+context+" not found");
        }

        if(pages == null){
            throw new ResourceNotFoundException(identifier);
        }

        List<Page> converted = Lists.newArrayList();
        for(org.apache.rave.model.Page page : pages) {
            Page convert = new Page(page);
View Full Code Here

            page = pageService.getPage(id);
        } else if("profile".equals(context)) {
            try{
                page = pageService.getPersonProfilePage(identifier);
            }catch (Exception e){
                throw new ResourceNotFoundException(identifier);
            }
        } else {
            throw new ResourceNotFoundException("Context "+context+" not found");
        }

        if(page == null){
            throw new ResourceNotFoundException(id);
        }

        Page converted = renderService.prepareForRender(new Page(page));

        return converted;
View Full Code Here

                break;
            }
        }

        if(match == null) {
            throw new ResourceNotFoundException(regionId);
        }

        return match;
    }
View Full Code Here

                break;
            }
        }

        if (match == null) {
            throw new ResourceNotFoundException(userId);
        }

        return match;
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.rest.exception.ResourceNotFoundException

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.