Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 11609 fixes #13216

Merged
merged 33 commits into from
Dec 15, 2017
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9525217
#11609 : Updating DB scripts. Adding upgrade task to create intermedi…
jcastro-dotcms Nov 6, 2017
f285dc8
#11609 added first draft for add/edit workflow action
Nov 8, 2017
8a6444a
#11609 merge done
Nov 8, 2017
ce25b42
#11609 almost code done for save/edit workflow actions associated to …
Nov 9, 2017
60ef0e7
#11609 the add action and action to step are done
Nov 15, 2017
eeb4172
#11609 Added the delete steps and dependencies/minor fixes for transa…
Nov 16, 2017
0929145
#11609 delete action from step done in the ui/ajax and endpoint
Nov 17, 2017
1f17c62
#11609 Added the deletes for the UI
Nov 20, 2017
4cd30de
#12960 changes for reorder done
Nov 28, 2017
fe70d6c
#13104 Added the new field requires lock options that supports locked…
Nov 29, 2017
677079c
#12960 added the scripts changes for all dbs
Nov 30, 2017
161c206
#12960 MERGE MASTER DONE
Nov 30, 2017
ab38919
#12960 added changes for the workflow, action and step new relationships
Dec 4, 2017
d30507c
#12960 merge done
Dec 4, 2017
4992dd9
#12960 notes and fixes
Dec 5, 2017
df465db
#12960 fixing the IT test
Dec 5, 2017
f558a7b
#12960 code review feedback
Dec 5, 2017
329da3e
#11691 added changes for the new endpoint for getting content type sc…
Dec 6, 2017
a0fbd9c
#12960 added changes for h2 and mysql
Dec 6, 2017
82e3837
#12960 added the changes for the show_on column
Dec 6, 2017
96c6ceb
#12960 adding changes for the showOn
Dec 6, 2017
6a709f4
#12960 merge done
Dec 7, 2017
c4d12df
#12960 changes for show on functionality
Dec 8, 2017
92347c1
resolving the error of the missing schemeid
Dec 8, 2017
5ab4a08
solving issue with content resource test
Dec 8, 2017
694375b
Fixing the Task04305UpdateWorkflowActionTable
Dec 11, 2017
62e4317
Reverting to master configuration
Dec 11, 2017
6caba12
#12960 merge done
Dec 11, 2017
43483c8
#12960 fixing postgres and oracle UT
Dec 12, 2017
cc1cde1
#11609 fixes for 11609
Dec 13, 2017
8f0b9bf
#11609 merge done
Dec 14, 2017
0261f20
#11609 configuration rollback
Dec 14, 2017
ff87ab2
#11609 fixes by code review
Dec 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.dotcms.contenttype.model.type.BaseContentType;
import com.dotcms.contenttype.model.type.ContentType;
import com.dotcms.contenttype.model.type.ContentTypeBuilder;
import com.dotcms.repackage.javax.ws.rs.HEAD;
import com.dotcms.repackage.javax.ws.rs.client.Client;
import com.dotcms.repackage.javax.ws.rs.client.ClientBuilder;
import com.dotcms.repackage.javax.ws.rs.client.Entity;
Expand Down
2 changes: 1 addition & 1 deletion dotCMS/src/main/enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public final Response findSchemes(@Context final HttpServletRequest request,
@NoCache
@Produces({MediaType.APPLICATION_JSON, "application/javascript"})
public final Response findAllSchemesAndSchemesByContentType(@Context final HttpServletRequest request,
@PathParam("contentTypeId") final String contentTypeId) {
@PathParam("contentTypeId") final String contentTypeId) {

final InitDataObject initDataObject = this.webResource.init
(null, true, request, true, null);
Expand Down Expand Up @@ -625,4 +625,4 @@ public final Response reorderAction(@Context final HttpServletRequest request,

return response;
} // reorderAction
} // E:O:F:WorkflowResource.
} // E:O:F:WorkflowResource.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import com.dotcms.repackage.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.dotcms.repackage.javax.validation.constraints.NotNull;
import com.dotcms.rest.api.Validated;
import com.dotmarketing.portlets.workflows.model.WorkflowAction;
import com.dotmarketing.portlets.workflows.model.WorkflowStatus;

import java.util.List;
import java.util.Set;

@JsonDeserialize(builder = WorkflowActionForm.Builder.class)
public class WorkflowActionForm extends Validated {
Expand All @@ -30,7 +31,7 @@ public class WorkflowActionForm extends Validated {
@NotNull
private final boolean requiresCheckout;
@NotNull
private final RequiresCheckoutOption requiresCheckoutOption;
private final Set<WorkflowStatus> showOn;
@NotNull
private final boolean actionRoleHierarchyForAssign;
private final boolean roleHierarchyForAssign;
Expand Down Expand Up @@ -75,8 +76,8 @@ public boolean isRequiresCheckout() {
return requiresCheckout;
}

public RequiresCheckoutOption getRequiresCheckoutOption() {
return requiresCheckoutOption;
public Set<WorkflowStatus> getShowOn() {
return showOn;
}

public boolean isActionRoleHierarchyForAssign() {
Expand Down Expand Up @@ -104,12 +105,14 @@ public String toString() {
return "WorkflowActionForm{" +
"actionId='" + actionId + '\'' +
", schemeId='" + schemeId + '\'' +
", stepId='" + stepId + '\'' +
", actionName='" + actionName + '\'' +
", whoCanUse=" + whoCanUse +
", actionIcon='" + actionIcon + '\'' +
", actionAssignable=" + actionAssignable +
", actionCommentable=" + actionCommentable +
", requiresCheckoutOption=" + requiresCheckoutOption +
", requiresCheckout=" + requiresCheckout +
", showOn=" + showOn +
", actionRoleHierarchyForAssign=" + actionRoleHierarchyForAssign +
", roleHierarchyForAssign=" + roleHierarchyForAssign +
", actionNextStep='" + actionNextStep + '\'' +
Expand All @@ -128,7 +131,7 @@ public WorkflowActionForm(final Builder builder) {
this.actionIcon = builder.actionIcon;
this.actionCommentable = builder.actionCommentable;
this.requiresCheckout = builder.requiresCheckout;
this.requiresCheckoutOption = valueOf(builder.requiresCheckoutOption);
this.showOn = builder.showOn;
this.actionNextStep = builder.actionNextStep;
this.actionNextAssign = builder.actionNextAssign;
this.actionCondition = builder.actionCondition;
Expand All @@ -138,32 +141,7 @@ public WorkflowActionForm(final Builder builder) {
this.checkValid();
}

private RequiresCheckoutOption valueOf (final String option) {

try {
return RequiresCheckoutOption.valueOf(option.toUpperCase());
} catch (Throwable e) {
return RequiresCheckoutOption.BOTH;
}
}

public enum RequiresCheckoutOption {

LOCKED(WorkflowAction.LOCKED),
UNLOCKED(WorkflowAction.UNLOCKED),
BOTH(WorkflowAction.LOCKED_OR_UNLOCKED);

private final String name;
RequiresCheckoutOption (final String name) {
this.name = name;
}

public String getName() {
return name;
};
}

public static final class Builder {
public static final class Builder {

@JsonProperty()
private String actionId;
Expand All @@ -187,8 +165,6 @@ public static final class Builder {
@JsonProperty(required = true)
private boolean requiresCheckout;
@JsonProperty(required = true)
private String requiresCheckoutOption;
@JsonProperty(required = true)
private boolean actionRoleHierarchyForAssign;
@JsonProperty(required = true)
private String actionNextStep;
Expand All @@ -197,6 +173,15 @@ public static final class Builder {
@JsonProperty()
private String actionCondition;

@JsonProperty(required = true)
private Set<WorkflowStatus> showOn;


public Builder showOn(Set<WorkflowStatus> showOn) {
this.showOn = showOn;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Store a copy of "showOn". rule

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

return this;
}

public Builder stepId(String stepId) {
this.stepId = stepId;
return this;
Expand Down Expand Up @@ -242,11 +227,6 @@ public Builder requiresCheckout(boolean requiresCheckout) {
return this;
}

public Builder requiresCheckoutOption(String requiresCheckoutOption) {
this.requiresCheckoutOption = requiresCheckoutOption;
return this;
}

public Builder actionRoleHierarchyForAssign(boolean actionRoleHierarchyForAssign) {
this.actionRoleHierarchyForAssign = actionRoleHierarchyForAssign;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package com.dotcms.workflow.form;

import com.dotcms.repackage.com.fasterxml.jackson.annotation.JsonProperty;
import com.dotcms.repackage.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.dotcms.repackage.javax.validation.constraints.NotNull;
import com.dotcms.rest.api.Validated;

@JsonDeserialize(builder = WorkflowReorderActionStepForm.Builder.class)
public class WorkflowReorderActionStepForm extends Validated {

@NotNull
private final String actionId;

@NotNull
private final String stepId;

@NotNull
private final int order;

public String getActionId() {
return actionId;
}

public String getStepId() {
return stepId;
}

public int getOrder() {
return order;
}

@Override
public String toString() {
return "WorkflowReorderActionStepForm{" +
"actionId='" + actionId + '\'' +
", stepId='" + stepId + '\'' +
", order=" + order +
'}';
}

public WorkflowReorderActionStepForm(final Builder builder) {

this.actionId = builder.actionId;
this.stepId = builder.stepId;
this.order = builder.order;
this.checkValid();
}

public static final class Builder {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Add a constructor to the class, or provide default values. rule


@JsonProperty(required = true)
private String actionId;
@JsonProperty(required = true)
private String stepId;
@JsonProperty(required = true)
private int order;

public Builder actionId(String actionId) {
this.actionId = actionId;
return this;
}

public Builder stepId(String stepId) {
this.stepId = stepId;
return this;
}

public Builder order(int order) {
this.order = order;
return this;
}


public WorkflowReorderActionStepForm build() {

return new WorkflowReorderActionStepForm(this);
}
}
}
Loading