diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java.off
index 2d39a421f..686887a3e 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java.off
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentItemPage.java.off
@@ -436,7 +436,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
* @param itemId the id of the ContentItem object to display
* @param tab The index of the tab to display
*/
- public static String getItemURL(BigDecimal itemId, int tab) {
+ public static String getItemURL(long itemId, int tab) {
final ContentItem item =
(ContentItem) DomainObjectFactory.newInstance(new OID(
ContentItem.BASE_DATA_OBJECT_TYPE, itemId));
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionContextBar.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/ContentSectionPage.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java.off
index 0424c008f..ad268f1fb 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java.off
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/AuthoringKitWizard.java.off
@@ -57,7 +57,7 @@ import com.arsdigita.toolbox.ui.Section;
import com.arsdigita.util.Assert;
import com.arsdigita.util.SequentialMap;
import com.arsdigita.util.UncheckedWrapperException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -66,6 +66,9 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.Collections;
+import org.apache.logging.log4j.LogManager;
+import org.librecms.contenttypes.AuthoringKitInfo;
+import org.librecms.contenttypes.ContentTypeInfo;
/**
* This class represents a single authoring kit. The wizard accepts a
@@ -83,12 +86,11 @@ import java.util.Collections;
* This constructor will be called when the component is automatically
* instantiated by the AuthoringKitWizard.
*
- * @version $Id: AuthoringKitWizard.java 2140 2011-01-16 12:04:20Z pboy $
*/
public class AuthoringKitWizard extends LayoutPanel implements Resettable {
/** Private Logger instance for this class */
- private static final Logger s_log = Logger.getLogger(
+ private static final Logger LOGGER = LogManager.getLogger(
AuthoringKitWizard.class);
private static Class[] s_args = new Class[]{
ItemSelectionModel.class,
@@ -103,8 +105,8 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
private static final java.util.List s_assets = new
ArrayList();
private final Object[] m_vals;
- private final ContentType m_type;
- private final AuthoringKit m_kit;
+ private final ContentTypeInfo m_type;
+ private final AuthoringKitInfo m_kit;
private final ItemSelectionModel m_sel;
private final WorkflowRequestLocal m_workflow;
private final AssignedTaskTable m_tasks;
@@ -131,14 +133,12 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
*
* @param type The content type of the items that this wizard will
* handle
- *
- * @param itemModel The item selection model which will supply
- * this wizard with the content item object
+ * @param model
*/
- public AuthoringKitWizard(final ContentType type,
+ public AuthoringKitWizard(final ContentTypeInfo type,
final ItemSelectionModel model) {
- if (s_log.isDebugEnabled()) {
- s_log.debug("Authoring kit wizard for type " + type + " "
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Authoring kit wizard for type " + type + " "
+ "undergoing creation");
}
@@ -262,9 +262,9 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
Collection skipSteps = ContentSection.getConfig().getAssetStepsToSkip(
type);
Iterator it = skipSteps.iterator();
- if (s_log.isDebugEnabled()) {
+ if (LOGGER.isDebugEnabled()) {
while (it.hasNext()) {
- s_log.debug("skip step " + it.next());
+ LOGGER.debug("skip step " + it.next());
}
}
//Iterator assets = s_assets.iterator();
@@ -276,7 +276,7 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
final String baseObjectType = data.getBaseDataObjectType();
//Class step = (Class) data[1];
Class step = data.getStep();
- s_log.debug("possibly adding asset step " + step.getName());
+ LOGGER.debug("possibly adding asset step " + step.getName());
if (!skipSteps.contains(step.getName())) {
//GlobalizedMessage label = (GlobalizedMessage) data[2];
GlobalizedMessage label = data.getLabel();
@@ -423,7 +423,7 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
// registered, but I needed the image step to use a different step class if the specialised
// image step application was loaded. Solution is to ensure initialiser in new project
// runs after original ccm-ldn-image-step initializer and override the registered step here
- s_log.debug(
+ LOGGER.debug(
"registering asset step - label: "
+ label.localize()
+ " step class: "
@@ -451,7 +451,7 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
*/
if ((thisObjectType.equals(baseObjectType))
&& (thisLabel.localize().equals(label.localize()))) {
- s_log.debug(
+ LOGGER.debug(
"registering authoring step with same label as previously registered step");
s_assets.remove(data);
break;
@@ -570,8 +570,8 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
* @param className The Java class name of the step
*/
protected Component instantiateStep(String name) {
- if (s_log.isDebugEnabled()) {
- s_log.debug("Instantiating kit wizard '" + name + "' with "
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Instantiating kit wizard '" + name + "' with "
+ "arguments " + s_args);
}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/WizardSelector.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/WizardSelector.java.off
index 64d0db1ef..9754fa27d 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/WizardSelector.java.off
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/WizardSelector.java.off
@@ -18,7 +18,6 @@
*/
package com.arsdigita.cms.ui.authoring;
-
import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.Resettable;
@@ -33,6 +32,7 @@ import org.librecms.contentsection.ContentType;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.toolbox.ui.LayoutPanel;
+import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.xml.Element;
import oracle.jrockit.jfr.events.ContentTypeImpl;
@@ -42,37 +42,36 @@ import org.librecms.contenttypes.ContentTypeInfo;
import java.math.BigDecimal;
-
/**
- * An invisible component which contains all the possible authoring kits.
- * The kits are loaded from the database at construction time. The selector
- * chooses which kit to display at page rendering time based on the value
- * of the content_type state parameter.
- *
- * Essentially, this component is a hack which is used to get around
- * the fact that we cannot instantiate stateful components dynamically.
+ * An invisible component which contains all the possible authoring kits. The
+ * kits are loaded from the database at construction time. The selector chooses
+ * which kit to display at page rendering time based on the value of the
+ * content_type state parameter.
+ *
+ * Essentially, this component is a hack which is used to get around the fact
+ * that we cannot instantiate stateful components dynamically.
*
* @author Jens Pelzetter
* @author unknown
*/
public class WizardSelector extends AuthoringKitSelector
- implements Resettable {
+ implements Resettable {
private ItemSelectionModel itemSelectionModel;
/**
- * Construct a new WizardSelector. Load all the possible authoring kits
- * from the database and construct wizards for them.
+ * Construct a new WizardSelector. Load all the possible authoring kits from
+ * the database and construct wizards for them.
*
- * @param model the {@link ItemSelectionModel} which will
- * supply the wizard with its item
+ * @param model the {@link ItemSelectionModel} which will supply the wizard
+ * with its item
*
- * @param typeModel the {@link ACSObjectSelectionModel} which will
- * supply the default content type
+ * @param typeModel the {@link ACSObjectSelectionModel} which will supply
+ * the default content type
*
* @pre itemModel != null
*/
- public WizardSelector(final ItemSelectionModel model,
+ public WizardSelector(final ItemSelectionModel model,
final SingleSelectionModel typeModel) {
super(typeModel);
itemSelectionModel = model;
@@ -81,18 +80,19 @@ public class WizardSelector extends AuthoringKitSelector
/**
* Get the wizard for the given kit.
+ *
* @param kit
* @param type
- * @return
+ * @return
*/
- public Component instantiateKitComponent(final AuthoringKitInfo kit,
+ @Override
+ public Component instantiateKitComponent(final AuthoringKitInfo kit,
final ContentTypeInfo type) {
- final ItemSelectionModel itemModel = new
- ItemSelectionModel(type,
- (LongParameter)itemSelectionModel.getStateParameter());
+ final ItemSelectionModel itemModel = new ItemSelectionModel(
+ type, (LongParameter) itemSelectionModel.getStateParameter());
- final AuthoringKitWizard wizard = new AuthoringKitWizard(type, itemModel);
+ final AuthoringKitWizard wizard = new AuthoringKitWizard(type, itemModel);
return wizard;
}
@@ -107,54 +107,51 @@ public class WizardSelector extends AuthoringKitSelector
private Component getCurrentWizard(PageState state) {
// Get the current item and extract its content type
- if(!itemSelectionModel.isSelected(state))
- throw new RuntimeException( (String) GlobalizationUtil.globalize(
- "cms.ui.authoring.missing_item_id")
- .localize());
+ if (!itemSelectionModel.isSelected(state)) {
+ throw new UncheckedWrapperException("No item selected.");
+ }
- ContentItem item =
- (ContentItem)itemSelectionModel.getSelectedObject(state);
+ final ContentItem item = (ContentItem) itemSelectionModel
+ .getSelectedObject(state);
- ContentType type = item.getContentType();
- BigDecimal typeId;
+ final ContentType type = item.getContentType();
+ final String typeClass;
- if(type == null) {
+ if (type == null) {
// Try to get the default content type
- typeId = (BigDecimal)getComponentSelectionModel().getSelectedKey(state);
- if(typeId == null) {
- throw new RuntimeException((String) GlobalizationUtil.globalize(
- "cms.ui.authoring.missing_content_type")
- .localize());
+ typeClass = getComponentSelectionModel().getSelectedKey(state);
+ if (typeClass == null || typeClass.isEmpty()) {
+ throw new UncheckedWrapperException("Content type is missing");
}
} else {
- typeId = type.getID();
+ typeClass = type.getContentItemClass();
}
-
+
// Return the selected wizard
- return (Component)getComponent(typeId);
+ return (Component) getComponent(typeClass);
}
// Choose the right wizard and run it
- public void generateXML(PageState state, Element parent) {
+ @Override
+ public void generateXML(final PageState state, final Element parent) {
- Component c = getCurrentWizard(state);
+ final Component component = getCurrentWizard(state);
- if(c == null) {
- throw new RuntimeException( (String) GlobalizationUtil.globalize(
- "cms.ui.authoring.no_current_wizard")
- .localize());
+ if (component == null) {
+ throw new UncheckedWrapperException("No Wizard.");
}
- c.generateXML(state, parent);
+ component.generateXML(state, parent);
}
/**
* Reset the state of the current wizard
*/
- public void reset(PageState state) {
- Resettable r = (Resettable)getCurrentWizard(state);
- if(r != null) r.reset(state);
+ public void reset(final PageState state) {
+ final Resettable resettable = (Resettable) getCurrentWizard(state);
+ if (resettable != null) {
+ resettable.reset(state);
+ }
}
-
}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskController.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskController.java
index 25f60747f..ae40c2e3f 100644
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskController.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskController.java
@@ -24,8 +24,8 @@ import com.arsdigita.kernel.KernelConfig;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.security.Shiro;
import org.libreccm.security.User;
-import org.libreccm.workflow.UserTask;
-import org.libreccm.workflow.UserTaskRepository;
+import org.libreccm.workflow.AssignableTask;
+import org.libreccm.workflow.AssignableTaskRepository;
import org.libreccm.workflow.Workflow;
import org.libreccm.workflow.WorkflowManager;
@@ -50,7 +50,7 @@ public class AssignedTaskController {
private WorkflowManager workflowManager;
@Inject
- private UserTaskRepository userTaskRepo;
+ private AssignableTaskRepository userTaskRepo;
@Inject
private Shiro shiro;
@@ -71,7 +71,7 @@ public class AssignedTaskController {
@Transactional(Transactional.TxType.REQUIRED)
public List> getAssignedTasks(final Workflow workflow) {
final User user = shiro.getUser();
- final List tasks = userTaskRepo.getAssignedTasks(user,
+ final List tasks = userTaskRepo.getAssignedTasks(user,
workflow);
return tasks
@@ -81,7 +81,7 @@ public class AssignedTaskController {
}
- private RowData createRowData(final UserTask task) {
+ private RowData createRowData(final AssignableTask task) {
final RowData rowData = new RowData<>(3);
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java.off
similarity index 92%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java.off
index 3ffe736ef..16d84091c 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskSection.java.off
@@ -39,14 +39,14 @@ import org.apache.log4j.Logger;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.security.Shiro;
import org.libreccm.workflow.Task;
-import org.libreccm.workflow.UserTask;
-import org.libreccm.workflow.UserTaskRepository;
+import org.libreccm.workflow.AssignableTask;
+import org.libreccm.workflow.AssignableTaskRepository;
import org.libreccm.workflow.WorkflowConstants;
import org.libreccm.workflow.WorkflowManager;
import org.libreccm.workflow.WorkflowRepository;
import org.librecms.CmsConstants;
import org.librecms.workflow.CmsTask;
-import org.librecms.workflow.CmsTaskType;
+import org.librecms.workflow.CmsTaskTypeOld;
import java.util.List;
@@ -177,16 +177,15 @@ public final class AssignedTaskSection extends Section {
protected final Object initialValue(final PageState state) {
final Workflow workflow = m_flow.getWorkflow(state);
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
- final UserTaskRepository userTaskRepo = cdiUtil.findBean(
- UserTaskRepository.class);
+ final AssignableTaskRepository userTaskRepo = cdiUtil.findBean(AssignableTaskRepository.class);
final Shiro shiro = cdiUtil.findBean(Shiro.class);
return userTaskRepo.findEnabledTasksForWorkflow(shiro.getUser(),
workflow);
}
@SuppressWarnings("unchecked")
- final List getTasks(final PageState state) {
- return (ArrayList) get(state);
+ final List getTasks(final PageState state) {
+ return (ArrayList) get(state);
}
}
@@ -208,7 +207,7 @@ public final class AssignedTaskSection extends Section {
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowManager workflowManager = cdiUtil.findBean(WorkflowManager.class);
- for(final UserTask task : m_tasks.getTasks(state)) {
+ for(final AssignableTask task : m_tasks.getTasks(state)) {
if (relevant(task) && !task.isLocked()) {
workflowManager.lockTask(task);
}
@@ -219,7 +218,7 @@ public final class AssignedTaskSection extends Section {
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final WorkflowManager workflowManager = cdiUtil.findBean(WorkflowManager.class);
- for(final UserTask task : m_tasks.getTasks(state)) {
+ for(final AssignableTask task : m_tasks.getTasks(state)) {
if (relevant(task) && task.isLocked()) {
workflowManager.unlockTask(task);
}
@@ -227,7 +226,7 @@ public final class AssignedTaskSection extends Section {
}
final boolean tasksLocked(final PageState state) {
- for(final UserTask task : m_tasks.getTasks(state)) {
+ for(final AssignableTask task : m_tasks.getTasks(state)) {
if (relevant(task) && !task.isLocked()) {
return false;
}
@@ -248,7 +247,7 @@ public final class AssignedTaskSection extends Section {
return !m_tasks.getTasks(state).isEmpty();
}
- private boolean relevant(final UserTask task) {
+ private boolean relevant(final AssignableTask task) {
return true;
// ToDo
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java.off
similarity index 94%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java.off
index 848793dbc..bc39534f4 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTable.java.off
@@ -40,8 +40,8 @@ import org.apache.log4j.Logger;
import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.security.Shiro;
import org.libreccm.security.User;
-import org.libreccm.workflow.UserTask;
-import org.libreccm.workflow.UserTaskRepository;
+import org.libreccm.workflow.AssignableTask;
+import org.libreccm.workflow.AssignableTaskRepository;
import org.libreccm.workflow.WorkflowManager;
import org.librecms.CmsConstants;
import org.librecms.workflow.CmsTaskTypeRepository;
@@ -70,13 +70,12 @@ public final class AssignedTaskTable extends Table {
final int column = event.getColumn();
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
- final UserTaskRepository userTaskRepo = cdiUtil.findBean(
- UserTaskRepository.class);
+ final AssignableTaskRepository userTaskRepo = cdiUtil.findBean(AssignableTaskRepository.class);
final WorkflowManager workflowManager = cdiUtil.findBean(WorkflowManager.class);
final Shiro shiro = cdiUtil.findBean(Shiro.class);
if (column == 1) {
- final UserTask task = userTaskRepo.findById((Long) event
+ final AssignableTask task = userTaskRepo.findById((Long) event
.getRowKey());
final User currentUser = shiro.getUser();
final User lockingUser = task.getLockingUser();
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTableModelBuilder.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTableModelBuilder.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTableModelBuilder.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/AssignedTaskTableModelBuilder.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java.off
similarity index 95%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java.off
index aa4583994..9ff3c3b5e 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseTaskForm.java.off
@@ -27,7 +27,7 @@ import com.arsdigita.bebop.parameters.IntegerParameter;
import com.arsdigita.cms.ui.BaseForm;
import com.arsdigita.cms.ui.ListOptionPrintListener;
-import org.librecms.workflow.CmsTaskType;
+import org.librecms.workflow.CmsTaskTypeOld;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.kernel.KernelConfig;
@@ -142,27 +142,27 @@ class BaseTaskForm extends BaseForm {
}
*/
// Fix this one too
- private class TaskTypePrintListener extends ListOptionPrintListener {
+ private class TaskTypePrintListener extends ListOptionPrintListener {
@Override
- protected List getDataQuery(final PageState state) {
+ protected List getDataQuery(final PageState state) {
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
final CmsTaskTypeRepository taskTypeRepo = cdiUtil.findBean(
CmsTaskTypeRepository.class);
- final List taskTypes = taskTypeRepo.findAll();
+ final List taskTypes = taskTypeRepo.findAll();
return taskTypes;
}
@Override
- public String getKey(final CmsTaskType taskType) {
+ public String getKey(final CmsTaskTypeOld taskType) {
return Long.toString(taskType.getTaskTypeId());
}
@Override
- public String getValue(final CmsTaskType taskType) {
+ public String getValue(final CmsTaskTypeOld taskType) {
final KernelConfig kernelConfig = KernelConfig.getConfig();
final Locale defaultLocale = kernelConfig.getDefaultLocale();
return taskType.getName().getValue(defaultLocale);
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseWorkflowItemPane.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseWorkflowItemPane.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseWorkflowItemPane.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/BaseWorkflowItemPane.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java.off
new file mode 100755
index 000000000..64f91fdf7
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/CommentAddForm.java.off
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.ui.workflow;
+
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.form.TextArea;
+import com.arsdigita.cms.ui.BaseForm;
+import org.librecms.workflow.CmsTask;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.libreccm.cdi.utils.CdiUtil;
+import org.libreccm.workflow.TaskRepository;
+
+/**
+ * @author Justin Ross
+ * @author Jens Pelzetter
+ */
+class CommentAddForm extends BaseForm {
+
+ private static final Logger LOGGER = LogManager.getLogger(CommentAddForm.class);
+
+ private final TaskRequestLocal selectedTask;
+ private final TextArea comment;
+
+ public CommentAddForm(final TaskRequestLocal task) {
+ super("addComment", gz("cms.ui.workflow.task.comment.add"));
+
+ this.selectedTask = task;
+
+ comment = new TextArea("Comment");
+ comment.setWrap(TextArea.SOFT);
+ comment.setRows(5);
+ comment.setCols(40);
+
+ addComponent(comment);
+
+ addAction(new Finish());
+ addAction(new Cancel());
+
+ addProcessListener(new ProcessListener());
+ }
+
+ private class ProcessListener implements FormProcessListener {
+ @Override
+ public final void process(final FormSectionEvent event)
+ throws FormProcessException {
+ LOGGER.debug("Processing comment add");
+
+ final PageState state = event.getPageState();
+ final CmsTask task = selectedTask.getTask(state);
+ final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
+ final TaskRepository taskRepo = cdiUtil.findBean(TaskRepository.class);
+
+ task.addComment((String)comment.getValue(state));
+ taskRepo.save(task);
+ }
+ }
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java.off
similarity index 97%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java.off
index 0a141a20c..aa0e63d80 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddForm.java.off
@@ -30,7 +30,7 @@ import com.arsdigita.bebop.form.OptionGroup;
import com.arsdigita.kernel.KernelConfig;
import org.librecms.workflow.CmsTask;
-import org.librecms.workflow.CmsTaskType;
+import org.librecms.workflow.CmsTaskTypeOld;
import com.arsdigita.util.UncheckedWrapperException;
@@ -120,7 +120,7 @@ class TaskAddForm extends BaseTaskForm {
defaultLocale,
((String) m_description.getValue(state)));
- final CmsTaskType taskType = taskTypeRepo.findById((Long) m_type.getValue(state));
+ final CmsTaskTypeOld taskType = taskTypeRepo.findById((Long) m_type.getValue(state));
task.setTaskType(taskType);
task.setActive(true);
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddRole.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddRole.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddRole.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddRole.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddUser.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddUser.java
index a670a6417..e5f4aa720 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddUser.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskAddUser.java
@@ -30,7 +30,7 @@ import com.arsdigita.cms.ui.UserSearchForm;
import com.arsdigita.globalization.GlobalizedMessage;
import org.libreccm.security.User;
-import org.libreccm.workflow.UserTask;
+import org.libreccm.workflow.AssignableTask;
import com.arsdigita.xml.Element;
@@ -146,7 +146,7 @@ class TaskAddUser extends SimpleContainer {
WorkflowManager.class);
final UserRepository userRepo = cdiUtil.findBean(UserRepository.class);
- final UserTask task = m_task.getTask(state);
+ final AssignableTask task = m_task.getTask(state);
User user;
for (int i = 0; i < users.length; i++) {
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java.off
similarity index 97%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java.off
index 1816b6e04..3e4bbc3fd 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskEditForm.java.off
@@ -37,7 +37,7 @@ import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.workflow.Task;
import org.libreccm.workflow.TaskRepository;
-import org.librecms.workflow.CmsTaskType;
+import org.librecms.workflow.CmsTaskTypeOld;
import org.librecms.workflow.CmsTaskTypeRepository;
import java.util.ArrayList;
@@ -144,7 +144,7 @@ class TaskEditForm extends BaseTaskForm {
defaultLocale,
(String) m_description.getValue(state));
- final CmsTaskType taskType = taskTypeRepo.findById((Long) m_type
+ final CmsTaskTypeOld taskType = taskTypeRepo.findById((Long) m_type
.getValue(state));
task.setTaskType(taskType);
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java.off b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java.off
new file mode 100755
index 000000000..525bdcc29
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskFinishForm.java.off
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.ui.workflow;
+
+import com.arsdigita.bebop.FormProcessException;
+import com.arsdigita.bebop.Label;
+import com.arsdigita.bebop.PageState;
+import com.arsdigita.bebop.event.FormInitListener;
+import com.arsdigita.bebop.event.FormProcessListener;
+import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.event.FormValidationListener;
+import com.arsdigita.bebop.form.Option;
+import com.arsdigita.bebop.form.RadioGroup;
+import com.arsdigita.bebop.parameters.BooleanParameter;
+
+import org.librecms.contentsection.ContentSection;
+
+import com.arsdigita.cms.ContentCenter;
+import com.arsdigita.cms.ui.ContentItemPage;
+import com.arsdigita.globalization.GlobalizedMessage;
+import com.arsdigita.util.UncheckedWrapperException;
+
+import org.librecms.workflow.CmsTask;
+import org.librecms.workflow.CmsTaskTypeOld;
+
+import com.arsdigita.web.RedirectSignal;
+import com.arsdigita.web.URL;
+import com.arsdigita.web.Web;
+
+import org.libreccm.workflow.Task;
+import org.apache.logging.log4j.Logger;
+
+import java.util.Iterator;
+import java.util.Optional;
+
+import org.apache.logging.log4j.LogManager;
+import org.libreccm.cdi.utils.CdiUtil;
+import org.libreccm.security.PermissionChecker;
+import org.libreccm.security.Shiro;
+import org.libreccm.workflow.TaskRepository;
+import org.libreccm.workflow.WorkflowManager;
+import org.libreccm.workflow.WorkflowRepository;
+import org.librecms.CmsConstants;
+import org.librecms.contentsection.ContentItem;
+import org.librecms.contentsection.ContentItemRepository;
+
+/**
+ *
+ * A form that prompts the user to comment on and approve tasks and then
+ * finishes the task if it was approved.
+ *
+ * @author Justin Ross <jross@redhat.com>
+ * @author Jens Pelzetter
+ */
+public final class TaskFinishForm extends CommentAddForm {
+
+ private static final Logger LOGGER = LogManager.getLogger(
+ TaskFinishForm.class);
+ private final TaskRequestLocal m_task;
+ private final Label m_approvePrompt;
+ private final RadioGroup m_approve;
+
+ public TaskFinishForm(final TaskRequestLocal task) {
+ super(task);
+
+ m_task = task;
+
+ m_approve = new RadioGroup(new BooleanParameter("approve"));
+ m_approve.addOption(new Option("true",
+ lz("cms.ui.workflow.task.approve")));
+ m_approve.addOption(new Option("false",
+ lz("cms.ui.workflow.task.reject")));
+
+ m_approvePrompt = new Label(gz("cms.ui.workflow.task.approve_prompt"));
+
+ addComponent(m_approvePrompt);
+ addComponent(m_approve);
+
+ addInitListener(new InitListener());
+ addValidationListener(new ValidationListener());
+ addProcessListener(new ProcessListener());
+ }
+
+ private class InitListener implements FormInitListener {
+
+ @Override
+ public final void init(final FormSectionEvent e) {
+ LOGGER.debug("Initializing task finish");
+
+ final PageState state = e.getPageState();
+
+ if (isVisible(state)) {
+ final CmsTask task = m_task.getTask(state);
+
+ if (requiresApproval(task)) {
+ m_approvePrompt.setVisible(state, true);
+ m_approve.setVisible(state, true);
+ } else {
+ m_approvePrompt.setVisible(state, false);
+ m_approve.setVisible(state, false);
+ }
+ }
+ }
+ }
+
+ private class ValidationListener implements FormValidationListener {
+
+ @Override
+ public final void validate(final FormSectionEvent e)
+ throws FormProcessException {
+ LOGGER.debug("Validating task finish");
+
+ final PageState state = e.getPageState();
+ final CmsTask task = m_task.getTask(state);
+
+ if (requiresApproval(task) && m_approve.getValue(state) == null) {
+ throw new FormProcessException(new GlobalizedMessage(
+ "cms.ui.workflow.task.approval_or_reject_required",
+ CmsConstants.CMS_BUNDLE));
+ }
+ }
+ }
+
+ private class ProcessListener implements FormProcessListener {
+
+ @Override
+ public final void process(final FormSectionEvent event)
+ throws FormProcessException {
+ LOGGER.debug("Processing task finish");
+
+ final PageState state = event.getPageState();
+ final CmsTask task = m_task.getTask(state);
+ boolean finishedTask = false;
+
+ final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
+ final PermissionChecker permissionChecker = cdiUtil.findBean(
+ PermissionChecker.class);
+ final ContentItemRepository itemRepo = cdiUtil.findBean(
+ ContentItemRepository.class);
+ final Optional item = itemRepo.findItemWithWorkflow(
+ task.getWorkflow());
+
+ if (!item.isPresent()) {
+ throw new UncheckedWrapperException(
+ "Workflow not assigned to an item");
+ }
+
+ permissionChecker.checkPermission(task.getTaskType().getPrivilege(),
+ item.get());
+
+ final TaskRepository taskRepo = cdiUtil.findBean(
+ TaskRepository.class);
+
+ if (requiresApproval(task)) {
+ LOGGER.debug("The task requires approval; checking to see "
+ + "if it's approved");
+
+ // XXX I think the fact that this returns a Boolean is
+ // the effect of broken parameter marshalling in
+ // Bebop.
+ final Boolean isApproved = (Boolean) m_approve.getValue(state);
+
+ if (isApproved.equals(Boolean.TRUE)) {
+ LOGGER.debug("The task is approved; finishing the task");
+
+ final Shiro shiro = cdiUtil.findBean(Shiro.class);
+ final WorkflowManager workflowManager = cdiUtil.findBean(
+ WorkflowManager.class);
+
+ task.setActive(false);
+ finishedTask = true;
+ } else {
+ LOGGER.debug("The task is rejected; reenabling dependent "
+ + "tasks");
+
+ // Reenable the previous tasks.
+ final Iterator iter = task.getDependentTasks().
+ iterator();
+
+ while (iter.hasNext()) {
+ final Task dependent = (Task) iter.next();
+
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Reenabling task " + dependent.
+ getLabel());
+ }
+
+ dependent.setActive(true);
+
+ taskRepo.save(dependent);
+ }
+ }
+ } else {
+ LOGGER.debug("The task does not require approval; finishing "
+ + "it");
+
+ task.setActive(false);
+ taskRepo.save(task);
+ }
+ if (finishedTask) {
+ Iterator tasks = Engine.getInstance(CMSEngine.CMS_ENGINE_TYPE).
+ getEnabledTasks(Web.getWebContext().getUser(),
+ task.getParentID()).iterator();
+ if (tasks.hasNext()) {
+ CmsTask thisTask = (CmsTask) tasks.next();
+ PermissionDescriptor thisTaskAccess = new PermissionDescriptor(
+ thisTask.getTaskType().getPrivilege(), task.
+ getWorkflow().getObject(), user);
+ if (PermissionService.checkPermission(thisTaskAccess)) {
+
+ // Lock task for user
+ thisTask.lock((User) user);
+ int targetTab = (thisTask.getTaskType().getID().equals(CmsTaskTypeOld.DEPLOY)) ? ContentItemPage.PUBLISHING_TAB : ContentItemPage.AUTHORING_TAB;
+ throw new RedirectSignal(URL.there(state.getRequest(),
+ ContentItemPage.
+ getItemURL(
+ task.
+ getItem(),
+ targetTab)),
+ true);
+ }
+ }
+ // redirect to /content-center if streamlined creation mode is active.
+ if (ContentSection.getConfig().getUseStreamlinedCreation()) {
+ throw new RedirectSignal(URL.there(state.getRequest(),
+ ContentCenter.getURL()),
+ true);
+ }
+
+ }
+ }
+ }
+
+ private static boolean requiresApproval(final CmsTask task) {
+ return !task.getTaskType().getID().equals(CmsTaskTypeOld.AUTHOR);
+ }
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java.off
similarity index 99%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java.off
index b63b933c5..0ff7964a7 100755
--- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/TaskItemPane.java.off
@@ -49,7 +49,7 @@ import org.libreccm.security.Role;
import org.libreccm.security.RoleRepository;
import org.libreccm.security.Shiro;
import org.libreccm.workflow.Task;
-import org.libreccm.workflow.UserTask;
+import org.libreccm.workflow.AssignableTask;
import org.libreccm.workflow.WorkflowManager;
import org.librecms.CmsConstants;
import org.librecms.contentsection.privileges.AdminPrivileges;
@@ -173,7 +173,7 @@ final class TaskItemPane extends BaseItemPane {
final User user = shiro.getUser();
- final List tasks = workflowManager.lockedBy(user);
+ final List tasks = workflowManager.lockedBy(user);
return tasks.contains(task);
}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowAdminPane.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowItemPane.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowItemPane.java.off
similarity index 100%
rename from ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowItemPane.java
rename to ccm-cms/src/main/java/com/arsdigita/cms/ui/workflow/WorkflowItemPane.java.off
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/workflow/AuthoringTaskURLGenerator.java b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/AuthoringTaskURLGenerator.java
new file mode 100755
index 000000000..47fc0d164
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/AuthoringTaskURLGenerator.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.workflow;
+
+/**
+ * Class for generating a URL to the Authoring kit given the ID of the
+ * ContentItem and the Task.
+ *
+ * @author Uday Mathur (umathur@arsdigita.com)
+ * @author Jens Pelzetter
+ * */
+
+public class AuthoringTaskURLGenerator implements TaskURLGenerator {
+
+ public AuthoringTaskURLGenerator() {}
+
+ /**
+ * Generates a Link to the Authoring Kit in the Item Management part
+ * of the CMS UI.
+ *
+ * @param itemId id of the item in question
+ * @param taskId this param is ignored.
+ * @return
+ * */
+ @Override
+ public String generateURL(final long itemId, final long taskId) {
+ throw new UnsupportedOperationException("ToDo");
+// return ContentItemPage.getItemURL(itemId,
+// ContentItemPage.AUTHORING_TAB);
+ }
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/workflow/DeployTaskURLGenerator.java b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/DeployTaskURLGenerator.java
new file mode 100755
index 000000000..ef61633d3
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/DeployTaskURLGenerator.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.workflow;
+
+/**
+ * Generates a Link to the Deploy Task Panel under the Workflow Tab in the Item
+ * Management part of the CMS UI.
+ *
+ * @author Uday Mathur (umathur@arsdigita.com)
+ * @author Jens Pelzetter
+ *
+ */
+public class DeployTaskURLGenerator implements TaskURLGenerator {
+
+ public DeployTaskURLGenerator() {
+ }
+
+ /**
+ * Generates a Link to the Finish Task Panel under the Workflow Tab in the
+ * Item Management part of the CMS UI.
+ *
+ * @param itemId id of the item in question
+ * @param taskId id of the task to finish
+ * @return
+ *
+ */
+ @Override
+ public String generateURL(final long itemId, final long taskId) {
+// String url = ContentItemPage.getItemURL(itemId, ContentItemPage.PUBLISHING_TAB);
+// return url;
+ throw new UnsupportedOperationException("ToDo");
+ }
+
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/workflow/EditingTaskURLGenerator.java b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/EditingTaskURLGenerator.java
new file mode 100755
index 000000000..313b67710
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/EditingTaskURLGenerator.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.workflow;
+
+/**
+ * Class for generating a URL to the Authoring kit given the ID of the
+ * ContentItem and the Task. Eventually we may have a separate kit for editors,
+ * hence this is a separate class and has its own TaskType
+ *
+ * @author Uday Mathur (umathur@arsdigita.com)
+ * @author Jens Pelzetter
+ *
+ */
+public class EditingTaskURLGenerator implements TaskURLGenerator {
+
+ public EditingTaskURLGenerator() {
+ }
+
+ /**
+ * Generates a Link to the Workflow Tab in the Item Management part of the
+ * CMS UI.
+ *
+ * @param itemId id of the item in question
+ * @param taskId this param is ignored.
+ *
+ * @return
+ *
+ */
+ @Override
+ public String generateURL(final long itemId, final long taskId) {
+// final StringBuffer url = new StringBuffer
+// (ContentItemPage.getItemURL(itemId, ContentItemPage.WORKFLOW_TAB));
+//
+// // XXX task, approve, and action were constants; restore them
+// url.append("&action=approve&task=").append(taskId.toString());
+//
+// return url.toString();
+ throw new UnsupportedOperationException("ToDo");
+ }
+
+}
diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/workflow/TaskURLGenerator.java b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/TaskURLGenerator.java
new file mode 100755
index 000000000..2772e4d0d
--- /dev/null
+++ b/ccm-cms/src/main/java/com/arsdigita/cms/workflow/TaskURLGenerator.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.workflow;
+
+import java.math.BigDecimal;
+
+/**
+ * Interface for generating a URL for a Task given the ID of the
+ * ContentItem and the Task.
+ *
+ * @author Uday Mathur (umathur@arsdigita.com)
+ * @author Jens Pelzetter
+ * */
+
+public interface TaskURLGenerator {
+
+ String generateURL(long item_id, long task_id);
+}
diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItem.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItem.java
index 7050f3447..8a1a02513 100644
--- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItem.java
+++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItem.java
@@ -65,67 +65,77 @@ import static org.librecms.CmsConstants.*;
@Table(name = "CONTENT_ITEMS", schema = DB_SCHEMA)
@NamedQueries({
@NamedQuery(
- name = "ContentItem.findByType",
- query = "SELECT i FROM ContentItem i WHERE TYPE(i) = :type")
+ name = "ContentItem.findByType",
+ query = "SELECT i FROM ContentItem i WHERE TYPE(i) = :type")
,
@NamedQuery(
- name = "ContentItem.findByFolder",
- query = "SELECT i FROM ContentItem i "
- + "JOIN i.categories c "
- + "WHERE c.category = :folder "
- + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER + "'")
+ name = "ContentItem.findByFolder",
+ query = "SELECT i FROM ContentItem i "
+ + "JOIN i.categories c "
+ + "WHERE c.category = :folder "
+ + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER
+ + "'")
,
@NamedQuery(
- name = "ContentItem.countItemsInFolder",
- query = "SELECT count(i) FROM ContentItem i "
- + "JOIN i.categories c "
- + "WHERE c.category = :folder "
- + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER + "'")
+ name = "ContentItem.countItemsInFolder",
+ query = "SELECT count(i) FROM ContentItem i "
+ + "JOIN i.categories c "
+ + "WHERE c.category = :folder "
+ + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER
+ + "'")
,
@NamedQuery(
- name = "ContentItem.countByNameInFolder",
- query = "SELECT COUNT(i) FROM ContentItem i "
- + "JOIN i.categories c "
- + "WHERE c.category = :folder "
- + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER + "' "
- + "AND i.displayName = :name")
+ name = "ContentItem.countByNameInFolder",
+ query = "SELECT COUNT(i) FROM ContentItem i "
+ + "JOIN i.categories c "
+ + "WHERE c.category = :folder "
+ + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER
+ + "' "
+ + "AND i.displayName = :name")
,
@NamedQuery(
- name = "ContentItem.filterByFolderAndName",
- query = "SELECT i FROM ContentItem i "
- + "JOIN i.categories c "
- + "WHERE c.category = :folder "
- + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER + "' "
- + "AND LOWER(i.displayName) LIKE CONCAT(LOWER(:name), '%')")
+ name = "ContentItem.filterByFolderAndName",
+ query = "SELECT i FROM ContentItem i "
+ + "JOIN i.categories c "
+ + "WHERE c.category = :folder "
+ + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER
+ + "' "
+ + "AND LOWER(i.displayName) LIKE CONCAT(LOWER(:name), '%')")
,
@NamedQuery(
- name = "ContentItem.countFilterByFolderAndName",
- query = "SELECT COUNT(i) FROM ContentItem i "
- + "JOIN i.categories c "
- + "WHERE c.category = :folder "
- + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER + "' "
- + "AND LOWER(i.displayName) LIKE CONCAT(LOWER(:name), '%')"
+ name = "ContentItem.countFilterByFolderAndName",
+ query = "SELECT COUNT(i) FROM ContentItem i "
+ + "JOIN i.categories c "
+ + "WHERE c.category = :folder "
+ + "AND c.type = '" + CATEGORIZATION_TYPE_FOLDER
+ + "' "
+ + "AND LOWER(i.displayName) LIKE CONCAT(LOWER(:name), '%')"
)
,
@NamedQuery(
- name = "ContentItem.hasLiveVersion",
- query = "SELECT (CASE WHEN COUNT(i) > 0 THEN true ELSE false END) "
- + "FROM ContentItem i "
- + "WHERE i.itemUuid = :uuid "
- + "AND i.version = org.librecms.contentsection.ContentItemVersion.LIVE")
+ name = "ContentItem.hasLiveVersion",
+ query = "SELECT (CASE WHEN COUNT(i) > 0 THEN true ELSE false END) "
+ + "FROM ContentItem i "
+ + "WHERE i.itemUuid = :uuid "
+ + "AND i.version = org.librecms.contentsection.ContentItemVersion.LIVE")
,
@NamedQuery(
- name = "ContentItem.findDraftVersion",
- query = "SELECT i FROM ContentItem i "
- + "WHERE i.itemUuid = :uuid "
- + "AND i.version = org.librecms.contentsection.ContentItemVersion.DRAFT")
+ name = "ContentItem.findDraftVersion",
+ query = "SELECT i FROM ContentItem i "
+ + "WHERE i.itemUuid = :uuid "
+ + "AND i.version = org.librecms.contentsection.ContentItemVersion.DRAFT")
,
@NamedQuery(
- name = "ContentItem.findLiveVersion",
- query = "SELECT i FROM ContentItem i "
- + "WHERE i.itemUuid = :uuid "
- + "AND i.version = org.librecms.contentsection.ContentItemVersion.LIVE")
-
+ name = "ContentItem.findLiveVersion",
+ query = "SELECT i FROM ContentItem i "
+ + "WHERE i.itemUuid = :uuid "
+ + "AND i.version = org.librecms.contentsection.ContentItemVersion.LIVE")
+ ,
+ @NamedQuery(
+ name = "ContentItem.findItemWithWorkflow",
+ query = "SELECT i FROM ContentItem i "
+ + "WHERE i.workflow = :workflow"
+ )
})
public class ContentItem extends CcmObject implements Serializable,
InheritsPermissions {
@@ -143,13 +153,13 @@ public class ContentItem extends CcmObject implements Serializable,
*/
@Embedded
@AssociationOverride(
- name = "values",
- joinTable = @JoinTable(name = "CONTENT_ITEM_NAMES",
- schema = DB_SCHEMA,
- joinColumns = {
- @JoinColumn(name = "OBJECT_ID")
- }
- )
+ name = "values",
+ joinTable = @JoinTable(name = "CONTENT_ITEM_NAMES",
+ schema = DB_SCHEMA,
+ joinColumns = {
+ @JoinColumn(name = "OBJECT_ID")
+ }
+ )
)
private LocalizedString name;
@@ -166,13 +176,13 @@ public class ContentItem extends CcmObject implements Serializable,
*/
@Embedded
@AssociationOverride(
- name = "values",
- joinTable = @JoinTable(name = "CONTENT_ITEM_TITLES",
- schema = DB_SCHEMA,
- joinColumns = {
- @JoinColumn(name = "OBJECT_ID")
- }
- )
+ name = "values",
+ joinTable = @JoinTable(name = "CONTENT_ITEM_TITLES",
+ schema = DB_SCHEMA,
+ joinColumns = {
+ @JoinColumn(name = "OBJECT_ID")
+ }
+ )
)
private LocalizedString title;
@@ -181,12 +191,12 @@ public class ContentItem extends CcmObject implements Serializable,
*/
@Embedded
@AssociationOverride(
- name = "values",
- joinTable = @JoinTable(name = "CONTENT_ITEM_DESCRIPTIONS",
- schema = DB_SCHEMA,
- joinColumns = {
- @JoinColumn(name = "OBJECT_ID")}
- ))
+ name = "values",
+ joinTable = @JoinTable(name = "CONTENT_ITEM_DESCRIPTIONS",
+ schema = DB_SCHEMA,
+ joinColumns = {
+ @JoinColumn(name = "OBJECT_ID")}
+ ))
private LocalizedString description;
/**
@@ -342,10 +352,10 @@ public class ContentItem extends CcmObject implements Serializable,
@Override
public Optional getParent() {
final List result = getCategories().stream().filter(
- categorization -> CmsConstants.CATEGORIZATION_TYPE_FOLDER.
- equals(
- categorization.getType()))
- .collect(Collectors.toList());
+ categorization -> CmsConstants.CATEGORIZATION_TYPE_FOLDER.
+ equals(
+ categorization.getType()))
+ .collect(Collectors.toList());
if (result.isEmpty()) {
return Optional.empty();
@@ -424,15 +434,15 @@ public class ContentItem extends CcmObject implements Serializable,
@Override
public String toString(final String data) {
return super.toString(String.format(", itemUuid = %s, "
- + "name = %s, "
- + "contentType = { %s }, "
- + "title = %s, "
- + "description = %s, "
- + "version = %s, "
- + "launchDate = %s, "
- + "lifecycle = { %s }, "
- + "workflow = { %s }"
- + "%s",
+ + "name = %s, "
+ + "contentType = { %s }, "
+ + "title = %s, "
+ + "description = %s, "
+ + "version = %s, "
+ + "launchDate = %s, "
+ + "lifecycle = { %s }, "
+ + "workflow = { %s }"
+ + "%s",
itemUuid,
Objects.toString(name),
Objects.toString(contentType),
diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java
index b0dd3347a..785df460c 100644
--- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java
+++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentItemManager.java
@@ -78,7 +78,7 @@ import javax.transaction.Transactional;
public class ContentItemManager {
private static final Logger LOGGER = LogManager.getLogger(
- ContentItemManager.class);
+ ContentItemManager.class);
@Inject
private EntityManager entityManager;
@@ -121,31 +121,31 @@ public class ContentItemManager {
* {@link ContentSection#rootDocumentsFolder} of the provided content
* section. Otherwise an {@link IllegalArgumentException} is thrown.
*
- * @param The type of the content item.
- * @param name The name (URL stub) of the new content item.
+ * @param The type of the content item.
+ * @param name The name (URL stub) of the new content item.
* @param section The content section in which the item is generated.
- * @param folder The folder in which in the item is stored.
- * @param type The type of the new content item.
+ * @param folder The folder in which in the item is stored.
+ * @param type The type of the new content item.
*
* @return The new content item.
*/
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
public T createContentItem(
- final String name,
- final ContentSection section,
- @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
- final Folder folder,
- final Class type) {
+ final String name,
+ final ContentSection section,
+ @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
+ final Folder folder,
+ final Class type) {
final Optional contentType = typeRepo
- .findByContentSectionAndClass(section, type);
+ .findByContentSectionAndClass(section, type);
if (!contentType.isPresent()) {
throw new IllegalArgumentException(String.format(
- "ContentSection \"%s\" has no content type for \"%s\".",
- section.getLabel(),
- type.getName()));
+ "ContentSection \"%s\" has no content type for \"%s\".",
+ section.getLabel(),
+ type.getName()));
}
return createContentItem(name,
@@ -167,39 +167,40 @@ public class ContentItemManager {
* provided content section. Otherwise an {@link IllegalArgumentException}
* is thrown.
*
- * @param The type of the content item.
- * @param name The name (URL stub) of the new content item.
- * @param section The content section in which the item is generated.
- * @param folder The folder in which in the item is stored.
+ * @param The type of the content item.
+ * @param name The name (URL stub) of the new content item.
+ * @param section The content section in which the item is
+ * generated.
+ * @param folder The folder in which in the item is stored.
* @param workflowTemplate The template for the workflow to apply to the new
- * item.
- * @param type The type of the new content item.
+ * item.
+ * @param type The type of the new content item.
*
* @return The new content item.
*/
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
public T createContentItem(
- final String name,
- final ContentSection section,
- @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
- final Folder folder,
- final WorkflowTemplate workflowTemplate,
- final Class type) {
+ final String name,
+ final ContentSection section,
+ @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
+ final Folder folder,
+ final WorkflowTemplate workflowTemplate,
+ final Class type) {
final Optional contentType = typeRepo
- .findByContentSectionAndClass(section, type);
+ .findByContentSectionAndClass(section, type);
if (!contentType.isPresent()) {
throw new IllegalArgumentException(String.format(
- "ContentSection \"%s\" has no content type for \"%s\".",
- section.getLabel(),
- type.getName()));
+ "ContentSection \"%s\" has no content type for \"%s\".",
+ section.getLabel(),
+ type.getName()));
}
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException(
- "The name of a content item can't be blank.");
+ "The name of a content item can't be blank.");
}
final T item;
@@ -207,14 +208,14 @@ public class ContentItemManager {
item = type.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
LOGGER.error("Failed to create new content item of type \"{}\" "
- + "in content section \"{}\".",
+ + "in content section \"{}\".",
type.getName(),
section.getLabel());
throw new RuntimeException(ex);
}
final KernelConfig kernelConfig = confManager.findConfiguration(
- KernelConfig.class);
+ KernelConfig.class);
item.setDisplayName(name);
item.getName().addValue(kernelConfig.getDefaultLocale(),
@@ -225,16 +226,16 @@ public class ContentItemManager {
if (workflowTemplate != null) {
final Workflow workflow = workflowManager.createWorkflow(
- workflowTemplate);
+ workflowTemplate, item);
item.setWorkflow(workflow);
}
contentItemRepo.save(item);
categoryManager.addObjectToCategory(
- item,
- folder,
- CATEGORIZATION_TYPE_FOLDER);
+ item,
+ folder,
+ CATEGORIZATION_TYPE_FOLDER);
contentItemRepo.save(item);
@@ -252,23 +253,23 @@ public class ContentItemManager {
* only moves the draft version of the item. The live version is moved after
* a the item is republished.
*
- * @param item The item to move.
+ * @param item The item to move.
* @param targetFolder The folder to which the item is moved.
*/
@AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED)
public void move(
- @RequiresPrivilege(ItemPrivileges.EDIT)
- final ContentItem item,
- @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
- final Folder targetFolder) {
+ @RequiresPrivilege(ItemPrivileges.EDIT)
+ final ContentItem item,
+ @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
+ final Folder targetFolder) {
if (item == null) {
throw new IllegalArgumentException("The item to move can't be null.");
}
if (targetFolder == null) {
throw new IllegalArgumentException(
- "The target folder can't be null.");
+ "The target folder can't be null.");
}
final ContentItem draftItem = getDraftVersion(item, item.getClass());
@@ -277,18 +278,18 @@ public class ContentItemManager {
if (!sectionManager.hasContentType(draftItem.getClass(),
targetFolder.getSection())) {
throw new IllegalArgumentException(String.format(
- "Can't move item %d:\"%s\" to folder \"%s\"."
- + "The target folder %d:\"%s\" belongs to content section "
+ "Can't move item %d:\"%s\" to folder \"%s\"."
+ + "The target folder %d:\"%s\" belongs to content section "
+ "%d:\"%s\". The content type \"%s\" has not registered"
- + "for this section.",
- draftItem.getObjectId(),
- draftItem.getDisplayName(),
- folderManager.getFolderPath(targetFolder, true),
- targetFolder.getObjectId(),
- targetFolder.getDisplayName(),
- targetFolder.getSection().getObjectId(),
- targetFolder.getSection().getDisplayName(),
- draftItem.getClass().getName()));
+ + "for this section.",
+ draftItem.getObjectId(),
+ draftItem.getDisplayName(),
+ folderManager.getFolderPath(targetFolder, true),
+ targetFolder.getObjectId(),
+ targetFolder.getDisplayName(),
+ targetFolder.getSection().getObjectId(),
+ targetFolder.getSection().getDisplayName(),
+ draftItem.getClass().getName()));
}
if (currentFolder.isPresent()) {
@@ -301,9 +302,9 @@ public class ContentItemManager {
}
categoryManager.addObjectToCategory(
- draftItem,
- targetFolder,
- CATEGORIZATION_TYPE_FOLDER);
+ draftItem,
+ targetFolder,
+ CATEGORIZATION_TYPE_FOLDER);
}
@@ -317,10 +318,11 @@ public class ContentItemManager {
* section and the type of the item is not registered for the target section
* an {@link IllegalArgumentException} is thrown.
*
- * @param item The item to copy.
+ * @param item The item to copy.
* @param targetFolder The folder in which the copy is created. If the
- * target folder is the same folder as the folder of the original item an
- * index is appended to the name of the item.
+ * target folder is the same folder as the folder of the
+ * original item an index is appended to the name of the
+ * item.
*
* @return The copy of the item
*/
@@ -328,9 +330,9 @@ public class ContentItemManager {
@AuthorizationRequired
@SuppressWarnings("unchecked")
public ContentItem copy(
- final ContentItem item,
- @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
- final Folder targetFolder) {
+ final ContentItem item,
+ @RequiresPrivilege(ItemPrivileges.CREATE_NEW)
+ final Folder targetFolder) {
if (item == null) {
throw new IllegalArgumentException("The item to copy can't be null.");
@@ -338,36 +340,36 @@ public class ContentItemManager {
if (targetFolder == null) {
throw new IllegalArgumentException(
- "The target folder to which the item is copied can't be null");
+ "The target folder to which the item is copied can't be null");
}
final Optional contentType = typeRepo
- .findByContentSectionAndClass(
- targetFolder.getSection(), item.getClass());
+ .findByContentSectionAndClass(
+ targetFolder.getSection(), item.getClass());
if (!contentType.isPresent()) {
throw new IllegalArgumentException(String.format(
- "ContentSection \"%s\" has no content type for \"%s\".",
- item.getContentType().getContentSection(),
- item.getClass().getName()));
+ "ContentSection \"%s\" has no content type for \"%s\".",
+ item.getContentType().getContentSection(),
+ item.getClass().getName()));
}
final ContentItem draftItem = getDraftVersion(item, item.getClass());
if (!sectionManager.hasContentType(draftItem.getClass(),
targetFolder.getSection())) {
throw new IllegalArgumentException(String.format(
- "Can't copy item %d:\"%s\" to folder \"%s\"."
- + "The target folder %d:\"%s\" belongs to content section "
+ "Can't copy item %d:\"%s\" to folder \"%s\"."
+ + "The target folder %d:\"%s\" belongs to content section "
+ "%d:\"%s\". The content type \"%s\" has not registered"
- + "for this section.",
- draftItem.getObjectId(),
- draftItem.getDisplayName(),
- folderManager.getFolderPath(targetFolder, true),
- targetFolder.getObjectId(),
- targetFolder.getDisplayName(),
- targetFolder.getSection().getObjectId(),
- targetFolder.getSection().getDisplayName(),
- draftItem.getClass().getName()));
+ + "for this section.",
+ draftItem.getObjectId(),
+ draftItem.getDisplayName(),
+ folderManager.getFolderPath(targetFolder, true),
+ targetFolder.getObjectId(),
+ targetFolder.getDisplayName(),
+ targetFolder.getSection().getObjectId(),
+ targetFolder.getSection().getDisplayName(),
+ draftItem.getClass().getName()));
}
final ContentItem copy;
@@ -381,31 +383,31 @@ public class ContentItemManager {
if (draftItem.getWorkflow() != null) {
final WorkflowTemplate template = draftItem.getWorkflow()
- .getTemplate();
+ .getTemplate();
final Workflow copyWorkflow = workflowManager.createWorkflow(
- template);
+ template, item);
copy.setWorkflow(copyWorkflow);
}
contentItemRepo.save(copy);
draftItem.getCategories().forEach(categorization -> categoryManager
- .addObjectToCategory(copy, categorization.getCategory()));
+ .addObjectToCategory(copy, categorization.getCategory()));
final Optional itemFolder = getItemFolder(draftItem);
if (itemFolder.isPresent()) {
try {
categoryManager.removeObjectFromCategory(
- copy, getItemFolder(draftItem).get());
+ copy, getItemFolder(draftItem).get());
} catch (ObjectNotAssignedToCategoryException ex) {
throw new RuntimeException(ex);
}
}
categoryManager.addObjectToCategory(
- copy,
- targetFolder,
- CATEGORIZATION_TYPE_FOLDER);
+ copy,
+ targetFolder,
+ CATEGORIZATION_TYPE_FOLDER);
for (AttachmentList attachmentList : item.getAttachments()) {
copyAttachmentList(attachmentList, copy);
@@ -419,7 +421,7 @@ public class ContentItemManager {
}
for (final PropertyDescriptor propertyDescriptor : beanInfo
- .getPropertyDescriptors()) {
+ .getPropertyDescriptors()) {
if (propertyIsExcluded(propertyDescriptor.getName())) {
continue;
}
@@ -439,50 +441,50 @@ public class ContentItemManager {
source = (LocalizedString) readMethod.invoke(draftItem);
target = (LocalizedString) readMethod.invoke(copy);
} catch (IllegalAccessException
- | IllegalArgumentException
- | InvocationTargetException ex) {
+ | IllegalArgumentException
+ | InvocationTargetException ex) {
throw new RuntimeException(ex);
}
copyLocalizedString(source, target);
} else if (propType != null
- && propType.isAssignableFrom(ContentItem.class)) {
+ && propType.isAssignableFrom(ContentItem.class)) {
final ContentItem linkedItem;
try {
linkedItem = (ContentItem) readMethod.invoke(draftItem);
} catch (IllegalAccessException
- | IllegalArgumentException
- | InvocationTargetException ex) {
+ | IllegalArgumentException
+ | InvocationTargetException ex) {
throw new RuntimeException(ex);
}
final ContentItem linkedDraftItem = getDraftVersion(
- linkedItem, linkedItem.getClass());
+ linkedItem, linkedItem.getClass());
try {
writeMethod.invoke(copy, linkedDraftItem);
} catch (IllegalAccessException
- | IllegalArgumentException
- | InvocationTargetException ex) {
+ | IllegalArgumentException
+ | InvocationTargetException ex) {
throw new RuntimeException(ex);
}
} else if (propType != null
- && propType.isAssignableFrom(List.class)) {
+ && propType.isAssignableFrom(List.class)) {
final List