mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
Remove Traditional/Basic Workflow from codebase and database - restore in-between layer
This commit is contained in:
@@ -64,9 +64,9 @@ import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* Metadata importer to allow the batch import of metadata from a file
|
||||
@@ -370,7 +370,7 @@ public class MetadataImport extends DSpaceRunnable<MetadataImportScriptConfigura
|
||||
}
|
||||
|
||||
WorkspaceItem wsItem = null;
|
||||
XmlWorkflowItem wfItem = null;
|
||||
WorkflowItem wfItem = null;
|
||||
Item item = null;
|
||||
|
||||
// Is this an existing item?
|
||||
@@ -570,8 +570,7 @@ public class MetadataImport extends DSpaceRunnable<MetadataImportScriptConfigura
|
||||
|
||||
// Should the workflow be used?
|
||||
if (useWorkflow) {
|
||||
XmlWorkflowService workflowService
|
||||
= XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
if (workflowNotify) {
|
||||
wfItem = workflowService.start(c, wsItem);
|
||||
} else {
|
||||
|
@@ -97,8 +97,8 @@ import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.w3c.dom.Document;
|
||||
@@ -156,7 +156,7 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
|
||||
@Autowired(required = true)
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowService workflowService;
|
||||
protected WorkflowService workflowService;
|
||||
@Autowired(required = true)
|
||||
protected ConfigurationService configurationService;
|
||||
|
||||
@@ -498,7 +498,7 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
|
||||
// create workspace item
|
||||
Item myitem = null;
|
||||
WorkspaceItem wi = null;
|
||||
XmlWorkflowItem wfi = null;
|
||||
WorkflowItem wfi = null;
|
||||
|
||||
if (!isTest) {
|
||||
wi = workspaceItemService.create(c, mycollections.iterator().next(), template);
|
||||
|
@@ -33,7 +33,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ public class AuthorizeServiceImpl implements AuthorizeService {
|
||||
@Autowired(required = true)
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService workflowItemService;
|
||||
|
||||
protected AuthorizeServiceImpl() {
|
||||
|
||||
|
@@ -57,9 +57,9 @@ import org.dspace.harvest.service.HarvestedCollectionService;
|
||||
import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowFactory;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.state.Workflow;
|
||||
import org.dspace.xmlworkflow.storedcomponents.CollectionRole;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.CollectionRoleService;
|
||||
@@ -748,8 +748,8 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
}
|
||||
|
||||
|
||||
XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService().deleteCollection(context, collection);
|
||||
XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService().deleteByCollection(context, collection);
|
||||
WorkflowServiceFactory.getInstance().getWorkflowService().deleteCollection(context, collection);
|
||||
WorkflowServiceFactory.getInstance().getWorkflowItemService().deleteByCollection(context, collection);
|
||||
|
||||
// get rid of the content count cache if it exists
|
||||
// Remove any Handle
|
||||
|
@@ -55,8 +55,8 @@ import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.versioning.service.VersioningService;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
@Autowired(required = true)
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService workflowItemService;
|
||||
|
||||
@Autowired(required = true)
|
||||
protected RelationshipService relationshipService;
|
||||
@@ -1138,8 +1138,7 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
.findByItem(context,
|
||||
item);
|
||||
if (inprogress == null) {
|
||||
inprogress
|
||||
= XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService().findByItem(context, item);
|
||||
inprogress = WorkflowServiceFactory.getInstance().getWorkflowItemService().findByItem(context, item);
|
||||
}
|
||||
|
||||
if (inprogress != null) {
|
||||
|
@@ -28,7 +28,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.hibernate.proxy.HibernateProxyHelper;
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ public class WorkspaceItem
|
||||
* Protected constructor, create object using:
|
||||
* {@link org.dspace.content.service.WorkspaceItemService#create(Context, Collection, boolean)}
|
||||
* or
|
||||
* {@link org.dspace.content.service.WorkspaceItemService#create(Context, XmlWorkflowItem)}
|
||||
* {@link org.dspace.content.service.WorkspaceItemService#create(Context, WorkflowItem)}
|
||||
*/
|
||||
protected WorkspaceItem() {
|
||||
|
||||
|
@@ -28,8 +28,8 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ public class WorkspaceItemServiceImpl implements WorkspaceItemService {
|
||||
@Autowired(required = true)
|
||||
protected ItemService itemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowService workflowService;
|
||||
protected WorkflowService workflowService;
|
||||
|
||||
|
||||
protected WorkspaceItemServiceImpl() {
|
||||
@@ -138,7 +138,7 @@ public class WorkspaceItemServiceImpl implements WorkspaceItemService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkspaceItem create(Context c, XmlWorkflowItem workflowItem) throws SQLException, AuthorizeException {
|
||||
public WorkspaceItem create(Context c, WorkflowItem workflowItem) throws SQLException, AuthorizeException {
|
||||
WorkspaceItem workspaceItem = workspaceItemDAO.create(c, new WorkspaceItem());
|
||||
workspaceItem.setItem(workflowItem.getItem());
|
||||
workspaceItem.setCollection(workflowItem.getCollection());
|
||||
|
@@ -34,7 +34,7 @@ import org.dspace.content.service.SiteService;
|
||||
import org.dspace.content.service.SupervisedItemService;
|
||||
import org.dspace.content.service.WorkspaceItemService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the content package, use ContentServiceFactory.getInstance() to retrieve an
|
||||
@@ -109,7 +109,7 @@ public abstract class ContentServiceFactory {
|
||||
if (inProgressSubmission instanceof WorkspaceItem) {
|
||||
return getWorkspaceItemService();
|
||||
} else {
|
||||
return XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService();
|
||||
return WorkflowServiceFactory.getInstance().getWorkflowItemService();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,7 @@ import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.jdom.Element;
|
||||
|
||||
/**
|
||||
@@ -628,7 +628,7 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester {
|
||||
//We are probably dealing with an item that isn't archived yet
|
||||
InProgressSubmission inProgressSubmission = workspaceItemService.findByItem(context, item);
|
||||
if (inProgressSubmission == null) {
|
||||
inProgressSubmission = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService()
|
||||
inProgressSubmission = WorkflowServiceFactory.getInstance().getWorkflowItemService()
|
||||
.findByItem(context, item);
|
||||
}
|
||||
owningCollection = inProgressSubmission.getCollection();
|
||||
|
@@ -52,8 +52,8 @@ import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.license.service.CreativeCommonsService;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* Container class for code that is useful to many packagers.
|
||||
@@ -520,7 +520,7 @@ public class PackageUtils {
|
||||
} else if (params.workflowEnabled()) {
|
||||
// if we are treating package as a SIP, and we are told to respect workflows
|
||||
|
||||
XmlWorkflowService workflowService = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
// Start an item workflow
|
||||
// (NOTICE: The specified handle is ignored, as Workflows *always* end in a new handle being assigned)
|
||||
return workflowService.startWithoutNotify(context, wsi).getItem();
|
||||
|
@@ -18,7 +18,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
|
||||
/**
|
||||
* Service interface class for the WorkspaceItem object.
|
||||
@@ -55,7 +55,7 @@ public interface WorkspaceItemService extends InProgressSubmissionService<Worksp
|
||||
public WorkspaceItem create(Context context, Collection collection, boolean template)
|
||||
throws AuthorizeException, SQLException;
|
||||
|
||||
public WorkspaceItem create(Context c, XmlWorkflowItem wfi) throws SQLException, AuthorizeException;
|
||||
public WorkspaceItem create(Context c, WorkflowItem wfi) throws SQLException, AuthorizeException;
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@ import org.dspace.discovery.configuration.DiscoveryConfiguration;
|
||||
import org.dspace.discovery.configuration.DiscoveryConfigurationService;
|
||||
import org.dspace.kernel.ServiceManager;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
|
||||
/**
|
||||
* Util methods used by discovery
|
||||
@@ -140,8 +140,7 @@ public class SearchUtils {
|
||||
* @return a list of discovery configuration
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(XmlWorkflowItem witem)
|
||||
throws SQLException {
|
||||
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(WorkflowItem witem) throws SQLException {
|
||||
List<Collection> collections = new ArrayList<Collection>();
|
||||
collections.add(witem.getCollection());
|
||||
return getAllDiscoveryConfigurations("workflow", collections, witem.getItem());
|
||||
|
@@ -49,6 +49,8 @@ import org.dspace.versioning.dao.VersionDAO;
|
||||
import org.dspace.versioning.factory.VersionServiceFactory;
|
||||
import org.dspace.versioning.service.VersionHistoryService;
|
||||
import org.dspace.versioning.service.VersioningService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
|
||||
@@ -518,7 +520,7 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
||||
tableList.add("resourcepolicy");
|
||||
}
|
||||
|
||||
XmlWorkflowService workflowService = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
List<String> workflowConstraints = workflowService.getEPersonDeleteConstraints(context, ePerson);
|
||||
tableList.addAll(workflowConstraints);
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import org.dspace.identifier.DOIIdentifierProvider;
|
||||
import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.IdentifierNotFoundException;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* @author Pascal-Nicolas Becker (p dot becker at tu hyphen berlin dot de)
|
||||
@@ -64,7 +64,7 @@ public class DOIConsumer implements Consumer {
|
||||
Item item = (Item) dso;
|
||||
|
||||
if (ContentServiceFactory.getInstance().getWorkspaceItemService().findByItem(ctx, item) != null
|
||||
|| XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService().findByItem(ctx, item) != null) {
|
||||
|| WorkflowServiceFactory.getInstance().getWorkflowItemService().findByItem(ctx, item) != null) {
|
||||
// ignore workflow and workspace items, DOI will be minted when item is installed
|
||||
return;
|
||||
}
|
||||
|
@@ -33,8 +33,8 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.event.Consumer;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* @author Pascal-Nicolas Becker (dspace -at- pascal -hyphen- becker -dot- de)
|
||||
@@ -49,7 +49,7 @@ public class RDFConsumer implements Consumer {
|
||||
protected BundleService bundleService;
|
||||
protected SiteService siteService;
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService workflowItemService;
|
||||
|
||||
@Override
|
||||
public void initialize() throws Exception {
|
||||
@@ -57,7 +57,7 @@ public class RDFConsumer implements Consumer {
|
||||
bundleService = ContentServiceFactory.getInstance().getBundleService();
|
||||
siteService = ContentServiceFactory.getInstance().getSiteService();
|
||||
workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
workflowItemService = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService();
|
||||
workflowItemService = WorkflowServiceFactory.getInstance().getWorkflowItemService();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -32,7 +32,7 @@ import org.dspace.discovery.IndexingService;
|
||||
import org.dspace.discovery.SearchServiceException;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.FlywayException;
|
||||
import org.flywaydb.core.api.MigrationInfo;
|
||||
@@ -557,8 +557,8 @@ public class DatabaseUtils {
|
||||
scriptLocations.add("classpath:org/dspace/storage/rdbms/migration");
|
||||
|
||||
//Add all potential workflow migration paths
|
||||
List<String> workflowFlywayMigrationLocations = XmlWorkflowServiceFactory.getInstance()
|
||||
.getXmlWorkflowService()
|
||||
List<String> workflowFlywayMigrationLocations = WorkflowServiceFactory.getInstance()
|
||||
.getWorkflowService()
|
||||
.getFlywayMigrationLocations();
|
||||
scriptLocations.addAll(workflowFlywayMigrationLocations);
|
||||
|
||||
|
@@ -22,7 +22,7 @@ import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.dspace.versioning.service.VersionHistoryService;
|
||||
import org.dspace.versioning.service.VersioningService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ public class DefaultItemVersionProvider extends AbstractVersionProvider implemen
|
||||
@Autowired(required = true)
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService workflowItemService;
|
||||
@Autowired(required = true)
|
||||
protected VersionHistoryService versionHistoryService;
|
||||
@Autowired(required = true)
|
||||
|
@@ -21,8 +21,8 @@ import org.dspace.core.Context;
|
||||
import org.dspace.versioning.dao.VersionDAO;
|
||||
import org.dspace.versioning.service.VersionHistoryService;
|
||||
import org.dspace.versioning.service.VersioningService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ public class VersioningServiceImpl implements VersioningService {
|
||||
@Autowired(required = true)
|
||||
private WorkspaceItemService workspaceItemService;
|
||||
@Autowired(required = true)
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService workflowItemService;
|
||||
|
||||
private DefaultItemVersionProvider provider;
|
||||
|
||||
@@ -139,7 +139,7 @@ public class VersioningServiceImpl implements VersioningService {
|
||||
if (wsi != null) {
|
||||
workspaceItemService.deleteAll(c, wsi);
|
||||
} else {
|
||||
XmlWorkflowItem wfi = workflowItemService.findByItem(c, item);
|
||||
WorkflowItem wfi = workflowItemService.findByItem(c, item);
|
||||
if (wfi != null) {
|
||||
workflowItemService.delete(c, wfi);
|
||||
}
|
||||
|
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.workflow;
|
||||
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
|
||||
/**
|
||||
* Interface representing a workflowitem, each workflowItem implementation must implement this interface.
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public interface WorkflowItem extends InProgressSubmission {
|
||||
|
||||
}
|
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.workflow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.service.InProgressSubmissionService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
|
||||
/**
|
||||
* Service interface class for the Workflow items.
|
||||
* All WorkflowItem service classes should implement this class since it offers some basic methods which all
|
||||
* WorkflowItems
|
||||
* are required to have.
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public interface WorkflowItemService<T extends WorkflowItem> extends InProgressSubmissionService<T> {
|
||||
|
||||
public T create(Context context, Item item, Collection collection) throws SQLException, AuthorizeException;
|
||||
|
||||
/**
|
||||
* Get a workflow item from the database.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param id ID of the workflow item
|
||||
* @return the workflow item, or null if the ID is invalid.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public T find(Context context, int id) throws SQLException;
|
||||
|
||||
/**
|
||||
* return all workflowitems
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @return List of all workflowItems in system
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<T> findAll(Context context) throws SQLException;
|
||||
|
||||
/**
|
||||
* Get all workflow items for a particular collection.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param collection the collection
|
||||
* @return array of the corresponding workflow items
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<T> findByCollection(Context context, Collection collection) throws SQLException;
|
||||
|
||||
/**
|
||||
* Check to see if a particular item is currently under Workflow.
|
||||
* If so, its WorkflowItem is returned. If not, null is returned
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param item the item
|
||||
* @return workflow item corresponding to the item, or null
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public T findByItem(Context context, Item item) throws SQLException;
|
||||
|
||||
/**
|
||||
* Get all workflow items that were original submissions by a particular
|
||||
* e-person.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param ep the eperson
|
||||
* @return the corresponding workflow items
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<T> findBySubmitter(Context context, EPerson ep) throws SQLException;
|
||||
|
||||
/**
|
||||
* Delete all workflow items present in the specified collection.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param collection the containing collection
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void deleteByCollection(Context context, Collection collection)
|
||||
throws SQLException, IOException, AuthorizeException;
|
||||
|
||||
/**
|
||||
* Delete the specified workflow item.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param workflowItem which workflow item to delete
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void delete(Context context, T workflowItem) throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
}
|
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.workflow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
|
||||
/**
|
||||
* Service interface class for the WorkflowService framework.
|
||||
* All WorkflowServices service classes should implement this class since it offers some basic methods which all
|
||||
* Workflows
|
||||
* are required to have.
|
||||
*
|
||||
* @param <T> some implementation of workflow item.
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public interface WorkflowService<T extends WorkflowItem> {
|
||||
|
||||
|
||||
/**
|
||||
* startWorkflow() begins a workflow - in a single transaction do away with
|
||||
* the PersonalWorkspace entry and turn it into a WorkflowItem.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param wsi The WorkspaceItem to convert to a workflow item
|
||||
* @return The resulting workflow item
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws WorkflowException if workflow error
|
||||
*/
|
||||
public T start(Context context, WorkspaceItem wsi)
|
||||
throws SQLException, AuthorizeException, IOException, WorkflowException;
|
||||
|
||||
/**
|
||||
* startWithoutNotify() starts the workflow normally, but disables
|
||||
* notifications (useful for large imports,) for the first workflow step -
|
||||
* subsequent notifications happen normally
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wsi workspace item
|
||||
* @return the resulting workflow item.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws WorkflowException if workflow error
|
||||
*/
|
||||
public T startWithoutNotify(Context c, WorkspaceItem wsi)
|
||||
throws SQLException, AuthorizeException, IOException, WorkflowException;
|
||||
|
||||
/**
|
||||
* abort() aborts a workflow, completely deleting it (administrator do this)
|
||||
* (it will basically do a reject from any state - the item ends up back in
|
||||
* the user's PersonalWorkspace
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wi WorkflowItem to operate on
|
||||
* @param e EPerson doing the operation
|
||||
* @return workspace item returned to workspace
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
public WorkspaceItem abort(Context c, T wi, EPerson e) throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
/**
|
||||
* Deletes workflow task item in correct order.
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wi The WorkflowItem that shall be deleted.
|
||||
* @param e Admin that deletes this workflow task and item (for logging
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
public void deleteWorkflowByWorkflowItem(Context c, T wi, EPerson e)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
public WorkspaceItem sendWorkflowItemBackSubmission(Context c, T workflowItem, EPerson e, String provenance,
|
||||
String rejection_message)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
public String getMyDSpaceLink();
|
||||
|
||||
public void deleteCollection(Context context, Collection collection)
|
||||
throws SQLException, IOException, AuthorizeException;
|
||||
|
||||
public List<String> getEPersonDeleteConstraints(Context context, EPerson ePerson) throws SQLException;
|
||||
|
||||
public Group getWorkflowRoleGroup(Context context, Collection collection, String roleName, Group roleGroup)
|
||||
throws SQLException, IOException, WorkflowConfigurationException, AuthorizeException, WorkflowException;
|
||||
|
||||
/**
|
||||
* This method will create the workflowRoleGroup for a collection and the given rolename
|
||||
* @param context The relevant DSpace context
|
||||
* @param collection The collection
|
||||
* @param roleName The rolename
|
||||
* @return The created Group
|
||||
* @throws AuthorizeException If something goes wrong
|
||||
* @throws SQLException If something goes wrong
|
||||
* @throws IOException If something goes wrong
|
||||
* @throws WorkflowConfigurationException If something goes wrong
|
||||
*/
|
||||
public Group createWorkflowRoleGroup(Context context, Collection collection, String roleName)
|
||||
throws AuthorizeException, SQLException, IOException, WorkflowConfigurationException;
|
||||
|
||||
public List<String> getFlywayMigrationLocations();
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.workflow.factory;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the workflow package, use WorkflowServiceFactory.getInstance() to retrieve an
|
||||
* implementation
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public abstract class WorkflowServiceFactory {
|
||||
|
||||
public abstract WorkflowService getWorkflowService();
|
||||
|
||||
public abstract WorkflowItemService getWorkflowItemService();
|
||||
|
||||
public static WorkflowServiceFactory getInstance() {
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName("workflowServiceFactory", WorkflowServiceFactory.class);
|
||||
}
|
||||
}
|
41
dspace-api/src/main/java/org/dspace/workflow/package.html
Normal file
41
dspace-api/src/main/java/org/dspace/workflow/package.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!--
|
||||
|
||||
The contents of this file are subject to the license and copyright
|
||||
detailed in the LICENSE and NOTICE files at the root of the source
|
||||
tree and available online at
|
||||
|
||||
http://www.dspace.org/license/
|
||||
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Author: dstuve
|
||||
Version: $Id$
|
||||
Date: $Date$
|
||||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
<p>DSpace's workflow system</p>
|
||||
|
||||
<p>
|
||||
DSpace has a simple workflow system, which models the workflows
|
||||
as 5 steps: SUBMIT, three intermediate steps (STEP1, STEP2, STEP3), and ARCHIVE.
|
||||
When an item is submitted to DSpace, it is in the SUBMIT state. If there
|
||||
are no intermediate states defined, then it proceeds directly to ARCHIVE and
|
||||
is put into the main DSpace archive.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
EPerson groups may be assigned to the three possible intermediate steps,
|
||||
where they are expected to act on the item at those steps. For example,
|
||||
if a Collection's owners desire a review step, they would create a Group
|
||||
of reviewers, and assign that Group to step 1. The members of step 1's
|
||||
Group will receive emails asking them to review the submission, and
|
||||
will need to perform an action on the item before it can be rejected
|
||||
back to the submitter or placed in the archive.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -8,6 +8,7 @@
|
||||
package org.dspace.xmlworkflow.factory;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.ClaimedTaskService;
|
||||
@@ -23,7 +24,7 @@ import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public abstract class XmlWorkflowServiceFactory {
|
||||
public abstract class XmlWorkflowServiceFactory extends WorkflowServiceFactory {
|
||||
|
||||
public abstract XmlWorkflowFactory getWorkflowFactory();
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package org.dspace.xmlworkflow.factory;
|
||||
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.ClaimedTaskService;
|
||||
@@ -88,4 +90,14 @@ public class XmlWorkflowServiceFactoryImpl extends XmlWorkflowServiceFactory {
|
||||
public XmlWorkflowItemService getXmlWorkflowItemService() {
|
||||
return xmlWorkflowItemService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkflowService getWorkflowService() {
|
||||
return getXmlWorkflowService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkflowItemService getWorkflowItemService() {
|
||||
return getXmlWorkflowItemService();
|
||||
}
|
||||
}
|
||||
|
@@ -23,9 +23,9 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* A utility class that will send all the worklfow items
|
||||
@@ -114,11 +114,11 @@ public class RestartWorkflow {
|
||||
System.out.println("Sending all workflow items back to the workspace");
|
||||
|
||||
|
||||
XmlWorkflowServiceFactory workflowServiceFactory = XmlWorkflowServiceFactory.getInstance();
|
||||
List<XmlWorkflowItem> workflowItems = workflowServiceFactory.getXmlWorkflowItemService().findAll(context);
|
||||
XmlWorkflowService workflowService = workflowServiceFactory.getXmlWorkflowService();
|
||||
WorkflowServiceFactory workflowServiceFactory = WorkflowServiceFactory.getInstance();
|
||||
List<WorkflowItem> workflowItems = workflowServiceFactory.getWorkflowItemService().findAll(context);
|
||||
WorkflowService workflowService = workflowServiceFactory.getWorkflowService();
|
||||
int i = 0;
|
||||
for (XmlWorkflowItem workflowItem : workflowItems) {
|
||||
for (WorkflowItem workflowItem : workflowItems) {
|
||||
System.out.println("Processing workflow item " + i + " of " + workflowItems.size());
|
||||
System.out.println("Removing pooled tasks");
|
||||
|
||||
|
@@ -14,15 +14,12 @@ import javax.mail.MessagingException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.RoleMembers;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.state.Step;
|
||||
import org.dspace.xmlworkflow.state.Workflow;
|
||||
import org.dspace.xmlworkflow.state.actions.ActionResult;
|
||||
@@ -33,7 +30,7 @@ import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
|
||||
/**
|
||||
* When an item is submitted and is somewhere in a workflow, it has a row in the
|
||||
* cwf_workflowitem table pointing to it.
|
||||
* WorkflowItem table pointing to it.
|
||||
*
|
||||
* Once the item has completed the workflow it will be archived
|
||||
*
|
||||
@@ -42,101 +39,7 @@ import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
* @author Ben Bosman (ben at atmire dot com)
|
||||
* @author Mark Diggory (markd at atmire dot com)
|
||||
*/
|
||||
public interface XmlWorkflowService {
|
||||
/**
|
||||
* startWorkflow() begins a workflow - in a single transaction do away with
|
||||
* the PersonalWorkspace entry and turn it into a WorkflowItem.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param wsi The WorkspaceItem to convert to a workflow item
|
||||
* @return The resulting workflow item
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws WorkflowException if workflow error
|
||||
*/
|
||||
public XmlWorkflowItem start(Context context, WorkspaceItem wsi)
|
||||
throws SQLException, AuthorizeException, IOException, WorkflowException;
|
||||
|
||||
/**
|
||||
* startWithoutNotify() starts the workflow normally, but disables
|
||||
* notifications (useful for large imports,) for the first workflow step -
|
||||
* subsequent notifications happen normally
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wsi workspace item
|
||||
* @return the resulting workflow item.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws WorkflowException if workflow error
|
||||
*/
|
||||
public XmlWorkflowItem startWithoutNotify(Context c, WorkspaceItem wsi)
|
||||
throws SQLException, AuthorizeException, IOException, WorkflowException;
|
||||
|
||||
/**
|
||||
* abort() aborts a workflow, completely deleting it (administrator do this)
|
||||
* (it will basically do a reject from any state - the item ends up back in
|
||||
* the user's PersonalWorkspace
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wi WorkflowItem to operate on
|
||||
* @param e EPerson doing the operation
|
||||
* @return workspace item returned to workspace
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
public WorkspaceItem abort(Context c, XmlWorkflowItem wi, EPerson e)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
/**
|
||||
* Deletes workflow task item in correct order.
|
||||
*
|
||||
* @param c The relevant DSpace Context.
|
||||
* @param wi The WorkflowItem that shall be deleted.
|
||||
* @param e Admin that deletes this workflow task and item (for logging
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
public void deleteWorkflowByWorkflowItem(Context c, XmlWorkflowItem wi, EPerson e)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
public WorkspaceItem sendWorkflowItemBackSubmission(Context c, XmlWorkflowItem workflowItem, EPerson e,
|
||||
String provenance,
|
||||
String rejection_message)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
||||
public String getMyDSpaceLink();
|
||||
|
||||
public void deleteCollection(Context context, Collection collection)
|
||||
throws SQLException, IOException, AuthorizeException;
|
||||
|
||||
public List<String> getEPersonDeleteConstraints(Context context, EPerson ePerson) throws SQLException;
|
||||
|
||||
public Group getWorkflowRoleGroup(Context context, Collection collection, String roleName, Group roleGroup)
|
||||
throws SQLException, IOException, WorkflowConfigurationException, AuthorizeException, WorkflowException;
|
||||
|
||||
/**
|
||||
* This method will create the workflowRoleGroup for a collection and the given rolename
|
||||
* @param context The relevant DSpace context
|
||||
* @param collection The collection
|
||||
* @param roleName The rolename
|
||||
* @return The created Group
|
||||
* @throws AuthorizeException If something goes wrong
|
||||
* @throws SQLException If something goes wrong
|
||||
* @throws IOException If something goes wrong
|
||||
* @throws WorkflowConfigurationException If something goes wrong
|
||||
*/
|
||||
public Group createWorkflowRoleGroup(Context context, Collection collection, String roleName)
|
||||
throws AuthorizeException, SQLException, IOException, WorkflowConfigurationException;
|
||||
|
||||
public List<String> getFlywayMigrationLocations();
|
||||
public interface XmlWorkflowService extends WorkflowService<XmlWorkflowItem> {
|
||||
|
||||
public void alertUsersOnTaskActivation(Context c, XmlWorkflowItem wfi, String emailTemplate, List<EPerson> epa,
|
||||
String... arguments) throws IOException, SQLException, MessagingException;
|
||||
|
@@ -20,10 +20,10 @@ import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "cwf_workflowitem")
|
||||
public class XmlWorkflowItem implements InProgressSubmission {
|
||||
public class XmlWorkflowItem implements WorkflowItem {
|
||||
|
||||
@Id
|
||||
@Column(name = "workflowitem_id")
|
||||
|
@@ -7,16 +7,13 @@
|
||||
*/
|
||||
package org.dspace.xmlworkflow.storedcomponents.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.service.InProgressSubmissionService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
|
||||
/**
|
||||
@@ -26,87 +23,7 @@ import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public interface XmlWorkflowItemService extends InProgressSubmissionService<XmlWorkflowItem> {
|
||||
|
||||
public XmlWorkflowItem create(Context context, Item item, Collection collection) throws SQLException,
|
||||
AuthorizeException;
|
||||
|
||||
/**
|
||||
* Get a workflow item from the database.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param id ID of the workflow item
|
||||
* @return the workflow item, or null if the ID is invalid.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public XmlWorkflowItem find(Context context, int id) throws SQLException;
|
||||
|
||||
/**
|
||||
* return all workflowitems
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @return List of all workflowItems in system
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<XmlWorkflowItem> findAll(Context context) throws SQLException;
|
||||
|
||||
/**
|
||||
* Get all workflow items for a particular collection.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param collection the collection
|
||||
* @return array of the corresponding workflow items
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<XmlWorkflowItem> findByCollection(Context context, Collection collection) throws SQLException;
|
||||
|
||||
/**
|
||||
* Check to see if a particular item is currently under Workflow.
|
||||
* If so, its WorkflowItem is returned. If not, null is returned
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param item the item
|
||||
* @return workflow item corresponding to the item, or null
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public XmlWorkflowItem findByItem(Context context, Item item) throws SQLException;
|
||||
|
||||
/**
|
||||
* Get all workflow items that were original submissions by a particular
|
||||
* e-person.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param ep the eperson
|
||||
* @return the corresponding workflow items
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public List<XmlWorkflowItem> findBySubmitter(Context context, EPerson ep) throws SQLException;
|
||||
|
||||
/**
|
||||
* Delete all workflow items present in the specified collection.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param collection the containing collection
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void deleteByCollection(Context context, Collection collection)
|
||||
throws SQLException, IOException, AuthorizeException;
|
||||
|
||||
/**
|
||||
* Delete the specified workflow item.
|
||||
*
|
||||
* @param context The relevant DSpace Context.
|
||||
* @param workflowItem which workflow item to delete
|
||||
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void delete(Context context, XmlWorkflowItem workflowItem)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
public interface XmlWorkflowItemService extends WorkflowItemService<XmlWorkflowItem> {
|
||||
|
||||
/**
|
||||
* return all workflowitems for a certain page
|
||||
|
@@ -38,10 +38,10 @@ import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -50,24 +50,16 @@ import org.junit.Test;
|
||||
*/
|
||||
public class EPersonTest extends AbstractUnitTest {
|
||||
|
||||
protected EPersonService ePersonService
|
||||
= EPersonServiceFactory.getInstance().getEPersonService();
|
||||
protected GroupService groupService
|
||||
= EPersonServiceFactory.getInstance().getGroupService();
|
||||
protected CommunityService communityService
|
||||
= ContentServiceFactory.getInstance().getCommunityService();
|
||||
protected CollectionService collectionService
|
||||
= ContentServiceFactory.getInstance().getCollectionService();
|
||||
protected ItemService itemService
|
||||
= ContentServiceFactory.getInstance().getItemService();
|
||||
protected InstallItemService installItemService
|
||||
= ContentServiceFactory.getInstance().getInstallItemService();
|
||||
protected XmlWorkflowItemService workflowItemService
|
||||
= XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService();
|
||||
protected XmlWorkflowService workflowService
|
||||
= XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
protected WorkspaceItemService workspaceItemService
|
||||
= ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
protected EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService();
|
||||
protected GroupService groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
||||
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();
|
||||
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
||||
protected InstallItemService installItemService = ContentServiceFactory.getInstance().getInstallItemService();
|
||||
protected WorkflowItemService workflowItemService = WorkflowServiceFactory.getInstance().getWorkflowItemService();
|
||||
protected WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
protected WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance()
|
||||
.getWorkspaceItemService();
|
||||
|
||||
private Community community = null;
|
||||
private Collection collection = null;
|
||||
@@ -1034,7 +1026,7 @@ public class EPersonTest extends AbstractUnitTest {
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
// check whether the workflow item still exists.
|
||||
XmlWorkflowItem wfi = workflowItemService.find(context, wfiID);
|
||||
WorkflowItem wfi = workflowItemService.find(context, wfiID);
|
||||
assertNotNull("Could not load WorkflowItem after cascading deletion of the submitter.", wfi);
|
||||
assertNull("Cascading deletion of an EPerson did not set the submitter of an submitted WorkflowItem null.",
|
||||
wfi.getSubmitter());
|
||||
|
@@ -45,8 +45,8 @@ import org.dspace.identifier.service.DOIService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -166,7 +166,7 @@ public class DOIIdentifierProviderTest
|
||||
|
||||
WorkspaceItem wsItem = workspaceItemService.create(context, collection, false);
|
||||
|
||||
XmlWorkflowItem wfItem = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService().start(context, wsItem);
|
||||
WorkflowItem wfItem = WorkflowServiceFactory.getInstance().getWorkflowService().start(context, wsItem);
|
||||
|
||||
Item item = wfItem.getItem();
|
||||
itemService.addMetadata(context, item, "dc", "contributor", "author", null, "Author, A. N.");
|
||||
|
@@ -39,8 +39,8 @@ import org.dspace.identifier.ezid.Transform;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
@@ -124,7 +124,7 @@ public class EZIDIdentifierProviderTest
|
||||
|
||||
WorkspaceItem wsItem = workspaceItemService.create(context, collection, false);
|
||||
|
||||
XmlWorkflowItem wfItem = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService().start(context, wsItem);
|
||||
WorkflowItem wfItem = WorkflowServiceFactory.getInstance().getWorkflowService().start(context, wsItem);
|
||||
|
||||
item = wfItem.getItem();
|
||||
|
||||
|
@@ -24,14 +24,13 @@ import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.content.service.CommunityService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowFactory;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactoryImpl;
|
||||
import org.dspace.xmlworkflow.state.Workflow;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Tests that check that the spring bean {@link XmlWorkflowServiceFactoryImpl}
|
||||
* Tests that check that the spring bean {@link org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactoryImpl}
|
||||
* in workflow.xml gets created correctly
|
||||
*
|
||||
* @author Maria Verdonck (Atmire) on 19/12/2019
|
||||
|
@@ -51,8 +51,8 @@ import org.dspace.rest.common.Item;
|
||||
import org.dspace.rest.common.MetadataEntry;
|
||||
import org.dspace.rest.exceptions.ContextException;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
/**
|
||||
* This class provides all CRUD operation over collections.
|
||||
@@ -65,7 +65,7 @@ public class CollectionsResource extends Resource {
|
||||
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
||||
protected AuthorizeService authorizeService = AuthorizeServiceFactory.getInstance().getAuthorizeService();
|
||||
protected WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
protected XmlWorkflowService workflowService = XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
protected WorkflowService workflowService = WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(CollectionsResource.class);
|
||||
|
||||
|
@@ -31,8 +31,8 @@ import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.WorkflowUtils;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.rest.webmvc.ControllerUtils;
|
||||
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
|
||||
@@ -69,7 +69,7 @@ public class CollectionGroupRestController {
|
||||
private AuthorizeService authorizeService;
|
||||
|
||||
@Autowired
|
||||
private XmlWorkflowService workflowService;
|
||||
private WorkflowService workflowService;
|
||||
|
||||
/**
|
||||
* This method creates and returns an AdminGroup object for the given collection
|
||||
|
@@ -57,9 +57,9 @@ import org.dspace.discovery.indexobject.IndexableCollection;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.WorkflowUtils;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.CollectionRole;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.CollectionRoleService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.PoolTaskService;
|
||||
@@ -104,7 +104,7 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
||||
private AuthorizeService authorizeService;
|
||||
|
||||
@Autowired
|
||||
private XmlWorkflowService workflowService;
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private PoolTaskService poolTaskService;
|
||||
|
@@ -45,9 +45,9 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.EPersonServiceImpl;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.state.Step;
|
||||
import org.dspace.xmlworkflow.state.Workflow;
|
||||
import org.dspace.xmlworkflow.state.actions.WorkflowActionConfig;
|
||||
@@ -99,7 +99,7 @@ public class WorkflowItemRestRepository extends DSpaceRestRepository<WorkflowIte
|
||||
EPersonServiceImpl epersonService;
|
||||
|
||||
@Autowired
|
||||
XmlWorkflowService wfs;
|
||||
WorkflowService<XmlWorkflowItem> wfs;
|
||||
|
||||
@Autowired
|
||||
AuthorizeService authorizeService;
|
||||
|
@@ -47,14 +47,14 @@ public class WorkflowItemStepLinkRepository extends AbstractDSpaceRestRepository
|
||||
private XmlWorkflowFactory xmlWorkflowFactory;
|
||||
|
||||
/**
|
||||
* This method will retrieve the {@link WorkflowStepRest} object for the {@link XmlWorkflowItem}
|
||||
* This method will retrieve the {@link WorkflowStepRest} object for the {@link org.dspace.workflow.WorkflowItem}
|
||||
* with the given id
|
||||
* @param request The current request
|
||||
* @param workflowItemId The id for the WorkflowItem to be used
|
||||
* @param optionalPageable The pageable if relevant
|
||||
* @param projection The Projection
|
||||
* @return The {@link WorkflowStepRest} object related to the
|
||||
* {@link XmlWorkflowItem} specified by the given ID
|
||||
* {@link org.dspace.workflow.WorkflowItem} specified by the given ID
|
||||
*/
|
||||
public WorkflowStepRest getStep(@Nullable HttpServletRequest request,
|
||||
Integer workflowItemId,
|
||||
|
@@ -49,9 +49,9 @@ import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.RequestService;
|
||||
import org.dspace.services.model.Request;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.datasource.init.UncategorizedScriptException;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -75,9 +75,9 @@ public class SubmissionService {
|
||||
@Autowired
|
||||
protected WorkspaceItemService workspaceItemService;
|
||||
@Autowired
|
||||
protected XmlWorkflowItemService workflowItemService;
|
||||
protected WorkflowItemService<XmlWorkflowItem> workflowItemService;
|
||||
@Autowired
|
||||
protected XmlWorkflowService workflowService;
|
||||
protected WorkflowService<XmlWorkflowItem> workflowService;
|
||||
@Autowired
|
||||
protected CreativeCommonsService creativeCommonsService;
|
||||
@Autowired
|
||||
|
@@ -33,7 +33,7 @@ import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -51,7 +51,7 @@ public class CollectionGroupRestControllerIT extends AbstractControllerIntegrati
|
||||
private AuthorizeService authorizeService;
|
||||
|
||||
@Autowired
|
||||
private XmlWorkflowService workflowService;
|
||||
private WorkflowService workflowService;
|
||||
|
||||
Collection collection;
|
||||
|
||||
|
@@ -75,7 +75,7 @@ import org.dspace.eperson.service.AccountService;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.eperson.service.RegistrationDataService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -93,7 +93,7 @@ public class EPersonRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
private EPersonService ePersonService;
|
||||
|
||||
@Autowired
|
||||
private XmlWorkflowService workflowService;
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private RegistrationDataDAO registrationDataDAO;
|
||||
|
@@ -995,7 +995,7 @@ public class StatisticsRestRepositoryIT extends AbstractControllerIntegrationTes
|
||||
// ** THEN **
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$._embedded.usagereports", not(empty())))
|
||||
.andExpect(jsonPath("$._embedded.usagereports", Matchers.hasItems(
|
||||
.andExpect(jsonPath("$._embedded.usagereports", Matchers.containsInAnyOrder(
|
||||
UsageReportMatcher
|
||||
.matchUsageReport(collectionNotVisited.getID() + "_" + TOTAL_VISITS_REPORT_ID,
|
||||
TOTAL_VISITS_REPORT_ID,
|
||||
@@ -1007,8 +1007,7 @@ public class StatisticsRestRepositoryIT extends AbstractControllerIntegrationTes
|
||||
UsageReportMatcher.matchUsageReport(collectionNotVisited.getID() + "_" + TOP_CITIES_REPORT_ID,
|
||||
TOP_CITIES_REPORT_ID, new ArrayList<>()),
|
||||
UsageReportMatcher.matchUsageReport(collectionNotVisited.getID() + "_" + TOP_COUNTRIES_REPORT_ID,
|
||||
TOP_COUNTRIES_REPORT_ID, new ArrayList<>())
|
||||
)));
|
||||
TOP_COUNTRIES_REPORT_ID, new ArrayList<>()))));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
package org.dspace.app.rest.authorization;
|
||||
|
||||
import static org.dspace.builder.WorkflowItemBuilder.createWorkflowItem;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
@@ -24,13 +23,14 @@ import org.dspace.app.rest.utils.Utils;
|
||||
import org.dspace.builder.CollectionBuilder;
|
||||
import org.dspace.builder.CommunityBuilder;
|
||||
import org.dspace.builder.ItemBuilder;
|
||||
import org.dspace.builder.WorkflowItemBuilder;
|
||||
import org.dspace.builder.WorkspaceItemBuilder;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -239,7 +239,7 @@ public class ReinstateFeatureRestIT extends AbstractControllerIntegrationTest {
|
||||
Item archivedItem = ItemBuilder.createItem(context, col).withTitle("Item already in archive").build();
|
||||
WorkspaceItem wsItem = WorkspaceItemBuilder.createWorkspaceItem(context, col).withTitle("A workspace item")
|
||||
.build();
|
||||
XmlWorkflowItem wfItem = createWorkflowItem(context, col).withTitle("A workflow item").build();
|
||||
WorkflowItem wfItem = WorkflowItemBuilder.createWorkflowItem(context, col).withTitle("A workflow item").build();
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
ItemRest archivedItemRest = itemConverter.convert(archivedItem, Projection.DEFAULT);
|
||||
|
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
package org.dspace.app.rest.authorization;
|
||||
|
||||
import static org.dspace.builder.WorkflowItemBuilder.createWorkflowItem;
|
||||
import static org.hamcrest.Matchers.contains;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
@@ -24,13 +23,14 @@ import org.dspace.app.rest.utils.Utils;
|
||||
import org.dspace.builder.CollectionBuilder;
|
||||
import org.dspace.builder.CommunityBuilder;
|
||||
import org.dspace.builder.ItemBuilder;
|
||||
import org.dspace.builder.WorkflowItemBuilder;
|
||||
import org.dspace.builder.WorkspaceItemBuilder;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -240,7 +240,7 @@ public class WithdrawFeatureRestIT extends AbstractControllerIntegrationTest {
|
||||
.build();
|
||||
WorkspaceItem wsItem = WorkspaceItemBuilder.createWorkspaceItem(context, col).withTitle("A workspace item")
|
||||
.build();
|
||||
XmlWorkflowItem wfItem = createWorkflowItem(context, col).withTitle("A workflow item").build();
|
||||
WorkflowItem wfItem = WorkflowItemBuilder.createWorkflowItem(context, col).withTitle("A workflow item").build();
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
ItemRest withdrawnItemRest = itemConverter.convert(withdrawnItem, Projection.DEFAULT);
|
||||
|
@@ -24,9 +24,9 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.WorkspaceItemService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.swordapp.server.AuthCredentials;
|
||||
import org.swordapp.server.CollectionListManager;
|
||||
import org.swordapp.server.SwordAuthException;
|
||||
@@ -39,8 +39,8 @@ public class CollectionListManagerDSpace extends DSpaceSwordAPI
|
||||
protected WorkspaceItemService workspaceItemService = ContentServiceFactory
|
||||
.getInstance().getWorkspaceItemService();
|
||||
|
||||
protected XmlWorkflowItemService workflowItemService = XmlWorkflowServiceFactory
|
||||
.getInstance().getXmlWorkflowItemService();
|
||||
protected WorkflowItemService workflowItemService = WorkflowServiceFactory
|
||||
.getInstance().getWorkflowItemService();
|
||||
|
||||
@Override
|
||||
public Feed listCollectionContents(IRI colIRI,
|
||||
@@ -144,8 +144,8 @@ public class CollectionListManagerDSpace extends DSpaceSwordAPI
|
||||
List wfis = workflowItemService.findBySubmitter(sc.getContext(),
|
||||
person);
|
||||
for (Object found : wfis) {
|
||||
if (found instanceof XmlWorkflowItem) {
|
||||
XmlWorkflowItem wfi = (XmlWorkflowItem) found;
|
||||
if (found instanceof WorkflowItem) {
|
||||
WorkflowItem wfi = (WorkflowItem) found;
|
||||
Item item = wfi.getItem();
|
||||
|
||||
// check for the wfi collection
|
||||
|
@@ -25,9 +25,9 @@ import org.dspace.content.service.WorkspaceItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.swordapp.server.AuthCredentials;
|
||||
import org.swordapp.server.ContainerManager;
|
||||
import org.swordapp.server.Deposit;
|
||||
@@ -44,8 +44,8 @@ public class ContainerManagerDSpace extends DSpaceSwordAPI
|
||||
protected AuthorizeService authorizeService =
|
||||
AuthorizeServiceFactory.getInstance().getAuthorizeService();
|
||||
|
||||
protected XmlWorkflowItemService workflowItemService =
|
||||
XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService();
|
||||
protected WorkflowItemService workflowItemService =
|
||||
WorkflowServiceFactory.getInstance().getWorkflowItemService();
|
||||
|
||||
protected WorkspaceItemService workspaceItemService =
|
||||
ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
@@ -757,7 +757,7 @@ public class ContainerManagerDSpace extends DSpaceSwordAPI
|
||||
WorkspaceItem wsi = wft.getWorkspaceItem(context, item);
|
||||
workspaceItemService.deleteAll(context, wsi);
|
||||
} else if (wft.isItemInWorkflow(context, item)) {
|
||||
XmlWorkflowItem wfi = wft.getWorkflowItem(context, item);
|
||||
WorkflowItem wfi = wft.getWorkflowItem(context, item);
|
||||
workflowItemService.deleteWrapper(context, wfi);
|
||||
}
|
||||
|
||||
|
@@ -19,20 +19,20 @@ import org.dspace.core.Context;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.service.XmlWorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
public class WorkflowTools {
|
||||
protected WorkspaceItemService workspaceItemService =
|
||||
ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
|
||||
protected XmlWorkflowItemService workflowItemService =
|
||||
XmlWorkflowServiceFactory.getInstance().getXmlWorkflowItemService();
|
||||
protected WorkflowItemService workflowItemService =
|
||||
WorkflowServiceFactory.getInstance().getWorkflowItemService();
|
||||
|
||||
protected XmlWorkflowService workflowService =
|
||||
XmlWorkflowServiceFactory.getInstance().getXmlWorkflowService();
|
||||
protected WorkflowService workflowService =
|
||||
WorkflowServiceFactory.getInstance().getWorkflowService();
|
||||
|
||||
protected ConfigurationService configurationService
|
||||
= DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
@@ -88,7 +88,7 @@ public class WorkflowTools {
|
||||
* @return workflow item
|
||||
* @throws DSpaceSwordException can be thrown by the internals of the DSpace SWORD implementation
|
||||
*/
|
||||
public XmlWorkflowItem getWorkflowItem(Context context, Item item)
|
||||
public WorkflowItem getWorkflowItem(Context context, Item item)
|
||||
throws DSpaceSwordException {
|
||||
try {
|
||||
return workflowItemService.findByItem(context, item);
|
||||
@@ -154,7 +154,7 @@ public class WorkflowTools {
|
||||
throws DSpaceSwordException {
|
||||
try {
|
||||
// find the item in the workflow if it exists
|
||||
XmlWorkflowItem wfi = this.getWorkflowItem(context, item);
|
||||
WorkflowItem wfi = this.getWorkflowItem(context, item);
|
||||
|
||||
// abort the workflow
|
||||
if (wfi != null) {
|
||||
|
Reference in New Issue
Block a user