From 740e99a30601420077e4fffd6698f59761eb37f4 Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Wed, 1 Aug 2018 09:29:34 +0300 Subject: sdc-pubsub maven integration Added pom.xml file and defined maven clean and install stages Change-Id: I31c6997e55bf0d39fd56220a82d1d8ca2f6d5583 Issue-ID: SDC-1540 Signed-off-by: Idan Amit --- .gitignore | 4 +- .npmignore | 5 ++- README.md | 29 +++++++++++---- package.json | 2 +- pom.xml | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++ version.properties | 2 +- 6 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index 48f4a65..e48b1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ node_modules/ **/*.js.map **/*.js !webpack.config.js -npm-debug.log \ No newline at end of file +npm-debug.log +sdc-pubsub.iml +node/ \ No newline at end of file diff --git a/.npmignore b/.npmignore index 5c6c56b..56d2e84 100644 --- a/.npmignore +++ b/.npmignore @@ -10,4 +10,7 @@ version.properties .idea/ .gitignore .npm-debug.log -INFO.yaml \ No newline at end of file +INFO.yaml +sdc-pubsub.iml +node/ +pom.xml \ No newline at end of file diff --git a/README.md b/README.md index 5047828..9572095 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,30 @@ npm install sdc-pubsub ``` ### Loading It Up -#### ES6 +#### CommonJS ```javascript import {PluginPubSub} from 'sdc-pubsub' ``` -#### ES5 +#### Global Variable + +```html + + +``` ```javascript -var pluginPubSub = require('PluginPubSub') +// script.js +var pubsub = window.sdcPubSub.PluginPubSub; ``` ### Usage #### Initialize a pubsub client ```javascript -//eventsClientId= -//parentUrl= -//eventsToWaitFor = [ “CHECK_IN” ] +// eventsClientId = client id to be used by the event bus, received from query params +// parentUrl = event bus location url for communication, received from query params +// eventsToWaitFor = list of events names that the event hub should wait for their completion. +// the client should send an "ACTION_COMPLETED" event to the hub in order to notify the event hub to continue with the flow. +// For example: [ “CHECK_IN” ] var client = new PluginPubSub('eventsClientId, parentUrl, eventsToWaitFor') ``` @@ -38,6 +46,8 @@ client.notify(“READY”) #### Register for an event ```javascript +// When lisetning to event we have to specify the specific event we want to act once it being received. +// eventData.type will hold the event name that was notified by someone else client.on((eventData,event) => { if(eventData.type == ”WINDOW_OUT”) { //do logic @@ -48,7 +58,7 @@ client.on((eventData,event) => { ### Dependencies -* None. +None. ### Tests @@ -61,7 +71,10 @@ None. ### Links -sdc onap wiki [https://wiki.onap.org/x/_TX0](https://wiki.onap.org/x/_TX0) +* SDC onap wiki [https://wiki.onap.org/x/_TX0](https://wiki.onap.org/x/_TX0) +* Generic designer support document [https://wiki.onap.org/display/DW/Generic+Designer+Support](https://wiki.onap.org/display/DW/Generic+Designer+Support) +* Repository [https://gerrit.onap.org/r/gitweb?p=sdc/sdc-pubsub.git;a=summary](https://gerrit.onap.org/r/gitweb?p=sdc/sdc-pubsub.git;a=summary) + ### License diff --git a/package.json b/package.json index 56915c0..58bafb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sdc-pubsub", - "version": "1.0.18", + "version": "1.0.20", "description": "Publish Subscribe library using post message for sdc plugins", "main": "index.js", "author": "Idan Amit", diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5457ca3 --- /dev/null +++ b/pom.xml @@ -0,0 +1,105 @@ + + 4.0.0 + + org.openecomp.sdc + sdc-pubsub + 1.0.20 + pom + SDC Plugin Pubsub + + + https://nexus.onap.org + + + + + + maven-clean-plugin + 3.1.0 + + + clean dist folder and compiled files + clean + + clean + + + + + ${basedir} + + index.d.ts + index.js + index.js.map + + + + ${basedir}/dist + + + ${basedir}/lib + + *.d.ts + *.js + *.js.map + + + + + + + + + com.github.eirslett + frontend-maven-plugin + 1.6 + + ${project.basedir} + + + + install node and npm + + install-node-and-npm + + + v6.9.5 + 3.10.10 + + + + + npm set progress off + + npm + + + set progress=false + + + + + npm install + + npm + + + install + + + + + npm run build + + npm + + + run build + + + + + + + \ No newline at end of file diff --git a/version.properties b/version.properties index 4d6d32e..af317a0 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ major=1 minor=0 -patch=16 +patch=20 base_version=${major}.${minor}.${patch} -- cgit 1.2.3-korg