parent
e3df86ca21
commit
69f246f8a1
|
|
@ -11,6 +11,7 @@ import org.libreccm.l10n.GlobalizationHelper;
|
||||||
import org.libreccm.security.AuthorizationRequired;
|
import org.libreccm.security.AuthorizationRequired;
|
||||||
import org.libreccm.workflow.CircularTaskDependencyException;
|
import org.libreccm.workflow.CircularTaskDependencyException;
|
||||||
import org.libreccm.workflow.Task;
|
import org.libreccm.workflow.Task;
|
||||||
|
import org.libreccm.workflow.TaskDependency;
|
||||||
import org.libreccm.workflow.TaskManager;
|
import org.libreccm.workflow.TaskManager;
|
||||||
import org.libreccm.workflow.TaskRepository;
|
import org.libreccm.workflow.TaskRepository;
|
||||||
import org.libreccm.workflow.Workflow;
|
import org.libreccm.workflow.Workflow;
|
||||||
|
|
@ -19,6 +20,7 @@ import org.libreccm.workflow.WorkflowRepository;
|
||||||
import org.librecms.contentsection.ContentSection;
|
import org.librecms.contentsection.ContentSection;
|
||||||
import org.librecms.contentsection.ContentSectionManager;
|
import org.librecms.contentsection.ContentSectionManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -757,7 +759,6 @@ public class ConfigurationWorkflowController {
|
||||||
}
|
}
|
||||||
final Task task = taskResult.get();
|
final Task task = taskResult.get();
|
||||||
taskManager.removeTask(workflow, task);
|
taskManager.removeTask(workflow, task);
|
||||||
taskRepo.delete(task);
|
|
||||||
|
|
||||||
return String.format(
|
return String.format(
|
||||||
"redirect:/%s/configuration/workflows/%s",
|
"redirect:/%s/configuration/workflows/%s",
|
||||||
|
|
@ -1291,6 +1292,7 @@ public class ConfigurationWorkflowController {
|
||||||
workflow.getDescription()
|
workflow.getDescription()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
model.setHasTasks(!workflow.getTasks().isEmpty());
|
||||||
model.setName(
|
model.setName(
|
||||||
globalizationHelper.getValueFromLocalizedString(workflow.getName())
|
globalizationHelper.getValueFromLocalizedString(workflow.getName())
|
||||||
);
|
);
|
||||||
|
|
@ -1309,6 +1311,10 @@ public class ConfigurationWorkflowController {
|
||||||
task.getDescription()
|
task.getDescription()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
model.setHasDependencies(
|
||||||
|
!task.getBlockedTasks().isEmpty()
|
||||||
|
|| !task.getBlockingTasks().isEmpty()
|
||||||
|
);
|
||||||
model.setLabel(
|
model.setLabel(
|
||||||
globalizationHelper.getValueFromLocalizedString(
|
globalizationHelper.getValueFromLocalizedString(
|
||||||
task.getLabel()
|
task.getLabel()
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ public class WorkflowTaskTemplateListModel {
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
private boolean hasDependencies;
|
||||||
|
|
||||||
public long getTaskId() {
|
public long getTaskId() {
|
||||||
return taskId;
|
return taskId;
|
||||||
}
|
}
|
||||||
|
|
@ -57,4 +59,14 @@ public class WorkflowTaskTemplateListModel {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getHasDependencies() {
|
||||||
|
return hasDependencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasDependencies(final boolean hasDependencies) {
|
||||||
|
this.hasDependencies = hasDependencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ public class WorkflowTemplateListModel {
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
private boolean hasTasks;
|
||||||
|
|
||||||
public long getWorkflowId() {
|
public long getWorkflowId() {
|
||||||
return workflowId;
|
return workflowId;
|
||||||
}
|
}
|
||||||
|
|
@ -51,4 +53,12 @@ public class WorkflowTemplateListModel {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getHasTasks() {
|
||||||
|
return hasTasks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasTasks(boolean hasTasks) {
|
||||||
|
this.hasTasks = hasTasks;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,7 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="del-col">
|
<td class="del-col">
|
||||||
|
<c:if test="#{!task.hasDependencies}">
|
||||||
<libreccm:deleteDialog
|
<libreccm:deleteDialog
|
||||||
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/configuration/workflows/UUID-#{SelectedWorkflowTemplateModel.uuid}/tasks/UUID-#{task.uuid}/@remove"
|
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/configuration/workflows/UUID-#{SelectedWorkflowTemplateModel.uuid}/tasks/UUID-#{task.uuid}/@remove"
|
||||||
buttonText="#{CmsAdminMessages['contentsection.configuration.workflow.tasks.remove.button.label']}"
|
buttonText="#{CmsAdminMessages['contentsection.configuration.workflow.tasks.remove.button.label']}"
|
||||||
|
|
@ -238,6 +239,7 @@
|
||||||
dialogTitle="#{CmsAdminMessages['contentsection.configuration.workflow.tasks.remove.dialog.title']}"
|
dialogTitle="#{CmsAdminMessages['contentsection.configuration.workflow.tasks.remove.dialog.title']}"
|
||||||
message="#{CmsAdminMessages.getMessage('contentsection.configuration.workflow.tasks.remove.dialog.message', [ContentSectionModel.sectionName, SelectedWorkflowTemplateModel.displayName, task.label])}"
|
message="#{CmsAdminMessages.getMessage('contentsection.configuration.workflow.tasks.remove.dialog.message', [ContentSectionModel.sectionName, SelectedWorkflowTemplateModel.displayName, task.label])}"
|
||||||
/>
|
/>
|
||||||
|
</c:if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="del-col">
|
<td class="del-col">
|
||||||
|
<c:if test="#{!workflowTemplate.hasTasks}">
|
||||||
<libreccm:deleteDialog
|
<libreccm:deleteDialog
|
||||||
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/configuration/workflows/UUID-#{workflowTemplate.uuid}/@delete"
|
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/configuration/workflows/UUID-#{workflowTemplate.uuid}/@delete"
|
||||||
buttonText="#{CmsAdminMessages['contentsection.configuration.workflows.delete_button.label']}"
|
buttonText="#{CmsAdminMessages['contentsection.configuration.workflows.delete_button.label']}"
|
||||||
|
|
@ -168,6 +169,7 @@
|
||||||
dialogTitle="#{CmsAdminMessages['contentsection.configuration.workflows.delete_dialog.title']}"
|
dialogTitle="#{CmsAdminMessages['contentsection.configuration.workflows.delete_dialog.title']}"
|
||||||
message="#{CmsAdminMessages.getMessage('contentsection.configuration.workflows.delete_dialog.message', [ContentSectionModel.sectionName, workflowTemplate.name])}"
|
message="#{CmsAdminMessages.getMessage('contentsection.configuration.workflows.delete_dialog.message', [ContentSectionModel.sectionName, workflowTemplate.name])}"
|
||||||
/>
|
/>
|
||||||
|
</c:if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ table.contentsection-roles-table {
|
||||||
|
|
||||||
table.lifecycles-table,
|
table.lifecycles-table,
|
||||||
table.workflows-table,
|
table.workflows-table,
|
||||||
table.workflow-tasks-table {
|
table.wor{
|
||||||
td.info-col {
|
td.info-col {
|
||||||
width: 3em;
|
width: 3em;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,12 @@ import org.libreccm.core.CcmObject;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.persistence.NoResultException;
|
import javax.persistence.NoResultException;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Repository for {@link Workflow}s.
|
* Repository for {@link Workflow}s.
|
||||||
*
|
*
|
||||||
|
|
@ -63,6 +66,8 @@ public class WorkflowRepository extends AbstractEntityRepository<Long, Workflow>
|
||||||
workflow.setUuid(UUID.randomUUID().toString());
|
workflow.setUuid(UUID.randomUUID().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a {@link Workflow} by its UUID.
|
* Find a {@link Workflow} by its UUID.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue