包详细信息

grunt-nwabap-ui5uploader

pfefferf4.1kApache-2.02.2.0

UI5 source upload to SAP NetWeaver ABAP

gruntplugin, SAP NetWeaver ABAP, UI5 Repository, SAPUI5

自述文件

npm version

grunt-nwabap-ui5uploader

'grunt-nwabap-ui5uploader' is a Grunt Plugin which allows a developer to deploy SAPUI5/OpenUI5 sources to a SAP NetWeaver ABAP system as part of the Grunt task chain.

Starting from version 2.0.0 this deployer uses the OData Service /UI5/ABAP_RESPOSITORY_SRV for deploying UI5 sources. Please make sure that the service is activated on your system (for details you can check SAP note 2999557). The new service does some sanity checks like e.g. virus scans. If you have not configured virus scan profiles or want to disable virus scanning please have a look to SAP note 2437892.
Current deployer versions starting from version 2.0.0 can be used with SAP systems on which component SAP_UI 753 is installed. On systems with a lower version of component SAP_UI, you have to use version 1.x.x of this deployer.

Some further information can be found in the SAP Community.

Getting Started

Installation and Pre-Conditions

Grunt

This plugin requires Grunt 1.0.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you are familiar with that process, you may install this plugin with this command:

npm install grunt-nwabap-ui5uploader --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-nwabap-ui5uploader');

ABAP Development Tool Services

The ABAP Development Tool Services have to be activated on the SAP NetWeaver ABAP System (transaction SICF, path /sap/bc/adt). The user used for uploading the sources needs to have the authorization to use the ADT Services and to create/modify BSP applications. The plugin is tested with NW 7.40 and NW 7.5x systems.

Task "nwabap_ui5uploader"

Overview

In your project's Gruntfile, add a section named nwabap_ui5uploader to the data object passed into grunt.initConfig().

grunt.initConfig({
  nwabap_ui5uploader: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  }
});

Options

options.conn.server

Type: String

Defines SAP NetWeaver ABAP server (for instance 'http://myserver:8000').

options.conn.client

Type: String

Optional parameter to specify the client (transferred as sap-client URL parameter). In case the option is not specified the default client is used if specified.

options.conn.useStrictSSL

Type: Boolean Default: true

SSL mode handling. In case of self signed certificates the useStrictSSL mode option can be set to false to allow an upload of files.

options.conn.proxy

Type: String

Optional parameter to specify proxy used for communication with SAP NetWeaver ABAP server (for instance 'http://myproxyhost:3128').

options.conn.testMode

Type: Boolean Default: false

Optional parameter to define if upload is done in test mode or not.

options.conn.customQueryParams

Type: Object

Optional parameter with key/value pairs of custom parameters which are added to the call to the SAP NetWeaver ABAP server. For instance:

customQueryParams: {
  myCustomParameter1: 'myCustomValue1',
  myCustomParameter2: 'myCustomValue2'
}

options.auth.user

Type: String

Defines the user which is used for access to the SAP NetWeaver ABAP server. It is not recommended to store the user in the Grunt file. It should be passed as argument.

options.auth.pwd

Type: String

Defines the users password for access to the SAP NetWeaver ABAP server. It is not recommended to store the password in the Grunt file. It should be passed as argument. Do also not store the password as not masked value in a CI server environment. Use plugins to create masked variables (for instance the 'Mask Passwords Plugin' for Jenkins).

options.ui5.language

Type: String Default: EN

Defines the objects original language.

options.ui5.package

Type: String

Defines the development package in which the BSP container for the UI5 sources is available or should be created.

options.ui5.bspcontainer

Type: String

Defines the name of the BSP container used for the storage of the UI5 sources. Length is restricted to 15 characters (exclusive customer specific namespaces, e.g. /YYY/).

options.ui5.bspcontainer_text

Type: String

Defines the description of the BSP container.

options.ui5.transportno

Type: String Optional in case options.ui5.package is set to '$TMP'.

Defines the transport number which logs the changes. For the transport number it would also make sense to pass it via an argument.

options.ui5.create_transport

Type: Boolean Default: false

Set this option to true in case a new transport should be created each time the application is uploaded.

options.ui5.transport_text

Type: String

Optional in case options.ui5.create_transport is set to false.

Text for the new transport to be created.

options.ui5.transport_use_user_match

Type: Boolean Default: false

Optional, if set to true, it will be tried to find a transport request of the given user. If no transport is found and create_transport is enabled a new one will be created and used for further file uploads.

options.ui5.transport_use_locked

Type: Boolean Default: false

Optional, if set to true and a file upload failed due the BSP application is locked in another transport, the old (original one) one will be used to upload the files.

options.resources.cwd

Type: String

Defines the base folder which contains the sources (for instance 'build'). It should be avoided to use everything from the webapp folder, because some directories in it should not be packaged and uploaded into a BSP application. To create a build, use another grunt task to copy the relevant files to the build folder. In addition for instance you can use the openui5_preload task from the grunt-openui5 plugin to create a component preload file.

options.resources.src

Type: String or array of String

Defines files for upload.

Usage Examples

Upload to '$TMP' package

var sUser = grunt.option('user');
var sPwd = grunt.option('pwd');

grunt.initConfig({
  nwabap_ui5uploader: {
    options: {
      conn: {
        server: 'http://myserver:8000',
      },
      auth: {
        user: sUser,
        pwd: sPwd
      }
    },
    upload_build: {
      options: {
        ui5: {
           package: '$TMP',
           bspcontainer: 'ZZ_UI5_LOCAL',
           bspcontainer_text: 'UI5 upload local objects'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    }
  }
});

Upload to a transport tracked package

var sUser = grunt.option('user');
var sPwd = grunt.option('pwd');

grunt.initConfig({
  nwabap_ui5uploader: {
    options: {
      conn: {
        server: 'http://myserver:8000',
      },
      auth: {
        user: sUser,
        pwd: sPwd
      }
    },
    upload_build: {
      options: {
        ui5: {
           package: 'ZZ_UI5_REPO',
           bspcontainer: 'ZZ_UI5_TRACKED',
           bspcontainer_text: 'UI5 upload',
           transportno: 'DEVK900000'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    }
  }
});

Upload to a transport tracked package, creating a new transport for each upload

var sUser = grunt.option('user');
var sPwd = grunt.option('pwd');

grunt.initConfig({
  nwabap_ui5uploader: {
    options: {
      conn: {
        server: 'http://myserver:8000',
      },
      auth: {
        user: sUser,
        pwd: sPwd
      }
    },
    upload_build: {
      options: {
        ui5: {
           package: 'ZZ_UI5_REPO',
           bspcontainer: 'ZZ_UI5_TRACKED',
           bspcontainer_text: 'UI5 upload',
           create_transport: true,
           transport_text: 'Transport for ZZ_UI5_TRACKED container'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    }
  }
});

Upload to different servers

var sUser = grunt.option('user');
var sPwd = grunt.option('pwd');

grunt.initConfig({
  nwabap_ui5uploader: {
    upload_build_740: {
      options: {
        conn: {
          server: 'http://myserver740:8000',
        },
        auth: {
          user: sUser,
          pwd: sPwd
        },      
        ui5: {
           package: 'ZZ_UI5_REPO',
           bspcontainer: 'ZZ_UI5_TRACKED',
           bspcontainer_text: 'UI5 upload',
           transportno: 'DEVK900000'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    },
    upload_build_750: {
      options: {
        conn: {
          server: 'http://myserver750:8000',
        },
        auth: {
          user: sUser,
          pwd: sPwd
        },      
        ui5: {
           package: 'ZZ_UI5_REPO',
           bspcontainer: 'ZZ_UI5_TRACKED',
           bspcontainer_text: 'UI5 upload',
           transportno: 'DEVK900000'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    }    
  }
});

Create and reuse a transport request

var sUser = grunt.option('user');
var sPwd = grunt.option('pwd');

grunt.initConfig({
  nwabap_ui5uploader: {
    options: {
      conn: {
        server: 'http://myserver:8000',
      },
      auth: {
        user: sUser,
        pwd: sPwd
      }
    },
    upload_build: {
      options: {
        ui5: {
           package: 'ZZ_UI5_REPO',
           bspcontainer: 'ZZ_UI5_TRACKED',
           bspcontainer_text: 'UI5 upload',
           create_transport: true,
           transport_use_user_match: true,
           transport_text: 'Transport for ZZ_UI5_TRACKED container'
        },
        resources: {
          cwd: 'build-folder',
          src: '**/*.*'
        }
      }
    }
  }
});

Release History

CHANGELOG.md

License

Apache License 2.0

更新日志

2.2.0 (2023-11-16)

Fixes

  • Do grunt.fail.warn to raise exit code.

2.1.0 (2021-07-21)

Features

  • New option testMode for deployment execution in test mode.

2.0.0 (2021-06-18)

Features

  • Usage of /UI5/ABAP_REPOSITORY_SRV service for deployment instead of Team Provider API.
    Team Provider API was set to deprecated. As a consequence starting from version 2.0.0 this deployer supports only systems with at least SAP_UI 753 component installed.
    For all previous versions, version 1.x.x of this deployer needs to be used.

1.0.7 (2020-09-25)

Feature

  • Support of options.conn.customQueryParams configuration option to be able to transfer custom parameters to the backend (for instance to bypass SAML2 or SPNEGO authentication).

1.0.6 (2020-04-27)

General

  • Update dependency for ui5-nwabap-deployer-core package to v1.0.6 + setting for automatic update of ui5-nwabap-deployer-core package.

1.0.5 (2020-04-15)

General

  • Update dependency for ui5-nwabap-deployer-core package to v1.0.5.

1.0.4 (2020-03-17)

General

  • Update dependency for ui5-nwabap-deployer-core package to v1.0.4.

1.0.3 (2020-03-11)

General

  • Update dependency for ui5-nwabap-deployer-core package to v1.0.3.

1.0.2 (2020-01-24)

Fixes

  • Update depedency to ui5-nwabap-deployer-core to fix an issue regarding upload of files with special characters in their name.

1.0.1 (2019-12-20)

General

  • Update dependency for ui5-nwabap-deployer-core package to v1.0.2.

1.0.0 (2019-11-24)

General

  • Usage of ui5-nwabap-deployer-core package.

0.3.4 (2019-05-16)

Features

  • In case the creation of a transport request is required via option options.ui5.create_transport, the number of the created transport request is logged in form "Creation of transport request required. Number of created transport request: \<created transport request number\>".

0.3.3 (2019-01-14)

Fixes

  • Fixed issue regarding response status code check (thanks to BurnerPat).

0.3.2 (2019-01-03)

General

  • More detailed information in case an ADT API call fails (expected HTTP Status Code, actual HTTP Status Code, response body).

0.3.1 (2018-11-26)

Fixes

  • Fixed issue in check if a transport for the user exists.

0.3.0 (2018-11-19)

General

  • Replaced unirest library by request library, because of a better maintenance support.
  • Removal of duplicated code.
  • Support for Node versions < 5.0.0 skipped.

0.2.10 (2018-09-07)

Features

  • Option options.conn.proxy added to specify a proxy for SAP NetWeaver ABAP server communcation (thanks to anomistu).

0.2.9 (2018-06-01)

Fixes

  • Removal of ISO-8859-1 to avoid side issues when project is edited in different editors.

0.2.8 (2018-05-02)

Fixes

  • Fixed issue that "properties" files were uploaded with UTF-8 charset instead of ISO-8859-1 charset (thanks to stockbal).

0.2.7 (2018-04-06)

Fixes

  • Fixed issues for `transport_use_user_match' option (thanks to stockbal).

0.2.6 (2018-04-05)

Fixes

  • Fixed issues for create_transport option (thanks to stockbal).

0.2.5 (2018-03-22)

Fixes

  • Increased the backoff reconnect time interval.

0.2.4 (2018-03-22)

Features

  • Reconnect if request was aborted due to a syscall error.

0.2.3 (2018-03-13)

Fixes

  • In case of using the parameter to use a locked transport, an error occurred if no response body was available when the check was done for a locked transport.

0.2.2 (2018-02-27)

General

  • NPM package dependencies updated.

Features

  • Options options.ui5.transport_use_user_match and options.ui5.transport_use_locked added for specific cases. These options allow to reuse an existing not released transport for a user or the usage of a not released transport by which the UI5 application BSP container is locked. Thanks to @mxschmitt for adding these options.

0.2.1 (2018-01-23)

Features

  • Option options.ui5.create_transport and options.ui5.transport_text added to be able to create a new transport for each upload. Thanks to @themasch for adding that feature.

0.2.0 (2017-05-29)

General

  • Grunt dependency updated to 1.0.1, to avoid security vulnerabilities of 0.4.5.

0.1.19 (2017-02-10)

General

  • Adjustment of copyright information (year).
  • Now also tested with NW ABAP 7.51.

0.1.18 (2016-12-14)

Fixes

  • Application index was recalculated independent of option setting.

0.1.17 (2016-12-12)

Fixes

  • Error forwarding in case CSRF Token determination fails.

0.1.16 (2016-11-18)

General

  • Switched from JSHint to ESLint linting.
  • Support for Node versions < 4.0.0 skipped.
  • Logging changed to an "immediate" logging. Folder/File actions are displayed immediately instead of collecting them.
  • Slashes at the end of a defined server URL are ignored.

0.1.15 (2016-10-25)

General

  • Code simplification regarding sap-language parameter.

0.1.14 (2016-10-21)

Fixes

  • BSP container length check excludes customer specific namespaces.
  • Deletion requests are fired with sap-language parameter.

0.1.13 (2016-09-30)

General

  • Readme update.

0.1.12 (2016-09-28)

General

  • Update dependency to Unirest 0.5.1

Fixes

  • Client parameter handling

0.1.11 (2016-09-27)

General

  • Added Travis CI support.

0.1.10 (2016-08-04)

Fixes

  • Crash caused by empty files fixed.

0.1.9 (2016-08-01)

Features

  • Option options.conn.client added to be able to specify a SAP client (in case no default client is maintained in system).

0.1.8 (2016-07-25)

Features

  • Option options.ui5.calc_appindex steers if the SAPUI5 application index is recalculated (program /UI5/APP_INDEX_CALCULATE). Thanks to @olirogers for adding this feature.

0.1.7 (2016-06-17)

Fixes

  • Ensure ES 5.1 compatibility.

0.1.6 (2016-06-13)

Fixes

  • Namespace handling for file comparison.

0.1.5 (2016-06-13)

Features

  • Option options.conn.useStrictSSL steers if a strict SSL mode check has to be executed. In case of self signed certificates it can be set to false to allow an upload of files.

Fixes

  • Correct encoding of namespaces for file upload.

0.1.4 (2016-06-08)

Features

  • Option options.ui5.language introduced to be able to specify objects original language (e.g. for BSP Container).

0.1.3 (2016-04-01)

General

  • Readme update.

0.1.2 (2016-03-30)

General

  • Minor issues.

0.1.1 (2016-03-25)

General

  • Readme update.

0.1.0 (2016-03-25)

General

  • Initial release.