diff --git a/cc.kave.commons/src/main/java/cc/kave/commons/model/enums/Likert5Point.java b/cc.kave.commons/src/main/java/cc/kave/commons/model/enums/Likert5Point.java new file mode 100644 index 0000000..f27e79f --- /dev/null +++ b/cc.kave.commons/src/main/java/cc/kave/commons/model/enums/Likert5Point.java @@ -0,0 +1,25 @@ +/* + * Copyright 2017 University of Zurich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cc.kave.commons.model.enums; + +public enum Likert5Point { + Unknown, + Negative2, + Negative1, + Neutral, + Positive1, + Positive2 +} diff --git a/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskAction.java b/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskAction.java new file mode 100644 index 0000000..7a349eb --- /dev/null +++ b/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskAction.java @@ -0,0 +1,27 @@ +/* + * Copyright 2017 Nico Strebel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cc.kave.commons.model.events.tasks; + +public enum TaskAction { + Create, + Activate, + Pause, + Complete, + Delete, + Edit, + Move, + UndoComplete +} diff --git a/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskEvent.java b/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskEvent.java new file mode 100644 index 0000000..d089558 --- /dev/null +++ b/cc.kave.commons/src/main/java/cc/kave/commons/model/events/tasks/TaskEvent.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Nico Strebel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package cc.kave.commons.model.events.tasks; + +import cc.kave.commons.model.enums.Likert5Point; +import cc.kave.commons.model.events.IDEEvent; + +public class TaskEvent extends IDEEvent +{ + public String Version; + public String TaskId; + public TaskAction Action; + public String NewParentId; + public Likert5Point Annoyance; + public Likert5Point Importance; + public Likert5Point Urgency; +} \ No newline at end of file diff --git a/cc.kave.commons/src/main/java/cc/kave/commons/utils/io/json/JsonUtils.java b/cc.kave.commons/src/main/java/cc/kave/commons/utils/io/json/JsonUtils.java index 926e399..7676c37 100644 --- a/cc.kave.commons/src/main/java/cc/kave/commons/utils/io/json/JsonUtils.java +++ b/cc.kave.commons/src/main/java/cc/kave/commons/utils/io/json/JsonUtils.java @@ -25,6 +25,9 @@ import java.util.Map; import java.util.Set; +import cc.kave.commons.model.enums.Likert5Point; +import cc.kave.commons.model.events.tasks.TaskAction; +import cc.kave.commons.model.events.tasks.TaskEvent; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -244,7 +247,9 @@ private static void registerEventHierarchy(GsonBuilder gb) { WindowEvent.class, // general ActivityEvent.class, CommandEvent.class, ErrorEvent.class, InfoEvent.class, NavigationEvent.class, - NavigationType.class, SystemEvent.class, SystemEventType.class, EventTrigger.class }; + NavigationType.class, SystemEvent.class, SystemEventType.class, EventTrigger.class, + // task events + TaskEvent.class, TaskAction.class, Likert5Point.class }; identifyHierarchiesAndRegisterAll(gb, eventsAndRelatedTypes); }