/** * Find out which page a user has reached in this particular step. * * @param subInfo * Submission information * * @return page reached */ public static final int getPageReached(SubmissionInfo subInfo) { if (subInfo.isInWorkflow() || subInfo.getSubmissionItem() == null) { return -1; } else { WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); int i = wi.getPageReached(); return i; } }
/** * Find out which step a user has reached in the submission process. If the * submission is in the workflow process, this returns -1. * * @param subInfo * submission info object * * @return step reached */ public static int getStepReached(SubmissionInfo subInfo) { if (subInfo == null || subInfo.isInWorkflow() || subInfo.getSubmissionItem() == null) { return -1; } else { WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); int i = wi.getStageReached(); // Uninitialised workspace items give "-1" as the stage reached // this is a special value used by the progress bar, so we change // it to "FIRST_STEP" if (i == -1) { i = FIRST_STEP; } return i; } }
/** * Set a specific step and page as reached. * It will also "set back" where a user has reached. * * @param subInfo * the SubmissionInfo object pertaining to the current submission * @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 */ private void setReachedStepAndPage(SubmissionInfo subInfo, int step, int page) throws SQLException, AuthorizeException, IOException { if (!subInfo.isInWorkflow() && subInfo.getSubmissionItem() != null) { WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); wi.setStageReached(step); wi.setPageReached(page); wi.update(); } }
/** * 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(); } } }
context.getCurrentLocale(), subInfo.getSubmissionItem() .getCollection(), subInfo.getSubmissionItem().getItem(), subInfo .getSubmissionItem().getSubmitter()); request.setAttribute("license", license);
Item item = subInfo.getSubmissionItem().getItem(); boolean exists = CreativeCommons.hasLicense(context, item); request.setAttribute("cclicense.exists", Boolean.valueOf(exists));
|| subInfo.getSubmissionItem().hasMultipleFiles())
/** * Indicate the user has advanced to the given stage. This will only * actually do anything when it's a user initially entering a submission. It * will only increase the "stage reached" column - it will not "set back" * where a user has reached. Whenever the "stage reached" column is * increased, the "page reached" column is reset to 1, since you've now * reached page #1 of the next stage. * * @param subInfo * the SubmissionInfo object pertaining to the current submission * @param step * the step the user has just reached */ private void userHasReached(SubmissionInfo subInfo, int step) throws SQLException, AuthorizeException, IOException { if (!subInfo.isInWorkflow() && subInfo.getSubmissionItem() != null) { WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); if (step > wi.getStageReached()) { wi.setStageReached(step); wi.setPageReached(1); // reset page reached back to 1 (since // it's page 1 of the new step) wi.update(); } } }
Collection c = subInfo.getSubmissionItem().getCollection();
Collection c = subInfo.getSubmissionItem().getCollection(); try
Item item = subInfo.getSubmissionItem().getItem(); if (item == null)
Collection c = subInfo.getSubmissionItem().getCollection();
if ((si.getSubmissionItem() != null) && si.isInWorkflow()) + si.getSubmissionItem().getID() + "\"/>"; else if (si.getSubmissionItem() != null) + si.getSubmissionItem().getID() + "\"/>";
(subInfo!=null && submission!=null && subInfo.getSubmissionItem().getID()!=submission.getID()))
WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();
if (subInfo.getSubmissionItem() == null)
&& (SubmissionController.getStepReached(subInfo) <= SubmissionController.FIRST_STEP)) WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); wi.deleteAll();
&& (SubmissionController.getStepReached(subInfo) <= SubmissionController.FIRST_STEP)) WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem(); wi.deleteAll();
IOException Bundle[] bundles = subInfo.getSubmissionItem().getItem().getBundles( "ORIGINAL");
request.setAttribute("workflow.item", subInfo.getSubmissionItem()); JSPManager.showJSP(request, response, "/mydspace/perform-task.jsp");