diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/Journal.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/Journal.java index 43670730c1d13bff2e35570aba12b952739e8fae..65a17d1fea783d016f0422414d5dbed66ee4b671 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/Journal.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/Journal.java @@ -10,18 +10,17 @@ import static unipotsdam.gf.core.management.utils.MarkdownUtils.convertMarkdownT */ public class Journal { - long id; - StudentIdentifier studentIdentifier; - String creator; - String entryHTML; - String entryMD; - long timestamp; - Visibility visibility; - String category; //TODO enum + private long id; + private StudentIdentifier studentIdentifier; + private String creator; + private String entryHTML; + private String entryMD; + private long timestamp; + private Visibility visibility; + private String category;//TODO enum public Journal() {} - public Journal(long id, StudentIdentifier studentIdentifier, String entry, long timestamp, Visibility visibility, String category) { this.id = id; this.studentIdentifier = studentIdentifier; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/ProjectDescription.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/ProjectDescription.java index 88daca376d2e6112204398e53c9c4e85ca35c91a..7c73443a81d372bfe5bdc2cbc43a67a241e95c43 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/ProjectDescription.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/model/ProjectDescription.java @@ -13,15 +13,15 @@ import static unipotsdam.gf.core.management.utils.MarkdownUtils.convertMarkdownT public class ProjectDescription { - long id; - String name; - String descriptionHTML; - String descriptionMD; - boolean open; - Project project; - Map<String,String> links; - ArrayList<String> group; - long timestamp; + private long id; + private String name; + private String descriptionHTML; + private String descriptionMD; + private boolean open; + private Project project; + private Map<String,String> links; + private ArrayList<String> group; + private long timestamp; public ProjectDescription() { } diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyJournalService.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyJournalService.java index 5773092ece30e3c5de290e7d2fde6c8e2454f897..d005bbd9dd17092bd316eea835c49ce5f8c66661 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyJournalService.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyJournalService.java @@ -16,14 +16,14 @@ import java.util.Calendar; public class DummyJournalService implements JournalService { - Logger log = LoggerFactory.getLogger(DummyJournalService.class); + private Logger log = LoggerFactory.getLogger(DummyJournalService.class); - Calendar cal = Calendar.getInstance(); + private Calendar cal = Calendar.getInstance(); - long id = 4; + private long id = 4; - ArrayList<Journal> journals = new ArrayList<>(); + private ArrayList<Journal> journals = new ArrayList<>(); public DummyJournalService(){ @@ -80,7 +80,7 @@ public class DummyJournalService implements JournalService { @Override public boolean saveJournal(long id, String student, String project, String text, String visibility, String category) { - if (Long.valueOf(id) == -1){ + if (id == -1){ StudentIdentifier studentId = new StudentIdentifier(student,project); journals.add(new Journal(this.id++, studentId, text , cal.getTimeInMillis(), stringToVisibility(visibility) , category)); @@ -126,7 +126,7 @@ public class DummyJournalService implements JournalService { return v; } - ArrayList<Journal> resetList () { + private void resetList() { StudentIdentifier studentIdentifier = new StudentIdentifier("0","0"); StudentIdentifier studentIdentifier2 = new StudentIdentifier("0","1"); @@ -152,7 +152,6 @@ public class DummyJournalService implements JournalService { journals.add(j4); journals.add(j5); - return journals; } diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyProjectDescription.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyProjectDescription.java index 395db96115408339a831714b5f21651a2ef5d8e6..83d23f00d26a72cadeaecbd95f3b68d9d6d83704 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyProjectDescription.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/service/DummyProjectDescription.java @@ -6,22 +6,18 @@ import unipotsdam.gf.modules.journal.model.ProjectDescription; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Map; public class DummyProjectDescription implements ProjectDescriptionService { - ArrayList<Map<String,String>> links; - ArrayList<String> group; - ProjectDescription testProject; + private ProjectDescription testProject; public DummyProjectDescription(){ - links = new ArrayList(); HashMap<String,String> link = new HashMap<>(); link.put("Test", "www.test.de"); link.put("Google", "www.google.de"); - group = new ArrayList<>(); + ArrayList<String> group = new ArrayList<>(); group.add("Test Person"); group.add("Person Test"); diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/JournalView.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/JournalView.java index 6a4298d53ccf269a83ba56eefcd9b16ee2235a5d..8a26fbc40cb7fae833c122ef9dddf912e9a58b34 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/JournalView.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/JournalView.java @@ -23,8 +23,8 @@ import java.util.ArrayList; @Path("/journal") public class JournalView { - Logger log = LoggerFactory.getLogger(JournalView.class); - JournalService journalService = new DummyJournalService(); + private Logger log = LoggerFactory.getLogger(JournalView.class); + private JournalService journalService = new DummyJournalService(); /** * Returns a specific Journal @@ -111,7 +111,7 @@ public class JournalView { journalService.saveJournal(id, student, project, text, visibility, category); //TODO token - URI location = null; + URI location; try { location = new URI("../pages/eportfolio.jsp?token=test"); log.debug("<<< saveJournal: redirect to " +location.toString()); diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java index f4d0102491bd87072193da68d94bba08f8cb3c85..5e8afa676f072c2e056a7af79465c978292ddec2 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/journal/view/ProjectDescriptionView.java @@ -21,8 +21,8 @@ import java.net.URISyntaxException; @Path("/projectdescription") public class ProjectDescriptionView { - Logger log = LoggerFactory.getLogger(ProjectDescriptionView.class); - ProjectDescriptionService descriptionService = new DummyProjectDescription(); + private Logger log = LoggerFactory.getLogger(ProjectDescriptionView.class); + private ProjectDescriptionService descriptionService = new DummyProjectDescription(); //get Description @GET