Commit cae8003f authored by Adrien PARROT's avatar Adrien PARROT
Browse files

First implem of search

parent de00a677
function getConceptsAjax(oData, oTable_ref, oRowsNumber) {
var URL_concepts = "http://127.0.0.1:5000/concepts";
// var URL_concepts = "http://omop-mapper.fgh.ovh/concepts";
// var URL_concepts = "http://127.0.0.1:5000/concepts";
var URL_concepts = "http://omop-mapper.fgh.ovh/concepts";
console.log("concepts");
......@@ -35,8 +35,8 @@ function getConceptsAjax(oData, oTable_ref, oRowsNumber) {
function getConceptAjax(sVal) {
var URL_concept = "http://127.0.0.1:5000/concept/";
// var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
if (sVal !== undefined) {
$.ajax({
......@@ -119,7 +119,7 @@ sap.ui.controller("conceptmapper.searchPage", {
oData.mini = parseInt(sap.ui.getCore().byId('oMiniIB').getProperty('value'));
oData.maxi = parseInt(sap.ui.getCore().byId('oMaxiIB').getProperty('value'));
//oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
oData.search_string = sap.ui.getCore().byId('searchField').getProperty('value');
// Standard => 'S' , Classification => 'C', Non-Standard => Null
oData.standard_concept = oStandardMCB_list;
......@@ -162,6 +162,9 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* CREATE *******/
openCreateDialog : function (oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var oCreateDialog = new sap.m.Dialog({
title : "{i18n>create_concept}",
icon : "sap-icon://doc-attachment"
......@@ -249,14 +252,7 @@ sap.ui.controller("conceptmapper.searchPage", {
&& oData.concept_code !== "" && oData.concept_class_id !== "" && oData.vocabulary_id !== ""
&& oData.domain_id !== "" && oData.standard_concept !== "" ) {
var URL_concept = "http://127.0.0.1:5000/concept/";
// var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
//
// var oModel = sap.ui.getCore().getModel('concept');
// var aData = oModel.getProperty("/names");
// aData.push(oData);
// oModel.setProperty("/names", aData);
$.ajax({
type:"POST",
......@@ -275,7 +271,6 @@ sap.ui.controller("conceptmapper.searchPage", {
// oModel.setProperty("/names", aData);
// backend creation
// debugger;
// sap.m.MessageToast.show("New concept : '" + oData.concept_name + "' created");
sap.m.MessageToast.show(xhr.responseJSON.help);
console.log("connection");
......@@ -316,6 +311,9 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* UPDATE *******/
openUpdateDialog : function(oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var button_press = oEvt.getParameters().id;
var oTable_ref = sap.ui.getCore().byId(button_press).getParent().getParent();
idx = oTable_ref.getSelectedIndices();
......@@ -412,7 +410,7 @@ sap.ui.controller("conceptmapper.searchPage", {
$.ajax({
type:"PUT",
url:"http://127.0.0.1:5000/concept/" + oData.concept_id,
url: URL_concept + oData.concept_id,
dataType:"json",
data: oData,
async: false,
......@@ -468,6 +466,10 @@ sap.ui.controller("conceptmapper.searchPage", {
/******* DELETE *******/
openDeleteDialog : function (oEvt) {
// var URL_concept = "http://127.0.0.1:5000/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/concept/";
var button_press = oEvt.getParameters().id;
var oTable_ref = sap.ui.getCore().byId(button_press).getParent().getParent();
idx = oTable_ref.getSelectedIndices();
......@@ -506,18 +508,11 @@ sap.ui.controller("conceptmapper.searchPage", {
oData.standard_concept = concept[5].getProperty('text');
oData.invalid_reason = 'Deleted';
oData.domain_id = concept[7].getProperty('text');
// var oModel = sap.ui.getCore().getModel('concept');
// var aData = oModel.getProperty("/names");
// aData.splice(idx[0], 1, oData);
// oModel.setProperty("/names", aData);
var URL = "http://127.0.0.1:5000/concept/";
URL = URL + oTable_ref.getRows()[idx[0]].getCells()[0].getProperty('text');
$.ajax({
type:"DELETE",
url:URL,
url:URL_concept + oTable_ref.getRows()[idx[0]].getCells()[0].getProperty('text'),
dataType:"json",
async: false,
header: {
......
......@@ -272,26 +272,26 @@ sap.ui.jsview("conceptmapper.searchPage", {
}));
oTable.bindRows({
path : "conceptsModel>/names"
path : "conceptsModel>/docs"
});
var icoToolbar = new sap.m.IconTabBar({
expandable : false,
expanded : false,
items : [ new sap.m.IconTabFilter({
text : "concepts",
text : "Concepts",
showAll : true,
count : "{conceptsModel>/total_concepts}",
count : "{conceptsModel>/num_found}",
// iconColor : "Critical"
// select:
}), new sap.m.IconTabFilter({
text : "Standard",
icon : "sap-icon://message-success",
count : "{conceptsModel>/total_standard_concepts}",
}), new sap.m.IconTabFilter({
text : "Valid",
icon : "sap-icon://message-success",
count : "{conceptsModel>/total_valid_concepts}",
// }), new sap.m.IconTabFilter({
// text : "Standard",
// icon : "sap-icon://message-success",
// count : "{conceptsModel>/total_standard_concepts}",
// }), new sap.m.IconTabFilter({
// text : "Valid",
// icon : "sap-icon://message-success",
// count : "{conceptsModel>/total_valid_concepts}",
}) ]
});
......
function getUsers() {
//var URL_users = "http://omop-mapper.fgh.ovh/users"
var URL_users = "http://127.0.0.1:5000/users";
var URL_users = "http://omop-mapper.fgh.ovh/users"
// var URL_users = "http://127.0.0.1:5000/users";
$.ajax({
method:"GET",
......@@ -24,8 +24,8 @@ function getUsers() {
}
function getUser(username) {
//var URL_users = "http://omop-mapper.fgh.ovh/users"
var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/user/"
// var URL_user = "http://127.0.0.1:5000/user/";
$.ajax({
method:"GET",
......@@ -64,8 +64,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* CREATE *******/
openCreateDialog : function (oEvt) {
//var URL_user = "http://omop-mapper.fgh.ovh/user/";
var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/user/";
//var URL_user = "http://127.0.0.1:5000/user/";
var oCreateDialog = new sap.m.Dialog({
......@@ -199,8 +199,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* UPDATE *******/
openUpdateDialog : function(oEvt) {
// var URL_user = "http://omop-mapper.fgh.ovh/user/";
var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/user/";
// var URL_user = "http://127.0.0.1:5000/user/";
var button_press = oEvt.getParameters().id;
......@@ -344,8 +344,8 @@ sap.ui.controller("conceptmapper.userPage", {
/******* DELETE *******/
openDeleteDialog : function (oEvt) {
// var URL_user = "http://omop-mapper.fgh.ovh/user/";
var URL_user = "http://127.0.0.1:5000/user/";
var URL_user = "http://omop-mapper.fgh.ovh/user/";
// var URL_user = "http://127.0.0.1:5000/user/";
var button_press = oEvt.getParameters().id;
......@@ -377,8 +377,6 @@ sap.ui.controller("conceptmapper.userPage", {
var oData = {};
oData.username = oTable_ref.getRows()[idx[0]].getCells()[0].getProperty('text');
//var URL = URL_user;
//URL = URL + oTable_ref.getRows()[idx[0]].getCells()[0].getProperty('text');
$.ajax({
method:'DELETE',
url:URL_user + oTable_ref.getRows()[idx[0]].getCells()[0].getProperty('text'),
......
......@@ -17,7 +17,7 @@
// create an app
var app = new sap.m.App({
initialPage : "idHomePage"
initialPage : "idSearchPage"
});
// Adding all the pages to the app
......
Supports Markdown
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