branch feature/sync updated (d63c6c1 -> eacb097)
This is an automated email from the git hooks/post-receive script. New change to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git from d63c6c1 Deletion of TaskJsonDisplayer class that was used to test the display of the json Adding an update option to the UI and an update frame (TimeTaskUpdaterView) to display the data to be sent (not finished) based on the Report UI new 3708b2b corrected method for getting times that was ignoring the date parameters and always sending all the times of a task new 5790868 small typo corrected with " at the wrong places or missing in the json output new fbe0fc5 showing an info log when receiving a 200 OK after an update. small typo correction in properties file new eacb097 set up ids for times in the json output to be dates (one task at one date has only one value for duration in jtimer), minor properties change The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit eacb0976461729c7f964e9f540ed59bcec2d5bcc Author: servantie <servantie.c@gmail.com> Date: Wed May 18 17:33:52 2016 +0200 set up ids for times in the json output to be dates (one task at one date has only one value for duration in jtimer), minor properties change commit fbe0fc5540c6a69e3e4db4e905edba8c9bd7f90e Author: servantie <servantie.c@gmail.com> Date: Wed May 18 16:04:40 2016 +0200 showing an info log when receiving a 200 OK after an update. small typo correction in properties file commit 5790868e4efc1e6e152150aaf493dc3b726f9671 Author: servantie <servantie.c@gmail.com> Date: Wed May 18 10:07:43 2016 +0200 small typo corrected with " at the wrong places or missing in the json output commit 3708b2b523cc7e5c5c9fc9b96ae433839a2d83c9 Author: servantie <servantie.c@gmail.com> Date: Wed May 18 09:53:29 2016 +0200 corrected method for getting times that was ignoring the date parameters and always sending all the times of a task Summary of changes: .../chorem/jtimer/entities/TimerTaskHelper.java | 26 +++++++++++----------- .../jtimer/ui/report/TimerTaskUpdaterView.java | 14 +++++++++++- .../resources/TimerTaskUpdaterView.properties | 8 ++----- .../resources/TimerTaskUpdaterView_fr.properties | 20 +++-------------- 4 files changed, 31 insertions(+), 37 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 3708b2b523cc7e5c5c9fc9b96ae433839a2d83c9 Author: servantie <servantie.c@gmail.com> Date: Wed May 18 09:53:29 2016 +0200 corrected method for getting times that was ignoring the date parameters and always sending all the times of a task --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index b6c05f4..7b54efc 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -358,7 +358,7 @@ public class TimerTaskHelper { public static String taskToJSONFormat(TimerTask task, Date startDate, Date endDate) { //todo : change id with something else ? String taskID = Integer.toString(task.getNumber()); - String resultingJSON = "{\"uuid\":\"" + task.getName()+ "\",\"periods\":" + getTimesAndCommentsJSON(task, startDate, endDate) +"}"; + String resultingJSON = "{\"URL\":\"" + task.getSynchronisingURL()+ "\",\"periods\":" + getTimesAndCommentsJSON(task, startDate, endDate) +"}"; return resultingJSON; } @@ -376,10 +376,9 @@ public class TimerTaskHelper { SortedMap<Date, Long> dates = task.getAllDaysAndTimes().subMap(startDate, endDate); //todo:deal with ids (currently a useless sequence) int sequence = 0; - if (task.getAllDaysAndTimes().size() != 0) { + if (dates.size() != 0) { result = result + "["; - SortedMap<Date, Long> timesMap = task.allDaysTimes; - for (SortedMap.Entry<Date, Long> entry : timesMap.entrySet()) { + for (SortedMap.Entry<Date, Long> entry : dates.entrySet()) { //adding id, startDate and duration //converting Date to LocalDate (to ease the .toString()) //todo:deal with timezones ? @@ -400,6 +399,9 @@ public class TimerTaskHelper { result = result.substring(0, result.length()-1); result = result + "]"; } + else { + result ="[]"; + } return result; } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 5790868e4efc1e6e152150aaf493dc3b726f9671 Author: servantie <servantie.c@gmail.com> Date: Wed May 18 10:07:43 2016 +0200 small typo corrected with " at the wrong places or missing in the json output --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index 7b54efc..49b1060 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -356,8 +356,6 @@ public class TimerTaskHelper { * @return result the string in JSON */ public static String taskToJSONFormat(TimerTask task, Date startDate, Date endDate) { - //todo : change id with something else ? - String taskID = Integer.toString(task.getNumber()); String resultingJSON = "{\"URL\":\"" + task.getSynchronisingURL()+ "\",\"periods\":" + getTimesAndCommentsJSON(task, startDate, endDate) +"}"; return resultingJSON; } @@ -381,16 +379,18 @@ public class TimerTaskHelper { for (SortedMap.Entry<Date, Long> entry : dates.entrySet()) { //adding id, startDate and duration //converting Date to LocalDate (to ease the .toString()) - //todo:deal with timezones ? + //deal with timezones ? LocalDate date = entry.getKey().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - result = result + "{\"id\":"+ sequence + "\",\"startDate\":\"" + date.toString() + "T00:00:00" + - "\",\"duration\":\"" + Long.toString(entry.getValue()) + ",\"info\":\""; + result = result + "{\"id\":\""+ sequence + "\",\"startDate\":\"" + date.toString() + "T00:00:00" + + "\",\"duration\":" + Long.toString(entry.getValue()) + ",\"info\":\""; //adding comments (if there are any) if (getAnnotation(task, entry.getKey()).size() != 0) { for (String s : getAnnotation(task, entry.getKey())) { result = result + s + ","; } + //remove trailing comma + result = result.substring(0, result.length()-1); } result = result + "\"},"; ++sequence; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit fbe0fc5540c6a69e3e4db4e905edba8c9bd7f90e Author: servantie <servantie.c@gmail.com> Date: Wed May 18 16:04:40 2016 +0200 showing an info log when receiving a 200 OK after an update. small typo correction in properties file --- .../org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java | 14 +++++++++++++- .../ui/report/resources/TimerTaskUpdaterView.properties | 4 ++-- .../ui/report/resources/TimerTaskUpdaterView_fr.properties | 9 ++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java index 1181dc2..045fcfd 100644 --- a/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java +++ b/src/main/java/org/chorem/jtimer/ui/report/TimerTaskUpdaterView.java @@ -44,6 +44,7 @@ import java.io.UnsupportedEncodingException; import java.net.*; import java.text.DateFormat; import java.util.*; +import java.util.List; import static org.chorem.jtimer.entities.TimerTaskHelper.taskToJSONFormat; @@ -377,8 +378,19 @@ public class TimerTaskUpdaterView extends FrameView implements DocumentListener } try { - //todo: deal with responses ! InputStream response = connection.getInputStream(); + //get the header fields + Map<String, List<String>> map = connection.getHeaderFields(); + for (Map.Entry<String, List<String>> entry : map.entrySet()) { + for (String s : entry.getValue()) { + if (s.equals("HTTP/1.1 200 OK")) { + log.info("Synchronised!"); + //todo : make it update the lastSync Data + + } + } + } + } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties index 6359a52..3837279 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties @@ -30,12 +30,12 @@ updateWeekly=Weekly updateYearly=Yearly currentWeek.Action.icon = date_current.png -currentWeek.Action.shortDescription = Current week- +currentWeek.Action.shortDescription = Current week previousWeek.Action.icon = date_previous.png previousWeek.Action.shortDescription = Previous week -updateAnnotations.Action.text = Include annotations +updateAnnotations.text = Include annotations generateUpdate.Action.text = &Generate generateUpdate.Action.icon = applications-system.png diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties index 85d01e6..44943f0 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties @@ -38,16 +38,15 @@ updateProjects=Projets updateProjectsList=Liste des projets currentWeek.Action.icon = date_current.png -currentWeek.Action.shortDescription = Semaine courante- +currentWeek.Action.shortDescription = Semaine courante previousWeek.Action.icon = date_previous.png -previousWeek.Action.shortDescription = Semaine precedente +previousWeek.Action.shortDescription = Semaine pr\u00E9c\u00E9dente updateAnnotations.Action.text = Inclure les annotations +updateAnnotations.Action.shortDescription = Inclure les annotations - -showHiddenProjects.Action.text = Show hidden projects -showHiddenProjects.Action.shortDescription = Show hidden projects +* generateUpdate.Action.text = &G\u00E9n\u00E9rer generateUpdate.Action.icon = applications-system.png -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit eacb0976461729c7f964e9f540ed59bcec2d5bcc Author: servantie <servantie.c@gmail.com> Date: Wed May 18 17:33:52 2016 +0200 set up ids for times in the json output to be dates (one task at one date has only one value for duration in jtimer), minor properties change --- .../java/org/chorem/jtimer/entities/TimerTaskHelper.java | 8 +++----- .../ui/report/resources/TimerTaskUpdaterView.properties | 6 +----- .../report/resources/TimerTaskUpdaterView_fr.properties | 15 +-------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index 49b1060..43f34b2 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -372,8 +372,6 @@ public class TimerTaskHelper { public static String getTimesAndCommentsJSON(TimerTask task, Date startDate, Date endDate) { String result = ""; SortedMap<Date, Long> dates = task.getAllDaysAndTimes().subMap(startDate, endDate); - //todo:deal with ids (currently a useless sequence) - int sequence = 0; if (dates.size() != 0) { result = result + "["; for (SortedMap.Entry<Date, Long> entry : dates.entrySet()) { @@ -381,8 +379,9 @@ public class TimerTaskHelper { //converting Date to LocalDate (to ease the .toString()) //deal with timezones ? LocalDate date = entry.getKey().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - - result = result + "{\"id\":\""+ sequence + "\",\"startDate\":\"" + date.toString() + "T00:00:00" + + String dateString = date.toString(); + //as jtimer has time entries only for a day, the id of the times will be the date in yyyy-mm-dd format + result = result + "{\"id\":\""+ dateString + "\",\"startDate\":\"" + dateString + "T00:00:00" + "\",\"duration\":" + Long.toString(entry.getValue()) + ",\"info\":\""; //adding comments (if there are any) if (getAnnotation(task, entry.getKey()).size() != 0) { @@ -393,7 +392,6 @@ public class TimerTaskHelper { result = result.substring(0, result.length()-1); } result = result + "\"},"; - ++sequence; } //deleting trailing ',' because of the loop result = result.substring(0, result.length()-1); diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties index 3837279..e3a30c1 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties @@ -24,10 +24,7 @@ updateGeneral=General updateOptions=Options updateFrom=From : updateTo=To : -updateDaily=Daily -updateMonthly=Monthly -updateWeekly=Weekly -updateYearly=Yearly +updateAnnotations = Include annotations currentWeek.Action.icon = date_current.png currentWeek.Action.shortDescription = Current week @@ -35,7 +32,6 @@ currentWeek.Action.shortDescription = Current week previousWeek.Action.icon = date_previous.png previousWeek.Action.shortDescription = Previous week -updateAnnotations.text = Include annotations generateUpdate.Action.text = &Generate generateUpdate.Action.icon = applications-system.png diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties index 44943f0..169d5bd 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties @@ -25,17 +25,8 @@ updateGeneral=G\u00E9n\u00E9ral updateOptions=Options updateFrom=De : updateTo=\u00C0 : -updateDaily=Par jour -updateMonthly=Par mois -updateWeekly=Par semaine -updateYearly=Par ann\u00E9e -updateByProject=Par projet +updateAnnotations = Inclure les annotations -updateIncludeTime=Afficher les temps -updateAnnotationsTime=avec l'heure -updateIntermediateTotalTime=Ajout des temps totaux interm\u00E9diaires -updateProjects=Projets -updateProjectsList=Liste des projets currentWeek.Action.icon = date_current.png currentWeek.Action.shortDescription = Semaine courante @@ -43,10 +34,6 @@ currentWeek.Action.shortDescription = Semaine courante previousWeek.Action.icon = date_previous.png previousWeek.Action.shortDescription = Semaine pr\u00E9c\u00E9dente -updateAnnotations.Action.text = Inclure les annotations -updateAnnotations.Action.shortDescription = Inclure les annotations - -* generateUpdate.Action.text = &G\u00E9n\u00E9rer generateUpdate.Action.icon = applications-system.png -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm