CCM NG: Some minor fixes for the Workflow tab of the Content Section Admin
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5219 8810af33-2d31-482b-a856-94f89814c4df
Former-commit-id: 0da6279752
pull/2/head
parent
248f849283
commit
16088ed228
|
|
@ -64,6 +64,7 @@ class BaseTaskForm extends BaseForm {
|
||||||
BaseTaskForm(final String key,
|
BaseTaskForm(final String key,
|
||||||
final GlobalizedMessage message,
|
final GlobalizedMessage message,
|
||||||
final WorkflowRequestLocal workflowRequestLocal) {
|
final WorkflowRequestLocal workflowRequestLocal) {
|
||||||
|
|
||||||
super(key, message);
|
super(key, message);
|
||||||
|
|
||||||
this.workflowRequestLocal = workflowRequestLocal;
|
this.workflowRequestLocal = workflowRequestLocal;
|
||||||
|
|
@ -166,7 +167,9 @@ class BaseTaskForm extends BaseForm {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void prepare(final PrintEvent event) {
|
public void prepare(final PrintEvent event) {
|
||||||
|
|
||||||
final OptionGroup target = (OptionGroup) event.getTarget();
|
final OptionGroup target = (OptionGroup) event.getTarget();
|
||||||
|
target.clearOptions();
|
||||||
|
|
||||||
for (final CmsTaskType type : CmsTaskType.values()) {
|
for (final CmsTaskType type : CmsTaskType.values()) {
|
||||||
final GlobalizedMessage label = new GlobalizedMessage(
|
final GlobalizedMessage label = new GlobalizedMessage(
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ package com.arsdigita.cms.ui.workflow;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SingleSelectionModel;
|
import com.arsdigita.bebop.SingleSelectionModel;
|
||||||
|
import com.arsdigita.bebop.Text;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.PrintEvent;
|
import com.arsdigita.bebop.event.PrintEvent;
|
||||||
|
|
@ -51,28 +52,31 @@ class TaskAddForm extends BaseTaskForm {
|
||||||
+ "name already exists in this "
|
+ "name already exists in this "
|
||||||
+ "content section.";
|
+ "content section.";
|
||||||
|
|
||||||
private final SingleSelectionModel<Long> m_model;
|
private final SingleSelectionModel<Long> selectedWorkflowId;
|
||||||
|
|
||||||
public TaskAddForm(final WorkflowRequestLocal workflow,
|
public TaskAddForm(final WorkflowRequestLocal workflow,
|
||||||
final SingleSelectionModel<Long> model) {
|
final SingleSelectionModel<Long> selectedWorkflowId) {
|
||||||
|
|
||||||
super("task", gz("cms.ui.workflow.task.add"), workflow);
|
super("task", gz("cms.ui.workflow.task.add"), workflow);
|
||||||
|
|
||||||
m_model = model;
|
this.selectedWorkflowId = selectedWorkflowId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getDependenciesOptionGroup()
|
super
|
||||||
|
.getDependenciesOptionGroup()
|
||||||
.addPrintListener(new DependencyPrinter());
|
.addPrintListener(new DependencyPrinter());
|
||||||
} catch (TooManyListenersException tmle) {
|
} catch (TooManyListenersException ex) {
|
||||||
throw new UncheckedWrapperException(tmle);
|
throw new UncheckedWrapperException(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
addProcessListener(new ProcessListener());
|
super.addProcessListener(new ProcessListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DependencyPrinter implements PrintListener {
|
private class DependencyPrinter implements PrintListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void prepare(final PrintEvent event) {
|
public final void prepare(final PrintEvent event) {
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final WorkflowAdminPaneController controller = cdiUtil
|
final WorkflowAdminPaneController controller = cdiUtil
|
||||||
|
|
@ -88,7 +92,7 @@ class TaskAddForm extends BaseTaskForm {
|
||||||
options.clearOptions();
|
options.clearOptions();
|
||||||
tasks.forEach(task -> options.addOption(new Option(
|
tasks.forEach(task -> options.addOption(new Option(
|
||||||
Long.toString(task.getTaskId()),
|
Long.toString(task.getTaskId()),
|
||||||
task.getLabel().getValue(defaultLocale))));
|
new Text(task.getLabel().getValue(defaultLocale)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +117,7 @@ class TaskAddForm extends BaseTaskForm {
|
||||||
.getValue(state)),
|
.getValue(state)),
|
||||||
(String[]) getDependenciesOptionGroup().getValue(state));
|
(String[]) getDependenciesOptionGroup().getValue(state));
|
||||||
|
|
||||||
m_model.setSelectedKey(state, task.getTaskId());
|
selectedWorkflowId.setSelectedKey(state, task.getTaskId());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue