mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
DS-2713: Cleanup. Remove unnecessary "workflow.framework" config. Comment cleanup. Make easier to enable in Spring configs
This commit is contained in:
@@ -15,6 +15,8 @@ import org.dspace.administer.RegistryLoader;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.flywaydb.core.api.MigrationInfo;
|
||||
import org.flywaydb.core.api.callback.FlywayCallback;
|
||||
import org.slf4j.Logger;
|
||||
@@ -74,8 +76,7 @@ public class DatabaseRegistryUpdater implements FlywayCallback
|
||||
MetadataImporter.loadRegistry(base + "sword-metadata.xml", true);
|
||||
|
||||
// Check if XML Workflow is enabled in workflow.cfg
|
||||
String framework = config.getProperty("workflow.framework");
|
||||
if (framework!=null && framework.equals("xmlworkflow"))
|
||||
if (WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService)
|
||||
{
|
||||
// If so, load in the workflow metadata types as well
|
||||
MetadataImporter.loadRegistry(base + "workflow-types.xml", true);
|
||||
|
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
package org.dspace.storage.rdbms.xmlworkflow;
|
||||
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.storage.rdbms.DatabaseUtils;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
@@ -19,6 +18,18 @@ import org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource;
|
||||
import java.sql.Connection;
|
||||
|
||||
/**
|
||||
* This class automatically migrates your DSpace Database to use the
|
||||
* XML-based Configurable Workflow system whenever it is enabled.
|
||||
* <P>
|
||||
* Because XML-based Configurable Workflow existed prior to our migration, this
|
||||
* class first checks for the existence of the "cwf_workflowitem" table before
|
||||
* running any migrations.
|
||||
* <P>
|
||||
* This class represents a Flyway DB Java Migration
|
||||
* http://flywaydb.org/documentation/migration/java.html
|
||||
* <P>
|
||||
* It can upgrade a 6.0 version of DSpace to use the XMLWorkflow.
|
||||
*
|
||||
* User: kevin (kevin at atmire.com)
|
||||
* Date: 1/09/15
|
||||
* Time: 11:34
|
||||
|
@@ -17,7 +17,7 @@
|
||||
--
|
||||
-- This script is called automatically by the following
|
||||
-- Flyway Java migration class:
|
||||
-- org.dspace.storage.rdbms.migration.V5_0_2014_01_01__XMLWorkflow_Migration
|
||||
-- org.dspace.storage.rdbms.xmlworkflow.V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration
|
||||
----------------------------------------------------
|
||||
|
||||
-- Convert workflow groups:
|
||||
|
@@ -7,7 +7,7 @@
|
||||
--
|
||||
|
||||
----------------------------------------------------
|
||||
-- Database Schema Update for XML/Configurable Workflow
|
||||
-- Database Schema Update for XML/Configurable Workflow (for DSpace 6.0)
|
||||
--
|
||||
-- This file will automatically create/update your
|
||||
-- DSpace Database tables to support XML/Configurable workflows.
|
||||
@@ -17,7 +17,7 @@
|
||||
--
|
||||
-- This script is called automatically by the following
|
||||
-- Flyway Java migration class:
|
||||
-- org.dspace.storage.rdbms.migration.V5_0_2014_01_01__XMLWorkflow_Migration
|
||||
-- org.dspace.storage.rdbms.xmlworkflow.V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration
|
||||
----------------------------------------------------
|
||||
|
||||
CREATE SEQUENCE cwf_workflowitem_seq;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
--
|
||||
-- This script is called automatically by the following
|
||||
-- Flyway Java migration class:
|
||||
-- org.dspace.storage.rdbms.migration.V5_0_2014_01_01__XMLWorkflow_Migration
|
||||
-- org.dspace.storage.rdbms.xmlworkflow.V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration
|
||||
----------------------------------------------------
|
||||
|
||||
-- Convert workflow groups:
|
||||
|
@@ -17,7 +17,7 @@
|
||||
--
|
||||
-- This script is called automatically by the following
|
||||
-- Flyway Java migration class:
|
||||
-- org.dspace.storage.rdbms.migration.V5_0_2014_01_01__XMLWorkflow_Migration
|
||||
-- org.dspace.storage.rdbms.xmlworkflow.V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration
|
||||
----------------------------------------------------
|
||||
|
||||
CREATE SEQUENCE cwf_workflowitem_seq;
|
||||
|
@@ -9,7 +9,6 @@ package org.dspace.app.xmlui.aspect.administrative;
|
||||
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.apache.cocoon.servlet.multipart.Part;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -43,6 +42,7 @@ import org.dspace.workflow.WorkflowService;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.WorkflowUtils;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -59,6 +59,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
* Utility methods to processes actions on Communities and Collections.
|
||||
*
|
||||
@@ -540,7 +541,7 @@ public class FlowContainerUtils
|
||||
collectionService.removeSubmitters(context, collection);
|
||||
}
|
||||
else{
|
||||
if(StringUtils.equals(DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("workflow.framework"), "xmlworkflow"))
|
||||
if(WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService)
|
||||
{
|
||||
WorkflowUtils.deleteRoleGroup(context, collection, roleName);
|
||||
}else{
|
||||
|
@@ -25,10 +25,11 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.Role;
|
||||
import org.dspace.xmlworkflow.WorkflowConfigurationException;
|
||||
import org.dspace.xmlworkflow.WorkflowUtils;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
@@ -247,7 +248,7 @@ public class AssignCollectionRoles extends AbstractDSpaceTransformer
|
||||
tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_default_read);
|
||||
|
||||
|
||||
if(StringUtils.equals(DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("workflow.framework"), "xmlworkflow")) {
|
||||
if(WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService) {
|
||||
try{
|
||||
HashMap<String, Role> roles = WorkflowUtils.getAllExternalRoles(thisCollection);
|
||||
addXMLWorkflowRoles(thisCollection, baseURL, roles, rolesTable);
|
||||
|
@@ -29,7 +29,10 @@ importClass(Packages.org.dspace.eperson.EPerson);
|
||||
importClass(Packages.org.dspace.eperson.Group);
|
||||
importClass(Packages.org.dspace.app.util.Util);
|
||||
|
||||
importClass(Packages.org.dspace.workflow.factory.WorkflowServiceFactory);
|
||||
importClass(Packages.org.dspace.xmlworkflow.factory.XmlWorkflowServiceFactory);
|
||||
importClass(Packages.org.dspace.xmlworkflow.service.XmlWorkflowService);
|
||||
|
||||
importClass(Packages.java.util.Set);
|
||||
|
||||
importClass(Packages.org.dspace.app.xmlui.utils.FlowscriptUtils);
|
||||
@@ -45,7 +48,6 @@ importClass(Packages.org.dspace.app.xmlui.aspect.administrative.FlowCurationUtil
|
||||
importClass(Packages.org.dspace.app.xmlui.aspect.administrative.FlowMetadataImportUtils);
|
||||
importClass(Packages.org.dspace.app.xmlui.aspect.administrative.FlowBatchImportUtils);
|
||||
importClass(Packages.java.lang.System);
|
||||
importClass(Packages.org.dspace.core.ConfigurationManager);
|
||||
|
||||
/**
|
||||
* Simple access method to access the current cocoon object model.
|
||||
@@ -2698,7 +2700,7 @@ function doAssignCollectionRoles(collectionID)
|
||||
{
|
||||
result = doDeleteCollectionRole(collectionID, "DEFAULT_READ");
|
||||
}else{
|
||||
if(StringUtils.equals(ConfigurationManager.getProperty("workflow.framework"), "xmlworkflow")){
|
||||
if(WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService){
|
||||
if(workflow == null){
|
||||
var collection = getCollectionService().find(getDSContext(),collectionID);
|
||||
workflow = getXmlWorkflowFactory().getWorkflow(collection);
|
||||
|
@@ -64,17 +64,19 @@
|
||||
<mapping class="org.dspace.versioning.Version"/>
|
||||
<mapping class="org.dspace.versioning.VersionHistory"/>
|
||||
|
||||
<mapping class="org.dspace.app.requestitem.RequestItem"/>
|
||||
|
||||
<!--Basic workflow services, comment or remove when switching to the configurable workflow -->
|
||||
<mapping class="org.dspace.workflowbasic.BasicWorkflowItem"/>
|
||||
<mapping class="org.dspace.workflowbasic.TaskListItem"/>
|
||||
|
||||
<mapping class="org.dspace.app.requestitem.RequestItem"/>
|
||||
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.ClaimedTask"/>-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.CollectionRole"/>-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.InProgressUser"/>-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.PoolTask"/>-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.WorkflowItemRole"/>-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem"/>-->
|
||||
<!--Configurable workflow services, uncomment the xml workflow classes below to enable the configurable workflow-->
|
||||
<!--<mapping class="org.dspace.xmlworkflow.storedcomponents.ClaimedTask"/>
|
||||
<mapping class="org.dspace.xmlworkflow.storedcomponents.CollectionRole"/>
|
||||
<mapping class="org.dspace.xmlworkflow.storedcomponents.InProgressUser"/>
|
||||
<mapping class="org.dspace.xmlworkflow.storedcomponents.PoolTask"/>
|
||||
<mapping class="org.dspace.xmlworkflow.storedcomponents.WorkflowItemRole"/>
|
||||
<mapping class="org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem"/>-->
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
@@ -4,12 +4,12 @@
|
||||
# Configuration properties used solely by the Configurable #
|
||||
# Reviewer Workflow (XMLUI only) #
|
||||
#---------------------------------------------------------------#
|
||||
#Selection of workflow framework that will be used in DSpace
|
||||
# Possible values:
|
||||
# originalworkflow = Traditional DSpace Workflow
|
||||
# xmlworkflow = New (as of 1.8.0) Configurable Reviewer Workflow
|
||||
workflow.framework=originalworkflow
|
||||
#workflow.framework=xmlworkflow
|
||||
#
|
||||
# Workflow framework used by DSpace is now determined by the configured
|
||||
# WorkflowService implementation in [dspace.dir]/config/spring/api/core-services.xml
|
||||
# One of two WorkflowServices should be enabled in that file:
|
||||
# org.dspace.workflowbasic.BasicWorkflowServiceImpl = Traditional DSpace Workflow
|
||||
# org.dspace.xmlworkflow.XmlWorkflowServiceImpl = Configurable (XML) Workflow
|
||||
|
||||
#Allow the reviewers to add/edit/remove files from the submission
|
||||
#When changing this property you might want to alert submitters in the license that reviewers can alter their files
|
||||
|
@@ -103,19 +103,15 @@
|
||||
<bean class="org.dspace.workflowbasic.BasicWorkflowItemServiceImpl"/>
|
||||
<bean class="org.dspace.workflowbasic.BasicWorkflowServiceImpl"/>
|
||||
|
||||
|
||||
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.ClaimedTaskServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.CollectionRoleServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.InProgressUserServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.PoolTaskServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.WorkflowItemRoleServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItemServiceImpl"/>-->
|
||||
|
||||
|
||||
<!--Configurable workflow services, uncomment the xml workflow beans below to enable the configurable workflow-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.XmlWorkflowServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.WorkflowRequirementsServiceImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.XmlWorkflowFactoryImpl"/>-->
|
||||
<!--<bean class="org.dspace.xmlworkflow.storedcomponents.ClaimedTaskServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.storedcomponents.CollectionRoleServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.storedcomponents.InProgressUserServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.storedcomponents.PoolTaskServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.storedcomponents.WorkflowItemRoleServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItemServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.XmlWorkflowServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.WorkflowRequirementsServiceImpl"/>
|
||||
<bean class="org.dspace.xmlworkflow.XmlWorkflowFactoryImpl"/>-->
|
||||
|
||||
</beans>
|
||||
|
Reference in New Issue
Block a user