Skip to content

Commit

Permalink
#30900 draft for first changes on force unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
jdotcms committed Dec 10, 2024
1 parent 8c6f422 commit 784575f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.dotmarketing.portlets.workflows.actionlet;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.dotcms.util.DotPreconditions;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.portlets.contentlet.model.Contentlet;
import com.dotmarketing.portlets.workflows.model.CheckboxWorkflowActionletParameter;
import com.dotmarketing.portlets.workflows.model.WorkflowActionClassParameter;
import com.dotmarketing.portlets.workflows.model.WorkflowActionFailureException;
import com.dotmarketing.portlets.workflows.model.WorkflowActionletParameter;
import com.dotmarketing.portlets.workflows.model.WorkflowProcessor;
import com.dotmarketing.portlets.workflows.model.WorkflowStep;
import com.dotmarketing.util.Logger;
import com.liferay.util.StringPool;

/**
* {@link WorkFlowActionlet} that unlock a {@link Contentlet}
Expand All @@ -21,7 +24,7 @@
*/
public class CheckinContentActionlet extends WorkFlowActionlet {


private static final String FORCE_UNLOCK_ALLOWED = "force-unlock";

/**
*
Expand Down Expand Up @@ -65,6 +68,10 @@ public WorkflowStep getNextStep() {
@Override
public List<WorkflowActionletParameter> getParameters() {

return null;
final List<WorkflowActionletParameter> workflowActionletParameters = new ArrayList<>();

workflowActionletParameters.add(new CheckboxWorkflowActionletParameter(FORCE_UNLOCK_ALLOWED, "Force Unlock", "force-unlock", false));

return workflowActionletParameters;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.dotmarketing.portlets.workflows.model;

/**
* This represents a single checkbox parameter
* @author jsanca
*/
public class CheckboxWorkflowActionletParameter extends WorkflowActionletParameter {

public CheckboxWorkflowActionletParameter(final String key, final String displayName,
final String defaultValue, final boolean isRequired) {
super(key, displayName, defaultValue, isRequired);
}

@Override
public String toString() {
return "CheckboxWorkflowActionletParameter [key=" + getKey() + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<%@ page import="com.dotmarketing.portlets.workflows.model.MultiSelectionWorkflowActionletParameter" %>
<%@ page import="com.dotmarketing.portlets.workflows.model.MultiKeyValue" %>
<%@ page import="java.util.Collection" %>
<%@ page import="com.dotmarketing.portlets.workflows.model.CheckboxWorkflowActionletParameter" %>

<%
WorkflowAPI wapi = APILocator.getWorkflowAPI();
Expand Down Expand Up @@ -77,6 +78,16 @@
</select>
</td>
</tr>
<% } else if (workflowActionletParameter instanceof CheckboxWorkflowActionletParameter) { %>
<tr>
<td nowrap="true" valign="top" style="text-align: right;"><%if(workflowActionletParameter.isRequired()){ %><span class="required"></span><%} %><%=workflowActionletParameter.getDisplayName() %>:</td>
<td>
<%=workflowActionletParameter.getDefaultValue()%> | <%=value%>
<input id="acp-<%=workflowActionletParameter.getKey() %>" name="acp-<%=workflowActionletParameter.getKey() %>" value="<%=workflowActionletParameter.getDefaultValue()%>"
type="checkbox"
<%=workflowActionletParameter.getDefaultValue().equals(value)? "checked":""%> dojoType="dijit.form.CheckBox" />
</td>
</tr>
<% } else { %>
<tr>
<td valign="top" style="text-align: right;max-width: 700px;"><%if(workflowActionletParameter.isRequired()){ %><span class="required"></span><%} %><%=workflowActionletParameter.getDisplayName() %>:</td>
Expand Down

0 comments on commit 784575f

Please sign in to comment.