Today I was tasked with another co-worker to migrate an existent app from Neo to Cloud Foundry. When we migrated the app, we noticed one of the calls to get the info was broken, exactly at this piece of code.
sap.ushell.cpv2.services.cloudServices.SiteService()
And we use the SiteService to get the user roles, as you can see here
var that = this,
localSiteService =
sap.ushell.cpv2.services.cloudServices.SiteService(),
roles = Object.values(
localSiteService.siteModel.getProperty("/roles")
),
userId = sap.ushell.Container.getService("UserInfo")
.getUser()
.getId()
.toUpperCase(),
delegaciones = roles
.filter((rol) => that.isDelegacion(rol))
.reduce(function (result, rol) {
var delegId = rol.identification.id.split("_")[1],
info = rol.identification.title.split("#"),
ids = info[1] ? info[1].split("_") : [],
userIdDefault = userId + "X";
if(ids.find((id) => id === userId)) {
result.push({
// ...
})
// ...
}
})
We suspect that cpv2 is deprecated in Cloud Foundry, since it's value is undefined. But we are kinda lost since we are new to SAPUI5 and, even searching everywhere, we haven't found anything.
We tried looking the documentation to migrate from Neo to Cloud Foundry, and doing some tweaks to the code, with no luck