We all been there, you just finished developed your shiny application with its 5 spec.xml files and you just can’t wait to see them together on your HANA Cloud Portal site.
we need to deploy the application.
Go to the landscape cockpit, click the new application URL.
Find your spec.xml URL according to its location in your project.
Check its location again on the eclipse IDE.
Go back to the URL together with the XML relative path.
Found it? Great!
Now go to your admin page on HANA cloud Portal. Create a new Generic Widget with the URL you copy-pasted.
Click Done. OK! You did it.
now do it again 4 more times…
No more! 😀
All you need to do for start using the widgets immediately, is to make sure all your spec xml files has a *.spec.xml suffix. That’s it.
Cloud portal will know to create them on deployment, update them on re-deployment and remove them on un-deployment. It’s that simple.
Now you could say, but I will still need to set the title, description and thumbnail after the discovery.. right? Wrong. 😉
On discovery, these values are extracted from the spec.xml and handed to us by the platform.
Here is what you need to set to take advantage of this capability:
<?xml version="1.0" encoding="UTF-8"?> <Module> <!-- as you can see, the title, the optional description and the optional thumbnail are set on the ModulePerfs tag --> <ModulePrefs title="SAPUI5 example" height="250" description="A widget used to manage to-do lists" thumbnail="thumb/SAPUI5photo.jpg"> <Require feature="sap-theme"/> </ModulePrefs> <Content view="authoring, consumption, mobile, preview" href="../index.html"/> </Module>
So what do you think? are you planing to use the widget’s auto-discovery?
UPDATE: it is now possible to set the thumbnail value as a relative path to the application root context URL. on deployment, the full URL will be constructed accordingly.