Skip to content

Commit

Permalink
LEOS Prototype v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikvijay committed Jul 7, 2018
1 parent de246ef commit a7a7135
Show file tree
Hide file tree
Showing 9,766 changed files with 187,949 additions and 177,642 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-Xms256m
-Xmx512m
-XX:MaxPermSize=256m
-Djava.awt.headless=true
17 changes: 14 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT: LEOS
Joinup Release: 3.0.0-SNAPSHOT
Date: 2016-06-17
Joinup Release: 3.1.0-SNAPSHOT
Date: 2016-09-07

INTRODUCTION
============
Expand Down Expand Up @@ -117,11 +117,22 @@ BUGS
====

There might be bugs or incomplete features present in this version as it is a prototype under active development.

* Suggestions on document title cannot be accepted/deleted.
* Suggestions/Comments on article heading are lost on save.

CHANGE LOG
==========

3.1.0 (Prototype)
-----------------
* Comments Viewer
- Feature to suggest a change in the text
* Document Viewer
- Accept or delete suggested changes
- Comments deletion with button
* Updated dependencies (frameworks and libraries)
* Technical improvements and bug fixes

3.0.0 (Prototype)
-----------------
* Updated HOWTO documentation
Expand Down
7 changes: 5 additions & 2 deletions docs/HOWTO/00_Index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@

COMMENTS VIEWER
--------------------------------------------------------------------------------
17. Insert, edit and delete comments
- refer to Comments viewer HOWTO
17. Comment Viewer
17a. Insert, edit and delete comments
- refer to COMMENTS section in Comments viewer HOWTO
17b. Insert and delete suggestions
- refer to SUGGESTIONS section in Comments viewer HOWTO

MISCELLANEOUS
--------------------------------------------------------------------------------
Expand Down
30 changes: 26 additions & 4 deletions docs/HOWTO/11_Leos_editor.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

LEOS EDITOR - HOWTO
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -199,8 +199,12 @@
3. To edit an existing comment double-click on it. A dialog will appear to edit
the comment text. Edit the existing text and click 'Ok'.

4. To delete an existing comment, select it with the mouse and press the
'DELETE' key on the keyboard. The comment will be deleted.
4. To delete an existing comment, there are two ways,
a) Select it with the mouse and press the 'DELETE' key on the keyboard. The
comment will be deleted.
b) If 'Show Comments' is active and editor is open, a delete button will
become visible for comments inside edited area. Clicking on 'Delete' will
delete the comment.

5. To 'drag n drop' an existing comment, select it from the little
square icon that appears over it and drag it to the desired position then
Expand All @@ -209,4 +213,22 @@
6. Document toolbar provides a 'Show comments' button. On click it displays all
the comments in the document. Clicking again on the same button, hides all
comments.


SUGGESTIONS
--------------------------------------------------------------------------------
1. If there is any suggestion present on any element, a icon of 'pinned-box'
will appear on the right side of element.

2. Hovering over the 'pinned-box' icon will display the suggested text.

3. if Article/Citation/Recital editor is active and 'Show Comments' button is
also active, then two buttons 'Accept' and 'Delete' will appear on the right
-bottom corner of the suggestion box.

4. Clicking on 'Accept' button will replace the current element in the editor
with text inside the suggestion. Suggestion will be removed after accept.
All comments in text will be moved to end of the element.

5. Clicking on 'Delete' will remove the suggestion.

6. Editor Save button must be used to persist the accept/delete for suggestion.
51 changes: 41 additions & 10 deletions docs/HOWTO/17_Comments_viewer.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,62 @@
COMMENT VIEWER - HOWTO
--------------------------------------------------------------------------------
1. Comment viewer is a read-only view for the document which is used mainly for
review and comment purpose. No content modification is allowed and the user
can provide review comments related to document content.
review, comment and providing suggestions on text. No content modification is
allowed and the user can provide review comments related to document content
or suggest an alternate text to replace a current one.

2. Comment viewer is available for the documents having the stage as 'IN REVIEW'
. Click on the 'Open' button to open the document in Comment viewer. It is
only allowed to add, edit or delete comments.
allowed to add, edit or delete comments. Also, user can provide a new
suggestion or delete an existing suggestion.


17a. COMMENTS - HOWTO
--------------------------------------------------------------------------------

3. A comment can be added to a paragraph, sub-paragraph and point. On mouse-over
1. A comment can be added to a paragraph, sub-paragraph and point. On mouse-over
to these elements a '+' icon becomes visible on right side of element and if
the mouse is placed over the button, the icon colour will change to 'Green'.

4. To add a comment, click on the '+' icon and a small in-line dialog will open
2. To add a comment, click on the '+' icon and a small in-line dialog will open
with a place to type comment. The user-name and DG is displayed in
the dialog for the user, inserting the comment. After typing the comment,
click on 'Post' to save the comment.

5. The comment will be posted and the '+' icon will be replaced by the number
3. The comment will be posted and the '+' icon will be replaced by the number
of comments added for that element. To edit the existing comment, click
on the icon with number and the in-line dialog will open with the existing
comment. A user can edit/delete only his own comments.

6. To add another comment to the same element, click on the '+' with label
4. To add another comment to the same element, click on the '+' with label
'Leave a comment' and another place will be available to type next comment.

7. To delete an existing comment, open the in-line dialog and click 'Delete'.
The comment will be deleted and number of comments will be adjusted
5. To delete an existing comment, open the in-line dialog and click 'Delete'.
The comment will be deleted and the number on icon will be adjusted
accordingly.


17b. SUGGESTIONS - HOWTO
--------------------------------------------------------------------------------
1. An alternate text can be suggested for a paragraph, sub-paragraph, point or
heading. On mouse-over to these elements, a pen icon becomes visible on right
side of element under a '+' icon and if the mouse is placed over the button,
the icon colour will change to 'Green'.

2. To provide a suggestion, click on the pen icon. The current text will be
highlighted and a dialogue box appear below original text. This dialogue box
will be pre-populated with current text which can be edited. A toolbar will
also be available to user to format the alternate version text.
Under the dialogue box, two buttons 'Post' and 'Cancel' are available. Click
on 'Post' to save the suggestion and clicking on cancel will close the
dialogue and changes, if any, will be lost.

3. After clicking on 'Post' button,suggestion will be posted and the '+' icon
will be replaced by the number of comments and suggestions added for that
element. To view the suggestions, click on the icon with number and the
in-line dialog will open with the existing comments and suggestions.
Suggestions are clearly marked with heading 'Suggestion'and coloured
differently.

4. To delete an existing suggestion, open the in-line dialog and click 'Delete'.
The suggestion will be deleted and number on icon will be adjusted
accordingly. A user can delete only his own suggestions.
17 changes: 0 additions & 17 deletions docs/ReleaseNotes_v3.0/ReleaseNotes_v3.0.txt

This file was deleted.

13 changes: 13 additions & 0 deletions docs/ReleaseNotes_v3.1/ReleaseNotes_v3.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Updated HOWTO documentation

Comments Viewer
- Feature to suggest a change in the text

Document Viewer
- Accept or delete suggested changes
- Comments deletion with button

Updated dependencies (frameworks and libraries)
Technical improvements

Please see the README file included in the release to learn how to compile and run the project on your local machine without external dependencies.
2 changes: 1 addition & 1 deletion modules/groovy-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>eu.europa.ec.leos.prototype</groupId>
<artifactId>leos-modules</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>leos-groovy-support</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,64 @@
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
package eu.europa.ec.leos.support.xml

import java.text.SimpleDateFormat
import java.util.concurrent.TimeUnit

import com.google.common.base.Stopwatch
import eu.europa.ec.leos.vo.CommentVO
import eu.europa.ec.leos.vo.CommentVO.RefersTo
import groovy.util.slurpersupport.GPathResult
import groovy.xml.StreamingMarkupBuilder
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component

import com.google.common.base.Stopwatch

import eu.europa.ec.leos.vo.CommentVO
import groovy.util.slurpersupport.GPathResult
import java.text.SimpleDateFormat
import java.util.concurrent.TimeUnit

@Component
class XmlCommentProcessorImpl implements XmlCommentProcessor {
private static final Logger LOG = LoggerFactory.getLogger(XmlCommentProcessorImpl.class);
private static final SimpleDateFormat dateFormatISO_GMT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");

private static final SimpleDateFormat dateFormatISO_GMT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");

@Override
def List<CommentVO> fromXML(String xmlFragment ){
def List<CommentVO> fromXML(String xmlFragment) {
Stopwatch watch = Stopwatch.createStarted();

XmlSlurper xmlSlurper = new XmlSlurper(false, false)
GPathResult rootNode=xmlSlurper.parseText(xmlFragment)
List<CommentVO> commentList=new ArrayList<CommentVO>();
GPathResult rootNode = xmlSlurper.parseText(xmlFragment)
List<CommentVO> commentList = new ArrayList<CommentVO>();

dateFormatISO_GMT.setTimeZone(TimeZone.getTimeZone("UTC"));

rootNode
.'**'
.findAll{it.name()=="popup"}
.each{commentNode->

String commentId = commentNode.@'id'.text()?:null
String userLogin = commentNode.@'leos:userid'.text()?:null
String userName = commentNode.@'leos:username'.text()?:null
String date = commentNode.@'leos:datetime'.text()?:null
String dg = commentNode.@'leos:dg'.text()?:null
Date timestamp = (date!=null)? dateFormatISO_GMT.parse(date): new Date()
GPathResult commentText =commentNode.'*'.find{it.name()=="p" }
String commentContent = commentText.text()

String elementId =rootNode.@'id'.text()?:null
.each { commentNode ->

String commentId = commentNode.@'id'.text() ?: null
String userLogin = commentNode.@'leos:userid'.text() ?: null
String userName = commentNode.@'leos:username'.text() ?: null
String date = commentNode.@'leos:datetime'.text() ?: null
String dg = commentNode.@'leos:dg'.text() ?: null
Date timestamp = (date != null) ? dateFormatISO_GMT.parse(date) : new Date()
GPathResult commentText = commentNode.'*'.find{ it.name() == "p" }//TODO handle comments inside suggestions.
String content = nodeToXML(commentText);

commentList.add(new CommentVO(commentId, elementId, commentContent, userName, userLogin, dg, timestamp));

}
String refersTo = commentNode.@'refersTo'.text() ?: null
String elementId = rootNode.@'id'.text() ?: null

commentList.add(new CommentVO(commentId, elementId, content, userName, userLogin, dg, timestamp, RefersTo.fromString(refersTo)));
}
LOG.trace("Created commentVO in {} ms", watch.elapsed(TimeUnit.MILLISECONDS));

return commentList;
}

private String nodeToXML(groovy.util.slurpersupport.NodeChild node) {
def builder = new StreamingMarkupBuilder()
builder.setUseDoubleQuotes(true)
builder.setProperty("encoding", "UTF-8");
def w = builder.bind { mkp.yield node };
return w.toString();
}
}


Expand Down
Loading

0 comments on commit a7a7135

Please sign in to comment.