diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/AbstractContentTypeWorkflowSchemesView.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/AbstractContentTypeWorkflowSchemesView.java new file mode 100644 index 000000000000..6edce27cad27 --- /dev/null +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/AbstractContentTypeWorkflowSchemesView.java @@ -0,0 +1,31 @@ +package com.dotcms.rest.api.v1.workflow; + +import com.dotmarketing.portlets.workflows.model.WorkflowScheme; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import org.immutables.value.Value; + +@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*") +@Value.Immutable +@JsonSerialize(as = ContentTypeWorkflowSchemesView.class) +@JsonDeserialize(as = ContentTypeWorkflowSchemesView.class) +@Schema(description = "Workflow schemes associated with a specific content type") +public interface AbstractContentTypeWorkflowSchemesView { + + @JsonProperty("contentTypeId") + @Schema( + description = "Identifier of the content type", + requiredMode = Schema.RequiredMode.REQUIRED + ) + String contentTypeId(); + + @JsonProperty("contentTypeSchemes") + @Schema( + description = "Workflow schemes associated with the content type", + requiredMode = Schema.RequiredMode.REQUIRED + ) + List contentTypeSchemes(); +} \ No newline at end of file diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/ResponseEntityContentTypeWorkflowSchemesView.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/ResponseEntityContentTypeWorkflowSchemesView.java new file mode 100644 index 000000000000..3cc0e1e9e8e5 --- /dev/null +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/workflow/ResponseEntityContentTypeWorkflowSchemesView.java @@ -0,0 +1,21 @@ +package com.dotcms.rest.api.v1.workflow; + +import com.dotcms.rest.ResponseEntityView; +import java.util.List; + +/** + * Response entity wrapping a list of {@link ContentTypeWorkflowSchemesView}, one entry per + * content type, each pairing a content type identifier with its associated workflow schemes. + * Used by the {@code GET /api/v1/workflow/contenttypes/schemes} endpoint. + */ +public class ResponseEntityContentTypeWorkflowSchemesView extends + ResponseEntityView> { + + /** + * @param contentTypeWorkflowSchemesView list of content-type/scheme associations to return + */ + public ResponseEntityContentTypeWorkflowSchemesView( + final List contentTypeWorkflowSchemesView) { + super(contentTypeWorkflowSchemesView); + } +} \ No newline at end of file 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 54005964f7f6..50ec83a08d06 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 @@ -70,6 +70,7 @@ import com.dotmarketing.portlets.contentlet.transform.DotTransformerBuilder; import com.dotmarketing.portlets.structure.model.ContentletRelationships; import com.dotmarketing.portlets.workflows.actionlet.WorkFlowActionlet; +import com.dotmarketing.portlets.workflows.business.DotWorkflowException; import com.dotmarketing.portlets.workflows.business.WorkflowAPI; import com.dotmarketing.portlets.workflows.business.WorkflowAPI.SystemAction; import com.dotmarketing.portlets.workflows.model.SystemActionWorkflowActionMapping; @@ -199,6 +200,7 @@ public class WorkflowResource { public final static String VERSION = "1.0"; + private static final int MAX_CONTENT_TYPE_IDS = 100; private static final String LISTING = "listing"; private static final String EDITING = "editing"; private static final String ASSIGN = "assign"; @@ -536,6 +538,120 @@ public final Response findAllSchemesAndSchemesByContentType( } } // findAllSchemesAndSchemesByContentType. + /** + * Returns workflow schemes grouped by content type for a list of content type identifiers. + * Unknown or invalid IDs are silently skipped — the response only contains entries for IDs + * that were successfully resolved. At most {@value #MAX_CONTENT_TYPE_IDS} distinct IDs may + * be requested in a single call; exceeding this limit returns 400. + * Returns 401 if the user does not have the required backend permissions. + * + * @param request {@link HttpServletRequest} + * @param response {@link HttpServletResponse} + * @param contentTypeIds content type identifiers — repeat the parameter + * ({@code ?contentTypeIds=a&contentTypeIds=b}) or comma-separate values + * ({@code ?contentTypeIds=a,b}); both formats are supported and may be mixed + * @return {@link Response} containing a list of {@link ContentTypeWorkflowSchemesView}, + * one entry per resolved content type + */ + @GET + @Path("/contenttypes/schemes") + @JSONP + @NoCache + @Produces(MediaType.APPLICATION_JSON) + @Operation(operationId = "getWorkflowSchemesByContentTypeList", + summary = "Find workflow schemes for multiple content types", + description = "Returns workflow [schemes](https://www.dotcms.com/docs/latest/managing-workflows#Schemes) " + + "grouped by content type for a list of content type identifiers. " + + "Each entry in the response maps a resolved content type to its associated schemes. " + + "Unknown or invalid IDs are silently skipped — only successfully resolved content types appear in the result " + + "(note: the single-content-type endpoint returns 404 for an unknown ID; this batch endpoint omits it instead). " + + "Maximum " + MAX_CONTENT_TYPE_IDS + " tokens per request (checked before deduplication).", + tags = {"Workflow"}, + responses = { + @ApiResponse(responseCode = "200", description = "Schemes returned successfully", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = ResponseEntityContentTypeWorkflowSchemesView.class) + ) + ), + @ApiResponse(responseCode = "400", description = "More than " + MAX_CONTENT_TYPE_IDS + " content type IDs supplied"), + @ApiResponse(responseCode = "401", description = "User does not have permission") + } + ) + public final Response findAllSchemesByContentTypeList( + @Context final HttpServletRequest request, + @Context final HttpServletResponse response, + @QueryParam("contentTypeIds") @Parameter( + description = "Content type identifiers. Repeat the parameter " + + "(?contentTypeIds=a&contentTypeIds=b) or comma-separate values " + + "(?contentTypeIds=a,b). Both formats may be mixed. Max " + + MAX_CONTENT_TYPE_IDS + " distinct IDs." + ) final List contentTypeIds) { + + final User user = new WebResource.InitBuilder(webResource) + .requiredBackendUser(true) + .requiredFrontendUser(false) + .requestAndResponse(request, response) + .rejectWhenNoUser(true) + .init() + .getUser(); + + try { + + Logger.debug(this, "Getting the workflow schemes by content type list"); + + final String rawIds = String.join(",", + contentTypeIds == null ? Collections.emptyList() : contentTypeIds); + + final String[] rawTokens = rawIds.split(","); + + if (rawTokens.length > MAX_CONTENT_TYPE_IDS) { + throw new IllegalArgumentException( + "contentTypeIds exceeds the maximum allowed size of " + MAX_CONTENT_TYPE_IDS); + } + + final List ids = Arrays.stream(rawTokens) + .map(String::trim) + .filter(UtilMethods::isSet) + .distinct() + .collect(Collectors.toList()); + + final List skippedIds = new ArrayList<>(); + + final List result = ids.stream() + .map(contentTypeId -> { + try { + return ContentTypeWorkflowSchemesView.builder() + .contentTypeId(contentTypeId) + .contentTypeSchemes(this.workflowHelper.findSchemesByContentType( + contentTypeId, user)) + .build(); + } catch (DotWorkflowException e) { + if (ExceptionUtil.causedBy(e, NotFoundInDbException.class)) { + skippedIds.add(contentTypeId); + return null; + } + throw e; // permission errors and unexpected causes propagate + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + if (!skippedIds.isEmpty()) { + Logger.warn(this.getClass(), "Skipped " + skippedIds.size() + + " unknown content type ID(s): " + skippedIds); + } + + return Response.ok(new ResponseEntityContentTypeWorkflowSchemesView(result)).build(); + + } catch (Exception e) { + + Logger.error(this.getClass(), + "Exception on findAllSchemesByContentTypeList: " + e.getMessage(), e); + return ResponseUtil.mapExceptionResponse(e); + + } + } // findAllSchemesByContentTypeList. + /** * Return Steps associated to the scheme, 404 if does not exists. 401 if the user does not have permission. * @param request HttpServletRequest @@ -3172,7 +3288,7 @@ public final Response fireActionDefaultSinglePart(@Context final HttpServletRequ .requestAndResponse(request, response) .requiredAnonAccess(AnonymousAccess.WRITE) .init(); - + try { Logger.debug(this, ()-> "On Fire Action: systemAction = " + systemAction + ", inode = " + inode + @@ -4912,7 +5028,7 @@ private Contentlet populateContentlet(final FireActionForm fireActionForm, final if(constant instanceof ConstantField) contentlet.getMap().put(constant.variable(), constant.values()); } - + return contentlet; } // populateContentlet. diff --git a/dotCMS/src/main/java/com/dotmarketing/portlets/templates/design/bean/LayoutChanges.java b/dotCMS/src/main/java/com/dotmarketing/portlets/templates/design/bean/LayoutChanges.java index 6c9bcbd146bb..523c20bcadb6 100644 --- a/dotCMS/src/main/java/com/dotmarketing/portlets/templates/design/bean/LayoutChanges.java +++ b/dotCMS/src/main/java/com/dotmarketing/portlets/templates/design/bean/LayoutChanges.java @@ -1,6 +1,5 @@ package com.dotmarketing.portlets.templates.design.bean; -import com.dotcms.rest.api.v1.workflow.SchemesAndSchemesContentTypeView; import com.dotmarketing.business.APILocator; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; diff --git a/dotCMS/src/main/webapp/WEB-INF/openapi/openapi.yaml b/dotCMS/src/main/webapp/WEB-INF/openapi/openapi.yaml index 19c2d8134b1f..8916daf639b7 100644 --- a/dotCMS/src/main/webapp/WEB-INF/openapi/openapi.yaml +++ b/dotCMS/src/main/webapp/WEB-INF/openapi/openapi.yaml @@ -19526,6 +19526,46 @@ paths: summary: Finds workflow actions by content inode tags: - Workflow + /v1/workflow/contenttypes/schemes: + get: + description: "Returns workflow [schemes](https://www.dotcms.com/docs/latest/managing-workflows#Schemes)\ + \ grouped by content type for a list of content type identifiers. Each entry\ + \ in the response maps a resolved content type to its associated schemes.\ + \ Unknown or invalid IDs are silently skipped — only successfully resolved\ + \ content types appear in the result (note: the single-content-type endpoint\ + \ returns 404 for an unknown ID; this batch endpoint omits it instead). Maximum\ + \ 100 tokens per request (checked before deduplication)." + operationId: getWorkflowSchemesByContentTypeList + parameters: + - description: "Content type identifiers. Repeat the parameter (?contentTypeIds=a&contentTypeIds=b)\ + \ or comma-separate values (?contentTypeIds=a,b). Both formats may be mixed.\ + \ Max 100 distinct IDs." + in: query + name: contentTypeIds + schema: + type: array + items: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ResponseEntityContentTypeWorkflowSchemesView" + description: Schemes returned successfully + "400": + description: More than 100 content type IDs supplied + "401": + description: User does not have permission + "403": + description: Forbidden + "406": + description: Not Acceptable + "500": + description: Internal Server Error + summary: Find workflow schemes for multiple content types + tags: + - Workflow /v1/workflow/contenttypes/{contentTypeVarOrId}/system/actions: get: description: "Returns a list of [default system actions](https://www.dotcms.com/docs/latest/managing-workflows#DefaultActions)\ @@ -24803,6 +24843,27 @@ components: type: string variable: type: string + ContentTypeWorkflowSchemesView: + type: object + properties: + contentTypeId: + type: string + description: Identifier of the content type + contentTypeSchemes: + type: array + description: Workflow schemes associated with the content type + items: + $ref: "#/components/schemas/WorkflowScheme" + properties: + empty: + type: boolean + first: + $ref: "#/components/schemas/WorkflowScheme" + last: + $ref: "#/components/schemas/WorkflowScheme" + required: + - contentTypeId + - contentTypeSchemes ContentView: type: object properties: @@ -27786,6 +27847,18 @@ components: $ref: "#/components/schemas/VariantResult" last: $ref: "#/components/schemas/VariantResult" + ImmutableListWorkflowScheme: + type: array + description: Workflow schemes associated with the content type + items: + $ref: "#/components/schemas/WorkflowScheme" + properties: + empty: + type: boolean + first: + $ref: "#/components/schemas/WorkflowScheme" + last: + $ref: "#/components/schemas/WorkflowScheme" ImmutableMapDoubleQuantilePair: type: object additionalProperties: @@ -30433,6 +30506,31 @@ components: type: array items: type: string + ResponseEntityContentTypeWorkflowSchemesView: + type: object + properties: + entity: + type: array + items: + $ref: "#/components/schemas/ContentTypeWorkflowSchemesView" + errors: + type: array + items: + $ref: "#/components/schemas/ErrorEntity" + i18nMessagesMap: + type: object + additionalProperties: + type: string + messages: + type: array + items: + $ref: "#/components/schemas/MessageEntity" + pagination: + $ref: "#/components/schemas/Pagination" + permissions: + type: array + items: + type: string ResponseEntityContentView: type: object properties: diff --git a/dotcms-integration/src/test/java/com/dotcms/rest/api/v1/workflow/WorkflowResourceResponseCodeIntegrationTest.java b/dotcms-integration/src/test/java/com/dotcms/rest/api/v1/workflow/WorkflowResourceResponseCodeIntegrationTest.java index df2e6b8fca66..2939949e0f92 100644 --- a/dotcms-integration/src/test/java/com/dotcms/rest/api/v1/workflow/WorkflowResourceResponseCodeIntegrationTest.java +++ b/dotcms-integration/src/test/java/com/dotcms/rest/api/v1/workflow/WorkflowResourceResponseCodeIntegrationTest.java @@ -1,10 +1,13 @@ package com.dotcms.rest.api.v1.workflow; +import com.dotcms.contenttype.model.type.ContentType; +import com.dotcms.datagen.ContentTypeDataGen; import com.dotcms.datagen.RoleDataGen; import com.dotcms.mock.response.MockAsyncResponse; import com.dotcms.rest.ContentHelper; import com.dotcms.rest.EmptyHttpResponse; import com.dotcms.rest.InitDataObject; +import com.dotcms.rest.ResponseEntityView; import com.dotcms.rest.WebResource; import com.dotcms.rest.api.MultiPartUtils; import com.dotcms.rest.api.v1.authentication.ResponseUtil; @@ -39,6 +42,8 @@ import static com.dotcms.rest.api.v1.workflow.WorkflowTestUtil.*; import static com.dotmarketing.business.Role.ADMINISTRATOR; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.mock; @@ -90,6 +95,7 @@ public static void prepare() throws Exception { when(webResource .init(nullable(String.class), any(HttpServletRequest.class), any(HttpServletResponse.class), anyBoolean(), nullable(String.class))).thenReturn(dataObject); + when(webResource.init(any(WebResource.InitBuilder.class))).thenReturn(dataObject); workflowResource = new WorkflowResource(workflowHelper, contentHelper, workflowAPI, contentletAPI, responseUtil, permissionAPI, workflowImportExportUtil,new MultiPartUtils(), webResource, @@ -442,4 +448,152 @@ public void Find_Actions_By_Scheme_Invalid_SchemeId() { assertEquals(Status.NOT_FOUND.getStatusCode(), findSchemeByActionResponse.getStatus()); } + // ── findAllSchemesByContentTypeList ──────────────────────────────────────── + + @Test + public void Find_Schemes_By_Content_Type_List_Null_Ids() { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), null); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertTrue("Null contentTypeIds should return an empty list", result.isEmpty()); + } + + @Test + public void Find_Schemes_By_Content_Type_List_Empty_List() { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), List.of("")); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertTrue("Empty token should be filtered and return an empty list", result.isEmpty()); + } + + @Test + public void Find_Schemes_By_Content_Type_List_Whitespace_Only() { + // Commas with only whitespace between them should all be filtered out + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), List.of(" , , ")); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertTrue("Whitespace-only tokens should be filtered and return an empty list", result.isEmpty()); + } + + @Test + public void Find_Schemes_By_Content_Type_List_Invalid_Id_Is_Skipped() { + // Invalid IDs are silently skipped; the rest of the batch still succeeds + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), List.of("invalid-ct-id")); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertTrue("Unknown content type ID should be skipped, leaving an empty result", result.isEmpty()); + } + + @Test + public void Find_Schemes_By_Content_Type_List_Ids_With_Surrounding_Whitespace() throws Exception { + // Spaces around a valid ID must be trimmed so the lookup succeeds + final ContentType contentType = new ContentTypeDataGen().nextPersisted(); + try { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), List.of(" " + contentType.id() + " ")); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = + (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertEquals(1, result.size()); + assertEquals(contentType.id(), result.get(0).contentTypeId()); + } finally { + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType); + } + } + + @Test + public void Find_Schemes_By_Content_Type_List_Happy_Path_Comma_Separated() throws Exception { + // Comma-separated values in a single param: ?contentTypeIds=id1,id2 + final ContentType contentType1 = new ContentTypeDataGen().nextPersisted(); + final ContentType contentType2 = new ContentTypeDataGen().nextPersisted(); + try { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), + List.of(contentType1.id() + "," + contentType2.id())); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = + (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertEquals(2, result.size()); + assertTrue(result.stream().anyMatch(v -> v.contentTypeId().equals(contentType1.id()))); + assertTrue(result.stream().anyMatch(v -> v.contentTypeId().equals(contentType2.id()))); + result.forEach(v -> assertFalse( + "Expected at least one scheme for contentType " + v.contentTypeId(), + v.contentTypeSchemes().isEmpty())); + } finally { + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType1); + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType2); + } + } + + @Test + public void Find_Schemes_By_Content_Type_List_Repeated_Param_Format_Captures_All_Ids() throws Exception { + // Repeated params (?contentTypeIds=a&contentTypeIds=b) arrive as separate list elements; + // both must be resolved and returned + final ContentType contentType1 = new ContentTypeDataGen().nextPersisted(); + final ContentType contentType2 = new ContentTypeDataGen().nextPersisted(); + try { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), + List.of(contentType1.id(), contentType2.id())); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = + (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertEquals(2, result.size()); + assertTrue(result.stream().anyMatch(v -> v.contentTypeId().equals(contentType1.id()))); + assertTrue(result.stream().anyMatch(v -> v.contentTypeId().equals(contentType2.id()))); + } finally { + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType1); + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType2); + } + } + + @Test + public void Find_Schemes_By_Content_Type_List_Deduplicates_Input_Ids() throws Exception { + // Duplicate IDs must produce a single lookup and a single entry in the response + final ContentType contentType = new ContentTypeDataGen().nextPersisted(); + try { + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), + List.of(contentType.id(), contentType.id(), contentType.id())); + assertEquals(Status.OK.getStatusCode(), response.getStatus()); + @SuppressWarnings("unchecked") + final List result = + (List) ResponseEntityView.class.cast(response.getEntity()).getEntity(); + assertEquals("Duplicate IDs should be deduplicated to a single entry", 1, result.size()); + } finally { + APILocator.getContentTypeAPI(APILocator.systemUser()).delete(contentType); + } + } + + @Test + public void Find_Schemes_By_Content_Type_List_Exceeds_Max_Size_Expect_BadRequest() { + final List tooManyIds = new java.util.ArrayList<>(); + for (int i = 0; i <= 100; i++) { + tooManyIds.add("ct-id-" + i); + } + final HttpServletRequest request = mock(HttpServletRequest.class); + final Response response = workflowResource.findAllSchemesByContentTypeList( + request, new EmptyHttpResponse(), tooManyIds); + assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus()); + } + } diff --git a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json index c71807be565d..008d545e87e4 100644 --- a/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json +++ b/dotcms-postman/src/main/resources/postman/Workflow_Resource_Tests.json @@ -19847,4 +19847,4 @@ "value": "" } ] -} \ No newline at end of file +} diff --git a/dotcms-postman/src/main/resources/postman/documentation/Workflow Resource.json b/dotcms-postman/src/main/resources/postman/documentation/Workflow Resource.json index 3604383e7f71..460730cc1e03 100644 --- a/dotcms-postman/src/main/resources/postman/documentation/Workflow Resource.json +++ b/dotcms-postman/src/main/resources/postman/documentation/Workflow Resource.json @@ -2,63 +2,330 @@ "info": { "_postman_id": "6f8ea334-6e61-4516-8d8c-4a8e7ac5d4d9", "name": "Workflow Resource Documentation", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "24818383" }, "item": [ + { + "name": "Setup", + "item": [ + { + "name": "Get default site", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "", + " const entity = pm.response.json().entity;", + " pm.collectionVariables.set(\"hostname\", entity.hostname);", + " pm.collectionVariables.set(\"hostIdentifier\", entity.identifier);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{serverURL}}/api/v1/site/defaultSite", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "site", + "defaultSite" + ] + } + }, + "response": [] + }, + { + "name": "Create Test Content Type", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Store first content type ID\", function () {", + " const entity = pm.response.json().entity;", + " pm.expect(entity).to.not.be.null;", + " pm.expect(entity[0]).to.not.be.null;", + " pm.expect(entity[0].id).to.not.be.null;", + " pm.collectionVariables.set(\"contentTypeId\", entity[0].id);", + " pm.collectionVariables.set(\"contentTypeName\", entity[0].name);", + " pm.collectionVariables.set(\"contentTypeVarName\", entity[0].variable);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.collectionVariables.set(\"systemWorkflowId\", \"d61a59e1-a49c-46f2-a929-db2b4bfa88b2\");" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{jwt}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"clazz\": \"com.dotcms.contenttype.model.type.ImmutableSimpleContentType\",\n \"defaultType\": false,\n \"name\": \"Styles_Test_ContentType_{{$timestamp}}\",\n \"description\": \"First content type for page tests\",\n \"host\": \"{{hostname}}\",\n \"owner\": \"dotcms.org.1\",\n \"fixed\": false,\n \"system\": false,\n \"folder\": \"SYSTEM_FOLDER\",\n \"fields\": [\n {\n \"dataType\": \"SYSTEM\",\n \"dbColumn\": \"system_field1\",\n \"fieldVariables\": [],\n \"fixed\": false,\n \"clazz\": \"com.dotcms.contenttype.model.field.ImmutableHostFolderField\",\n \"indexed\": true,\n \"listed\": false,\n \"name\": \"Host/Folder\",\n \"readOnly\": false,\n \"required\": true,\n \"searchable\": true,\n \"sortOrder\": 1,\n \"unique\": false,\n \"variable\": \"hostfolder\"\n },\n {\n \"dataType\": \"TEXT\",\n \"dbColumn\": \"text1\",\n \"fieldVariables\": [],\n \"fixed\": false,\n \"clazz\": \"com.dotcms.contenttype.model.field.ImmutableTextField\",\n \"indexed\": true,\n \"listed\": true,\n \"name\": \"title\",\n \"readOnly\": false,\n \"required\": true,\n \"searchable\": true,\n \"sortOrder\": 2,\n \"unique\": false,\n \"variable\": \"title\"\n }\n ],\n \"workflow\": [\n \"{{systemWorkflowId}}\"\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{serverURL}}/api/v1/contenttype", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "contenttype" + ] + } + }, + "response": [] + }, + { + "name": "copyScheme", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Store first content type ID\", function () {", + " const entity = pm.response.json().entity;", + " pm.expect(entity).to.not.be.null;", + " pm.collectionVariables.set(\"copiedWorkflowId\", entity.id);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{serverURL}}/api/v1/workflow/schemes/d61a59e1a4/copy", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "workflow", + "schemes", + "d61a59e1a4", + "copy" + ] + }, + "description": "Do a copy of an existing scheme \n\n@Path(\"/schemes/{schemeId}/copy\")" + }, + "response": [] + }, + { + "name": "Create Test Content Type 2", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Store first content type ID\", function () {", + " const entity = pm.response.json().entity;", + " pm.expect(entity).to.not.be.null;", + " pm.expect(entity[0]).to.not.be.null;", + " pm.expect(entity[0].id).to.not.be.null;", + " pm.collectionVariables.set(\"contentTypeId_2\", entity[0].id);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.collectionVariables.set(\"systemWorkflowId\", \"d61a59e1-a49c-46f2-a929-db2b4bfa88b2\");" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{jwt}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"clazz\": \"com.dotcms.contenttype.model.type.ImmutableSimpleContentType\",\n \"defaultType\": false,\n \"name\": \"Styles_Test_ContentType_{{$timestamp}}\",\n \"description\": \"Second content type for page tests\",\n \"host\": \"{{hostname}}\",\n \"owner\": \"dotcms.org.1\",\n \"fixed\": false,\n \"system\": false,\n \"folder\": \"SYSTEM_FOLDER\",\n \"fields\": [\n {\n \"dataType\": \"SYSTEM\",\n \"dbColumn\": \"system_field1\",\n \"fieldVariables\": [],\n \"fixed\": false,\n \"clazz\": \"com.dotcms.contenttype.model.field.ImmutableHostFolderField\",\n \"indexed\": true,\n \"listed\": false,\n \"name\": \"Host/Folder\",\n \"readOnly\": false,\n \"required\": true,\n \"searchable\": true,\n \"sortOrder\": 1,\n \"unique\": false,\n \"variable\": \"hostfolder\"\n },\n {\n \"dataType\": \"TEXT\",\n \"dbColumn\": \"text1\",\n \"fieldVariables\": [],\n \"fixed\": false,\n \"clazz\": \"com.dotcms.contenttype.model.field.ImmutableTextField\",\n \"indexed\": true,\n \"listed\": true,\n \"name\": \"title\",\n \"readOnly\": false,\n \"required\": true,\n \"searchable\": true,\n \"sortOrder\": 2,\n \"unique\": false,\n \"variable\": \"title\"\n }\n ],\n \"workflow\": [\n \"{{copiedWorkflowId}}\"\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{serverURL}}/api/v1/contenttype", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "contenttype" + ] + } + }, + "response": [] + }, + { + "name": "Create Test Contentlet 1", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Test Rich Text created successfully\", function () {", + " const json = pm.response.json();", + " pm.expect(json.errors.length).to.eql(0);", + " pm.collectionVariables.set(\"Contentlet_1\", json.entity.identifier);", + " pm.collectionVariables.set(\"contentletInode_1\", json.entity.inode);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"contentlet\": {\n \"contentType\": \"{{contentTypeVarName}}\",\n \"title\": \"Contentlet 1\",\n \"hostfolder\": \"{{hostname}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/PUBLISH?indexPolicy=WAIT_FOR", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "workflow", + "actions", + "default", + "fire", + "PUBLISH" + ], + "query": [ + { + "key": "indexPolicy", + "value": "WAIT_FOR" + } + ] + }, + "description": "Creates test data" + }, + "response": [] + } + ] + }, { "name": "findSchemes", "event": [ { "listen": "test", "script": { - "id": "4c3613d3-6fb2-4c7f-bd56-f964f128e9ca", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -76,15 +343,11 @@ { "listen": "test", "script": { - "id": "77d7aa9b-d45f-4b0c-83dd-90603deb6c78", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", - "", - "", "pm.test(\"Body matches string\", function () {", " pm.expect(pm.response.text()).to.include(\"schemes\");", "});", @@ -92,52 +355,28 @@ "pm.test(\"Body matches string\", function () {", " pm.expect(pm.response.text()).to.include(\"contentTypeSchemes\");", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": {}, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/schemescontenttypes/2a3e91e4-fbbf-4876-8c5b-2233c1739b05", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/schemescontenttypes/{{contentTypeId}}", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "schemes", "schemescontenttypes", - "2a3e91e4-fbbf-4876-8c5b-2233c1739b05" + "{{contentTypeId}}" ] }, "description": "Returns all schemes for the content type and include schemes non-archive . 401 if the user does not have permission.\n\n@Path(\"/schemes/schemescontenttypes/{contentTypeId}\")\n" @@ -145,65 +384,83 @@ "response": [] }, { - "name": "findStepsByScheme", + "name": "findAllSchemesByContentType", "event": [ { "listen": "test", "script": { - "id": "e4cc8fd5-37bc-4849-88ad-a948988282ec", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"contentTypeSchemes\");", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, + "method": "GET", + "header": [], + "url": { + "raw": "{{serverURL}}/api/v1/workflow/contenttypes/schemes?contentTypeIds={{contentTypeId}},{{contentTypeId_2}}", + "host": [ + "{{serverURL}}" + ], + "path": [ + "api", + "v1", + "workflow", + "contenttypes", + "schemes" + ], + "query": [ { - "key": "showPassword", - "value": false, - "type": "boolean" + "key": "contentTypeIds", + "value": "{{contentTypeId}},{{contentTypeId_2}}" } ] }, + "description": "Returns all schemes for the content type and include schemes non-archive . 401 if the user does not have permission.\n\n@Path(\"/schemes/schemescontenttypes/{contentTypeId}\")\n" + }, + "response": [] + }, + { + "name": "findStepsByScheme", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/d61a59e1-a49c-46f2-a929-db2b4bfa88b2/steps", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/{{systemWorkflowId}}/steps", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "schemes", - "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "{{systemWorkflowId}}", "steps" ] }, @@ -217,60 +474,40 @@ { "listen": "test", "script": { - "id": "67745621-ebda-4d87-a315-e2535e2b1537", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});" - ] + "});", + "", + "pm.test(\"Store action ID\", function () {", + " const entity = pm.response.json().entity;", + " pm.expect(entity).to.not.be.null;", + " pm.expect(entity[0]).to.not.be.null;", + " pm.expect(entity[0].id).to.not.be.null;", + " pm.collectionVariables.set(\"actionId\", entity[0].id);", + "});", + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/contentlet/e79ab40f-0728-4995-ab3f-ee9f87340cad/actions", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/contentlet/{{contentletInode_1}}/actions", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "contentlet", - "e79ab40f-0728-4995-ab3f-ee9f87340cad", + "{{contentletInode_1}}", "actions" ] }, @@ -284,60 +521,31 @@ { "listen": "test", "script": { - "id": "f6688a28-1b19-4eff-b51a-005d38de184b", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/actions/b9d89c80-3d88-4311-8365-187323c96436", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/actions/{{actionId}}", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "actions", - "b9d89c80-3d88-4311-8365-187323c96436" + "{{actionId}}" ] }, "description": "Returns a single action, 404 if does not exists. 401 if the user does not have permission\n\n@Path(\"/actions/{actionId}\")" @@ -350,54 +558,25 @@ { "listen": "test", "script": { - "id": "5874ff7e-18fb-4109-ab96-c7fb4ece3ede", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/6cb7e3bd-1710-4eed-8838-d3db60f78f19/actions/b9d89c80-3d88-4311-8365-187323c96436", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/6cb7e3bd-1710-4eed-8838-d3db60f78f19/actions/{{actionId}}", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -405,7 +584,7 @@ "steps", "6cb7e3bd-1710-4eed-8838-d3db60f78f19", "actions", - "b9d89c80-3d88-4311-8365-187323c96436" + "{{actionId}}" ] }, "description": "Returns a single action associated to the step, 404 if does not exists. 401 if the user does not have permission.\n\n@Path(\"/steps/{stepId}/actions/{actionId}\")" @@ -418,54 +597,25 @@ { "listen": "test", "script": { - "id": "09873357-6b9b-4bc5-998d-7cfa01abb186", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/6cb7e3bd-1710-4eed-8838-d3db60f78f19/actions", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/6cb7e3bd-1710-4eed-8838-d3db60f78f19/actions", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -485,60 +635,31 @@ { "listen": "test", "script": { - "id": "e0a97678-c11b-4a30-8dcc-ab2351299549", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/d61a59e1-a49c-46f2-a929-db2b4bfa88b2/actions", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/{{systemWorkflowId}}/actions", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "schemes", - "d61a59e1-a49c-46f2-a929-db2b4bfa88b2", + "{{systemWorkflowId}}", "actions" ] }, @@ -552,41 +673,18 @@ { "listen": "test", "script": { - "id": "0d05425f-d6e9-4d06-bcab-e1db93951ac3", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "POST", "header": [ { @@ -596,15 +694,13 @@ ], "body": { "mode": "raw", - "raw": "{\n \"stepId\": \"ee24a4cb-2d15-4c98-b1bd-6327126451f3\",\n \"actionName\": \"saveContent FROM REST NEW\",\n \"schemeId\": \"d61a59e1-a49c-46f2-a929-db2b4bfa88b2\",\n \"actionCondition\": \"\",\n \"actionNextStep\": \"currentstep\",\n \"actionNextAssign\": \"654b0931-1027-41f7-ad4d-173115ed8ec1\",\n \"actionRoleHierarchyForAssign\": false,\n \"actionAssignable\": false,\n \"actionCommentable\": true,\n \"whoCanUse\":[],\n \"showOn\": [\n \"UNPUBLISHED\",\n \"NEW\",\n \"LOCKED\",\n \"PUBLISHED\"\n ]\n}" + "raw": "{\n \"stepId\": \"ee24a4cb-2d15-4c98-b1bd-6327126451f3\",\n \"actionName\": \"saveContent FROM REST NEW\",\n \"schemeId\": \"{{systemWorkflowId}}\",\n \"actionCondition\": \"\",\n \"actionNextStep\": \"currentstep\",\n \"actionNextAssign\": \"654b0931-1027-41f7-ad4d-173115ed8ec1\",\n \"actionRoleHierarchyForAssign\": false,\n \"actionAssignable\": false,\n \"actionCommentable\": true,\n \"whoCanUse\":[],\n \"showOn\": [\n \"UNPUBLISHED\",\n \"NEW\",\n \"LOCKED\",\n \"PUBLISHED\"\n ]\n}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/actions", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/actions", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -622,41 +718,18 @@ { "listen": "test", "script": { - "id": "780aa125-c758-4373-ab44-27ab55b466be", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [ { @@ -666,15 +739,13 @@ ], "body": { "mode": "raw", - "raw": "{\n \"stepId\": \"ee24a4cb-2d15-4c98-b1bd-6327126451f3\",\n \"actionName\": \"Republish\",\n \"schemeId\": \"d61a59e1-a49c-46f2-a929-db2b4bfa88b2\",\n \"actionCondition\": \"\",\n \"actionNextStep\": \"currentstep\",\n \"actionNextAssign\": \"654b0931-1027-41f7-ad4d-173115ed8ec1\",\n \"actionRoleHierarchyForAssign\": false,\n \"actionAssignable\": false,\n \"actionCommentable\": true,\n \"whoCanUse\":[],\n \"showOn\": [\n \"UNPUBLISHED\",\n \"NEW\",\n \"LOCKED\",\n \"PUBLISHED\"\n ]\n}" + "raw": "{\n \"stepId\": \"ee24a4cb-2d15-4c98-b1bd-6327126451f3\",\n \"actionName\": \"Republish\",\n \"schemeId\": \"{{systemWorkflowId}}\",\n \"actionCondition\": \"\",\n \"actionNextStep\": \"currentstep\",\n \"actionNextAssign\": \"654b0931-1027-41f7-ad4d-173115ed8ec1\",\n \"actionRoleHierarchyForAssign\": false,\n \"actionAssignable\": false,\n \"actionCommentable\": true,\n \"whoCanUse\":[],\n \"showOn\": [\n \"UNPUBLISHED\",\n \"NEW\",\n \"LOCKED\",\n \"PUBLISHED\"\n ]\n}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/actions/4958588d-9c8e-40e4-bfcb-4ded", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/actions/4958588d-9c8e-40e4-bfcb-4ded", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -693,41 +764,18 @@ { "listen": "test", "script": { - "id": "f887d4a1-2c51-4558-99ae-49838ffb8c94", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "POST", "header": [ { @@ -740,12 +788,10 @@ "raw": "{ \"actionId\": \"777f1c6b-c877-4a37-ba4b-10627316c2cc\" }" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/dc3c9cd0-8467-404b-bf95-cb7df3fbc293/actions", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/dc3c9cd0-8467-404b-bf95-cb7df3fbc293/actions", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -765,41 +811,18 @@ { "listen": "test", "script": { - "id": "6b3f7ab6-697a-4b91-8b92-0391bd59ea2b", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "DELETE", "header": [], "body": { @@ -807,12 +830,10 @@ "raw": "" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/f7dc56cd-aa81-4ca8-8174-1bb30756df82", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/f7dc56cd-aa81-4ca8-8174-1bb30756df82", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -831,41 +852,18 @@ { "listen": "test", "script": { - "id": "d3c4d4d2-dfc6-4bde-8200-fa8746362691", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "DELETE", "header": [], "body": { @@ -873,12 +871,10 @@ "raw": "" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/0c5018fc-4773-4524-9ba8-328ca4c3d0b2/actions/658278d3-aa3b-4ce4-a028-c9e1656e4f9e", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/0c5018fc-4773-4524-9ba8-328ca4c3d0b2/actions/658278d3-aa3b-4ce4-a028-c9e1656e4f9e", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -899,41 +895,18 @@ { "listen": "test", "script": { - "id": "59aaecec-637a-4ade-b6e3-90a2b4239e42", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "DELETE", "header": [], "body": { @@ -941,12 +914,10 @@ "raw": "" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/actions/c8a03c24-277a-49a5-b5e0-7f99490a004d", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/actions/c8a03c24-277a-49a5-b5e0-7f99490a004d", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -965,41 +936,18 @@ { "listen": "test", "script": { - "id": "30ba50d2-eb76-496d-a481-af6f28e94c40", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [], "body": { @@ -1007,12 +955,10 @@ "raw": "" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/reorder/step/94178d17-96a0-4e08-b9aa-94214a7fb31e/order/0", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/reorder/step/94178d17-96a0-4e08-b9aa-94214a7fb31e/order/0", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1034,41 +980,18 @@ { "listen": "test", "script": { - "id": "06f10f41-5e6b-41da-b7a9-2352a199904a", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [ { @@ -1081,12 +1004,10 @@ "raw": " { \"stepOrder\":5, \"stepName\":\"REST\", \"enableEscalation\":false, \"escalationAction\":\"\", \"escalationTime\":\"0\",\"stepResolved\":false} " }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1105,41 +1026,18 @@ { "listen": "test", "script": { - "id": "758070ae-bec0-45a3-9dd4-753373cda29f", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "POST", "header": [ { @@ -1152,12 +1050,10 @@ "raw": " { \"schemeId\" : \"bf886961-42fe-4e49-b0e9-0347cacc81ba\", \"stepName\":\"REST123\", \"enableEscalation\":false, \"escalationAction\":\"\", \"escalationTime\":\"0\",\"stepResolved\":false} " }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1175,54 +1071,25 @@ { "listen": "test", "script": { - "id": "ffe7f645-bda6-4c83-a1fb-94f96fc7f5ad", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1241,41 +1108,18 @@ { "listen": "test", "script": { - "id": "95f737ad-f395-4a50-a502-8d8a41eeb889", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [ { @@ -1288,12 +1132,10 @@ "raw": "{ \"contentletFormData\" : {\n \"stInode\" : \"678d00bf-10b0-4080-99b4-9517ab9ea580\",\n \"languageId\" : 1,\n \"name\": \"postman1\"\n}\n}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/actions/936f14eef2/fire", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/actions/936f14eef2/fire", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1313,41 +1155,18 @@ { "listen": "test", "script": { - "id": "07a00a96-740c-4dbe-872f-9f6b4ab7a5d2", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [ { @@ -1360,12 +1179,10 @@ "raw": "{\"order\" : 3}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/reorder/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e/actions/7075981c-eda2-4896-a65c-71749ee2877e", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/reorder/steps/94178d17-96a0-4e08-b9aa-94214a7fb31e/actions/7075981c-eda2-4896-a65c-71749ee2877e", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1384,30 +1201,6 @@ { "name": "ImportScheme ", "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "POST", "header": [ { @@ -1420,12 +1213,10 @@ "raw": " {\n \"workflowImportObject\": {\n \"schemes\": [\n {\n \n \"creationDate\": 1523640559394,\n \"name\": \"Test3\",\n \"description\": \"\",\n \"archived\": false,\n \"mandatory\": false,\n \"defaultScheme\": false,\n \"modDate\": 1523640423771,\n \"entryActionId\": null,\n \"system\": false\n }\n ],\n \"steps\": [\n {\n \"id\": \"01d5d41a-007e-463d-a5b5-c35ea27b1a30\",\n \"creationDate\": 1523643857447,\n \"name\": \"Step1\",\n \"schemeId\": \"766d9cef-e138-4fe0-9acc-b8e7e40bbed3\",\n \"myOrder\": 0,\n \"resolved\": false,\n \"enableEscalation\": false,\n \"escalationAction\": null,\n \"escalationTime\": 0\n },\n {\n \"id\": \"2cbf9872-0ed3-407b-b803-70a9a161a7db\",\n \"creationDate\": 1523643857447,\n \"name\": \"step2\",\n \"schemeId\": \"766d9cef-e138-4fe0-9acc-b8e7e40bbed3\",\n \"myOrder\": 1,\n \"resolved\": false,\n \"enableEscalation\": false,\n \"escalationAction\": null,\n \"escalationTime\": 0\n }\n ],\n \"actions\": [\n {\n \"id\": \"81522b66-221b-4496-aec6-0e4c484973f7\",\n \"name\": \"Save it\",\n \"schemeId\": \"766d9cef-e138-4fe0-9acc-b8e7e40bbed3\",\n \"condition\": \"\",\n \"nextStep\": \"2cbf9872-0ed3-407b-b803-70a9a161a7db\",\n \"nextAssign\": \"e7d4e34e-5127-45fc-8123-d48b62d510e3\",\n \"icon\": \"workflowIcon\",\n \"roleHierarchyForAssign\": false,\n \"assignable\": false,\n \"commentable\": false,\n \"order\": 0,\n \"owner\": null,\n \"nextStepCurrentStep\": false,\n \"showOn\": [\n \"LOCKED\",\n \"NEW\",\n \"UNLOCKED\"\n ]\n },\n {\n \"id\": \"687c0729-95fe-4e1d-b37c-e9f70615df23\",\n \"name\": \"TEst\",\n \"schemeId\": \"766d9cef-e138-4fe0-9acc-b8e7e40bbed3\",\n \"condition\": \"\",\n \"nextStep\": \"currentstep\",\n \"nextAssign\": \"e7d4e34e-5127-45fc-8123-d48b62d510e3\",\n \"icon\": \"workflowIcon\",\n \"roleHierarchyForAssign\": false,\n \"assignable\": false,\n \"commentable\": false,\n \"order\": 0,\n \"owner\": null,\n \"nextStepCurrentStep\": true,\n \"showOn\": [\n \"LOCKED\",\n \"UNLOCKED\"\n ]\n }\n ],\n \"actionSteps\": [\n {\n \"stepId\": \"01d5d41a-007e-463d-a5b5-c35ea27b1a30\",\n \"actionId\": \"81522b66-221b-4496-aec6-0e4c484973f7\",\n \"actionOrder\": \"0\"\n },\n {\n \"stepId\": \"2cbf9872-0ed3-407b-b803-70a9a161a7db\",\n \"actionId\": \"687c0729-95fe-4e1d-b37c-e9f70615df23\",\n \"actionOrder\": \"0\"\n }\n ],\n \"actionClasses\": [\n {\n \"id\": \"2298b780-e1d3-4916-b981-e22fd5553086\",\n \"actionId\": \"81522b66-221b-4496-aec6-0e4c484973f7\",\n \"name\": \"Save content\",\n \"order\": 0,\n \"clazz\": \"com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet\",\n \"actionlet\": {\n \"name\": \"Save content\",\n \"parameters\": null,\n \"nextStep\": null,\n \"howTo\": \"This actionlet will checkin the content.\",\n \"localizedName\": \"Save content\",\n \"localizedHowto\": \"com.dotmarketing.portlets.workflows.actionlet.SaveContentActionlet.howTo\"\n }\n }\n ],\n \"actionClassParams\": []\n },\n \"permissions\": []\n}\n \n" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/import", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/import", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1441,43 +1232,13 @@ { "name": "exportScheme", "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/766d9cef-e138-4fe0-9acc-b8e7e40bbed3/export", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/766d9cef-e138-4fe0-9acc-b8e7e40bbed3/export", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1491,120 +1252,38 @@ }, "response": [] }, - { - "name": "copyScheme", - "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/d61a59e1a4/copy", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "8080", - "path": [ - "api", - "v1", - "workflow", - "schemes", - "d61a59e1a4", - "copy" - ] - }, - "description": "Do a copy of an existing scheme \n\n@Path(\"/schemes/{schemeId}/copy\")" - }, - "response": [] - }, { "name": "findAvailableDefaultActionsByContentType", "event": [ { "listen": "test", "script": { - "id": "8f66df74-cb91-4225-bac4-6c1224639727", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/defaultactions/contenttype/2a3e91e4-fbbf-4876-8c5b-2233c1739b05", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/defaultactions/contenttype/{{contentTypeId}}", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "defaultactions", "contenttype", - "2a3e91e4-fbbf-4876-8c5b-2233c1739b05" + "{{contentTypeId}}" ] }, "description": "Returns all the possible default actions associated to the content type workflow schemes.\n401 if the user does not have permission.\n\n@Path(\"/defaultactions/contenttype/{contentTypeId}\")\n" @@ -1617,54 +1296,25 @@ { "listen": "test", "script": { - "id": "1e70664a-c44a-4bf3-8a50-9ede1497de70", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/defaultactions/schemes", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/defaultactions/schemes", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1683,61 +1333,32 @@ { "listen": "test", "script": { - "id": "8f66df74-cb91-4225-bac4-6c1224639727", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "" - }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/initialactions/contenttype/2a3e91e4-fbbf-4876-8c5b-2233c1739b05", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/initialactions/contenttype/{{contentTypeId}}", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", "workflow", "initialactions", "contenttype", - "2a3e91e4-fbbf-4876-8c5b-2233c1739b05" + "{{contentTypeId}}" ] }, "description": "Finds the available actions of the initial/first step(s) of the workflow scheme(s) associated with a content type Id.\n\n@Path(\"/initialactions/contenttype/{contentTypeId}\")" @@ -1750,41 +1371,18 @@ { "listen": "test", "script": { - "id": "29ec07b1-4ad2-4aea-b001-29dc0a075184", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "POST", "header": [ { @@ -1797,12 +1395,10 @@ "raw": "{\"schemeName\": \"REST1\", \"schemeDescription\": \"rest1\", \"schemeArchived\": \"false\"}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1820,41 +1416,18 @@ { "listen": "test", "script": { - "id": "8fcc8e4c-1d0e-4180-90b9-6af971bffa92", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "PUT", "header": [ { @@ -1867,12 +1440,10 @@ "raw": "{\"schemeName\": \"REST2\", \"schemeDescription\": \"rest1\", \"schemeArchived\": \"false\"}" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/211040db-5d79-4e3c-807a-1f2dec2ff16b", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/211040db-5d79-4e3c-807a-1f2dec2ff16b", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1891,41 +1462,18 @@ { "listen": "test", "script": { - "id": "6b3f7ab6-697a-4b91-8b92-0391bd59ea2b", - "type": "text/javascript", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ], "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "password", - "value": "admin", - "type": "string" - }, - { - "key": "username", - "value": "admin@dotcms.com", - "type": "string" - }, - { - "key": "saveHelperData", - "type": "any" - }, - { - "key": "showPassword", - "value": false, - "type": "boolean" - } - ] - }, "method": "DELETE", "header": [], "body": { @@ -1933,12 +1481,10 @@ "raw": "" }, "url": { - "raw": "http://localhost:8080/api/v1/workflow/schemes/85c1515c-c4f3-463c-bac2-860b8fcacc34", - "protocol": "http", + "raw": "{{serverURL}}/api/v1/workflow/schemes/85c1515c-c4f3-463c-bac2-860b8fcacc34", "host": [ - "localhost" + "{{serverURL}}" ], - "port": "8080", "path": [ "api", "v1", @@ -1952,22 +1498,69 @@ "response": [] } ], + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{jwt}}", + "type": "string" + } + ] + }, "event": [ { "listen": "prerequest", "script": { - "id": "e45174b5-930d-43ed-ac45-f0717afc21ce", "type": "text/javascript", + "requests": {}, "exec": [ - "" + "const serverURL = pm.environment.get('serverURL'); // Get the server URL from the environment variable", + "const apiUrl = `${serverURL}/api/v1/apitoken`; // Construct the full API URL", + "", + "// If we are unable to get the JWT we need to generate a new one", + "if (!pm.environment.get('jwt')) {", + " const username = pm.environment.get('user');", + " const password = pm.environment.get('password');", + " const basicAuth = Buffer.from(`${username}:${password}`).toString('base64');", + "", + " const requestOptions = {", + " url: apiUrl,", + " method: 'POST',", + " header: {", + " 'accept': '*/*',", + " 'content-type': 'application/json',", + " 'Authorization': `Basic ${basicAuth}`", + " },", + " body: {", + " mode: 'raw',", + " raw: JSON.stringify({", + " expirationSeconds: 7200,", + " userId: 'dotcms.org.1',", + " network: '0.0.0.0/0',", + " claims: { label: 'postman-tests' }", + " })", + " }", + " };", + "", + " pm.sendRequest(requestOptions, function (err, response) {", + " if (err) {", + " console.log(err);", + " } else {", + " const jwt = response.json().entity.jwt;", + " pm.environment.set('jwt', jwt);", + " console.log(jwt);", + " }", + " });", + "}" ] } }, { "listen": "test", "script": { - "id": "729767eb-bb1b-4f38-9d6d-376048f5d7c0", "type": "text/javascript", + "requests": {}, "exec": [ "" ] @@ -1976,11 +1569,52 @@ ], "variable": [ { - "id": "a5cbff48-850f-4a3b-b649-0498db79a8d7", "key": "localServer", - "value": "http://localhost:8080", - "type": "string", - "description": "" - } - ] -} \ No newline at end of file + "value": "http://localhost:8080" + }, + { + "key": "hostname", + "value": "" + }, + { + "key": "hostIdentifier", + "value": "" + }, + { + "key": "systemWorkflowId", + "value": "" + }, + { + "key": "contentTypeId", + "value": "" + }, + { + "key": "contentTypeName", + "value": "" + }, + { + "key": "contentTypeVarName", + "value": "" + }, + { + "key": "Contentlet_1", + "value": "" + }, + { + "key": "contentletInode_1", + "value": "" + }, + { + "key": "actionId", + "value": "" + }, + { + "key": "contentTypeId_2", + "value": "" + }, + { + "key": "copiedWorkflowId", + "value": "" + } + ] +}