Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
InterHop
Omop
susana-front
Commits
1816cd9d
Commit
1816cd9d
authored
Jan 16, 2019
by
Adrien PARROT
Browse files
user and searchview working on omop
parent
101b2680
Changes
7
Hide whitespace changes
Inline
Side-by-side
WebContent/conceptmapper/searchPage.controller.js
View file @
1816cd9d
...
...
@@ -230,12 +230,12 @@ sap.ui.controller("conceptmapper.searchPage", {
oData
.
concept_class_id
=
content
[
8
].
getValue
();
oData
.
vocabulary_id
=
content
[
10
].
getValue
();
oData
.
domain_id
=
content
[
12
].
getValue
();
oData
.
valid
ity
=
content
[
14
].
getValue
();
oData
.
in
valid
_reason
=
content
[
14
].
getValue
();
oData
.
standard_concept
=
content
[
16
].
getValue
();
if
(
oData
.
concept_id
!==
""
&&
oData
.
concept_name
!==
""
&&
oData
.
concept_code
&&
oData
.
concept_class_id
&&
oData
.
vocabulary_id
&&
oData
.
domain_id
&&
oData
.
valid
ity
&&
oData
.
standard_concept
)
{
&&
oData
.
domain_id
&&
oData
.
in
valid
_reason
&&
oData
.
standard_concept
)
{
//
...
...
@@ -340,7 +340,7 @@ sap.ui.controller("conceptmapper.searchPage", {
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
concept
[
4
].
getProperty
(
'
text
'
)
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>
domain_id
}
"
text
:
"
{i18n>
standard_concept
}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
concept
[
5
].
getProperty
(
'
text
'
)
}),
new
sap
.
m
.
Label
({
...
...
@@ -348,10 +348,10 @@ sap.ui.controller("conceptmapper.searchPage", {
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
concept
[
6
].
getProperty
(
'
text
'
)
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>
standard_concept
}
"
text
:
"
{i18n>
domain_id
}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
concept
[
7
].
getProperty
(
'
text
'
)
}),
}),
]
});
...
...
@@ -371,40 +371,41 @@ sap.ui.controller("conceptmapper.searchPage", {
oData
.
concept_code
=
content
[
6
].
getValue
();
oData
.
concept_class_id
=
content
[
8
].
getValue
();
oData
.
vocabulary_id
=
content
[
10
].
getValue
();
oData
.
domain_id
=
content
[
12
].
getValue
();
oData
.
validity
=
content
[
14
].
getValue
();
oData
.
standard_concept
=
content
[
16
].
getValue
();
oData
.
standard_concept
=
content
[
12
].
getValue
();
oData
.
invalid_reason
=
content
[
14
].
getValue
();
oData
.
domain_id
=
content
[
16
].
getValue
();
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
concept
'
);
var
aData
=
oModel
.
getProperty
(
"
/names
"
);
aData
.
splice
(
idx
[
0
],
1
,
oData
);
oModel
.
setProperty
(
"
/names
"
,
aData
);
//
var oModel = sap.ui.getCore().getModel('concept');
//
var aData = oModel.getProperty("/names");
//
aData.splice(idx[0], 1, oData);
//
oModel.setProperty("/names", aData);
//
$.ajax({
//
type:"PUT",
//
url:"http://127.0.0.1:5000/concept/" + oData.concept_id,
//
dataType:"json",
//
data: oData,
//
async: false,
//
header: {
//
"Content-Type": "application/json",
//
},
//
success: function(data, response, xhr) {
//
// front update
//
var oModel = sap.ui.getCore().getModel('concept');
//
var aData = oModel.getProperty("/names");
//
aData.splice(idx[0], 1, oData);
//
oModel.setProperty("/names", aData);
//
//
// backend creation
//
sap.m.MessageToast.show("New concept : '" + oData.concept_name + " 'updated");
//
console.log("connection");
//
},
//
error : function(error) {
//
sap.m.MessageToast.show("Connexion error");
//
console.log(error);
//
}
//
});
$
.
ajax
({
type
:
"
PUT
"
,
url
:
"
http://127.0.0.1:5000/concept/
"
+
oData
.
concept_id
,
dataType
:
"
json
"
,
data
:
oData
,
async
:
false
,
header
:
{
"
Content-Type
"
:
"
application/json
"
,
},
success
:
function
(
data
,
response
,
xhr
)
{
// front update
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
concept
'
);
var
aData
=
oModel
.
getProperty
(
"
/names
"
);
aData
.
splice
(
idx
[
0
],
1
,
oData
);
oModel
.
setProperty
(
"
/names
"
,
aData
);
// backend creation
sap
.
m
.
MessageToast
.
show
(
"
New concept : '
"
+
oData
.
concept_name
+
"
'updated
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
sap
.
m
.
MessageToast
.
show
(
"
Connexion error
"
);
console
.
log
(
error
);
}
});
...
...
@@ -468,7 +469,7 @@ sap.ui.controller("conceptmapper.searchPage", {
oData
.
concept_class_id
=
concept
[
3
].
getProperty
(
'
text
'
);
oData
.
vocabulary_id
=
concept
[
4
].
getProperty
(
'
text
'
);
oData
.
standard_concept
=
concept
[
5
].
getProperty
(
'
text
'
);
oData
.
valid
ity
=
'
D
'
;
oData
.
in
valid
_reason
=
'
D
'
;
oData
.
domain_id
=
concept
[
7
].
getProperty
(
'
text
'
);
// var oModel = sap.ui.getCore().getModel('concept');
...
...
WebContent/conceptmapper/searchPage.view.js
View file @
1816cd9d
...
...
@@ -121,7 +121,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
text
:
"
{i18n>validity}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{concept>valid
ity
}
"
text
:
"
{concept>
in
valid
_reason
}
"
}),
sortProperty
:
"
validity
"
,
editable
:
false
,
...
...
WebContent/conceptmapper/userPage.controller.js
View file @
1816cd9d
var
oItemTemplateAdmin
=
new
sap
.
ui
.
core
.
Item
({
key
:
"
{adminModel>key}
"
,
text
:
"
{adminModel>text}
"
,
enabled
:
"
{adminModel>enabled}
"
});
function
getUsers
()
{
//var URL_users = "http://omop-mapper.fgh.ovh/users"
var
URL_users
=
"
http://127.0.0.1:5000/users
"
;
$
.
ajax
({
method
:
"
GET
"
,
url
:
URL_users
,
dataType
:
"
json
"
,
async
:
false
,
header
:
{
"
Content-Type
"
:
"
application/json
"
,
},
success
:
function
(
oData
,
response
,
xhr
)
{
var
oModel
=
new
sap
.
ui
.
model
.
json
.
JSONModel
(
oData
);
sap
.
ui
.
getCore
().
setModel
(
oModel
,
"
users
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
alert
(
"
pb in the connection
"
);
console
.
log
(
error
);
}
})
}
function
getUser
(
username
)
{
//var URL_users = "http://omop-mapper.fgh.ovh/users"
var
URL_user
=
"
http://127.0.0.1:5000/user/
"
;
$
.
ajax
({
method
:
"
GET
"
,
url
:
URL_user
+
username
,
dataType
:
"
json
"
,
async
:
false
,
header
:
{
"
Content-Type
"
:
"
application/json
"
,
},
success
:
function
(
oData
,
response
,
xhr
)
{
var
oModel
=
new
sap
.
ui
.
model
.
json
.
JSONModel
(
oData
);
sap
.
ui
.
getCore
().
setModel
(
oModel
,
"
user
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
alert
(
"
pb in the connection
"
);
console
.
log
(
error
);
}
})
}
sap
.
ui
.
controller
(
"
conceptmapper.userPage
"
,
{
/**
...
...
@@ -8,13 +65,36 @@ sap.ui.controller("conceptmapper.userPage", {
*
* @memberOf conceptmapper.userPage
*/
// onInit : function() {
//
// },
onInit
:
function
()
{
var
oModel
=
new
sap
.
ui
.
model
.
json
.
JSONModel
();
var
mData
=
{
"
selected
"
:
[],
"
items
"
:
[{
"
key
"
:
"
Not Admin
"
,
"
text
"
:
"
Not Admin
"
},
{
"
key
"
:
"
Admin
"
,
"
text
"
:
"
Admin
"
}]
};
oModel
.
setData
(
mData
);
sap
.
ui
.
getCore
().
setModel
(
oModel
,
"
adminModel
"
);
},
/******* CREATE *******/
openCreateDialog
:
function
(
oEvt
)
{
// var URL_user = "http://omop-mapper.fgh.ovh/user/";
var
URL_user
=
"
http://127.0.0.1:5000/user/
"
;
...
...
@@ -25,6 +105,8 @@ sap.ui.controller("conceptmapper.userPage", {
});
// ariaDescribedBy: "p1",
// state: sap.ui.core.ValueState.Warning,
var
oSimpleForm
=
new
sap
.
ui
.
layout
.
form
.
SimpleForm
({
// maxContainerCols : 2,
...
...
@@ -35,6 +117,19 @@ sap.ui.controller("conceptmapper.userPage", {
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
""
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>is_admin}
"
}),
new
sap
.
m
.
ComboBox
({
// width : "400px",
//placeholder : "Standard Concepts",
items
:
{
path
:
"
adminModel>/items
"
,
template
:
oItemTemplateAdmin
},
selectedKeys
:
{
path
:
"
adminModel>/selected
"
,
template
:
"
{adminModel>selected}
"
},
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>password}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
""
...
...
@@ -71,11 +166,13 @@ sap.ui.controller("conceptmapper.userPage", {
var
oData
=
{};
oData
.
username
=
content
[
2
].
getValue
();
oData
.
password
=
content
[
4
].
getValue
();
oData
.
firstname
=
content
[
6
].
getValue
();
oData
.
lastname
=
content
[
8
].
getValue
();
oData
.
address
=
content
[
10
].
getValue
();
oData
.
email
=
content
[
12
].
getValue
();
oData
.
is_admin
=
content
[
4
].
getValue
();
oData
.
password
=
content
[
6
].
getValue
();
oData
.
firstname
=
content
[
8
].
getValue
();
oData
.
lastname
=
content
[
10
].
getValue
();
oData
.
address
=
content
[
12
].
getValue
();
oData
.
email
=
content
[
14
].
getValue
();
if
(
oData
.
username
!==
""
&&
oData
.
password
!==
""
&&
oData
.
firstname
&&
oData
.
lastname
&&
oData
.
address
&&
oData
.
email
){
...
...
@@ -92,7 +189,7 @@ sap.ui.controller("conceptmapper.userPage", {
},
success
:
function
(
data
,
response
,
xhr
)
{
// front update
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
'
);
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
s
'
);
var
aData
=
oModel
.
getProperty
(
"
/names
"
);
aData
.
push
(
oData
);
oModel
.
setProperty
(
"
/names
"
,
aData
);
...
...
@@ -153,6 +250,9 @@ sap.ui.controller("conceptmapper.userPage", {
icon
:
"
sap-icon://employee
"
});
// get the model called user to get the password
getUser
(
oTable_ref
.
getRows
()[
idx
[
0
]].
getCells
()[
0
].
getProperty
(
'
text
'
));
var
oSimpleForm
=
new
sap
.
ui
.
layout
.
form
.
SimpleForm
({
// maxContainerCols : 2,
content
:
[
new
sap
.
m
.
Title
({
...
...
@@ -161,27 +261,37 @@ sap.ui.controller("conceptmapper.userPage", {
text
:
"
{i18n>username}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
enabled
:
false
,
value
:
user
[
0
].
getProperty
(
'
text
'
)
value
:
"
{user>/username}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>is_admin}
"
}),
new
sap
.
m
.
ComboBox
({
// width : "400px",
//placeholder : "Standard Concepts",
items
:
{
path
:
"
adminModel>/items
"
,
template
:
oItemTemplateAdmin
},
selectedKey
:
"
{user>/is_admin}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>password}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
user
[
1
].
getProperty
(
'
text
'
)
value
:
"
{
user
>/password}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>firstname}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
user
[
2
].
getProperty
(
'
text
'
)
value
:
"
{
user
>/firstname}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>lastname}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
user
[
3
].
getProperty
(
'
text
'
)
value
:
"
{
user
>/lastname}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>address}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
user
[
4
].
getProperty
(
'
text
'
)
value
:
"
{
user
>/address}
"
}),
new
sap
.
m
.
Label
({
text
:
"
{i18n>email}
"
}),
new
sap
.
ui
.
commons
.
TextField
({
value
:
user
[
5
].
getProperty
(
'
text
'
)
value
:
"
{
user
>/email}
"
}),
]
});
...
...
@@ -198,11 +308,13 @@ sap.ui.controller("conceptmapper.userPage", {
var
oData
=
{};
oData
.
username
=
content
[
2
].
getValue
();
oData
.
password
=
content
[
4
].
getValue
();
oData
.
firstname
=
content
[
6
].
getValue
();
oData
.
lastname
=
content
[
8
].
getValue
();
oData
.
address
=
content
[
10
].
getValue
();
oData
.
email
=
content
[
12
].
getValue
();
oData
.
is_admin
=
content
[
4
].
getValue
();
oData
.
password
=
content
[
6
].
getValue
();
oData
.
firstname
=
content
[
8
].
getValue
();
oData
.
lastname
=
content
[
10
].
getValue
();
oData
.
address
=
content
[
12
].
getValue
();
oData
.
email
=
content
[
14
].
getValue
();
$
.
ajax
({
type
:
"
PUT
"
,
...
...
@@ -215,13 +327,13 @@ sap.ui.controller("conceptmapper.userPage", {
},
success
:
function
(
data
,
response
,
xhr
)
{
// front update
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
'
);
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
s
'
);
var
aData
=
oModel
.
getProperty
(
"
/names
"
);
aData
.
splice
(
idx
[
0
],
1
,
oData
);
oModel
.
setProperty
(
"
/names
"
,
aData
);
// backend creation
sap
.
m
.
MessageToast
.
show
(
"
New user : '
"
+
oData
.
username
+
"
'updated
"
);
sap
.
m
.
MessageToast
.
show
(
"
New user : '
"
+
oData
.
username
+
"
'
updated
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
...
...
@@ -302,14 +414,13 @@ sap.ui.controller("conceptmapper.userPage", {
},
success
:
function
(
data
,
response
,
xhr
)
{
// front update
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
'
);
var
oModel
=
sap
.
ui
.
getCore
().
getModel
(
'
user
s
'
);
var
aData
=
oModel
.
getProperty
(
"
/names
"
);
aData
.
splice
(
idx
[
0
],
1
);
oModel
.
setProperty
(
"
/names
"
,
aData
);
oDeleteDialog
.
close
();
// backend creation
sap
.
m
.
MessageToast
.
show
(
"
New user : '
"
+
oData
.
username
+
"
'deleted
"
);
sap
.
m
.
MessageToast
.
show
(
"
New user : '
"
+
oData
.
username
+
"
'
deleted
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
...
...
@@ -353,7 +464,7 @@ sap.ui.controller("conceptmapper.userPage", {
var
URL_users
=
"
http://127.0.0.1:5000/users
"
;
$
.
ajax
({
type
:
"
GET
"
,
method
:
"
GET
"
,
url
:
URL_users
,
dataType
:
"
json
"
,
async
:
false
,
...
...
@@ -362,7 +473,7 @@ sap.ui.controller("conceptmapper.userPage", {
},
success
:
function
(
oData
,
response
,
xhr
)
{
var
oModel
=
new
sap
.
ui
.
model
.
json
.
JSONModel
(
oData
);
sap
.
ui
.
getCore
().
setModel
(
oModel
,
"
user
"
);
sap
.
ui
.
getCore
().
setModel
(
oModel
,
"
user
s
"
);
console
.
log
(
"
connection
"
);
},
error
:
function
(
error
)
{
...
...
WebContent/conceptmapper/userPage.view.js
View file @
1816cd9d
...
...
@@ -52,7 +52,7 @@ sap.ui.jsview("conceptmapper.userPage", {
text
:
"
{i18n>username}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user>username}
"
text
:
"
{user
s
>username}
"
}),
editable
:
false
,
sortProperty
:
"
Username
"
...
...
@@ -60,10 +60,10 @@ sap.ui.jsview("conceptmapper.userPage", {
oTable
.
addColumn
(
new
sap
.
ui
.
table
.
Column
({
label
:
new
sap
.
ui
.
commons
.
Label
({
text
:
"
{i18n>
password
}
"
text
:
"
{i18n>
is_admin
}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user
>password
}
"
text
:
"
{user
s>is_admin
}
"
}),
editable
:
false
,
}));
...
...
@@ -73,7 +73,7 @@ sap.ui.jsview("conceptmapper.userPage", {
text
:
"
{i18n>firstname}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user>firstname}
"
text
:
"
{user
s
>firstname}
"
}),
sortProperty
:
"
Firstname
"
,
editable
:
false
,
...
...
@@ -84,7 +84,7 @@ sap.ui.jsview("conceptmapper.userPage", {
text
:
"
{i18n>lastname}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user>lastname}
"
text
:
"
{user
s
>lastname}
"
}),
sortProperty
:
"
Lastname
"
,
editable
:
false
,
...
...
@@ -95,7 +95,7 @@ sap.ui.jsview("conceptmapper.userPage", {
text
:
"
{i18n>address}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user>address}
"
text
:
"
{user
s
>address}
"
}),
sortProperty
:
"
Address
"
,
editable
:
false
,
...
...
@@ -106,7 +106,7 @@ sap.ui.jsview("conceptmapper.userPage", {
text
:
"
{i18n>email}
"
}),
template
:
new
sap
.
m
.
Text
({
text
:
"
{user>email}
"
text
:
"
{user
s
>email}
"
}),
sortProperty
:
"
Email
"
,
editable
:
false
,
...
...
@@ -114,12 +114,12 @@ sap.ui.jsview("conceptmapper.userPage", {
}));
oTable
.
bindRows
({
path
:
"
user>/names
"
path
:
"
user
s
>/names
"
});
var
oPage
=
new
sap
.
m
.
Page
({
title
:
"
{i18n>app_head}
"
,
showNavButton
:
true
,
//peut etre que c'est mieux de le mettre ici
showNavButton
:
true
,
navButtonPress
:
function
(
oEvt
)
{
app
.
back
();
},
...
...
WebContent/i18n/i18n.properties
View file @
1816cd9d
...
...
@@ -14,11 +14,12 @@ create_user=Create
update_user
=
Update
delete_user
=
Delete
username
=
Username
password
=
Passw
or
d
is_admin
=
Administrat
or
firtname
=
Firtname
lastname
=
Lastname
address
=
Address
email
=
Email
password
=
Password
#searchPage
app_subhead_search
=
Research concept page
create_concept
=
Create
...
...
WebContent/i18n/i18n_fr.properties
View file @
1816cd9d
...
...
@@ -14,11 +14,12 @@ create_user=Creation
update_user
=
Actualisation
delete_user
=
Suppression
username
=
Username
password
=
Mot de passe
is_admin
=
Administrateur
firstname
=
Prenom
lastname
=
Nom de famille
address
=
Adresse
email
=
email
password
=
Mot de passe
#searchPage
app_subhead_search
=
Recherche des concepts
create_concept
=
Creation
...
...
WebContent/index.html
View file @
1816cd9d
...
...
@@ -17,7 +17,7 @@
// create an app
var
app
=
new
sap
.
m
.
App
({
initialPage
:
"
id
Search
Page
"
initialPage
:
"
id
Home
Page
"
});
// Adding all the pages to the app
...
...
Write
Preview
Supports
Markdown
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