Commit 0b05679f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

rest api provides type of commented element

parent 36334fb7
......@@ -26,6 +26,7 @@ import lcsb.mapviewer.services.interfaces.ICommentService;
import lcsb.mapviewer.services.interfaces.IModelService;
import lcsb.mapviewer.services.interfaces.IUserService;
import lcsb.mapviewer.services.overlay.IconManager;
import lcsb.mapviewer.services.search.data.ElementIdentifier.ElementIdentifierType;
import lcsb.mapviewer.services.view.AuthenticationToken;
@Transactional(value = "txManager")
......@@ -138,6 +139,8 @@ public class CommentRestImpl {
value = comment.isDeleted();
} else if (column.equals("coord")) {
value = getCoordinates(comment);
} else if (column.equals("type")) {
value = getType(comment);
} else if (column.equals("icon")) {
value = IconManager.getInstance().getCommentIcon();
} else if (admin) {
......@@ -156,6 +159,18 @@ public class CommentRestImpl {
return result;
}
private Object getType(Comment comment) {
if (comment.getTableName() != null) {
if (comment.getTableName().getName().contains("Reaction")) {
return ElementIdentifierType.REACTION;
} else {
return ElementIdentifierType.ALIAS;
}
} else {
return ElementIdentifierType.POINT;
}
}
private String getTitle(Comment comment) {
String title = "";
if (comment.getCoordinates() != null) {
......
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