Skip to content

Commit a7a4a3b

Browse files
committed
SSS-340
1 parent c91be78 commit a7a4a3b

File tree

7 files changed

+72
-5
lines changed

7 files changed

+72
-5
lines changed

adapter/adapter.rest/adapter.rest.v2/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494

9595
<apiSource>
9696
<apiVersion>v2</apiVersion>
97-
<basePath>http://localhost:8080/sss.adapter.rest.v2</basePath>
97+
<basePath>http://test-ll.know-center.tugraz.at/knowbrain</basePath>
9898
<!--
9999
localhost:8080/sss.adapter.rest.v2
100100
test-ll.know-center.tugraz.at/ltb.v2
@@ -111,7 +111,7 @@
111111
<licenseUrl>${project.licenseURI}</licenseUrl>
112112
</apiInfo>
113113

114-
<swaggerUIDocBasePath>http://localhost:8080/sss.adapter.rest.v2/api-docs</swaggerUIDocBasePath>
114+
<swaggerUIDocBasePath>http://test-ll.know-center.tugraz.at/knowbrain/api-docs</swaggerUIDocBasePath>
115115
<!--
116116
localhost:8080/sss.adapter.rest.v2/api-docs
117117
test-ll.know-center.tugraz.at/ltb.v2/api-docs

adapter/adapter.rest/adapter.rest.v2/src/main/java/at/tugraz/sss/adapter/rest/v2/SSRestMainV2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class SSRestMainV2 extends Application {
5555

5656
public SSRestMainV2() throws Exception{
5757

58-
SSAdapterRestConf.instSet (SSFileU.dirCatalinaBase() + SSVocConf.dirNameConf + "discussion.tool.yaml");
58+
SSAdapterRestConf.instSet (SSFileU.dirCatalinaBase() + SSVocConf.dirNameConf + "knowbrain.yaml");
5959

6060
conf = SSAdapterRestConf.instGet();
6161

adapter/adapter.rest/adapter.rest.v2/src/main/java/at/tugraz/sss/adapter/rest/v2/entity/SSRESTEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public Response entityUsersGet(
323323
@POST
324324
@Consumes(MediaType.APPLICATION_JSON)
325325
@Produces(MediaType.APPLICATION_JSON)
326-
@Path("{entity}/comments")
326+
@Path("/{entity}/comments")
327327
@ApiOperation(
328328
value = "add comments to the entity",
329329
response = SSCommentsAddPar.class)

adapter/adapter.rest/adapter.rest.v2/src/main/webapp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<script type="text/javascript">
2626
$(function () {
2727
window.swaggerUi = new SwaggerUi({
28-
url: "http://localhost:8080/sss.adapter.rest.v2/api-docs",
28+
url: "http://test-ll.know-center.tugraz.at/knowbrain/api-docs",
2929
//test-ll.know-center.tugraz.at/ltb-v2/api-docs
3030
//localhost:8080/sss.adapter.rest.v2/api-docs
3131
//test-ll.know-center.tugraz.at/ld

servs/comment/comment.api/src/main/java/at/kc/tugraz/sss/comment/api/SSCommentClientI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525

2626
public interface SSCommentClientI{
2727

28+
public void commentsAdd (final SSSocketCon sSCon, final SSServPar parA) throws Exception;
2829
public void commentsGet (final SSSocketCon sSCon, final SSServPar parA) throws Exception;
2930
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* Code contributed to the Learning Layers project
3+
* http://www.learning-layers.eu
4+
* Development is partly funded by the FP7 Programme of the European Commission under
5+
* Grant Agreement FP7-ICT-318209.
6+
* Copyright (c) 2015, Graz University of Technology - KTI (Knowledge Technologies Institute).
7+
* For a list of contributors see the AUTHORS file at the top-level directory of this distribution.
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License");
10+
* you may not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
package at.kc.tugraz.sss.comment.datatypes.ret;
22+
23+
import at.tugraz.sss.serv.SSServOpE;
24+
import at.tugraz.sss.serv.SSStrU;
25+
import at.tugraz.sss.serv.SSServRetI;
26+
import at.tugraz.sss.serv.SSUri;
27+
import java.util.Map;
28+
29+
public class SSCommentsAddRet extends SSServRetI{
30+
31+
public SSUri entity = null;
32+
33+
public String getEntity() throws Exception{
34+
return SSStrU.removeTrailingSlash(entity);
35+
}
36+
37+
@Override
38+
public Map<String, Object> jsonLDDesc(){
39+
throw new UnsupportedOperationException();
40+
}
41+
42+
public static SSCommentsAddRet get(
43+
final SSUri entity){
44+
45+
return new SSCommentsAddRet(entity);
46+
}
47+
48+
private SSCommentsAddRet(
49+
final SSUri entity) {
50+
51+
super(SSServOpE.commentsAdd);
52+
53+
this.entity = entity;
54+
}
55+
}

servs/comment/comment.impl/src/main/java/at/kc/tugraz/sss/comment/impl/SSCommentImpl.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import at.kc.tugraz.sss.comment.api.SSCommentServerI;
3939
import at.kc.tugraz.sss.comment.datatypes.par.SSCommentsAddPar;
4040
import at.kc.tugraz.sss.comment.datatypes.par.SSCommentsGetPar;
41+
import at.kc.tugraz.sss.comment.datatypes.ret.SSCommentsAddRet;
4142
import at.kc.tugraz.sss.comment.datatypes.ret.SSCommentsGetRet;
4243
import at.kc.tugraz.sss.comment.impl.fct.sql.SSCommentSQLFct;
4344
import at.kc.tugraz.sss.comment.impl.fct.userrelationgather.SSCommentUserRelationGatherFct;
@@ -108,6 +109,16 @@ public SSEntity describeEntity(
108109
}
109110
}
110111

112+
@Override
113+
public void commentsAdd(final SSSocketCon sSCon, final SSServPar parA) throws Exception{
114+
115+
SSServCallerU.checkKey(parA);
116+
117+
final SSCommentsAddPar par = (SSCommentsAddPar) parA.getFromJSON(SSCommentsAddPar.class);
118+
119+
sSCon.writeRetFullToClient(SSCommentsAddRet.get(commentsAdd(par)));
120+
}
121+
111122
@Override
112123
public SSUri commentsAdd(final SSCommentsAddPar par) throws Exception{
113124

0 commit comments

Comments
 (0)