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);