Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
INB
eTRANSAFE
pretox-rest-api
Commits
b829daf6
Commit
b829daf6
authored
Nov 09, 2021
by
Javi Corvi
Browse files
new draft version of api with modifications
parent
a0180df0
Pipeline
#25731
passed with stage
in 4 minutes and 20 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
src/main/java/es/bsc/inb/ades/rest/api/controllers/DocumentController.java
View file @
b829daf6
...
...
@@ -8,7 +8,6 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -17,8 +16,6 @@ import es.bsc.inb.ades.rest.api.model.Document;
import
es.bsc.inb.ades.rest.api.model.DocumentAnnotations
;
import
es.bsc.inb.ades.rest.api.model.DocumentTracking
;
import
es.bsc.inb.ades.rest.api.model.Status
;
import
es.bsc.inb.ades.rest.api.model.Tracking
;
import
es.bsc.inb.ades.rest.api.security.basic.inmemory.AuthenticationBean
;
import
es.bsc.inb.ades.rest.api.services.DocumentService
;
...
...
@@ -97,13 +94,24 @@ public class DocumentController {
return
snippet
;
}
@RequestMapping
(
"/documents/{id}/evidence/sentences"
)
public
String
findSentencesEvidence
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
String
snippet
=
documentService
.
findSentencesEvidenceByDocumentId
(
id
);
return
snippet
;
}
@RequestMapping
(
"/documents/{id}/
finding2/{findingId}
"
)
public
String
find
Finding2
(
@PathVariable
(
value
=
"id"
)
Long
id
,
@PathVariable
(
value
=
"findingId"
)
Integer
findingI
d
)
{
String
snippet
=
documentService
.
findText
Snippet
ByDocumentId
AndFindingId2
(
id
,
findingI
d
);
@RequestMapping
(
"/documents/{id}/
text
"
)
public
String
find
DocumentText
(
@PathVariable
(
value
=
"id"
)
Long
i
d
)
{
String
snippet
=
documentService
.
findTextByDocumentId
(
i
d
);
return
snippet
;
}
// @RequestMapping("/documents/{id}/finding2/{findingId}")
// public String findFinding2(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId) {
// String snippet = documentService.findTextSnippetByDocumentIdAndFindingId2(id, findingId);
// return snippet;
// }
@RequestMapping
(
value
=
"/documents/export/{id}"
)
public
ResponseEntity
<
byte
[]>
generateReport
(
@PathVariable
(
"id"
)
long
documentId
){
String
filename
=
"Study_Report_"
+
documentId
+
".txt"
;
...
...
src/main/java/es/bsc/inb/ades/rest/api/model/SRDomainFinding.java
View file @
b829daf6
...
...
@@ -23,17 +23,54 @@ public class SRDomainFinding implements Cloneable{
private
String
SRENPHSE
=
""
;
private
String
SROBENDY
=
""
;
private
String
SRDOMAIN
=
""
;
private
String
SRDOMAIN_DESC
=
""
;
private
String
SRSPEC
=
""
;
private
String
SRSPEC_DESC
=
""
;
private
String
SRTSTCD
=
""
;
private
String
SRTSTCD_DESC
=
""
;
private
String
SRFNDG
=
""
;
private
String
SRFNDG_DESC
=
""
;
private
String
SRORES
=
""
;
private
String
SROBSV
=
""
;
private
String
SROBSV_DESC
=
""
;
private
String
SROBSQ
=
""
;
private
String
SRSEV
=
""
;
private
String
SRPCNT
=
""
;
private
String
SRSIGF
=
""
;
private
String
SRTRTEF
=
""
;
private
String
SRCOMNT
=
""
;
public
String
getSrdomain_value
()
{
return
SRDOMAIN_DESC
+
"("
+
SRDOMAIN
+
")"
;
}
public
String
getSrfndg_value
()
{
if
(
SRFNDG
==
null
||
SRFNDG
.
equals
(
""
))
{
return
SRORES
;
}
return
SRFNDG_DESC
+
"("
+
SRFNDG
+
")"
;
}
public
String
getSrtstcd_value
()
{
if
(
SRTSTCD
==
null
||
SRTSTCD
.
equals
(
""
))
{
return
SRTSTCD_DESC
;
}
return
SRTSTCD_DESC
+
"("
+
SRTSTCD
+
")"
;
}
public
String
getSrobsv_value
()
{
if
(
SROBSV
==
null
||
SROBSV
.
equals
(
""
))
{
return
SROBSV_DESC
;
}
return
SROBSV_DESC
+
"("
+
SROBSV
+
")"
;
}
public
String
getSrspec_value
()
{
if
(
SRSPEC
==
null
||
SRSPEC
.
equals
(
""
))
{
return
SRSPEC_DESC
;
}
return
SRSPEC_DESC
+
"("
+
SRSPEC
+
")"
;
}
private
Boolean
export
;
private
Integer
findingId
;
...
...
@@ -156,9 +193,9 @@ public class SRDomainFinding implements Cloneable{
public
String
getSROBSV
()
{
return
SROBSV
;
}
public
void
setSROBSV
(
String
sROBSV
)
{
SROBSV
=
sROBSV
;
}
public
String
getSROBSQ
()
{
return
SROBSQ
;
}
...
...
@@ -195,10 +232,41 @@ public class SRDomainFinding implements Cloneable{
public
void
setSRCOMNT
(
String
sRCOMNT
)
{
SRCOMNT
=
sRCOMNT
;
}
public
void
setSRDOMAIN_DESC
(
String
sRDOMAIN_DESC
)
{
SRDOMAIN_DESC
=
sRDOMAIN_DESC
;
}
public
void
setSROBSV
(
String
sROBSV
)
{
SROBSV
=
sROBSV
;
}
public
String
getSRDOMAIN_DESC
()
{
return
SRDOMAIN_DESC
;
}
public
String
getSRSPEC_DESC
()
{
return
SRSPEC_DESC
;
}
public
void
setSRSPEC_DESC
(
String
sRSPEC_DESC
)
{
SRSPEC_DESC
=
sRSPEC_DESC
;
}
public
String
getSRTSTCD_DESC
()
{
return
SRTSTCD_DESC
;
}
public
void
setSRTSTCD_DESC
(
String
sRTSTCD_DESC
)
{
SRTSTCD_DESC
=
sRTSTCD_DESC
;
}
public
String
getSRFNDG_DESC
()
{
return
SRFNDG_DESC
;
}
public
void
setSRFNDG_DESC
(
String
sRFNDG_DESC
)
{
SRFNDG_DESC
=
sRFNDG_DESC
;
}
public
String
getSROBSV_DESC
()
{
return
SROBSV_DESC
;
}
public
void
setSROBSV_DESC
(
String
sROBSV_DESC
)
{
SROBSV_DESC
=
sROBSV_DESC
;
}
public
Boolean
getExport
()
{
if
(
export
==
null
)
return
true
;
return
export
;
...
...
src/main/java/es/bsc/inb/ades/rest/api/services/DocumentService.java
View file @
b829daf6
...
...
@@ -6,7 +6,6 @@ import es.bsc.inb.ades.rest.api.model.Document;
import
es.bsc.inb.ades.rest.api.model.DocumentAnnotations
;
import
es.bsc.inb.ades.rest.api.model.DocumentTracking
;
import
es.bsc.inb.ades.rest.api.model.Status
;
import
es.bsc.inb.ades.rest.api.model.Tracking
;
public
interface
DocumentService
{
...
...
@@ -17,7 +16,7 @@ public interface DocumentService {
Document
findByDocumentId2
(
Long
id
);
String
findTextSnippetByDocumentIdAndFindingId2
(
Long
id
,
Integer
findingId
);
//
String findTextSnippetByDocumentIdAndFindingId2(Long id, Integer findingId);
String
findFindingEvidenceByDocumentIdAndFindingId
(
Long
id
,
Integer
findingId
);
...
...
@@ -30,7 +29,11 @@ public interface DocumentService {
byte
[]
exportDocumentAnnotation
(
Long
documentId
);
String
findFindingsEvidenceByDocumentId
(
Long
id
);
String
findSentencesEvidenceByDocumentId
(
Long
id
);
String
findTextByDocumentId
(
Long
id
);
Boolean
setExportSRDomainFinding
(
Long
id
,
Integer
findingId
,
Boolean
export_srdomain
);
Boolean
setFindingValidation
(
Long
id
,
Integer
findingId
,
String
status
);
...
...
src/main/java/es/bsc/inb/ades/rest/api/services/DocumentServiceImpl.java
View file @
b829daf6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment