This is the continuation of the blog started here.
In this second part we are going to see how to create a new SAP Web IDE template after having already created our feature in the previous part.
Let's continue then with the other steps:
08 - Create a third plugin for extending an existing template
09 - Extend the existing SAPUI5 Application template
10 - Make some changes and test the template
11 - Deploy the feature again to SAP HANA Cloud platform
A plugin structure needs to be created even in the case you want to extend an existing template.
1 - Open SAP Web IDE.
2 - Right click on the client folder in the current feature project and select New --> SAP Web IDE Plugin
3 - Enter a name for this new plugin and a short description. DO NOT select to include the sample implementation code
4 - Click Finish
5 - This is the current project's structure
Let's now extend the existing SAPUI5 application template.
1 - Right click on the "pluginfortemplate" plugin and choose Template from Existing Template
2 - Enter a name for the new template and a description. Let's keep the type as "project". Choose to create a new category and enter the name and the description for this new category: this is the group where the new template will be included. Then click Next
3 - Select the SAPUI5 Application template and click Next
4 - Click Finish
5 - This is the current project's structure
Let’s make some easy changes to the template so that we can see that we can really change it according to our requirements. We will:
1 - Right click on the image subfolder under the "pluginfortemplate" folder and choose Import --> From File System
2 - Let's select a new image named "flower.png" (you can download one from the web) and import it by clicking on OK
3 - You can delete the old image by right clicking on it and choosing Delete
4 - Let's add the following dependencies to the service information located in the plugin.json file under the template plugin; change the name of the image loaded when the template is executed to be "flower.png". Then save the file
"filesystem.documentProvider",
"projectType",
"setting.project",
"basicSAPUI5ApplicationProjectTemplateService"
5 - Open the model.json file under the "mycooltemplate" folder and change the name of the first view from View1 to Main. Then save the file
6 - Right click on the plugin.json file and choose Run - Run as Plugin to test the plugin. A new Debug-Mode browser page opens
7 - Choose File --> New --> Project from Template
8 - Select "mycoolcategory" from the top dropdown list and the new template should be available. If you move forward in the wizard process you should be also able to see that the default view name is now "Main"
9 - You have successfully extended the SAPUI5 Application template. Please close the Debug-Mode tab of your browser
If we want to use our new template from the release mode of SAP Web IDE (not the one in Debug-Mode), we need to re-deploy our feature to SAP HANA Cloud platform.
1 - First of all, let's temporarily disable our feature: click on the Settings button and go in Plugins. Then disable the new feature and click on Save
2 - You will be requested to refresh your browser. Click on OK to accept this request
3 - Right click on the feature project and choose Deploy --> Deploy to SAP HANA Cloud Platform
4 - Select Update an existing application and click on Deploy. The existing SAP HANA Cloud application will be updated and a new version will be activated automatically
5 - Click on Close
6 - Let's activate again our feature
7 - Refresh again SAP Web IDE
8 - You should be able now to see your new template even in the release mode of your SAP Web IDE
9 - Congratulations! You have successfully extended an existing template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
14 | |
13 | |
12 | |
12 | |
8 | |
8 | |
7 | |
7 | |
5 |