Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
ed8ea3da
Commit
ed8ea3da
authored
Jan 05, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename graph API /api/graph instead of /api
parent
5b84755c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
main.py
services/main.py
+12
-12
settings_explorerjs.js
static/tinawebJS/settings_explorerjs.js
+2
-2
No files found.
services/main.py
View file @
ed8ea3da
...
...
@@ -114,28 +114,28 @@ def services():
return
redirect
(
url_for
(
'login'
,
_external
=
True
))
# /services/api/
@
app
.
route
(
config
[
'PREFIX'
]
+
config
[
'API_ROUTE'
]
+
'/'
)
def
api_main
():
# /services/api/
graph
@
app
.
route
(
config
[
'PREFIX'
]
+
config
[
'API_ROUTE'
]
+
'/
graph
'
)
def
graph_api
():
"""
API to provide json extracts of the DB to tinaweb
(originally @ moma/legacy_php_comex/tree/master/comex_install)
(original author S. Castillo)
"""
db
=
MySQL
(
config
[
'SQL_HOST'
])
if
'qtype'
in
request
.
args
:
scholars
=
db
.
getScholarsList
(
request
.
args
[
'qtype'
],
restparse
(
request
.
query_string
.
decode
()))
else
:
raise
TypeError
(
"API query is missing qtype (should be 'filters' or 'uid')"
)
graphdb
=
MySQL
(
config
[
'SQL_HOST'
])
scholars
=
graphdb
.
getScholarsList
(
request
.
args
[
'qtype'
],
restparse
(
request
.
query_string
.
decode
()))
if
scholars
and
len
(
scholars
):
# Data Extraction
graphdb
.
extract
(
scholars
)
if
scholars
and
len
(
scholars
):
# Data Extraction
db
.
extract
(
scholars
)
graphArray
=
graphdb
.
buildJSON_sansfa2
(
graphdb
.
Graph
)
return
dumps
(
graphArray
)
graphArray
=
db
.
buildJSON_sansfa2
(
db
.
Graph
)
return
dumps
(
graphArray
)
else
:
raise
TypeError
(
"graph API query is missing qtype (should be 'filters' or 'uid')"
)
# /services/user/
...
...
static/tinawebJS/settings_explorerjs.js
View file @
ed8ea3da
...
...
@@ -19,8 +19,8 @@ var iwantograph = "";
var
bridge
=
{};
external
=
""
;
//external="http://tina.iscpif.fr/explorerjs/";//Just if you want to use the server-apps from tina.server
bridge
[
"forFilteredQuery"
]
=
"services/api"
//external+"php/bridgeClientServer_filter.php";
bridge
[
"forNormalQuery"
]
=
"services/api"
//external+"php/bridgeClientServer.php";
bridge
[
"forFilteredQuery"
]
=
"services/api
/graph
"
//external+"php/bridgeClientServer_filter.php";
bridge
[
"forNormalQuery"
]
=
"services/api
/graph
"
//external+"php/bridgeClientServer.php";
...
...
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