SAP-samples / btp-cap-multitenant-saas

Sample project that demonstrates how to setup a multitenant application for a Software-as-a-Service scenario, leveraging the Kyma and Cloud Foundry Runtimes of the SAP Business Technology Platform. Developers learn how to implement their own CAP (mtxs) based SaaS app including an SaaS API and integration with various essential SAP BTP service of...
Apache License 2.0
95 stars 43 forks source link

Integrate apps in SAP Build Work Zone #25

Closed thisisevanfox closed 9 months ago

thisisevanfox commented 9 months ago

Hi,

Thank you for this nice step-to-step guide! I successfully deployed the application to my trial account. Now I have the use-case that I want to integrate the apps into an SAP Build WorkZone launchpad. But so far I haven't found a nice way to do this.

So my tenant subaccount looks like this: image

I created a destination in the tenant subaccount pointing to the Sandbox launchpad of the SusaaS application:

URL=https\://mytenant-susaas-dev.cfapps.us10-001.hana.ondemand.com/sapsusaasuipublicflp
Name=my-susaas-launchpad
ProxyType=Internet
Type=HTTP
Authentication=NoAuthentication

In the Content Manager I added the app as following and added it to the launchpad: image

When launching the application over the Work Zone service, but I have a duplicate shell header (which is logical for me): image

It would be possible to hide the header by adding the following code to the application:

sap.ushell.Container.getRenderer("fiori2").setHeaderVisibility(false);

In my opinion, however, this is not a viable option in this case because the shell header would also disappear if I opened the app via the sandbox launchpad.

Is there a way to integrate the apps in the SAP Build Work Zone in a nice way? I am aware that I could provide the apps as a content provider, but that is not an option in this case, as deployment via the portal service is deprecated and it no longer works via the launchpad/work zone service as it used to with the portal service.

Kind regards, Johannes

thisisevanfox commented 9 months ago

I have found a way to access the app via Work Zone, but I am unsure whether this is the way to go.

First, I changed the destination as following:

URL=https\://mytenant-susaas-dev.cfapps.us10-001.hana.ondemand.com/
Name=my-susaas-launchpad
ProxyType=Internet
Type=HTTP
Authentication=NoAuthentication

I also changed the integration of the app in the Content Manager: image

The sapsusaasuiadminusers is the app id in the html5 repository.

Reference: Run Your Deployed HTML5 Application

alperdedeoglu commented 9 months ago

Hi @thisisevanfox,

Can you remove the mock launchpad and try integrating again? Could it be the case that shell is two times rendered because you are using already mock launchpad and actual launchpad somehow? Please note that you need to update also relevant routes in approuter.

thisisevanfox commented 9 months ago

Hi @alperdedeoglu, I think we hit the Comment button at the same time :D

First, as you suspected, I linked to the mocked launchpad and that resulted in a duplicate shell header. Now I linked directly to the HTML5 app from the deployed HTML5 repository (CLI command: cf html5-list) and now it seems to work (see here). But I am not sure if this is the recommended way of SAP to include multitenant SaaS applications in a Build Work Zone.

alperdedeoglu commented 9 months ago

Hi @thisisevanfox, Yes, indeed we pressed simultaneously. What you did is the only way personally I can recommend from my knowledge. It is easier to maintain and I am not aware of any SAP offficial statement about the topic. (Build Workzone Multitenancy is a long living discussion)

There are of course some workarounds out there, but IMHO, they are not future-proof. So embbeding the URL is the way to go at the moment from my POV. When we have a better solution in the future about this topic, I would love to implement and document it for our community then people can make use of it.

thisisevanfox commented 9 months ago

Hi @alperdedeoglu, thanks for confirming my approach.

I'm unsure if I have to do some exploration in the topic of "content federation" like it is done for integrating S4/HANA apps in Build Work Zone (described here). Here I'm accessing the /sap/bc/ui2/cdm3/entities endpoint on the S4 system to retrieve the catalog of available applications.

I am wondering, if I could add the Susaas applications as a Content Provider in the Channel Manager somehow: image

Steps on this path could be:

  1. Move the content of the fioriSandboxConfig.js in a seperate CommonDataModel.json file (because the difference to a generated "CommonDataModel.json" is not too big)
  2. Make this file accessible via the approuter
  3. Add a design-time destination in the consumer subaccount pointing to the exposed CommonDataModel.json file
  4. Add a runtime destination in the consumer subaccount pointing to the approuter (or maybe to the srv application?)
  5. Add the new content provider (which now retrieves the 5 UI5 Apps from the repository)

Do you have any idea whether this can work or can I save myself the effort from the outset?

gregorwolf commented 9 months ago

Hi @thisisevanfox ,

the current unfortunately completely undocumented and I would guess also unsupported solution is the development of a Launchpad Module using:

      service: build-workzone-advanced
      service-plan: standard

instead of the documented but not anymore available:

    service: portal
    service-plan: standard

You can check my sample at mta.yaml#L142. I've deployed this in my BTP Free tier and despite the service name build-workzone-advanced I have not payed anything for the service. In Build Work Zone Standard (which must be subscribed in the subscriber subaccount) the content can be embedded following: Launchpad Modules Content Providers.

Best Regards Gregor

thisisevanfox commented 9 months ago

Hi @gregorwolf,

thanks for your suggested solution. However, as it seems that this is not an official way, I am now integrating the apps as described here and will monitor the further development of the Work Zone so that it may support multitenancy in the future. If I understand it correctly, this influencing request is aimed precisely at this issue.

Kinds regards Johannes