/** * shows my spaceList by userId * * @param userId * @return spaceList * @see SpaceList */ private SpaceList showMySpaceList(String userId) { SpaceList spaceList = new SpaceList(); _spaceService = getSpaceService(); List<Space> mySpaces = null; List<SpaceRest> mySpacesRest = new ArrayList<SpaceRest>(); try { mySpaces = _spaceService.getSpaces(userId); for (Space space : mySpaces) { SpaceRest spaceRest = new SpaceRest(space); mySpacesRest.add(spaceRest); } // fix for issue SOC-2039, sets the space url with new navigation controller Router router = this.getRouter(this.getConfigurationPath()); this.fillSpacesURI(mySpacesRest, router); } catch (SpaceException e) { throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } catch (Exception e) { throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } spaceList.setSpaces(mySpacesRest); return spaceList; }
/** * shows pending spaceList by userId * * @param userId * @return spaceList * @see SpaceList */ private SpaceList showPendingSpaceList(String userId) { SpaceList spaceList = new SpaceList(); _spaceService = getSpaceService(); List<Space> pendingSpaces; List<SpaceRest> pendingSpacesRest = new ArrayList<SpaceRest>(); try { pendingSpaces = _spaceService.getPendingSpaces(userId); for (Space space : pendingSpaces) { SpaceRest spaceRest = new SpaceRest(space); pendingSpacesRest.add(spaceRest); } } catch (SpaceException e) { throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } spaceList.setSpaces(pendingSpacesRest); return spaceList; }