- removes Marshaller Instances for classes which are not meant to be exported
- renames interface Identifiable to Portable

git-svn-id: https://svn.libreccm.org/ccm/trunk@4430 8810af33-2d31-482b-a856-94f89814c4df
master
tosmers 2016-11-07 18:41:36 +00:00
parent 10f748d5d6
commit d62cafc077
24 changed files with 103 additions and 217 deletions

View File

@ -39,7 +39,7 @@ import java.util.List;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
* @version created on 2/10/16
*/
public abstract class AbstractMarshaller<I extends Identifiable> {
public abstract class AbstractMarshaller<P extends Portable> {
private static final Logger log = Logger.getLogger(AbstractMarshaller.class);
@ -78,7 +78,7 @@ public abstract class AbstractMarshaller<I extends Identifiable> {
}
}
public void exportList(final List<I> exportList) {
public void exportList(final List<P> exportList) {
File file = new File(filename);
FileWriter fileWriter = null;
@ -89,7 +89,7 @@ public abstract class AbstractMarshaller<I extends Identifiable> {
" with the name %s.", file.getName()));
}
if (fileWriter != null) {
for (I object : exportList) {
for (P object : exportList) {
String line = null;
switch (format) {

View File

@ -40,7 +40,7 @@ public class Marshaller {
// Assigns lists with objects of the same type as values to their typ as
// key.
private Map<Class<? extends Identifiable>, List<Identifiable>> classListMap = new HashMap<>();
private Map<Class<? extends Portable>, List<Portable>> classListMap = new HashMap<>();
/**
@ -51,11 +51,11 @@ public class Marshaller {
* @param format The exportUsers style/format e.g. CSV or JSON
* @param filename The name of the file to be exported to
*/
public void exportObjects(List<? extends Identifiable> objects, Format format,
public void exportObjects(List<? extends Portable> objects, Format format,
String filename) {
putObjects(objects);
for (Map.Entry<Class<? extends Identifiable>, List<Identifiable>>
for (Map.Entry<Class<? extends Portable>, List<Portable>>
classListEntry : classListMap.entrySet()) {
exportList(classListEntry.getValue(), classListEntry.getKey(),
@ -64,7 +64,7 @@ public class Marshaller {
}
/**
* Organizes a list of different {@link Identifiable} objects into a map
* Organizes a list of different {@link Portable} objects into a map
* assigning lists of the same type to their type as values to a key. The
* type which all objects of that list have in common is their key.
* That opens the possibility of being certain of the objects types in
@ -72,14 +72,14 @@ public class Marshaller {
*
* @param objects list of all objects being organized
*/
private void putObjects(List<? extends Identifiable> objects) {
for (Identifiable object : objects) {
Class<? extends Identifiable> type = object.getClass();
private void putObjects(List<? extends Portable> objects) {
for (Portable object : objects) {
Class<? extends Portable> type = object.getClass();
if (classListMap.containsKey(type)) {
classListMap.get(type).add(object);
} else {
List<Identifiable> values = new ArrayList<>();
List<Portable> values = new ArrayList<>();
values.add(object);
classListMap.put(type, values);
}
@ -98,12 +98,12 @@ public class Marshaller {
* @param type The class of the type
* @param format The exportUsers style
* @param filename The filename
* @param <I> The type of the current marshaller
* @param <P> The type of the current marshaller
*/
private <I extends Identifiable> void exportList(List<I> list, Class<?
extends I> type, Format format, String filename) {
private <P extends Portable> void exportList(List<P> list, Class<?
extends P> type, Format format, String filename) {
@SuppressWarnings("unchecked")
AbstractMarshaller<I> marshaller = (AbstractMarshaller<I>) list.get
AbstractMarshaller<P> marshaller = (AbstractMarshaller<P>) list.get
(0).getMarshaller();
marshaller.prepare(format, filename + "__" + type.toString(),

View File

@ -22,7 +22,7 @@ package com.arsdigita.portation;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers</a>
* @version created on 5/9/16
*/
public interface Identifiable {
public interface Portable {
AbstractMarshaller<? extends Identifiable> getMarshaller();
AbstractMarshaller<? extends Portable> getMarshaller();
}

View File

@ -44,12 +44,13 @@ import java.util.ArrayList;
class ExportHelper {
private static String pathName = "/home/tosmers/Downloads/test-exports";
private static boolean indentation = false;
static void exportCategories() {
CategoryMarshaller categoryMarshaller = new
CategoryMarshaller();
categoryMarshaller.prepare(Format.XML, pathName,
"categories", true);
"categories", indentation);
categoryMarshaller.exportList(new ArrayList<>(
NgCollection.categories.values()));
}
@ -58,22 +59,23 @@ class ExportHelper {
CategorizationMarshaller categorizationMarshaller = new
CategorizationMarshaller();
categorizationMarshaller.prepare(Format.XML, pathName,
"categorizations", true);
"categorizations", indentation);
categorizationMarshaller.exportList(new ArrayList<>(
NgCollection.categorizations.values()));
}
static void exportUsers() {
UserMarshaller userMarshaller = new UserMarshaller();
userMarshaller.prepare(Format.XML, pathName, "users", true);
userMarshaller.prepare(Format.XML, pathName,
"users", indentation);
userMarshaller.exportList(new ArrayList<>(
NgCollection.users.values()));
}
static void exportGroups() {
GroupMarshaller groupMarshaller = new GroupMarshaller();
groupMarshaller.prepare(Format.XML, pathName, "groups",
true);
groupMarshaller.prepare(Format.XML, pathName,
"groups", indentation);
groupMarshaller.exportList(new ArrayList<>(
NgCollection.groups.values()));
}
@ -82,14 +84,15 @@ class ExportHelper {
GroupMembershipMarshaller groupMembershipMarshaller = new
GroupMembershipMarshaller();
groupMembershipMarshaller.prepare(Format.XML, pathName,
"groupMemberships", true);
"groupMemberships", indentation);
groupMembershipMarshaller.exportList(new ArrayList<>(
NgCollection.groupMemberships.values()));
}
static void exportRoles() {
RoleMarshaller roleMarshaller = new RoleMarshaller();
roleMarshaller.prepare(Format.XML, pathName, "roles", true);
roleMarshaller.prepare(Format.XML, pathName,
"roles", indentation);
roleMarshaller.exportList(new ArrayList<>(NgCollection
.roles.values()));
}
@ -98,7 +101,7 @@ class ExportHelper {
RoleMembershipMarshaller roleMembershipMarshaller = new
RoleMembershipMarshaller();
roleMembershipMarshaller.prepare(Format.XML, pathName,
"roleMemberships", true);
"roleMemberships", indentation);
roleMembershipMarshaller.exportList(new ArrayList<>
(NgCollection.roleMemberships.values()));
}
@ -107,7 +110,7 @@ class ExportHelper {
WorkflowMarshaller workflowMarshaller = new
WorkflowMarshaller();
workflowMarshaller.prepare(Format.XML, pathName,
"workflows", true);
"workflows", indentation);
workflowMarshaller.exportList(new ArrayList<>
(NgCollection.workflows.values()));
}
@ -116,7 +119,7 @@ class ExportHelper {
UserTaskMarshaller userTaskMarshaller = new
UserTaskMarshaller();
userTaskMarshaller.prepare(Format.XML, pathName,
"userTasks", true);
"userTasks", indentation);
userTaskMarshaller.exportList(new ArrayList<>
(NgCollection.userTasks.values()));
}
@ -125,7 +128,7 @@ class ExportHelper {
TaskAssignmentMarshaller taskAssignmentMarshaller = new
TaskAssignmentMarshaller();
taskAssignmentMarshaller.prepare(Format.XML, pathName,
"taskAssignments", true);
"taskAssignments", indentation);
taskAssignmentMarshaller.exportList(new ArrayList<>
(NgCollection.taskAssignments.values()));
}
@ -134,7 +137,7 @@ class ExportHelper {
PermissionMarshaller permissionMarshaller = new
PermissionMarshaller();
permissionMarshaller.prepare(Format.XML, pathName,
"permissions", true);
"permissions", indentation);
permissionMarshaller.exportList(new ArrayList<>
(NgCollection.permissions.values()));
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.categorization;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.core.CcmObject;
import com.fasterxml.jackson.annotation.JsonBackReference;
@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class Categorization implements Identifiable {
public class Categorization implements Portable {
private long categorizationId;
@ -45,6 +45,8 @@ public class Categorization implements Identifiable {
private long categoryOrder;
private long objectOrder;
private String type;
public Categorization(final Category category, final CcmObject
categorizedObject) {
this.categorizationId = NgCollection.categorizations.size() + 1;
@ -56,12 +58,14 @@ public class Categorization implements Identifiable {
this.categoryOrder = categorizedObject.getCategories().size() + 1;
this.objectOrder = category.getObjects().size() + 1;
this.type = "";
NgCollection.categorizations.put(this.categorizationId, this);
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new CategorizationMarshaller();
}
@ -112,4 +116,12 @@ public class Categorization implements Identifiable {
public void setObjectOrder(final long objectOrder) {
this.objectOrder = objectOrder;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -21,7 +21,7 @@ package com.arsdigita.portation.modules.core.categorization;
import com.arsdigita.categorization.CategoryLocalization;
import com.arsdigita.categorization.CategoryLocalizationCollection;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.core.CcmObject;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
@ -112,7 +112,7 @@ public class Category extends CcmObject {
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new CategoryMarshaller();
}

View File

@ -20,7 +20,7 @@ package com.arsdigita.portation.modules.core.core;
import com.arsdigita.kernel.ACSObject;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.categorization.Categorization;
import com.arsdigita.portation.modules.core.categorization.Category;
@ -48,7 +48,7 @@ import java.util.UUID;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class CcmObject implements Identifiable {
public class CcmObject implements Portable {
private long objectId;
@ -74,7 +74,7 @@ public class CcmObject implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new CcmObjectMarshaller();
}

View File

@ -18,14 +18,11 @@
*/
package com.arsdigita.portation.modules.core.core;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class EmailAddress implements Identifiable {
public class EmailAddress {
private String address;
@ -40,11 +37,6 @@ public class EmailAddress implements Identifiable {
this.verified = trunkEmailAddress.isVerified();
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
return new EmailAddressMarshaller();
}
public String getAddress() {
return address;
}

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2015 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.portation.modules.core.core;
import com.arsdigita.portation.AbstractMarshaller;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class EmailAddressMarshaller extends AbstractMarshaller<EmailAddress> {
}

View File

@ -18,9 +18,6 @@
*/
package com.arsdigita.portation.modules.core.l10n;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
@ -36,7 +33,7 @@ import java.util.Set;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class LocalizedString implements Identifiable {
public class LocalizedString {
private Map<Locale, String> values;
@ -47,11 +44,6 @@ public class LocalizedString implements Identifiable {
this.values = new HashMap<>();
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
return new LocalizedStringMarshaller();
}
/**
* Get all localised values.
*

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2015 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.portation.modules.core.l10n;
import com.arsdigita.portation.AbstractMarshaller;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class LocalizedStringMarshaller extends AbstractMarshaller<LocalizedString> {
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@ -30,7 +30,7 @@ import java.util.Set;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 31.05.16
*/
public class Group extends Party {
public class Group extends Party implements Portable {
@JsonManagedReference
private Set<GroupMembership> memberships;
@ -44,7 +44,7 @@ public class Group extends Party {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new GroupMarshaller();
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.fasterxml.jackson.annotation.JsonBackReference;
@ -27,7 +27,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class GroupMembership implements Identifiable {
public class GroupMembership implements Portable {
private long membershipId;
@ -46,7 +46,7 @@ public class GroupMembership implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new GroupMembershipMarshaller();
}

View File

@ -18,8 +18,6 @@
*/
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.conversion.NgCollection;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@ -30,7 +28,7 @@ import java.util.Set;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 01.06.16
*/
public class Party implements Identifiable {
public class Party {
private long partyId;
private String name;
@ -47,11 +45,6 @@ public class Party implements Identifiable {
NgCollection.parties.put(this.partyId, this);
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
return new PartyMarshaller();
}
public long getPartyId() {
return partyId;
}

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2015 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.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 01.06.16
*/
public class PartyMarshaller extends AbstractMarshaller<Party> {
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.core.CcmObject;
import com.arsdigita.portation.modules.core.security.util.PermissionIdMapper;
@ -32,7 +32,7 @@ import java.util.Date;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class Permission implements Identifiable {
public class Permission implements Portable {
private long permissionId;
private String grantedPrivilege;
@ -89,7 +89,7 @@ public class Permission implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new PermissionMarshaller();
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
import com.arsdigita.portation.modules.core.workflow.TaskAssignment;
@ -35,50 +35,52 @@ import java.util.Set;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class Role implements Identifiable {
public class Role implements Portable {
private long roleId;
private String name;
private LocalizedString description;
@JsonManagedReference
private Set<RoleMembership> memberships;
@JsonManagedReference
private List<Permission> permissions;
@JsonManagedReference
private List<TaskAssignment> assignedTasks;
private LocalizedString description;
public Role(final com.arsdigita.kernel.Role trunkRole) {
this.roleId = trunkRole.getID().longValue();
this.name = trunkRole.getName();
Locale local = Locale.getDefault();
this.description = new LocalizedString();
this.description.addValue(local, trunkRole.getDescription());
this.memberships = new HashSet<>();
this.permissions = new ArrayList<>();
this.assignedTasks = new ArrayList<>();
Locale local = Locale.getDefault();
this.description = new LocalizedString();
this.description.addValue(local, trunkRole.getDescription());
NgCollection.roles.put(this.roleId, this);
}
public Role(final String name) {
this.roleId = NgCollection.roles.size() + 1;
this.name = name;
this.description = new LocalizedString();
this.memberships = new HashSet<>();
this.permissions = new ArrayList<>();
this.assignedTasks = new ArrayList<>();
this.description = new LocalizedString();
NgCollection.roles.put(this.roleId, this);
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new RoleMarshaller();
}
@ -145,4 +147,12 @@ public class Role implements Identifiable {
public void removeAssignedTask(final TaskAssignment taskAssignment) {
assignedTasks.remove(taskAssignment);
}
public LocalizedString getDescription() {
return description;
}
public void setDescription(final LocalizedString description) {
this.description = description;
}
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.fasterxml.jackson.annotation.JsonBackReference;
@ -27,7 +27,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class RoleMembership implements Identifiable {
public class RoleMembership implements Portable {
private long membershipId;
@ -46,7 +46,7 @@ public class RoleMembership implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new RoleMembershipMarshaller();
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.core.EmailAddress;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@ -34,7 +34,7 @@ import java.util.Set;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 31.05.16
*/
public class User extends Party {
public class User extends Party implements Portable {
private String givenName;
private String familyName;
@ -74,7 +74,7 @@ public class User extends Party {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new UserMarshaller();
}

View File

@ -18,8 +18,6 @@
*/
package com.arsdigita.portation.modules.core.workflow;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
import com.fasterxml.jackson.annotation.JsonBackReference;
@ -34,7 +32,7 @@ import java.util.Locale;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class Task implements Identifiable {
public class Task {
private long taskId;
private LocalizedString label;
@ -50,6 +48,7 @@ public class Task implements Identifiable {
private List<Task> dependentTasks;
@JsonManagedReference
private List<Task> dependsOn;
private List<String> comments;
public Task(final com.arsdigita.workflow.simple.Task trunkTask) {
@ -76,11 +75,6 @@ public class Task implements Identifiable {
NgCollection.tasks.put(this.getTaskId(), this);
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
return new TaskMarshaller();
}
public long getTaskId() {
return taskId;
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.workflow;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.security.Role;
import com.fasterxml.jackson.annotation.JsonBackReference;
@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class TaskAssignment implements Identifiable {
public class TaskAssignment implements Portable {
private long taskAssignmentId;
@ -47,7 +47,7 @@ public class TaskAssignment implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new TaskAssignmentMarshaller();
}

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2015 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.portation.modules.core.workflow;
import com.arsdigita.portation.AbstractMarshaller;
/**
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class TaskMarshaller extends AbstractMarshaller<Task> {
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.workflow;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.security.User;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@ -32,7 +32,7 @@ import java.util.List;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class UserTask extends Task {
public class UserTask extends Task implements Portable {
private boolean locked;
private User lockingUser;
@ -65,7 +65,7 @@ public class UserTask extends Task {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new UserTaskMarshaller();
}

View File

@ -19,7 +19,7 @@
package com.arsdigita.portation.modules.core.workflow;
import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.Portable;
import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
import com.fasterxml.jackson.annotation.JsonManagedReference;
@ -32,13 +32,15 @@ import java.util.Locale;
* @author <a href="mailto:tosmers@uni-bremen.de>Tobias Osmers<\a>
* @version created on 6/15/16
*/
public class Workflow implements Identifiable {
public class Workflow implements Portable {
private long workflowId;
private LocalizedString name;
private LocalizedString description;
//Todo: private WorkflowTemplate workflowTemplate;
@JsonManagedReference
private List<Task> tasks;
@ -56,7 +58,7 @@ public class Workflow implements Identifiable {
}
@Override
public AbstractMarshaller<? extends Identifiable> getMarshaller() {
public AbstractMarshaller<? extends Portable> getMarshaller() {
return new WorkflowMarshaller();
}