Commit 20a05771 authored by Adrien PARROT's avatar Adrien PARROT
Browse files

add relations in json test

parent 2f79be7b
......@@ -9,26 +9,55 @@ sap.ui.controller("conceptmapper.searchPage", {
var oData1 = {
"names" : [ {
concept_id : "aparrot",
concept_name : "toto",
concept_code : "adrien",
concept_id : "12121",
concept_name : "Heart Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "142",
domain_id : "adrien.parrot@caramail.fr",
vocabulary_id : "SNOMED",
domain_id : "condition",
validity : "Valid",
standard_concept : "S",
relations: [
{
concept_id : "12121",
concept_name : "Heart Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
domain_id : "condition",
validity : "Valid",
standard_concept : "S",
}, {
concept_id : "12121",
concept_name : "Heart Rate",
concept_code : "34343-43",
concept_class_id : "parrot",
vocabulary_id : "SNOMED",
domain_id : "condition",
validity : "Valid",
standard_concept : "S",
}
]
} , {
concept_id : "mpondi",
concept_name : "toto",
concept_code : "marcy",
concept_id : 213121231,
concept_name : "Hematocssdjfkl fls sfdj lsfd flsdkjflsd slfj sdljsdlj fsdl fjrite",
concept_code : "334-21",
concept_class_id : "pondi",
vocabulary_id : "142",
domain_id : "marcy.pondi@caramail.fr",
vocabulary_id : "SNOMED",
domain_id : "LOINC",
validity : "Valid",
standard_concept : "S",
} ]
};
relations : []
} ],
"total_concepts": 5,
"total_valid_concepts": 4,
"total_standard_concepts" : 3,
}; // return les 15 premiers
// doit etre creer
// les domain existant, les vocabulaire existant, les langues existantes
var oModel = new sap.ui.model.json.JSONModel(oData1);
sap.ui.getCore().setModel(oModel, "concept");
......@@ -74,6 +103,21 @@ sap.ui.controller("conceptmapper.searchPage", {
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "vocabulary");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : [],
"items" : [{
"key" : "FR",
"text" : "FR"
},
{
"key" : "EN",
"text" : "EN"
}]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "language");
},
......
sap.ui.jsview("conceptmapper.searchPage", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf conceptmapper.searchPage
*/
/**
* Specifies the Controller belonging to this View. In the case that it is
* not implemented, or that "null" is returned, this View does not have a
* Controller.
*
* @memberOf conceptmapper.searchPage
*/
getControllerName : function() {
return "conceptmapper.searchPage";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf conceptmapper.searchPage
*/
/**
* Is initially called once after the Controller has been instantiated. It
* is the place where the UI is constructed. Since the Controller is given
* to this method, its event handlers can be attached right away.
*
* @memberOf conceptmapper.searchPage
*/
createContent : function(oController) {
// Detail Page
var oSubHeader = new sap.m.Bar({
// contentLeft : [ new sap.m.Button({
// icon : "sap-icon://nav-back",
// press : function(oEvt) {
// app.back();
// }
// }) ],
// contentLeft : [ new sap.m.Button({
// icon : "sap-icon://nav-back",
// press : function(oEvt) {
// app.back();
// }
// }) ],
contentMiddle : [ new sap.m.Label({
text : "{i18n>app_subhead_search}"
}) ]
......@@ -39,16 +45,16 @@ sap.ui.jsview("conceptmapper.searchPage", {
type : "Reject",
press : [ oController.openDeleteDialog, oController ],
}), new sap.m.SearchField({
placeholder:"{i18n>research}"
})
]}),
placeholder : "{i18n>research}"
}) ]
}),
cellClick : [ oController.goToConceptDetail, oController ]
});
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_id}"
text : "{i18n>concept_id}"
}),
template : new sap.m.Text({
text : "{concept>concept_id}"
......@@ -133,73 +139,64 @@ sap.ui.jsview("conceptmapper.searchPage", {
oTable.bindRows({
path : "concept>/names"
});
var icoToolbar = new sap.m.IconTabBar({
expandable:false,
expanded:false,
items :[
new sap.m.IconTabFilter({
text: "concepts",
showAll: true,
count: "3",
//iconColor : "Critical"
}),
new sap.m.IconTabFilter({
text: "Standard",
icon:"sap-icon://message-success",
count: "3",
//iconColor : "Critical"
}),
new sap.m.IconTabFilter({
text: "Valid",
icon:"sap-icon://message-success",
count: "3",
//iconColor : "Critical"
//select:
})]
expandable : false,
expanded : false,
items : [ new sap.m.IconTabFilter({
text : "concepts",
showAll : true,
count : "{concept>/total_concepts}",
// iconColor : "Critical"
}), new sap.m.IconTabFilter({
text : "Standard",
icon : "sap-icon://message-success",
count : "{concept>/total_standard_concepts}",
// iconColor : "Critical"
}), new sap.m.IconTabFilter({
text : "Valid",
icon : "sap-icon://message-success",
count : "{concept>/total_valid_concepts}",
// iconColor : "Critical"
// select:
}) ]
});
var oDetailPage = new sap.m.Page({
title : "{i18n>app_head}",
showSubHeader : true,
subHeader : oSubHeader,
headerContent : [
new sap.m.Button({
// text:"lol",
icon:"sap-icon://account"
})
],
content : [
icoToolbar,
oTable
]
headerContent : [ new sap.m.Button({
// text:"lol",
icon : "sap-icon://account"
}) ],
content : [ icoToolbar, oTable ]
});
// Master Page
var oStandardCB = new sap.m.CheckBox({
id:"standard_concepts",
visible:true,
selected: true,
enabled: true,
text: "Standard concepts"
id : "standard_concepts",
visible : true,
selected : true,
enabled : true,
text : "Standard concepts"
});
var oValidCB = new sap.m.CheckBox({
id:"valid_concepts",
visible:true,
selected: true,
enabled: true,
text: "Valid concepts"
id : "valid_concepts",
visible : true,
selected : true,
enabled : true,
text : "Valid concepts"
});
var oItemTemplateDomain = new sap.ui.core.Item({
key : "{domain>key}",
text : "{domain>text}",
enabled : "{domain>enabled}"
});
var oDomainMCB = new sap.m.MultiComboBox({
id : "oDomainMCB",
//width : "400px",
// width : "400px",
placeholder : "Choose your domain",
items : {
path : "domain>/items",
......@@ -209,29 +206,32 @@ sap.ui.jsview("conceptmapper.searchPage", {
path : "domain>/selected",
template : "{domain>selected}"
},
// change : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "change" value property to ' + oControlEvent.getParameter("value") + " on "
// + this);
// },
// selectionChange : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionChange" value property to ' + oControlEvent.getParameter("changedItem")
// + " with selected=" + oControlEvent.getParameter("selected") + " on " + this);
// },
// selectionFinish : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionFinish" value property to ' + oControlEvent.getParameter("selectedItems")
// + " on " + this);
// }
// change : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "change" value property to ' +
// oControlEvent.getParameter("value") + " on "
// + this);
// },
// selectionChange : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionChange" value property to
// ' + oControlEvent.getParameter("changedItem")
// + " with selected=" + oControlEvent.getParameter("selected") + " on "
// + this);
// },
// selectionFinish : function(oControlEvent) {
// jQuery.sap.log.info('Event fired: "selectionFinish" value property to
// ' + oControlEvent.getParameter("selectedItems")
// + " on " + this);
// }
});
var oItemTemplateVoc = new sap.ui.core.Item({
key : "{vocabulary>key}",
text : "{vocabulary>text}",
enabled : "{vocabulary>enabled}"
});
var oVocMCB = new sap.m.MultiComboBox({
id : "oVocMCB",
//width : "400px",
// width : "400px",
placeholder : "Choose your vocabulary",
items : {
path : "vocabulary>/items",
......@@ -242,19 +242,46 @@ sap.ui.jsview("conceptmapper.searchPage", {
template : "{vocabulary>selected}"
},
});
// domain, standard, vocabulary => MultiComboBox
var oMiniIB = new sap.m.Input({
id : "oMiniIB",
placeholder : "Mini id",
});
var oMaxiIB = new sap.m.Input({
id : "oMaxiIB",
placeholder : "Maxi id",
});
var oItemTemplateLang = new sap.ui.core.Item({
key : "{language>key}",
text : "{language>text}",
});
var oLangMCB = new sap.m.MultiComboBox({
id : "oLangMCB",
// width : "400px",
placeholder : "Choose your language",
items : {
path : "language>/items",
template : oItemTemplateLang
},
selectedKeys : {
path : "language>/selected",
template : "{language>selected}"
},
});
var oMasterPage = new sap.m.Page({
title : "Filters",
showNavButton: true, //peut etre que c'est mieux de le mettre ici
showNavButton : true,
navButtonPress : function(oEvt) {
app.back();
},
content : [ oStandardCB, oValidCB, oDomainMCB, oVocMCB ]
content : [ oStandardCB, oValidCB, oDomainMCB, oVocMCB, oMiniIB,
oMaxiIB, oLangMCB ]
});
// Master and detail in one Page
var oSplitContainer = new sap.m.SplitContainer();
oSplitContainer.addMasterPage(oMasterPage);
......
......@@ -17,7 +17,7 @@
// create an app
var app = new sap.m.App({
initialPage : "idHomePage"
initialPage : "idSearchPage"
});
// Adding all the pages to the app
......
Markdown is supported
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