Collection c = wsi.getCollection(); SubmissionConfigReader subConfigReader = new SubmissionConfigReader(); SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c.getHandle(), false); wsi.setStageReached(lastStep); wsi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED); wsi.update(); + wsi.getID() + "item_id=" + wsi.getItem().getID() + "collection_id=" + wsi.getCollection().getID() + "eperson_id=" + context.getCurrentUser().getID()));
if (step > workspaceItem.getStageReached()) workspaceItem.setStageReached(step); workspaceItem.setPageReached(1); //reset page to first page in new step workspaceItem.update(); context.commit(); else if ((step == workspaceItem.getStageReached()) && (page > workspaceItem.getPageReached())) workspaceItem.setPageReached(page); workspaceItem.update(); context.commit();
@Override public void remove(Context context, WorkspaceItem workspaceItem, Group group) throws SQLException, AuthorizeException { // get the workspace item and the group from the request values workspaceItem.getSupervisorGroups().remove(group); // get the item and have it remove the policies for the group Item item = workspaceItem.getItem(); itemService.removeGroupPolicies(context, item, group); }
/** * Set a specific step and page as reached. * It will also "set back" where a user has reached. * * @param context The current DSpace content * @param id The unique ID of the current workflow/workspace * @param step the step to set as reached, can be also a previous reached step * @param page the page (within the step) to set as reached, can be also a previous reached page */ public static void setBackPageReached(Context context, String id, int step, int page) throws SQLException, AuthorizeException, IOException { InProgressSubmission submission = findSubmission(context, id); if (submission instanceof WorkspaceItem) { WorkspaceItem workspaceItem = (WorkspaceItem) submission; workspaceItem.setStageReached(step); workspaceItem.setPageReached(page > 0 ? page : 1); workspaceItem.update(); context.commit(); } }
@Override public BasicWorkflowItem start(Context context, WorkspaceItem wsi) throws SQLException, AuthorizeException, IOException { Item myitem = wsi.getItem(); Collection collection = wsi.getCollection(); log.info(LogManager.getHeader(context, "start_workflow", "workspace_item_id=" + wsi.getID() + "item_id=" + myitem.getID() + "collection_id=" + collection.getID())); // record the start of the workflow w/provenance message recordStart(context, myitem); // create the WorkflowItem BasicWorkflowItem wfi = workflowItemService.create(context, myitem, collection); wfi.setMultipleFiles(wsi.hasMultipleFiles()); wfi.setMultipleTitles(wsi.hasMultipleTitles()); wfi.setPublishedBefore(wsi.isPublishedBefore()); // remove the WorkspaceItem workspaceItemService.deleteWrapper(context, wsi); // now get the workflow started wfi.setState(WFSTATE_SUBMIT); advance(context, wfi, null); // Return the workflow item return wfi; }
@Override public void deleteWrapper(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException { // Check authorisation. We check permissions on the enclosed item. Item item = workspaceItem.getItem(); authorizeService.authorizeAction(context, item, Constants.WRITE); log.info(LogManager.getHeader(context, "delete_workspace_item", "workspace_item_id=" + workspaceItem.getID() + "item_id=" + item.getID() + "collection_id=" + workspaceItem.getCollection().getID())); // deleteSubmitPermissions(); // Need to delete the workspaceitem row first since it refers // to item ID workspaceItem.getSupervisorGroups().clear(); workspaceItemDAO.delete(context, workspaceItem); }
@Override public BasicWorkflowItem startWithoutNotify(Context c, WorkspaceItem wsi) throws SQLException, AuthorizeException, IOException { // make a hash table entry with item ID for no notify // notify code checks no notify hash for item id noEMail.put(wsi.getItem().getID(), Boolean.TRUE); return start(c, wsi); }
WorkspaceItem wsItem = WorkspaceItem.find(c, wsItemID); Item item = wsItem.getItem(); Collection[] collections = {wsItem.getCollection()}; request.setAttribute("item", item); request.setAttribute("collections", collections); request.setAttribute("workspace_id", Integer.valueOf(wsItem.getID()));
WorkspaceItem[] unfinishedItems = WorkspaceItem.findByEPerson(context,context.getCurrentUser()); SupervisedItem[] supervisedItems = SupervisedItem.findbyEPerson(context, context.getCurrentUser()); DCValue[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY); EPerson submitterEPerson = workspaceItem.getItem().getSubmitter(); int workspaceItemID = workspaceItem.getID(); String url = contextPath+"/submit?workspaceID="+workspaceItemID; String submitterName = submitterEPerson.getFullName(); String submitterEmail = submitterEPerson.getEmail(); String collectionName = workspaceItem.getCollection().getMetadata("name"); DCValue[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY); EPerson submitterEPerson = workspaceItem.getItem().getSubmitter(); int workspaceItemID = workspaceItem.getID(); String url = contextPath+"/submit?workspaceID="+workspaceItemID; String submitterName = submitterEPerson.getFullName(); String submitterEmail = submitterEPerson.getEmail(); String collectionName = workspaceItem.getCollection().getMetadata("name");
@Override public void update(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException { // Authorisation is checked by the item.update() method below log.info(LogManager.getHeader(context, "update_workspace_item", "workspace_item_id=" + workspaceItem.getID())); // Update the item itemService.update(context, workspaceItem.getItem()); // Update ourselves workspaceItemDAO.save(context, workspaceItem); }
.findByEPerson(sc.getContext(), person); for (WorkspaceItem wsi : wsis) { Item item = wsi.getItem(); Collection wsCol = wsi.getCollection(); if (wsCol.getID().equals(collection.getID())) { collectionItems.add(item);
Collection c = wsi.getCollection(); SubmissionConfigReader subConfigReader = new SubmissionConfigReader(); SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c wsi.setStageReached(lastStep); wsi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED); wsi.update();
workspaceItem.setMultipleFiles(wfi.hasMultipleFiles()); workspaceItem.setMultipleTitles(wfi.hasMultipleTitles()); workspaceItem.setPublishedBefore(wfi.isPublishedBefore()); workspaceItemService.update(c, workspaceItem); + workspaceItem.getID()));
WorkspaceItem wi = WorkspaceItem.find(context, Integer .parseInt(workspaceID)); wi.setStageReached(lastStep); wi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED); wi.update(); context.commit();
@Override public Item create(Context context, WorkspaceItem workspaceItem) throws SQLException, AuthorizeException { if (workspaceItem.getItem() != null) { throw new IllegalArgumentException( "Attempting to create an item for a workspace item that already contains an item"); } Item item = createItem(context); workspaceItem.setItem(item); log.info(LogManager.getHeader(context, "create_item", "item_id=" + item.getID())); return item; }
@Override public void move(Context context, WorkspaceItem source, Collection fromCollection, Collection toCollection) throws DCInputsReaderException { source.setCollection(toCollection); List<MetadataValue> remove = new ArrayList<>(); List<String> diff = Util.differenceInSubmissionFields(fromCollection, toCollection); for (String toRemove : diff) { for (MetadataValue value : source.getItem().getMetadata()) { if (value.getMetadataField().toString('.').equals(toRemove)) { remove.add(value); } } } source.getItem().removeMetadata(remove); }
/** * Sets the number of the page reached for the specified step * * @param session * HTTP session (where page reached is stored) * @param step * the current Submission Process Step (which we want to * increment the page reached) * @param pageNumber * new page reached */ private void updatePageReached(SubmissionInfo subInfo, int page) throws SQLException, AuthorizeException, IOException { if (!subInfo.isInWorkflow() && subInfo.getSubmissionItem() != null) { WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); if (page > wi.getPageReached()) { wi.setPageReached(page); wi.update(); } } }