I want to map a folder like structure to a list control in sap.m Master view.
Please have a look at thie demo app named Shopping Cart. You will see a Master->Master->Detail navigation. From Category to Products to (Product) Detail.
I already studied the source code. The navigation above is realized using routing.
For my projects, I would like to have something similar. However, it would be no simple M->M->D structure. My data would be received in JSON form from a SAP Enterprise Portal folder structure. Each folder can have other folders or files. The data structure could like like this, but may have n levels of folders:
{ "root": [
{ "name" : "Folder A",
"isCollection": true,
"content" : [
{ "name" : "Sub Folder A",
"isCollection": true,
"content" : [
{"filename":"IpsumPrimisIn.xls","datatype":"application/vnd.ms-excel"},{"filename":"IdOrnare.mp3","datatype":"audio/x-mpeg-3"}
]
}
]
},
{ "name" : "Folder B",
"isCollection": true,
"content" : [
{ "name" : "Sub Folder B",
"isCollection": true,
"content" : [
{"filename":"IpsumPrimisIn.xls","datatype":"application/vnd.ms-excel"}{"filename":"Non.mov","datatype":"video/quicktime"}
]
}
]
}
] }
Please note, that the folder structure will be changing and might become more diverse and more deep over the time.
An ideal solution would be to dynamicly read, adapt and map the JSON structure to some kind of SAPUI5 routing logic. Is this possible? Have a Router instance, loop through my JSON structure, call addRoute() on it and dynamicly add the folder as a route...
Note: I already know how to create a JSON structure based on SAP EP folders.