Commit b258b884 authored by Mathieu Gicquel's avatar Mathieu Gicquel
Browse files

Fixing bug introduced in #29

Fixing bug introduced in #33
Remove dead code - fix #37
parent e57ef3e5
......@@ -165,7 +165,7 @@ public abstract class AbstractProject extends AbstractServerObject implements IP
@Override
public void setCreator(final IParticipant c) {
this.creator = c;
this.getCreatorReference().set(c);
}
@Override
......@@ -227,7 +227,7 @@ public abstract class AbstractProject extends AbstractServerObject implements IP
*/
@Override
public IParticipant getCreator() {
return creator;
return this.getCreatorReference().get();
}
/**
......
......@@ -58,7 +58,6 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
this.setEndingDate(new Date());
this.setTrash(false);
this.setLastModificationDate(new Date());
this.setTagsList(new ArrayList<>());
this.setURLsList(new ArrayList<>());
this.setPreviousTask(new ArrayList<>());
this.setContacts(new ArrayList<>());
......@@ -103,8 +102,6 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
this.setServerIdentifier(t.getServerIdentifier());
this.setLastModificationDate(t.getLastModificationDate());
this.setCreator(t.getCreator());
this.setParticipant(t.getParticipant());
this.setContext(t.getContext());
this.setTagsList(t.getTagsList());
this.setURLsList(t.getURLsList());
this.setProjectContainer(t.getProjectContainer());
......@@ -183,7 +180,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
@Override
public final void setCreator(final IParticipant c) {
this.creator = c;
this.getCreatorReference().set(c);
}
@Override
......@@ -193,12 +190,12 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
@Override
public final void setContext(final IContext c) {
this.context = c;
this.getContextReference().set(c);
}
@Override
public final void setTagsList(final List<ITag> tagsList) {
this.tagsList = tagsList;
this.getTagReference().set(tagsList);
}
@Override
......@@ -208,7 +205,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
@Override
public final void setProjectContainer(final IProject projectContainer) {
this.projectContainer = projectContainer;
this.getProjectReference().set(projectContainer);
}
@Override
......@@ -298,7 +295,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
*/
@Override
public IParticipant getCreator() {
return creator;
return this.getCreatorReference().get();
}
/**
......@@ -314,7 +311,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
*/
@Override
public IContext getContext() {
return context;
return this.getContextReference().get();
}
/**
......@@ -322,7 +319,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
*/
@Override
public List<ITag> getTagsList() {
return tagsList;
return this.getTagReference().get();
}
/**
......@@ -338,7 +335,7 @@ public abstract class AbstractTask extends AbstractServerObject implements ITask
*/
@Override
public IProject getProjectContainer() {
return projectContainer;
return this.getProjectReference().get();
}
/**
......
package fr.alma.gtd.server.core;
import fr.alma.gtd.server.core.reference.MultipleReference;
import fr.alma.gtd.server.core.reference.SingleReference;
import java.util.ArrayList;
import java.util.List;
......@@ -149,4 +150,6 @@ public interface IProject extends IServerObject {
MultipleReference<IProject> getSubprojectReference();
MultipleReference<IParticipant> getParticipantsReference();
SingleReference<IParticipant> getCreatorReference();
}
......@@ -203,4 +203,6 @@ public interface ITask extends IServerObject {
MultipleReference<ITag> getTagReference();
SingleReference<IProject> getProjectReference();
SingleReference<IParticipant> getCreatorReference();
}
......@@ -4,13 +4,8 @@ import fr.alma.gtd.server.core.*;
import fr.alma.gtd.server.core.reference.MultipleReference;
import fr.alma.gtd.server.core.reference.ReferenceContextToTasks;
import java.util.Date;
public class Context extends AbstractContext implements IContext {
private String contextName;
private String idServer;
private MultipleReference<ITask> tasks;
public Context() {
......@@ -20,34 +15,14 @@ public class Context extends AbstractContext implements IContext {
public Context(IContext other) {
this();
this.contextName = other.getName();
this.idServer = other.getServerIdentifier();
this.setName(other.getName());
this.setServerIdentifier(other.getServerIdentifier());
}
public Context(String name) {
super(name);
}
@Override
public String getName() {
return contextName;
}
@Override
public IParticipant getCreator() {
return null;
}
@Override
public String getServerIdentifier() {
return idServer;
}
@Override
public Date getLastModificationDate() {
return null;
}
public MultipleReference<ITask> getTaskReference() {
return this.tasks;
}
......
......@@ -9,31 +9,15 @@ import java.util.Date;
public class Idea extends AbstractIdea implements IIdea {
private String ideaName;
private String description;
private IParticipant ideaCreator;
private String idServeur;
public Idea() {
}
public Idea(IIdea other) {
this();
this.ideaName = other.getName();
this.description = other.getDescription();
this.idServeur = other.getServerIdentifier();
}
@Override
public String getName() {
return ideaName;
}
@Override
public String getDescription() {
return description;
this.setName(other.getName());
this.setDescription(other.getDescription());
this.setServerIdentifier(other.getServerIdentifier());
}
@Override
......@@ -45,29 +29,4 @@ public class Idea extends AbstractIdea implements IIdea {
public void restore() {
}
@Override
public boolean isTrash() {
return false;
}
@Override
public boolean isArchived() {
return false;
}
@Override
public IParticipant getCreator() {
return ideaCreator;
}
@Override
public String getServerIdentifier() {
return idServeur;
}
@Override
public Date getLastModificationDate() {
return null;
}
}
......@@ -7,11 +7,6 @@ import java.util.Date;
import java.util.List;
public class Project extends AbstractProject implements IProject {
private String idServeur;
private String projectName;
private Progress progress;
private ReferenceToProjects subprojects;
private ReferenceProjectToTask tasks;
private SingleReference<IParticipant> creator;
......@@ -27,47 +22,17 @@ public class Project extends AbstractProject implements IProject {
public Project(String idServeur, Progress progress, String projectName) {
this();
this.idServeur = idServeur;
this.progress = progress;
this.projectName = projectName;
this.setServerIdentifier(idServeur);
this.setProgress(progress);
this.setName(projectName);
}
public Project(IProject autre) {
this();
this.idServeur = autre.getServerIdentifier();
this.progress = autre.getProgress();
this.projectName = autre.getName();
}
@Override
public String getServerIdentifier() {
return idServeur;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public String getName() {
return projectName;
}
@Override
public boolean isTrash() {
return false;
}
@Override
public Progress getProgress() {
return progress;
}
@Override
public IContext getDefaultContext() {
return null;
this.setServerIdentifier( autre.getServerIdentifier());
this.setProgress(autre.getProgress());
this.setName(autre.getName());
}
@Override
......@@ -90,30 +55,11 @@ public class Project extends AbstractProject implements IProject {
return this.participants.get();
}
@Override
public IParticipant getCreator() {
return this.creator.get();
}
public void setCreator(IParticipant p) {
this.creator.set(p);
}
@Override
public List<IContact> getContactsList() {
return null;
}
@Override
public boolean isArchived() {
return false;
}
@Override
public void setArchived(boolean archived) {
}
@Override
public MultipleReference<ITask> getTaskReference() {
return this.tasks;
......@@ -128,4 +74,9 @@ public class Project extends AbstractProject implements IProject {
public MultipleReference<IParticipant> getParticipantsReference() {
return this.participants;
}
@Override
public SingleReference<IParticipant> getCreatorReference() {
return this.creator;
}
}
......@@ -4,6 +4,7 @@ import fr.alma.gtd.server.core.AbstractTag;
import fr.alma.gtd.server.core.IParticipant;
import fr.alma.gtd.server.core.ITag;
import java.util.Arrays;
import java.util.Date;
public class Tag extends AbstractTag implements ITag {
......@@ -14,28 +15,7 @@ public class Tag extends AbstractTag implements ITag {
public Tag() {}
public Tag(ITag other) {
id = other.getServerIdentifier();
name = other.getName().toCharArray();
}
@Override
public String getServerIdentifier() {
return id;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public String getName() {
return String.valueOf(name);
}
@Override
public IParticipant getCreator() {
return null;
this.setIdentifier(other.getServerIdentifier());
this.setName(Arrays.toString(other.getName().toCharArray()));
}
}
......@@ -7,14 +7,6 @@ import java.util.Date;
import java.util.List;
public class Task extends AbstractTask implements ITask {
private String task;
private int priority;
private int effortRate;
private Progress progress;
private Frequency frequency;
private Date beginningDate, endingDate;
private ReferenceToTags tags;
private SingleReference<IContext> context;
private ReferenceTaskToProject project;
......@@ -29,71 +21,13 @@ public class Task extends AbstractTask implements ITask {
public Task(ITask other) {
this();
}
@Override
public String getServerIdentifier() {
return null;
}
@Override
public Date getLastModificationDate() {
return null;
}
@Override
public String getName() {
return task;
}
@Override
public int getPriority() {
return priority;
}
@Override
public int getEffortRate() {
return effortRate;
}
@Override
public Progress getProgress() {
return progress;
}
@Override
public Frequency getFrequency() {
return frequency;
}
@Override
public Date getBeginningDate() {
return beginningDate;
}
@Override
public Date getEndingDate() {
return endingDate;
}
@Override
public boolean isTrash() {
return false;
}
@Override
public boolean isArchived() {
return false;
}
@Override
public IParticipant getCreator() {
return this.creator.get();
}
@Override
public IParticipant getParticipant() {
return null;
this.setName(other.getName());
this.setPriority(other.getPriority());
this.setEffortRate(other.getEffortRate());
this.setProgress(other.getProgress());
this.setFrequency(other.getFrequency());
this.setBeginningDate(other.getBeginningDate());
this.setEndingDate(other.getEndingDate());
}
@Override
......@@ -106,11 +40,6 @@ public class Task extends AbstractTask implements ITask {
return this.tags.get();
}
@Override
public List<String> getURLsList() {
return null;
}
@Override
public IProject getProjectContainer() {
return this.getProjectReference().get();
......@@ -140,4 +69,9 @@ public class Task extends AbstractTask implements ITask {
public SingleReference<IProject> getProjectReference() {
return this.project;
}
@Override
public SingleReference<IParticipant> getCreatorReference() {
return this.creator;
}
}
......@@ -18,6 +18,7 @@ import javax.persistence.Table;
import javax.persistence.Transient;
import fr.alma.gtd.server.core.reference.MultipleReference;
import fr.alma.gtd.server.core.reference.SingleReference;
import org.hibernate.annotations.GenericGenerator;
import fr.alma.gtd.server.core.*;
......@@ -243,4 +244,9 @@ public final class Project extends AbstractProject {
public MultipleReference<IParticipant> getParticipantsReference() {
throw new UnsupportedOperationException();
}
@Override
public SingleReference<IParticipant> getCreatorReference() {
throw new UnsupportedOperationException();
}
}
......@@ -241,4 +241,9 @@ public final class Task extends AbstractTask {
public SingleReference<IProject> getProjectReference() {
throw new UnsupportedOperationException();
}
@Override
public SingleReference<IParticipant> getCreatorReference() {
throw new UnsupportedOperationException();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment