CCM NG/ccm-cms: Workflows Tab bug hunting

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4625 8810af33-2d31-482b-a856-94f89814c4df
jensp 2017-03-11 18:20:49 +00:00
parent 6a8fe951a4
commit 45f9e5bda0
15 changed files with 431 additions and 109 deletions

View File

@ -26,7 +26,7 @@ import com.arsdigita.bebop.form.OptionGroup;
import com.arsdigita.bebop.form.SingleSelect;
import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.IntegerParameter;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ui.BaseForm;
import com.arsdigita.globalization.GlobalizedMessage;
@ -68,9 +68,9 @@ class BaseTaskForm extends BaseForm {
m_workflow = workflow;
m_name = new Name("name", 200, true);
addField(gz("cms.ui.name"), m_name);
addField(gz("cms.ui.workflow.task.name"), m_name);
m_type = new SingleSelect(new IntegerParameter("task_type"));
m_type = new SingleSelect(new StringParameter("task_type"));
addField(gz("cms.ui.workflow.task.type"), m_type);
try {
@ -80,7 +80,7 @@ class BaseTaskForm extends BaseForm {
}
m_description = new Description("desc", 4000, true);
addField(gz("cms.ui.description"), m_description);
addField(gz("cms.ui.workflow.task.description"), m_description);
m_deps = new CheckboxGroup("dep");
addField(gz("cms.ui.workflow.task.dependencies"), m_deps);
@ -160,7 +160,6 @@ class BaseTaskForm extends BaseForm {
* new ones in since it is possible that Tasks will fire events when
* dependencies are added and removed.
*
* XXX domlay
*/
final void processDependencies(final Task task,
final String[] selectedDependencies) {

View File

@ -41,10 +41,10 @@ class BaseWorkflowForm extends BaseForm {
super(key, message);
m_title = new Name("name", 200, true);
addField(gz("cms.ui.name"), m_title);
addField(gz("cms.ui.workflow.name"), m_title);
m_description = new Description("desc", 4000, true);
addField(gz("cms.ui.description"), m_description);
addField(gz("cms.ui.workflow.description"), m_description);
addAction(new Finish());
addAction(new Cancel());

View File

@ -53,6 +53,7 @@ import org.librecms.workflow.CmsTaskType;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
abstract class BaseWorkflowItemPane extends BaseItemPane {
@ -81,12 +82,14 @@ abstract class BaseWorkflowItemPane extends BaseItemPane {
final ActionLink taskAddLink = new ActionLink(new Label(gz(
"cms.ui.workflow.task.add")));
final TaskAddForm taskAddForm = new TaskAddForm(workflowRequestLocal, taskTable
final TaskAddForm taskAddForm = new TaskAddForm(workflowRequestLocal,
taskTable
.getRowSelectionModel());
final ActionLink taskEditLink = new ActionLink(new Label(gz(
"cms.ui.workflow.task.edit")));
final TaskEditForm taskEditForm = new TaskEditForm(workflowRequestLocal, taskRequestLocal);
final TaskEditForm taskEditForm = new TaskEditForm(workflowRequestLocal,
taskRequestLocal);
final ActionLink taskDeleteLink = new ActionLink(new Label(gz(
"cms.ui.workflow.task.delete")));
@ -159,7 +162,8 @@ abstract class BaseWorkflowItemPane extends BaseItemPane {
final PageState state = event.getPageState();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final TaskManager taskManager = cdiUtil.findBean(TaskManager.class);
final TaskManager taskManager = cdiUtil.findBean(
TaskManager.class);
final Task task = taskRequestLocal.getTask(state);
taskManager.finish(task);
@ -205,10 +209,22 @@ abstract class BaseWorkflowItemPane extends BaseItemPane {
@Override
protected final Object initialValue(final PageState state) {
final String key = taskTable.getRowSelectionModel().getSelectedKey(
state).toString();
return CmsTaskType.valueOf(key);
final Long key = Long.parseLong(taskTable.getRowSelectionModel()
.getSelectedKey(state).toString());
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final TaskRepository taskRepo = cdiUtil.findBean(
TaskRepository.class);
final CmsTask task = (CmsTask) taskRepo
.findById(key)
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No Task with ID %d in the database. "
+ "Where did that ID come from?",
key)));
return task;
}
}
@ -235,21 +251,27 @@ abstract class BaseWorkflowItemPane extends BaseItemPane {
protected final List<Property> properties(final PageState state) {
@SuppressWarnings("unchecked")
final List<Property> props = super.properties(state);
final Workflow workflow = (Workflow) workflowRequestLocal.get(state);
@SuppressWarnings("unchecked")
final Workflow workflow
= ((Optional<Workflow>) workflowRequestLocal
.get(state)).get();
final KernelConfig kernelConfig = KernelConfig.getConfig();
final Locale defaultLocale = kernelConfig.getDefaultLocale();
props.add(new Property(gz("cms.ui.name"),
workflow.getName().getValue(defaultLocale)));
props.add(new Property(gz("cms.ui.workflow.name"),
workflow.getName()
.getValue(defaultLocale)));
props.add(new Property(
gz("cms.ui.description"),
gz("cms.ui.workflow.description"),
workflow.getDescription().getValue(defaultLocale)));
if (workflow.getState() == null) {
props.add(new Property(gz("cms.ui.workflow.current_state"),
gz("cms.ui.workflow.current_state.none")));
} else {
props.add(new Property(gz("cms.ui.workflow.current_state"),
workflow.getState().toString()));
props.add(new Property(gz("cms.ui.workflow.num_tasks"),
String.valueOf(workflow.getTasks().size())));
}
return props;
}

View File

@ -34,12 +34,7 @@ import org.librecms.workflow.CmsTask;
import com.arsdigita.util.UncheckedWrapperException;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.workflow.Task;
import org.libreccm.workflow.TaskManager;
import org.libreccm.workflow.TaskRepository;
import org.libreccm.workflow.Workflow;
import org.libreccm.workflow.WorkflowManager;
import org.librecms.workflow.CmsTaskType;
import java.util.List;
@ -52,9 +47,9 @@ import java.util.TooManyListenersException;
*/
class TaskAddForm extends BaseTaskForm {
protected final static String ERROR_MSG
= "A workflow template with that name already exists in this content "
+ "section.";
protected final static String ERROR_MSG = "A workflow template with that "
+ "name already exists in this "
+ "content section.";
private final SingleSelectionModel<Long> m_model;
@ -78,7 +73,11 @@ class TaskAddForm extends BaseTaskForm {
@Override
public final void prepare(final PrintEvent event) {
final PageState state = event.getPageState();
final List<Task> tasks = m_workflow.getWorkflow(state).getTasks();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowAdminPaneController controller = cdiUtil
.findBean(WorkflowAdminPaneController.class);
final List<Task> tasks = controller
.getTasksForWorkflow(m_workflow.getWorkflow(state));
final OptionGroup options = (OptionGroup) event.getTarget();
final KernelConfig kernelConfig = KernelConfig.getConfig();
@ -99,36 +98,16 @@ class TaskAddForm extends BaseTaskForm {
final PageState state = event.getPageState();
final Workflow workflow = m_workflow.getWorkflow(state);
final CmsTask task = new CmsTask();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final TaskRepository taskRepo = cdiUtil.findBean(
TaskRepository.class);
final WorkflowManager workflowManager = cdiUtil.findBean(
WorkflowManager.class);
final TaskManager taskManager = cdiUtil.findBean(TaskManager.class);
final ConfigurationManager confManager = cdiUtil.findBean(
ConfigurationManager.class);
final KernelConfig kernelConfig = confManager.findConfiguration(
KernelConfig.class);
final Locale defaultLocale = kernelConfig.getDefaultLocale();
final WorkflowAdminPaneController controller = cdiUtil
.findBean(WorkflowAdminPaneController.class);
task.getLabel().addValue(defaultLocale,
((String) m_name.getValue(state)));
task.getDescription().addValue(
defaultLocale,
((String) m_description.getValue(state)));
final CmsTaskType taskType = CmsTaskType.valueOf((String) m_type.getValue(state));
task.setTaskType(taskType);
task.setActive(true);
taskRepo.save(task);
taskManager.addTask(workflow, task);
processDependencies(task, (String[]) m_deps.getValue(state));
final CmsTask task = controller.addTask(
m_workflow.getWorkflow(state),
(String) m_name.getValue(state),
(String) m_description.getValue(state),
CmsTaskType.valueOf((String) m_type.getValue(state)),
(String[]) m_deps.getValue(state));
m_model.setSelectedKey(state, task.getTaskId());
}

View File

@ -317,17 +317,30 @@ final class TaskItemPane extends BaseItemPane {
defaultLocale)));
props.add(new Property(gz("cms.ui.workflow.task.dependencies"),
deps(task)));
if (task.getTaskState() == null) {
props.add(new Property(gz("cms.ui.workflow.task.state"),
gz("cms.ui.workflow.task.state.none")));
} else {
props.add(new Property(gz("cms.ui.workflow.task.state"),
task.getTaskState().toString()));
}
if (task.isLocked()) {
props.add(new Property(gz("cms.ui.workflow.task.locked"),
task.isLocked()
? lz("cms.ui.yes") : lz("cms.ui.no")));
gz("cms.ui.yes")));
} else {
props.add(new Property(gz("cms.ui.workflow.task.locked"),
gz("cms.ui.no")));
}
return props;
}
private String deps(final CmsTask task) {
final List<Task> dependencies = task.getDependsOn();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowAdminPaneController controller = cdiUtil
.findBean(WorkflowAdminPaneController.class);
final List<Task> dependencies = controller.getDependencies(task);
final KernelConfig kernelConfig = KernelConfig.getConfig();
final Locale defaultLocale = kernelConfig.getDefaultLocale();

View File

@ -37,6 +37,7 @@ import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.Logger;
import org.libreccm.cdi.utils.CdiUtil;
class TaskTableModelBuilder extends AbstractTableModelBuilder {
@ -64,7 +65,14 @@ class TaskTableModelBuilder extends AbstractTableModelBuilder {
private Map m_dependencies = new HashMap();
private Model(final Workflow workflow) {
final Iterator<Task> tasksIter = workflow.getTasks().iterator();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowAdminPaneController controller = cdiUtil.findBean(
WorkflowAdminPaneController.class);
final Iterator<Task> tasksIter = controller
.getTasksForWorkflow(workflow)
.iterator();
GraphSet g = new GraphSet();
while (tasksIter.hasNext()) {
@ -100,7 +108,7 @@ class TaskTableModelBuilder extends AbstractTableModelBuilder {
LOGGER.error("found possible loop in tasks for " + workflow);
break;
}
Assert.assertEquals(workflow.getTasks().size(), tasks.size());
m_tasks = tasks.iterator();
}

View File

@ -24,16 +24,9 @@ import com.arsdigita.bebop.SingleSelectionModel;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.cms.CMS;
import com.arsdigita.kernel.KernelConfig;
import org.librecms.contentsection.ContentSection;
import org.libreccm.workflow.WorkflowTemplate;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.workflow.WorkflowTemplateRepository;
import org.librecms.contentsection.ContentSectionManager;
import java.util.Locale;
/**
* @author Uday Mathur
@ -58,32 +51,44 @@ class WorkflowAddForm extends BaseWorkflowForm {
@Override
public final void process(final FormSectionEvent event)
throws FormProcessException {
final PageState state = event.getPageState();
final String label = (String) m_title.getValue(state);
final String description = (String) m_description.getValue(state);
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowTemplateRepository workflowTemplateRepository = cdiUtil.findBean(
WorkflowTemplateRepository.class);
final ContentSectionManager sectionManager = cdiUtil.findBean(
ContentSectionManager.class);
final ConfigurationManager confManager = cdiUtil.findBean(ConfigurationManager.class);
final KernelConfig kernelConfig = confManager.findConfiguration(
KernelConfig.class);
final Locale defaultLocale = kernelConfig.getDefaultLocale();
final WorkflowAdminPaneController controller = cdiUtil.findBean(
WorkflowAdminPaneController.class);
// final WorkflowTemplateRepository workflowTemplateRepository
// = cdiUtil.findBean(
// WorkflowTemplateRepository.class);
// final ContentSectionManager sectionManager = cdiUtil.findBean(
// ContentSectionManager.class);
// final ConfigurationManager confManager = cdiUtil.findBean(
// ConfigurationManager.class);
// final KernelConfig kernelConfig = confManager.findConfiguration(
// KernelConfig.class);
// final Locale defaultLocale = kernelConfig.getDefaultLocale();
//
// final WorkflowTemplate workflow = new WorkflowTemplate();
// workflow.getName().addValue(defaultLocale, label);
// workflow.getDescription().addValue(defaultLocale, description);
//
// workflowTemplateRepository.save(workflow);
//
// final ContentSection section = CMS.getContext().getContentSection();
// sectionManager
// .addWorkflowTemplateToContentSection(workflow, section);
final WorkflowTemplate workflow = new WorkflowTemplate();
workflow.getName().addValue(defaultLocale, label);
workflow.getDescription().addValue(defaultLocale, description);
workflowTemplateRepository.save(workflow);
final ContentSection section =
CMS.getContext().getContentSection();
sectionManager.addWorkflowTemplateToContentSection(workflow, section);
final WorkflowTemplate workflow = controller.createWorkflow(
CMS.getContext().getContentSection(),
label,
description);
m_model.setSelectedKey(state, workflow.getWorkflowId());
}
}
}

View File

@ -0,0 +1,218 @@
/*
* Copyright (C) 2017 LibreCCM Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package com.arsdigita.cms.ui.workflow;
import com.arsdigita.kernel.KernelConfig;
import com.arsdigita.util.UncheckedWrapperException;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.workflow.CircularTaskDependencyException;
import org.libreccm.workflow.Task;
import org.libreccm.workflow.TaskManager;
import org.libreccm.workflow.TaskRepository;
import org.libreccm.workflow.Workflow;
import org.libreccm.workflow.WorkflowRepository;
import org.libreccm.workflow.WorkflowTemplate;
import org.libreccm.workflow.WorkflowTemplateMarshaller;
import org.libreccm.workflow.WorkflowTemplateRepository;
import org.librecms.contentsection.ContentSection;
import org.librecms.contentsection.ContentSectionManager;
import org.librecms.contentsection.ContentSectionRepository;
import org.librecms.workflow.CmsTask;
import org.librecms.workflow.CmsTaskType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.transaction.Transactional;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
public class WorkflowAdminPaneController {
@Inject
private ConfigurationManager confManager;
@Inject
private ContentSectionRepository sectionRepo;
@Inject
private ContentSectionManager sectionManager;
@Inject
private WorkflowRepository workflowRepo;
@Inject
private WorkflowTemplateRepository workflowTemplateRepo;
@Inject
private TaskRepository taskRepo;
@Inject
private TaskManager taskManager;
@Transactional(Transactional.TxType.REQUIRED)
public List<WorkflowTemplate> retrieveWorkflows(final ContentSection section) {
final ContentSection contentSection = sectionRepo
.findById(section.getObjectId())
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No ContentSection with ID %d in the database. "
+ "Where did that ID come from?",
section.getObjectId())));
return new ArrayList<>(contentSection.getWorkflowTemplates());
}
@Transactional(Transactional.TxType.REQUIRED)
public WorkflowTemplate createWorkflow(final ContentSection section,
final String name,
final String desc) {
final KernelConfig kernelConfig = confManager.findConfiguration(
KernelConfig.class);
final Locale defaultLocale = kernelConfig.getDefaultLocale();
final ContentSection contentSection = sectionRepo
.findById(section.getObjectId())
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No ContentSection with ID %d in the database. "
+ "Where did that ID come from?",
section.getObjectId())));
final WorkflowTemplate workflowTemplate = new WorkflowTemplate();
workflowTemplate.getName().addValue(defaultLocale, name);
workflowTemplate.getDescription().addValue(defaultLocale, desc);
workflowTemplateRepo.save(workflowTemplate);
sectionManager.addWorkflowTemplateToContentSection(workflowTemplate,
contentSection);
return workflowTemplate;
}
@Transactional(Transactional.TxType.REQUIRED)
public List<Task> getTasksForWorkflow(final Workflow workflow) {
final Workflow theWorkflow = workflowRepo
.findById(workflow.getWorkflowId())
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No Workflow with ID %d in the database. Where did that ID come from?",
workflow.getWorkflowId())));
return new ArrayList<>(theWorkflow.getTasks());
}
@Transactional(Transactional.TxType.REQUIRED)
public CmsTask addTask(final Workflow workflow,
final String name,
final String desc,
final CmsTaskType type,
final String[] deps) {
final KernelConfig kernelConfig = confManager
.findConfiguration(KernelConfig.class);
final Locale defaultLocale = kernelConfig.getDefaultLocale();
final Workflow theWorkflow = workflowRepo
.findById(workflow.getWorkflowId())
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No Workflow with ID %d in the database. "
+ "Where did that ID come from?",
workflow.getWorkflowId())));
final CmsTask task = new CmsTask();
task.getLabel().addValue(defaultLocale, name);
task.getDescription().addValue(defaultLocale, desc);
task.setTaskType(type);
task.setActive(true);
taskRepo.save(task);
taskManager.addTask(theWorkflow, task);
processDependencies(task, deps);
return task;
}
/**
* This method decides which dependencies have to be removed and which ones
* newly added. Unfortunately we cannot just do "remove all", and add the
* new ones in since it is possible that Tasks will fire events when
* dependencies are added and removed.
*
*/
private void processDependencies(final Task task,
final String[] selectedDependencies) {
final List<Task> dependencies = task.getDependentTasks();
final Map<Long, Task> toAdd = new HashMap<>();
// Everything is to be removed unless it is in the array.
final Map<Long, Task> toRemove = dependencies.stream()
.collect(Collectors.toMap(Task::getTaskId,
dependency -> dependency));
Long selectedId;
Object addedTask;
if (selectedDependencies != null) {
for (String selectedDependency : selectedDependencies) {
selectedId = Long.parseLong(selectedDependency);
addedTask = toRemove.remove(selectedId);
if (addedTask == null) {
toAdd.put(selectedId, taskRepo.findById(selectedId).get());
}
}
}
for (final Task taskToRemove : toRemove.values()) {
taskManager.removeDependentTask(task, taskToRemove);
}
for (final Task taskToAdd : toAdd.values()) {
try {
taskManager.addDependentTask(task, taskToAdd);
} catch (CircularTaskDependencyException ex) {
throw new UncheckedWrapperException(ex);
}
}
}
@Transactional(Transactional.TxType.REQUIRED)
public List<Task> getDependencies(final Task task) {
final Task theTask = taskRepo
.findById(task.getTaskId())
.orElseThrow(() -> new IllegalArgumentException(String.format(
"No Task with ID %d in the database. Where did that ID come from?",
task.getTaskId())));
return new ArrayList<>(theTask.getDependsOn());
}
}

View File

@ -94,7 +94,8 @@ class WorkflowEditForm extends BaseWorkflowForm {
final Locale defaultLocale = kernelConfig.getDefaultLocale();
m_title.setValue(state, workflow.getName().getValue(defaultLocale));
m_description.setValue(state, workflow.getDescription());
m_description.setValue(state, workflow.getDescription().getValue(
defaultLocale));
}
}

View File

@ -25,10 +25,11 @@ import com.arsdigita.bebop.list.ListModel;
import com.arsdigita.cms.CMS;
import com.arsdigita.kernel.KernelConfig;
import org.libreccm.cdi.utils.CdiUtil;
import org.librecms.contentsection.ContentSection;
import org.libreccm.workflow.WorkflowTemplate;
import org.libreccm.workflow.Task;
import java.util.Iterator;
import java.util.Locale;
/**
@ -48,31 +49,39 @@ class WorkflowListModelBuilder extends AbstractListModelBuilder {
private class Model implements ListModel {
private final java.util.List<WorkflowTemplate> templates;
private int index = -1;
private final Iterator<WorkflowTemplate> templates;
private WorkflowTemplate currentTemplate;
public Model() {
final ContentSection section = CMS.getContext().getContentSection();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowAdminPaneController controller = cdiUtil.findBean(
WorkflowAdminPaneController.class);
templates = section.getWorkflowTemplates();
templates = controller
.retrieveWorkflows(CMS.getContext().getContentSection())
.iterator();
}
@Override
public boolean next() {
index++;
return index < templates.size();
if (templates.hasNext()) {
currentTemplate = templates.next();
return true;
} else {
return false;
}
}
@Override
public Object getElement() {
final KernelConfig kernelConfig = KernelConfig.getConfig();
final Locale defaultLocale = kernelConfig.getDefaultLocale();
return templates.get(index).getName().getValue(defaultLocale);
return currentTemplate.getName().getValue(defaultLocale);
}
@Override
public String getKey() {
return Long.toString(templates.get(index).getWorkflowId());
return Long.toString(currentTemplate.getWorkflowId());
}
}

View File

@ -20,11 +20,14 @@ package com.arsdigita.cms.ui.workflow;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.RequestLocal;
import org.libreccm.workflow.Workflow;
import java.util.Optional;
public abstract class WorkflowRequestLocal extends RequestLocal {
public final Workflow getWorkflow(final PageState state) {
return (Workflow) get(state);
return ((Optional<Workflow>) get(state)).get();
}
}

View File

@ -146,3 +146,22 @@ cms.ui.finish=Finish
cms.ui.save=Save
cms.ui.role.name_not_unique=A role with this name already exists.
cms.ui.role.add=Add role
cms.ui.workflow.add=Add workflow
cms.ui.workflow.intro=Select a workflow or create a new one
cms.ui.workflow.name=Name
cms.ui.workflow.description=Description
cms.ui.workflow.details=Workflow Properties
cms.ui.workflow.current_state=Current state
cms.ui.workflow.current_state.none=None
cms.ui.workflow.edit=Edit
cms.ui.workflow.delete=Delete
cms.ui.workflow.tasks=Tasks
cms.ui.workflow.task.none=No tasks
cms.ui.workflow.task.add=Add task
cms.ui.workflow.task.name=Name
cms.ui.workflow.task.type=Type
cms.ui.workflow.task.description=Description
cms.ui.workflow.task.dependencies=Dependencies
cms.workflow.task_type.AUTHOR=Author
cms.workflow.task_type.EDIT=Edit
cms.workflow.task_type.DEPLOY=Deploy

View File

@ -145,3 +145,22 @@ cms.ui.finish=Beenden
cms.ui.save=Speichern
cms.ui.role.name_not_unique=Eine Rolle mit diesem Namen existiert bereits.
cms.ui.role.add=Rolle hinzuf\u00fcgen
cms.ui.workflow.add=Arbeitsablauf hinzuf\u00fcgen
cms.ui.workflow.intro=W\u00e4hlen Sie einen bestehenden Arbeitsablauf oder erstellen Sie einen neuen Arbeitsablauf
cms.ui.workflow.name=Name
cms.ui.workflow.description=Beschreibung
cms.ui.workflow.details=Arbeitsablauf Eigenschaften
cms.ui.workflow.current_state=Aktueller Status
cms.ui.workflow.current_state.none=Keiner
cms.ui.workflow.edit=Bearbeiten
cms.ui.workflow.delete=L\u00f6schen
cms.ui.workflow.tasks=Aufgaben
cms.ui.workflow.task.none=Keine Aufgaben
cms.ui.workflow.task.add=Aufgabe hinzuf\u00fcgen
cms.ui.workflow.task.name=Name
cms.ui.workflow.task.type=Typ
cms.ui.workflow.task.description=Beschreibung
cms.ui.workflow.task.dependencies=Abh\u00e4ngigkeiten
cms.workflow.task_type.AUTHOR=Verfassen
cms.workflow.task_type.EDIT=Bearbeiten
cms.workflow.task_type.DEPLOY=Ver\u00f6ffentlichen

View File

@ -114,3 +114,22 @@ cms.ui.finish=Finish
cms.ui.save=Save
cms.ui.role.name_not_unique=A role with this name already exists.
cms.ui.role.add=Add role
cms.ui.workflow.add=Add workflow
cms.ui.workflow.intro=Select a workflow or create a new one
cms.ui.workflow.name=Name
cms.ui.workflow.description=Description
cms.ui.workflow.details=Workflow Properties
cms.ui.workflow.current_state=Current state
cms.ui.workflow.current_state.none=None
cms.ui.workflow.edit=Edit
cms.ui.workflow.delete=Delete
cms.ui.workflow.tasks=Tasks
cms.ui.workflow.task.none=No tasks
cms.ui.workflow.task.add=Add task
cms.ui.workflow.task.name=Name
cms.ui.workflow.task.type=Type
cms.ui.workflow.task.description=Description
cms.ui.workflow.task.dependencies=Dependencies
cms.workflow.task_type.AUTHOR=Author
cms.workflow.task_type.EDIT=Edit
cms.workflow.task_type.DEPLOY=Deploy

View File

@ -20,6 +20,8 @@ package org.libreccm.workflow;
import org.libreccm.core.AbstractEntityRepository;
import java.util.UUID;
import javax.enterprise.context.RequestScoped;
/**
@ -41,4 +43,10 @@ public class WorkflowTemplateRepository
return template.getWorkflowId() == 0;
}
@Override
public void initNewEntity(final WorkflowTemplate workflowTemplate) {
super.initNewEntity(workflowTemplate);
workflowTemplate.setUuid(UUID.randomUUID().toString());
}
}