Skip to content

Commit

Permalink
Use HtmlStringBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-susanh committed Apr 5, 2024
1 parent 0222ba4 commit 481dcd6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/org/labkey/workflow/view/WorkflowViewBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.labkey.api.jsp.JspBase;
import org.labkey.api.util.DateUtil;
import org.labkey.api.util.HtmlString;
import org.labkey.api.util.HtmlStringBuilder;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.StringUtilsLabKey;
import org.labkey.api.view.ActionURL;
Expand Down Expand Up @@ -191,23 +192,26 @@ else if (variables.get(key) instanceof Date)

public HtmlString navigationLinks(@Nullable String processDefinitionName, @NotNull String processDefinitionKey, @Nullable String processInstanceId)
{
StringBuilder builder = new StringBuilder();
HtmlStringBuilder builder = HtmlStringBuilder.of();

builder.append(PageFlowUtil.link("All workflows").href(new ActionURL(WorkflowController.BeginAction.class, getContainer())));
builder.append("\n  \n");
builder.append(HtmlString.BR);
if (processDefinitionName != null)
{
builder.append(PageFlowUtil.link(processDefinitionName).href(new ActionURL(WorkflowController.SummaryAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey)));
builder.append("\n  \n");
builder.append(HtmlString.BR);

}
builder.append(PageFlowUtil.link("Process instance list").href(new ActionURL(WorkflowController.InstanceListAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey)));
builder.append("\n  \n");
builder.append(HtmlString.BR);

if (processInstanceId != null)
{
builder.append(PageFlowUtil.link("This Process Instance").href(new ActionURL(WorkflowController.ProcessInstanceAction.class, getContainer()).addParameter("processInstanceId", processInstanceId)));
builder.append("\n  \n");
builder.append(HtmlString.BR);
}
builder.append(PageFlowUtil.link("My tasks").href(new ActionURL(WorkflowController.TaskListAction.class, getContainer()).addParameter("processDefinitionKey", processDefinitionKey).addParameter("assignee", getUser().getUserId())));

return HtmlString.of(builder.toString());
return builder.getHtmlString();
}
}

0 comments on commit 481dcd6

Please sign in to comment.