private boolean checkProjectExists(String id) throws BizPolicyException { boolean found = false; Project project = projectBizService.getProject(id); if (project != null) { found = true; } return found; }
projectBizService.updateProject(project, user); resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml");
/** * Handles empty get call this will return a list of projects that are * visible to the current user Not yet implemented. * * @param mimeType * @param modifiedSince * @param request * @throws IOException * @throws BizPolicyException */ @RequestMapping(method = {RequestMethod.GET}) public void handleEmptyGetRequest(@RequestHeader(value = "Accept", required = false) String mimeType, @RequestHeader(value = "If-Modified-Since", required = false) @DateTimeFormat(iso = DATE_TIME) Date modifiedSince, HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException, BizPolicyException { Person user = getAuthenticatedUser(); if (user == null) { resp.sendError(HttpServletResponse.SC_UNAUTHORIZED); return; } else { Set<Project> projects = projectBizService.findByAdmin(user); Bop bop = new Bop(); bop.setProjects(projects); resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml"); objectBuilder.buildBusinessObjectPackage(bop, resp.getOutputStream()); } }
resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml"); Set<Collection> collections = projectBizService.getCollectionsForProject(project, user); Bop bop = new Bop(); bop.setCollections(collections);
/** * Handles empty get call this will return a list of projects that are * visible to the current user Not yet implemented. * * @param mimeType * @param modifiedSince * @param request * @throws IOException * @throws BizPolicyException */ @RequestMapping(method = {RequestMethod.GET}) public void handleEmptyGetRequest(@RequestHeader(value = "Accept", required = false) String mimeType, @RequestHeader(value = "If-Modified-Since", required = false) @DateTimeFormat(iso = DATE_TIME) Date modifiedSince, HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException, BizPolicyException { Person user = getAuthenticatedUser(); if (user == null) { resp.sendError(HttpServletResponse.SC_UNAUTHORIZED); return; } else { Set<Project> projects = projectBizService.findByAdmin(user); Bop bop = new Bop(); bop.setProjects(projects); resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml"); objectBuilder.buildBusinessObjectPackage(bop, resp.getOutputStream()); } }
resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml"); Set<Collection> collections = projectBizService.getCollectionsForProject(project, user); Bop bop = new Bop(); bop.setCollections(collections);
private boolean checkProjectExists(String id) throws BizPolicyException { boolean found = false; Project project = projectBizService.getProject(id); if (project != null) { found = true; } return found; }
projectBizService.updateProject(project, user); resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/xml");
Project project = projectBizService.getProject(objectId); if(project != null){ UiProjectObject uiProjectObject = new UiProjectObject(project);
projectBizService.updateProject(newProject, user);
String id = util.buildRequestUrl(request); Project project = projectBizService.getProject(id, user);
projectBizService.updateProject(newProject, user);
String id = util.buildRequestUrl(request); Project project = projectBizService.getProject(id, user);
Project project = projectBizService.getProject(objectId); if(project != null){ UiProjectObject uiProjectObject = new UiProjectObject(project);
Project project = projectBizService.getProject(businessObjectId); try{ for(String id : relationshipService.getCollectionIdsForProjectId(businessObjectId)){
Project project = projectBizService.getProject(businessObjectId); try{ for(String id : relationshipService.getCollectionIdsForProjectId(businessObjectId)){
parent = projectBizService.getProject(parentId); } else if (id.getType().equals(Types.COLLECTION.name())) { parent = collectionBizService.getCollection(parentId);
private void ingestCollection(Collection collection, IngestWorkflowState state, Person user) throws BizPolicyException, BizInternalException, StatefulIngestServiceException { //Check the collection parent is a project this can happen if the project is specified in the collection isPartOf section in the REM. if (collection.getParentId() != null && !collection.getParentId().isEmpty()) { if (projectBizService.getProject(collection.getParentId()) != null) { collection.setParentProjectId(collection.getParentId()); collection.setParentId(null); } } //Check to make sure any parent collections are already deposited if (collection.getParentId() != null && !collection.getParentId().isEmpty()) { Collection parent = collectionBizService.getCollection(collection.getParentId()); if (parent == null) { Collection parentInPackage = (Collection) state.getBusinessObjectManager().get(collection.getParentId()); if (parentInPackage == null) { throw new StatefulIngestServiceException("Parent Collection " + collection.getParentId() + " for collection " + collection.getId() + " could not be found."); } else { ingestCollection(parentInPackage, state, user); } } } collectionBizService.createCollection(collection, user); }
private void ingestCollection(Collection collection, IngestWorkflowState state, Person user) throws BizPolicyException, BizInternalException, StatefulIngestServiceException { //Check the collection parent is a project this can happen if the project is specified in the collection isPartOf section in the REM. if (collection.getParentId() != null && !collection.getParentId().isEmpty()) { if (projectBizService.getProject(collection.getParentId()) != null) { collection.setParentProjectId(collection.getParentId()); collection.setParentId(null); } } //Check to make sure any parent collections are already deposited if (collection.getParentId() != null && !collection.getParentId().isEmpty()) { Collection parent = collectionBizService.getCollection(collection.getParentId()); if (parent == null) { Collection parentInPackage = (Collection) state.getBusinessObjectManager().get(collection.getParentId()); if (parentInPackage == null) { throw new StatefulIngestServiceException("Parent Collection " + collection.getParentId() + " for collection " + collection.getId() + " could not be found."); } else { ingestCollection(parentInPackage, state, user); } } } collectionBizService.createCollection(collection, user); }
parent = projectBizService.getProject(parentId); } else if (id.getType().equals(Types.COLLECTION.name())) { parent = collectionBizService.getCollection(parentId);