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

Begin searchPage

parent e227a5c8
......@@ -5,9 +5,35 @@ sap.ui.controller("conceptmapper.searchPage", {
* Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization.
* @memberOf conceptmapper.searchPage
*/
// onInit: function() {
//
// },
onInit: function() {
var oData1 = {
"names" : [ {
concept_id : "aparrot",
concept_name : "toto",
concept_code : "adrien",
concept_class_id : "parrot",
vocabulary_id : "142",
domain_id : "adrien.parrot@caramail.fr",
validity : "Valid",
standard_concept : "S",
} , {
concept_id : "mpondi",
concept_name : "toto",
concept_code : "marcy",
concept_class_id : "pondi",
vocabulary_id : "142",
domain_id : "marcy.pondi@caramail.fr",
validity : "Valid",
standard_concept : "S",
} ]
};
var oModel = new sap.ui.model.json.JSONModel(oData1);
sap.ui.getCore().setModel(oModel, "concept");
},
/**
* Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered
......
......@@ -13,6 +13,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
* @memberOf conceptmapper.searchPage
*/
createContent : function(oController) {
// Detail Page
var oSubHeader = new sap.m.Bar({
contentLeft : [ new sap.m.Button({
icon : "sap-icon://nav-back",
......@@ -25,41 +26,177 @@ sap.ui.jsview("conceptmapper.searchPage", {
}) ]
});
var oSearchProd = new sap.m.SearchField("idSearchField", {
placeholder : "{i18n>search_placeholder}",
//search:[oController.onSearchProduct,oController],
}).addStyleClass("searchPage");
var oTable = new sap.ui.table.Table({
toolbar : new sap.m.Toolbar({
content : [ new sap.m.Button({
text : "{i18n>create_concept}",
press : [ oController.openCreateDialog, oController ],
}), new sap.m.Button({
text : "{i18n>update_concept}",
press : [ oController.openUpdateDialog, oController ],
}), new sap.m.Button({
text : "{i18n>delete_concept}",
type : "Reject",
press : [ oController.openDeleteDialog, oController ],
}), new sap.m.SearchField({
placeholder:"{i18n>research}"
})
]
}),
});
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_id}"
}),
template : new sap.m.Text({
text : "{concept>concept_id}"
}),
editable : false,
sortProperty : "concept_id"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_name}"
}),
template : new sap.m.Text({
text : "{concept>concept_name}"
}),
editable : false,
sortProperty : "concept_id"
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_code}"
}),
template : new sap.m.Text({
text : "{concept>concept_code}"
}),
sortProperty : "concept_code",
editable : false,
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_class_id}"
}),
template : new sap.m.Text({
text : "{concept>concept_class_id}"
}),
sortProperty : "concept_class_id",
editable : false,
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>vocabulary_id}"
}),
template : new sap.m.Text({
text : "{concept>vocabulary_id}"
}),
sortProperty : "vocabulary_id",
editable : false,
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>standard_concept}"
}),
template : new sap.m.Text({
text : "{concept>standard_concept}"
}),
sortProperty : "standard_concept",
editable : false,
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>validity}"
}),
template : new sap.m.Text({
text : "{concept>validity}"
}),
sortProperty : "validity",
editable : false,
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>domain_id}"
}),
template : new sap.m.Text({
text : "{concept>domain_id}"
}),
sortProperty : "domain_id",
editable : false,
}));
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:
})]
});
var oDetailPage = new sap.m.Page({
title : "{i18n>app_head}",
showSubHeader : true,
subHeader : oSubHeader,
content : [
icoToolbar,
oTable]
});
// Master Page
var oStandardCB = new sap.m.CheckBox({
id:"cb_with_label_size",
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: "Standard"
}).addStyleClass("searchPage");
text: "Valid concepts"
});
// domain, standard, vocabulary => MultiComboBox
var oList = new sap.m.List({
itemPress:[oController.onProductListPress,oController]
}).addStyleClass("searchPage");
// bind the oList items to the oData collection
oList.bindItems({
path : "list>/value",
template : new sap.m.StandardListItem({
title : "{list>Name}",
description : "{list>Description}",
type: sap.m.ListType.Navigation
})
var oMasterPage = new sap.m.Page({
title : "Filters",
content : [ oStandardCB, oValidCB ]
});
var oPage = new sap.m.Page({
title : "{i18n>app_head}",
showSubHeader : true,
subHeader : oSubHeader,
content : [ oSearchProd, oStandardCB, oList ]
});
return oPage;
// Master and detail in one Page
var oSplitContainer = new sap.m.SplitContainer();
oSplitContainer.addMasterPage(oMasterPage);
oSplitContainer.addDetailPage(oDetailPage);
return oSplitContainer;
}
});
\ No newline at end of file
......@@ -9,48 +9,47 @@ sap.ui.controller("conceptmapper.userPage", {
* @memberOf conceptmapper.userPage
*/
onInit : function() {
$.ajax({
type:"GET",
url:"http://127.0.0.1:5000/users",
dataType:"json",
async: false,
header: {
"Content-Type": "application/json",
},
success: function(oData, response, xhr) {
//debugger;
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);
}
});
// $.ajax({
// type:"GET",
// url:"http://127.0.0.1:5000/users",
// dataType:"json",
// async: false,
// header: {
// "Content-Type": "application/json",
// },
// success: function(oData, response, xhr) {
// //debugger;
// 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);
// }
//
// });
var oData1 = {
"names" : [ {
username : "aparrot",
password : "toto",
firstname : "adrien",
lastname : "parrot",
address : "142",
email : "adrien.parrot@caramail.fr",
} , {
username : "mpondi",
password : "toto",
firstname : "marcy",
lastname : "pondi",
address : "142",
email : "marcy.pondi@caramail.fr",
} ]
};
// var oData1 = {
// "names" : [ {
// username : "aparrot",
// password : "toto",
// firstname : "adrien",
// lastname : "parrot",
// address : "142",
// email : "adrien.parrot@caramail.fr",
// } , {
// username : "mpondi",
// password : "toto",
// firstname : "marcy",
// lastname : "pondi",
// address : "142",
// email : "marcy.pondi@caramail.fr",
// } ]
// };
//
//debugger;
// var oModel = new sap.ui.model.json.JSONModel(oData);
// sap.ui.getCore().setModel(oModel, "user");
var oModel = new sap.ui.model.json.JSONModel(oData1);
sap.ui.getCore().setModel(oModel, "user");
},
/******* CREATE *******/
......
......@@ -6,8 +6,10 @@ tile_map=Mapper
app_head=Concepts Mapper App
app_subhead_search=Search by id
search_placeholder=Search (id)
app_subhead_csv=manage users (you can only select one user)
CSV_upload=Upload File
research=Search
#userPage
app_subhead_csv=manage users (you can only select one user)
create_user=Create user
update_user=Update user's data
delete_user=Delete user
......@@ -16,4 +18,17 @@ password=Password
firtname=Firtname
lastname=Lastname
address=Address
email=Email
\ No newline at end of file
email=Email
#searchPage
app_subhead_search=Research concept page
create_concept=Create concept
update_concept=Update concept
delete_concept=Delete concept
concept_id=Id
concept_code=Concept_code
concept_name=Name
concept_class_id=concept_class_id
vocabulary_id=vocabulary_id
domain_id=domain_id
validity=Validity
standard_concept=Standard
\ No newline at end of file
......@@ -6,8 +6,10 @@ tile_search=Recherche
tile_map=Mapper
app_subhead_search=Recherche par id
search_placeholder=Recherche (id)
app_subhead_csv=Utilisateurs (un seul utilisateur peut etre selectionne a la fois)
CSV_upload=Telechargement
research=Recherche
#userPage
app_subhead_csv=Utilisateurs (un seul utilisateur peut etre selectionne a la fois)
create_user=Creation d'un utilisateur
update_user=Mise a jour d'un utilisateur
delete_user=Suppression d'un utilisateur
......@@ -16,4 +18,17 @@ password=Mot de passe
firstname=Prenom
lastname=Nom de famille
address=Adresse
email=email
\ No newline at end of file
email=email
#searchPage
app_subhead_search=Recherche des concepts
create_concept=Creer un concept
update_concept=Mise a jour d'un concept
delete_concept=Suprression d'un concept
concept_id=Id
concept_code=Concept_code
concept_name=Nom
concept_class_id=concept_class_id
vocabulary_id=vocabulary_id
domain_id=domain_id
validity=Validite
standard_concept=Standard
\ No newline at end of file
......@@ -17,7 +17,7 @@
// create an app
var app = new sap.m.App({
initialPage : "idUserPage"
initialPage : "idSearchPage"
});
// Adding all the pages to the app
......@@ -40,8 +40,7 @@
id : "idCSVPage",
viewName : "conceptmapper.CSVPage",
type : sap.ui.core.mvc.ViewType.JS
}));
}));
app.placeAt("content");
</script>
......
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