0

SAPUI5 コントロール ライブラリを実装して SAP ABAP リポジトリにデプロイする方法はほぼ明らかですが、Web-IDE で再利用しようとして完全に迷っています。Web-IDE は、SAP ABAP リポジトリにデプロイされたライブラリを認識しません。確かに、いつでもライブラリ ファイルをすべてのプロジェクトに複製できますが、それは正しい方法ではありません。依存関係パスのさまざまなバリアントを試してみましたが、役に立ちませんでした。

誰も手がかりを持っていますか?

ありがとうございました。

4

2 に答える 2

1

Finally, the problem's been solved. And this is how:

  1. First, in Web IDE I created a separate project for the library

  2. Under the root folder of the project I created another folder named "library" (name can be arbitrary). Under the "library" folder I created folder hierarchy according to the id (or namespace) of the library: suppose you are developing library with the name space "com.your_proud_company_name.controls", in that case you have to create a nested folder hierarchy corresponding to the path "com/your_proud_company_name/controls".

  3. I placed all my library files together with the properly written library.js file into the deepest folder ("controls" in the example)
  4. And now it's time to deploy the new project to the SAP HCP (in the local menu for the project select Deploy -> Deploy to SAP HANA Cloud Platform). When deploying you will be asked for the name of the application. Give an arbitrary name and note it somewhere. We will use it later. Also make note of the version of the deployed application (SAP will provide default number automatically - like 1.0.1)

  5. Now go to your app project where you plan to use this library and open the file neo-app.json

  6. Add the following entry to the "routes" list:

    {

       "path": "/webapp/resources",
       "target": {
           "type": "application",
           "name": "your_deployed_library_application_name", 
           "version": "version_of_your_deployed_library_application",
           "entryPath": "/library"
       },
       "description": "Custom control library"
    

    },

  7. In this "roots" entry "webapp" is the default name of the root folder of the app, if you are using some other name change the "path" value accordingly

  8. "type" value ("application" in our case) is one of the predefined types fo routes and is used for shareable applications.

  9. "name" value is the name of the deployed application (not the name of the project in Web IDE).

  10. "entryPath" value is the root folder in the library project (and application) where the HCP starts searching for library files.

  11. Now you can add the library as a dependency to the manifest.json file of your app project. The entry under "dependencies" should look like this (put your specific value into "minVersion"):

        "com.your_proud_company_name.controls": {
            "minVersion": "1.0.5"
        }
    
于 2016-11-25T15:26:59.157 に答える
0

manifest.json ファイルで依存関係をセットアップしようとしましたか? セットアップを試したことはありませんが、ヒントにすぎません。

"dependencies": {
            "minUI5Version": "1.38.0",
            "libs": {
                "sap.ui.core": {},
                "sap.m": {},
                "sap.ui.layout": {},
                "YOUR_LIB": {}
            }
于 2016-11-22T12:30:42.417 に答える