From e9665bbb08154d1a67dcd9ad78883c1ffe1b44d7 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 31 Jan 2018 15:03:45 -0600 Subject: [PATCH] Issue 13174 create systemworkflow (#13447) * #13395 CopyContentlet done * #Added the work to create the system workflow on UT * #13174 fixing a log * #13174 feedback fixes --- .../com/dotcms/rest/ErrorResponseHelper.java | 5 +- .../api/v1/authentication/ResponseUtil.java | 5 +- .../api/v1/workflow/WorkflowResource.java | 70 ++- .../exception/mapper/ExceptionMapperUtil.java | 16 +- .../business/WorkflowFactoryImpl.java | 5 +- .../util/WorkflowImportExportUtil.java | 16 +- .../Task04335CreateSystemWorkflow.java | 214 ++++++++ .../dotmarketing/util/TaskLocatorUtil.java | 2 + .../com/dotmarketing/util/UtilMethods.java | 11 + .../startup/runonce/json/systemworkflow.json | 486 ++++++++++++++++++ .../WEB-INF/messages/Language.properties | 1 + 11 files changed, 813 insertions(+), 18 deletions(-) create mode 100644 dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task04335CreateSystemWorkflow.java create mode 100644 dotCMS/src/main/resources/com/dotmarketing/startup/runonce/json/systemworkflow.json diff --git a/dotCMS/src/main/java/com/dotcms/rest/ErrorResponseHelper.java b/dotCMS/src/main/java/com/dotcms/rest/ErrorResponseHelper.java index 7a18b6c6969d..2f4f8f1712d1 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/ErrorResponseHelper.java +++ b/dotCMS/src/main/java/com/dotcms/rest/ErrorResponseHelper.java @@ -28,7 +28,8 @@ private ErrorResponseHelper() {} */ public Response getErrorResponse(final Response.Status status, final Locale locale, - final String messageKey) { + final String messageKey, + final Object... arguments) { try { @@ -36,7 +37,7 @@ public Response getErrorResponse(final Response.Status status, (new ResponseEntityView (Arrays.asList(new ErrorEntity(messageKey, LanguageUtil.get(locale, - messageKey))))).build(); + messageKey, arguments))))).build(); } catch (LanguageException e1) { diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/authentication/ResponseUtil.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/authentication/ResponseUtil.java index b36ef2f1d18e..80cff4cb3635 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/authentication/ResponseUtil.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/authentication/ResponseUtil.java @@ -41,9 +41,10 @@ public Response getErrorResponse(final HttpServletRequest request, final Response.Status status, final Locale locale, final String userId, - final String messageKey) { + final String messageKey, + final Object... arguments) { - return ErrorResponseHelper.INSTANCE.getErrorResponse(status, locale, messageKey); + return ErrorResponseHelper.INSTANCE.getErrorResponse(status, locale, messageKey, arguments); } /** diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java index 06429396e4f8..d2ba7c752aee 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/WorkflowResource.java @@ -22,12 +22,15 @@ import com.dotmarketing.portlets.workflows.model.WorkflowAction; import com.dotmarketing.portlets.workflows.model.WorkflowScheme; import com.dotmarketing.portlets.workflows.model.WorkflowStep; +import com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil; +import com.dotmarketing.portlets.workflows.util.WorkflowSchemeImportExportObject; import com.dotmarketing.util.Logger; import com.google.common.annotations.Beta; import com.liferay.portal.model.User; import com.liferay.util.LocaleUtil; import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.IntStream; @@ -38,9 +41,10 @@ public class WorkflowResource { private final WorkflowHelper workflowHelper; - private final WebResource webResource; - private final WorkflowAPI workflowAPI; - private final ResponseUtil responseUtil; + private final WebResource webResource; + private final WorkflowAPI workflowAPI; + private final ResponseUtil responseUtil; + private final WorkflowImportExportUtil workflowImportExportUtil; /** @@ -50,6 +54,7 @@ public WorkflowResource() { this(WorkflowHelper.getInstance(), APILocator.getWorkflowAPI(), ResponseUtil.INSTANCE, + WorkflowImportExportUtil.getInstance(), new WebResource()); } @@ -57,12 +62,15 @@ public WorkflowResource() { protected WorkflowResource(final WorkflowHelper workflowHelper, final WorkflowAPI workflowAPI, final ResponseUtil responseUtil, + final WorkflowImportExportUtil workflowImportExportUtil, final WebResource webResource) { - this.workflowHelper = workflowHelper; - this.webResource = webResource; - this.responseUtil = responseUtil; - this.workflowAPI = workflowAPI; + this.workflowHelper = workflowHelper; + this.webResource = webResource; + this.responseUtil = responseUtil; + this.workflowAPI = workflowAPI; + this.workflowImportExportUtil = workflowImportExportUtil; + } /** @@ -628,6 +636,7 @@ public final Response deleteAction(@Context final HttpServletRequest request, } // deleteAction /** + * Todo: change the signature to be align with the rest implementation such as: reorderAction * Change the order of the steps in a scheme * @param request HttpServletRequest * @param stepId String step id @@ -717,4 +726,51 @@ public final Response reorderAction(@Context final HttpServletRequest request, return response; } // reorderAction + + /** + * Returns a set of actions associated to the schemeId + * @param request HttpServletRequest + * @param schemeId String + * @return Response + */ + @GET + @Path("/schemes/{schemeId}/export") + @JSONP + @NoCache + @Produces({MediaType.APPLICATION_JSON, "application/javascript"}) + public final Response exportScheme(@Context final HttpServletRequest request, + @PathParam("schemeId") final String schemeId) { + + final InitDataObject initDataObject = this.webResource.init + (null, true, request, true, null); + Response response; + WorkflowSchemeImportExportObject exportObject; + WorkflowScheme scheme; + Locale locale; + + try { + + Logger.debug(this, "Exporting the workflow scheme: " + schemeId); + scheme = this.workflowAPI.findScheme(schemeId); + exportObject = this.workflowImportExportUtil.buildExportObject(Arrays.asList(scheme)); + response = Response.ok(new ResponseEntityView(exportObject)).build(); // 200 + } catch (DoesNotExistException e) { + + Logger.error(this.getClass(), + "The Scheme does not exist, id: " + schemeId, e); + locale = LocaleUtil.getLocale(request); + response = this.responseUtil.getErrorResponse(request, Response.Status.NOT_FOUND, + locale, initDataObject.getUser().getUserId(), "Workflow-does-not-exists-scheme-id", schemeId); + } catch (Exception e) { + + Logger.error(this.getClass(), + "Exception on findActionsByScheme, schemeId: " + schemeId + + ", exception message: " + e.getMessage(), e); + response = (e.getCause() instanceof SecurityException)? + ExceptionMapperUtil.createResponse(e, Response.Status.UNAUTHORIZED) : + ExceptionMapperUtil.createResponse(e, Response.Status.INTERNAL_SERVER_ERROR); + } + + return response; + } // exportScheme. } // E:O:F:WorkflowResource. \ No newline at end of file diff --git a/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/ExceptionMapperUtil.java b/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/ExceptionMapperUtil.java index 8cde60e76065..078dc895245d 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/ExceptionMapperUtil.java +++ b/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/ExceptionMapperUtil.java @@ -43,11 +43,23 @@ public static String getJsonErrorAsString(String message){ * @param entity JSON as String. * @return Response with Status 400 and Media Type JSON. */ - public static Response createResponse(String entity, String message){ + public static Response createResponse(final String entity, final String message){ //Return 4xx message to the client. + return createResponse(entity, message, Response.Status.BAD_REQUEST); + } + + /** + * Creates an error response with a specific status. + * @param entity JSON as String. + * @return Response with Status 400 and Media Type JSON. + */ + public static Response createResponse(final String entity, + final String message, + final Response.Status status){ + return Response - .status(Response.Status.BAD_REQUEST) + .status(status) .entity(entity) .header("error-message", message) .type(MediaType.APPLICATION_JSON) diff --git a/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/business/WorkflowFactoryImpl.java b/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/business/WorkflowFactoryImpl.java index 7d4937f0545d..c08d548cf56b 100644 --- a/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/business/WorkflowFactoryImpl.java +++ b/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/business/WorkflowFactoryImpl.java @@ -9,6 +9,7 @@ import com.dotmarketing.db.DbConnectionFactory; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.AlreadyExistException; +import com.dotmarketing.exception.DoesNotExistException; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.contentlet.model.Contentlet; @@ -610,8 +611,10 @@ public WorkflowScheme findScheme(String id) throws DotDataException { db.addParam(id); scheme = (WorkflowScheme) this.convertListToObjects(db.loadObjectResults(), WorkflowScheme.class).get(0); cache.add(scheme); + } catch (final IndexOutOfBoundsException e) { + throw new DoesNotExistException(e.getMessage(), e); } catch (final Exception e) { - throw new DotDataException(e.getMessage(),e); + throw new DotDataException(e.getMessage(), e); } } return scheme; diff --git a/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/util/WorkflowImportExportUtil.java b/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/util/WorkflowImportExportUtil.java index a1d82476e955..66491dc14bb1 100644 --- a/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/util/WorkflowImportExportUtil.java +++ b/dotCMS/src/main/java/com/dotmarketing/portlets/workflows/util/WorkflowImportExportUtil.java @@ -136,8 +136,17 @@ public void importWorkflowExport(final File file) throws IOException { } public WorkflowSchemeImportExportObject buildExportObject() throws DotDataException, DotSecurityException { + + final WorkflowAPI workflowAPI = APILocator.getWorkflowAPI(); + final List schemes = workflowAPI.findSchemes(true); + + return buildExportObject(schemes); + } + + public WorkflowSchemeImportExportObject buildExportObject(final List schemes) + throws DotDataException, DotSecurityException { + final WorkflowAPI workflowAPI = APILocator.getWorkflowAPI(); - List schemes = workflowAPI.findSchemes(true); List steps = new ArrayList(); List actions = new ArrayList(); List actionClasses = new ArrayList(); @@ -152,10 +161,10 @@ public WorkflowSchemeImportExportObject buildExportObject() throws DotDataExcept // steps actions this.exportStepActions(workflowAPI, actionStepsListMap, steps, scheme); } - + DotConnect dc = new DotConnect(); dc.setSQL("select id, scheme_id, structure_id from workflow_scheme_x_structure"); - List> workflowStructures = dc.loadResults(); + List> workflowStructures = dc.loadResults(); WorkflowSchemeImportExportObject export = new WorkflowSchemeImportExportObject(); export.setSchemes(schemes); @@ -167,7 +176,6 @@ public WorkflowSchemeImportExportObject buildExportObject() throws DotDataExcept export.setWorkflowStructures(workflowStructures); export.setActionSteps(actionStepsListMap); return export; - } private void exportStepActions(final WorkflowAPI wapi, diff --git a/dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task04335CreateSystemWorkflow.java b/dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task04335CreateSystemWorkflow.java new file mode 100644 index 000000000000..888731ca673c --- /dev/null +++ b/dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task04335CreateSystemWorkflow.java @@ -0,0 +1,214 @@ + + +package com.dotmarketing.startup.runonce; + +import com.dotcms.business.CloseDBIfOpened; +import com.dotcms.repackage.com.fasterxml.jackson.databind.DeserializationFeature; +import com.dotcms.repackage.com.fasterxml.jackson.databind.ObjectMapper; +import com.dotcms.util.ConversionUtils; +import com.dotmarketing.common.db.DotConnect; +import com.dotmarketing.exception.DotDataException; +import com.dotmarketing.startup.StartupTask; +import com.dotmarketing.util.Logger; +import com.dotmarketing.util.UtilMethods; +import org.apache.velocity.util.ClassUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * This upgrade task will creates the system workflow + * + * @author jsanca + * @version 5.0 + * + */ +public class Task04335CreateSystemWorkflow implements StartupTask { + + + public static final String SYSTEMWORKFLOW_JSON_PATH = "com/dotmarketing/startup/runonce/json/systemworkflow.json"; + protected static final String SELECT_SCHEME_SQL = "select * from workflow_scheme where id = ?"; + protected static final String INSERT_SCHEME = "insert into workflow_scheme (id, name, description, archived, mandatory, entry_action_id, default_scheme, mod_date) values (?,?,?,?,?,?,?,?)"; + protected static final String INSERT_STEP = "insert into workflow_step (id, name, scheme_id,my_order,resolved,escalation_enable,escalation_action,escalation_time) values (?, ?, ?, ?, ?, ?, ?, ?) "; + protected static final String INSERT_ACTION = "insert into workflow_action (id, scheme_id, name, condition_to_progress, next_step_id, next_assign, my_order, assignable, commentable, icon, use_role_hierarchy_assign, requires_checkout, show_on) values (?, ?, ?, ?, ?, ?, ?,?, ?, ?,?,?,?)"; + protected static final String INSERT_ACTION_FOR_STEP = "insert into workflow_action_step(action_id, step_id, action_order) values (?,?,?)"; + protected static final String INSERT_ACTION_CLASS = "insert into workflow_action_class (id, action_id, name, my_order, clazz) values (?,?, ?, ?, ?)"; + protected static final String DELIMITER = ","; + + + @Override + public boolean forceRun() { + return Boolean.TRUE; + } + + @Override + @CloseDBIfOpened + public void executeUpgrade() throws DotDataException { + + final Map systemWorkflowMap = this.getSystemWorkflowMap(); + boolean doesNotHaveSystemWorkflow = false; + + if (UtilMethods.isSet (systemWorkflowMap)) { + + final List schemeList = (List) systemWorkflowMap.get("schemes"); + + if (UtilMethods.isSet(schemeList)) { + + final Map schemeMap = (Map)schemeList.get(0); + if (!this.existsSystemWorkflow((String) schemeMap.get("id"))) { + + Logger.debug(this, "The System Workflow does not exists, creating it"); + this.createScheme (schemeMap); + this.createSteps ((List)systemWorkflowMap.get("steps")); + this.createActions ((List)systemWorkflowMap.get("actions")); + this.createActionSteps ((List)systemWorkflowMap.get("actionSteps")); + this.createActionClasses((List)systemWorkflowMap.get("actionClasses")); + } + } else { + doesNotHaveSystemWorkflow = true; + } + } else { + doesNotHaveSystemWorkflow = true; + } + + if (doesNotHaveSystemWorkflow) { + + Logger.warn(this, "The resource: " + + SYSTEMWORKFLOW_JSON_PATH + ", does not have any system workflow"); + } + } // executeUpgrade. + + + private void createActionClasses(final List actionClasses) throws DotDataException { + + for (Object actionClass : actionClasses) { + + this.createActionClass((Map)actionClass); + } + } + + private void createActionClass(final Map actionClass) throws DotDataException { + + new DotConnect().setSQL(INSERT_ACTION_CLASS) + .addParam(actionClass.get("id")) + .addParam(actionClass.get("actionId")) + .addParam(actionClass.get("name")) + .addParam(ConversionUtils.toInt(actionClass.get("order").toString(), 0)) + .addParam(actionClass.get("clazz")) + .loadResult(); + } + + private void createActionSteps(final List actionSteps) throws DotDataException { + + for (Object actionStep : actionSteps) { + + this.createActionStep((Map)actionStep); + } + } + + private void createActionStep(final Map actionStep) throws DotDataException { + + new DotConnect().setSQL(INSERT_ACTION_FOR_STEP) + .addParam(actionStep.get("actionId")) + .addParam(actionStep.get("stepId")) + .addParam(ConversionUtils.toInt(actionStep.get("actionOrder"), 0)) + .loadResult(); + } + + private void createActions(final List actions) throws DotDataException { + + for (Object action : actions) { + + this.createAction((Map)action); + } + } + + private void createAction(final Map action) throws DotDataException { + + new DotConnect().setSQL(INSERT_ACTION) + .addParam((String)action.get("id")) + .addParam((String)action.get("schemeId")) + .addParam((String)action.get("name")) + .addParam((String)action.get("condition")) + .addParam((String)action.get("nextStep")) + .addParam((String)action.get("nextAssign")) + .addParam(ConversionUtils.toInt(action.get("order").toString(), 0)) + .addParam(Boolean.valueOf(action.get("assignable").toString())) + .addParam(Boolean.valueOf(action.get("commentable").toString())) + .addParam((String)action.get("icon")) + .addParam(Boolean.valueOf(action.get("roleHierarchyForAssign").toString())) + .addParam(Boolean.valueOf(action.get("requiresCheckout").toString())) + .addParam(this.getShowOn((List)action.get("showOn"))) + .loadResult(); + } + + private String getShowOn(final List showOn) { + + return showOn.stream().collect(Collectors.joining(DELIMITER)); + } + + private void createSteps(final List steps) throws DotDataException { + + for (Object step : steps) { + + this.createStep((Map)step); + } + } + + private void createStep(final Map step) throws DotDataException { + + new DotConnect().setSQL(INSERT_STEP) + .addParam((String)step.get("id")) + .addParam((String)step.get("name")) + .addParam((String)step.get("schemeId")) + .addParam(ConversionUtils.toInt(step.get("myOrder"), 0)) + .addParam(Boolean.valueOf(step.get("resolved").toString())) + .addParam(false) + .addParam((Object)null) + .addParam(0) + .loadResult(); + } + + private void createScheme(final Map schemeMap) throws DotDataException { + + final Date modDate = new Date(ConversionUtils.toLong(schemeMap.get("modDate").toString())); + new DotConnect().setSQL(INSERT_SCHEME) + .addParam((String)schemeMap.get("id")) + .addParam((String)schemeMap.get("name")) + .addParam((String)schemeMap.get("description")) + .addParam(Boolean.valueOf(schemeMap.get("archived").toString())) + .addParam(Boolean.valueOf(schemeMap.get("mandatory").toString())) + .addParam((String)schemeMap.get("entryActionId")) + .addParam(Boolean.valueOf(schemeMap.get("defaultScheme").toString())) + .addParam(modDate) + .loadResult(); + } + + private boolean existsSystemWorkflow(final String workflowId) throws DotDataException { + + return UtilMethods.isSet(new DotConnect().setSQL(SELECT_SCHEME_SQL) + .addParam(workflowId).loadResults()); + } + + private Map getSystemWorkflowMap () throws DotDataException { + + final ObjectMapper mapper = new ObjectMapper(); + Map systemWorkflowMap = null; + + try (final InputStream inputStream = ClassUtils.getResourceAsStream(this.getClass(), SYSTEMWORKFLOW_JSON_PATH)){ + + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + systemWorkflowMap = mapper.readValue(inputStream, Map.class); + } catch (IOException e) { + Logger.error(this,"Does not exists the resource: " + SYSTEMWORKFLOW_JSON_PATH, e); + throw new DotDataException(e); + } + + return systemWorkflowMap; + } + +} diff --git a/dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java b/dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java index 00e307eb7f92..70d7fa494e9f 100644 --- a/dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java +++ b/dotCMS/src/main/java/com/dotmarketing/util/TaskLocatorUtil.java @@ -222,6 +222,8 @@ public static List> getStartupRunOnceTaskClasses() { ret.add(Task04320WorkflowActionRemoveNextStepConstraint.class); ret.add(Task04325RemoveFKFromWorkflowTaskTable.class); ret.add(Task04330WorkflowTaskAddLanguageIdColumn.class); + ret.add(Task04335CreateSystemWorkflow.class); + return ret; } diff --git a/dotCMS/src/main/java/com/dotmarketing/util/UtilMethods.java b/dotCMS/src/main/java/com/dotmarketing/util/UtilMethods.java index 882446dfaffe..1bb6b0b9038e 100644 --- a/dotCMS/src/main/java/com/dotmarketing/util/UtilMethods.java +++ b/dotCMS/src/main/java/com/dotmarketing/util/UtilMethods.java @@ -352,6 +352,17 @@ public static final boolean isSet(final Collection collection) { return null != collection && !collection.isEmpty(); } + /** + * Determines if a map of objects is different from {@code null} and is not empty. + * + * @param map - The {@link Collection} to check. + * @return If the collection is not null and is not empty, returns {@code true}. Otherwise, + * returns {@code false}. + */ + public static final boolean isSet(final Map map) { + return null != map && !map.isEmpty(); + } + /** * Determines if an array of objects is different from {@code null} and is not empty. * diff --git a/dotCMS/src/main/resources/com/dotmarketing/startup/runonce/json/systemworkflow.json b/dotCMS/src/main/resources/com/dotmarketing/startup/runonce/json/systemworkflow.json new file mode 100644 index 000000000000..5be771a00d98 --- /dev/null +++ b/dotCMS/src/main/resources/com/dotmarketing/startup/runonce/json/systemworkflow.json @@ -0,0 +1,486 @@ +{ + "schemes": [ + { + "id": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "creationDate": 1516226192947, + "name": "System Workflow", + "description": "", + "archived": false, + "mandatory": false, + "defaultScheme": false, + "modDate": 1516219477107, + "entryActionId": null + } + ], + "steps": [ + { + "id": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "creationDate": 1516226384825, + "name": "Unpublished", + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "myOrder": 0, + "resolved": false, + "enableEscalation": false, + "escalationAction": null, + "escalationTime": 0 + }, + { + "id": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "creationDate": 1516226384826, + "name": "Published", + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "myOrder": 1, + "resolved": true, + "enableEscalation": false, + "escalationAction": null, + "escalationTime": 0 + }, + { + "id": "d6b095b6-b65f-4bdb-bbfd-701d663dfee2", + "creationDate": 1516226384826, + "name": "Archived", + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "myOrder": 2, + "resolved": true, + "enableEscalation": false, + "escalationAction": null, + "escalationTime": 0 + } + ], + "actions": [ + { + "id": "4da13a42-5d59-480c-ad8f-94a3adf809fe", + "name": "Archive", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "d6b095b6-b65f-4bdb-bbfd-701d663dfee2", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED", + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "134a50d3-782d-43de-8877-42c0be1c86a4", + "name": "Copy", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "currentstep", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED", + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": true + }, + { + "id": "777f1c6b-c877-4a37-ba4b-10627316c2cc", + "name": "Delete", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "d6b095b6-b65f-4bdb-bbfd-701d663dfee2", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "000ec468-0a63-4283-beb7-fcb36c107b2f", + "name": "Publish", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED", + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "4958588d-9c8e-40e4-bfcb-4ded40bd099f", + "name": "Republish", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "ceca71a0-deee-4999-bd47-b01baa1bcfc8", + "name": "Save", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "b9d89c80-3d88-4311-8365-187323c96436", + "name": "Save / Publish", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "c92f9aa1-9503-4567-ac30-d3242b54d02d", + "name": "Unarchive", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + }, + { + "id": "38efc763-d78f-4e4b-b092-59cd8c579b93", + "name": "Unpublish", + "stepId": null, + "schemeId": "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "condition": "", + "nextStep": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "nextAssign": "654b0931-1027-41f7-ad4d-173115ed8ec1", + "icon": "workflowIcon", + "roleHierarchyForAssign": false, + "requiresCheckout": false, + "assignable": false, + "commentable": false, + "order": 0, + "showOn": [ + "LOCKED", + "UNLOCKED" + ], + "owner": null, + "nextStepCurrentStep": false + } + ], + "actionSteps": [ + { + "stepId": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "actionId": "4da13a42-5d59-480c-ad8f-94a3adf809fe", + "actionOrder": "0" + }, + { + "stepId": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "actionId": "000ec468-0a63-4283-beb7-fcb36c107b2f", + "actionOrder": "1" + }, + { + "stepId": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "actionId": "134a50d3-782d-43de-8877-42c0be1c86a4", + "actionOrder": "2" + }, + { + "stepId": "ee24a4cb-2d15-4c98-b1bd-6327126451f3", + "actionId": "ceca71a0-deee-4999-bd47-b01baa1bcfc8", + "actionOrder": "3" + }, + { + "stepId": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "actionId": "4958588d-9c8e-40e4-bfcb-4ded40bd099f", + "actionOrder": "0" + }, + { + "stepId": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "actionId": "38efc763-d78f-4e4b-b092-59cd8c579b93", + "actionOrder": "1" + }, + { + "stepId": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "actionId": "134a50d3-782d-43de-8877-42c0be1c86a4", + "actionOrder": "2" + }, + { + "stepId": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "actionId": "ceca71a0-deee-4999-bd47-b01baa1bcfc8", + "actionOrder": "3" + }, + { + "stepId": "dc3c9cd0-8467-404b-bf95-cb7df3fbc293", + "actionId": "b9d89c80-3d88-4311-8365-187323c96436", + "actionOrder": "4" + }, + { + "stepId": "d6b095b6-b65f-4bdb-bbfd-701d663dfee2", + "actionId": "c92f9aa1-9503-4567-ac30-d3242b54d02d", + "actionOrder": "0" + }, + { + "stepId": "d6b095b6-b65f-4bdb-bbfd-701d663dfee2", + "actionId": "777f1c6b-c877-4a37-ba4b-10627316c2cc", + "actionOrder": "1" + } + ], + "actionClasses": [ + { + "id": "74c560b7-f71d-44cd-bb33-8016abb3f0f2", + "actionId": "4da13a42-5d59-480c-ad8f-94a3adf809fe", + "name": "Archive content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.ArchiveContentActionlet", + "actionlet": { + "name": "Archive content", + "parameters": null, + "howTo": "This actionlet will archive the content.", + "localizedName": "Archive Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.ArchiveContentActionlet.howTo" + } + }, + { + "id": "6bc6def5-0565-483d-a5bf-e42d4e424bf0", + "actionId": "4da13a42-5d59-480c-ad8f-94a3adf809fe", + "name": "Unlock content", + "order": 1, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.CheckinContentActionlet", + "actionlet": { + "name": "Unlock content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will checkin and unlock the content.", + "localizedName": "Unlock Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.CheckinContentActionlet.howTo" + } + }, + { + "id": "369f381e-d58b-4243-8c92-f3a40b6b801d", + "actionId": "134a50d3-782d-43de-8877-42c0be1c86a4", + "name": "Copy Contentlet", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.CopyActionlet", + "actionlet": { + "name": "Copy Contentlet", + "parameters": [], + "howTo": "This workflow actionlet copies the edited contentlet ", + "localizedName": "Copy Contentlet", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.CopyActionlet.howTo" + } + }, + { + "id": "93f32847-87b7-4770-bd00-987446fd69b8", + "actionId": "777f1c6b-c877-4a37-ba4b-10627316c2cc", + "name": "Delete content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.DeleteContentActionlet", + "actionlet": { + "name": "Delete content", + "parameters": null, + "howTo": "This action will delete the content. Warning: this can't be undone!", + "localizedName": "Delete content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.DeleteContentActionlet.howTo" + } + }, + { + "id": "10494596-1368-460f-980b-51c68fd32e5f", + "actionId": "000ec468-0a63-4283-beb7-fcb36c107b2f", + "name": "Save content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet", + "actionlet": { + "name": "Save content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will checkin the content.", + "localizedName": "Save content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet.howTo" + } + }, + { + "id": "254775a0-713c-4e12-b065-076bde6d51f4", + "actionId": "000ec468-0a63-4283-beb7-fcb36c107b2f", + "name": "Push Publish", + "order": 1, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.PushPublishActionlet", + "actionlet": { + "name": "Push Publish", + "parameters": null, + "howTo": "This actionlet will add the content to the remote publish queue", + "localizedName": "Push Publish", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.PushPublishActionlet.howTo" + } + }, + { + "id": "9f18823e-0a70-4e41-abbe-d356891ff044", + "actionId": "000ec468-0a63-4283-beb7-fcb36c107b2f", + "name": "Unlock content", + "order": 2, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.CheckinContentActionlet", + "actionlet": { + "name": "Unlock content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will checkin and unlock the content.", + "localizedName": "Unlock Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.CheckinContentActionlet.howTo" + } + }, + { + "id": "ce09710c-aaa6-41fd-89b0-d6367a65f118", + "actionId": "4958588d-9c8e-40e4-bfcb-4ded40bd099f", + "name": "Publish content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.PublishContentActionlet", + "actionlet": { + "name": "Publish content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will publish the content.", + "localizedName": "Publish Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.PublishContentActionlet.howTo" + } + }, + { + "id": "61e7c4f5-cbc8-4535-a927-b9b793b7b3eb", + "actionId": "ceca71a0-deee-4999-bd47-b01baa1bcfc8", + "name": "Save content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet", + "actionlet": { + "name": "Save content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will checkin the content.", + "localizedName": "Save content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet.howTo" + } + }, + { + "id": "8a02cf4b-2bf5-4803-8c68-e67fd669ce33", + "actionId": "b9d89c80-3d88-4311-8365-187323c96436", + "name": "Push Publish", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.PushPublishActionlet", + "actionlet": { + "name": "Push Publish", + "parameters": null, + "howTo": "This actionlet will add the content to the remote publish queue", + "localizedName": "Push Publish", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.PushPublishActionlet.howTo" + } + }, + { + "id": "b84879e9-545f-4436-b4c5-e76c1743d168", + "actionId": "b9d89c80-3d88-4311-8365-187323c96436", + "name": "Save content", + "order": 1, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet", + "actionlet": { + "name": "Save content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will checkin the content.", + "localizedName": "Save content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet.howTo" + } + }, + { + "id": "a766e1a8-dd14-4b6a-b39e-98db6a258623", + "actionId": "c92f9aa1-9503-4567-ac30-d3242b54d02d", + "name": "Unarchive content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.UnarchiveContentActionlet", + "actionlet": { + "name": "Unarchive content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will un archive the content and return it to a working state", + "localizedName": "Unarchive Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.UnarchiveContentActionlet.howTo" + } + }, + { + "id": "4132cee3-393d-42ee-84f7-1084a015c4b3", + "actionId": "38efc763-d78f-4e4b-b092-59cd8c579b93", + "name": "Unpublish content", + "order": 0, + "clazz": "com.dotmarketing.portlets.workflows.actionlet.UnpublishContentActionlet", + "actionlet": { + "name": "Unpublish content", + "parameters": null, + "nextStep": null, + "howTo": "This actionlet will unpublish the content.", + "localizedName": "Unpublish Content", + "localizedHowto": "com.dotmarketing.portlets.workflows.actionlet.UnpublishContentActionlet.howTo" + } + } + ], + "actionClassParams": [] + } \ No newline at end of file diff --git a/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties b/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties index b26307f444b8..1889c1fdf176 100644 --- a/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties +++ b/dotCMS/src/main/webapp/WEB-INF/messages/Language.properties @@ -3350,6 +3350,7 @@ Workflow-please-choose-actionlet=Please Choose a Sub-action Workflow-does-not-exists-action=The action does not exists Workflow-does-not-exists-step=The step does not exists Workflow-does-not-exists-scheme=The scheme does not exists +Workflow-does-not-exists-scheme-id=The scheme {0} does not exists Workflow-could-not-save-action=Could not save the action Workflow-action-already-exists=The action could not be saved, it already exists Workflow-permission-issue-save-action=The current user does not have the required permissions to save this action