public boolean testItem(Context context, Item item) { return item.isWithdrawn(); } },
public boolean testItem(Context context, Item item) { return !item.isWithdrawn(); } },
public void replaceResourceContent(Context context, Item item) throws SwordError, DSpaceSwordException { WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
public void deleteMediaResource(Context context, Item item) throws SwordError, DSpaceSwordException { WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
public void addResourceContent(Context context, Item item) throws SwordError, DSpaceSwordException { WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
public void deleteItem(Context context, Item item) throws SwordError, DSpaceSwordException { WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
public void modifyState(Context context, Item item) throws SwordError, DSpaceSwordException { WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
protected Map<String, String> getStates(Context context, Item item) throws DSpaceSwordException { SwordConfigurationDSpace config = new SwordConfigurationDSpace(); WorkflowTools wft = new WorkflowTools(); Map<String, String> states = new HashMap<String, String>(); if (item.isWithdrawn()) { String uri = config.getStateUri("withdrawn"); String desc = config.getStateDescription("withdrawn"); states.put(uri, desc); } else if (item.isArchived()) { String uri = config.getStateUri("archive"); String desc = config.getStateDescription("archive"); states.put(uri, desc); } else if (wft.isItemInWorkflow(context, item)) { String uri = config.getStateUri("workflow"); String desc = config.getStateDescription("workflow"); states.put(uri, desc); } else if (wft.isItemInWorkspace(context, item)) { String uri = config.getStateUri("workspace"); String desc = config.getStateDescription("workspace"); states.put(uri, desc); } return states; }
case Constants.ITEM: Item item = (Item) dso; if (item.isArchived() || item.isWithdrawn()) {
case Constants.ITEM: Item item = (Item) dso; if (item.isArchived() && !item.isWithdrawn()) {
this.setWithdrawn(Boolean.toString(item.isWithdrawn())); this.setLastModified(item.getLastModified().toString());
public void addMetadata(Context context, Item item) throws SwordError, DSpaceSwordException { boolean allowUpdate = ConfigurationManager .getBooleanProperty("swordv2-server", "workflowmanagerdefault.always-update-metadata"); if (allowUpdate) { // all updates are allowed return; } // otherwise, lookup the state of the item WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
itemInfo.item = i; itemInfo.handle = handle; itemInfo.withdrawn = i.isWithdrawn(); itemInfo.datestamp = i.getLastModified(); itemInfo.itemID = i.getID();
public void replaceMetadata(Context context, Item item) throws SwordError, DSpaceSwordException { boolean allowUpdate = ConfigurationManager .getBooleanProperty("swordv2-server", "workflowmanagerdefault.always-update-metadata"); if (allowUpdate) { // all updates are allowed return; } // otherwise, go ahead and figure out the state WorkflowTools wft = new WorkflowTools(); if (item.isArchived() || item.isWithdrawn()) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been archived, and can no longer be modified"); } if (wft.isItemInWorkflow(context, item)) { throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED, "The item has already been injected into the review workflow, and can no longer be " + "modified"); } }
if (item.isWithdrawn()) { dc.add(makeDC("rights", "accessRights", "WITHDRAWN"));
throw new ItemNotDiscoverableException(); if (item.isWithdrawn()) { throw new ItemWithdrawnException();
(item.isWithdrawn() || !item.isDiscoverable() || (isEmbargoed ? isPublic : false)));
boolean inarch = item.isArchived() || item.isWithdrawn();
boolean inarch = item.isArchived() || item.isWithdrawn();
if(item.isWithdrawn()){ Division div = division.addDivision("notice", "notice"); Para p = div.addPara();