summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/services
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-03-06 13:52:58 +0200
committerMichael Lando <ml636r@att.com>2018-03-07 06:56:36 +0000
commitf97bae33631c3f5ef06574e9d21620c8dfff8f62 (patch)
tree5d7e2682fd7db6646b5608a417ae7af40a5ebf56 /catalog-ui/src/app/services
parent2064106f298ac9683821e83acbfd87dac8b5b32f (diff)
Add events hub notify calls
Added events hub notify calls. Fixed issues raised by development across the publish subscribe mechanism development Change-Id: I0768bdcb2d89f99634cdb6bc7cb75e20263f5c00 Issue-ID: SDC-1029 Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/services')
-rw-r--r--catalog-ui/src/app/services/components/component-service.ts22
-rw-r--r--catalog-ui/src/app/services/components/resource-service.ts13
-rw-r--r--catalog-ui/src/app/services/components/service-service.ts10
3 files changed, 32 insertions, 13 deletions
diff --git a/catalog-ui/src/app/services/components/component-service.ts b/catalog-ui/src/app/services/components/component-service.ts
index 90ae850899..1b2b9f2fa1 100644
--- a/catalog-ui/src/app/services/components/component-service.ts
+++ b/catalog-ui/src/app/services/components/component-service.ts
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,7 @@ import {ArtifactModel, IFileDownload, InstancesInputsPropertiesMap, InputModel,
import {ComponentInstanceFactory, CommonUtils} from "app/utils";
import {SharingService} from "../sharing-service";
import {ComponentMetadata} from "../../models/component-metadata";
+import {EventBusService} from "../../ng2/services/event-bus.service";
export interface IComponentService {
@@ -79,14 +80,16 @@ export class ComponentService implements IComponentService {
'sdcConfig',
'Sdc.Services.SharingService',
'$q',
- '$base64'
+ '$base64',
+ 'EventBusService'
];
constructor(protected restangular:restangular.IElement,
protected sdcConfig:IAppConfigurtaion,
protected sharingService:SharingService,
protected $q:ng.IQService,
- protected $base64:any
+ protected $base64:any,
+ protected eventBusService:EventBusService
) {
this.restangular.setBaseUrl(sdcConfig.api.root + sdcConfig.api.component_api_root);
@@ -224,6 +227,17 @@ export class ComponentService implements IComponentService {
}, (err)=> {
deferred.reject(err);
});
+
+ // Notifying about events before executing the actual actions
+ switch (state) {
+ case "checkIn":
+ this.eventBusService.notify("CHECK_IN");
+ break;
+ case "submitForTesting":
+ this.eventBusService.notify("SUBMIT_FOR_TESTING");
+ break;
+ }
+
return deferred.promise;
};
diff --git a/catalog-ui/src/app/services/components/resource-service.ts b/catalog-ui/src/app/services/components/resource-service.ts
index 472775e50d..641d7cba48 100644
--- a/catalog-ui/src/app/services/components/resource-service.ts
+++ b/catalog-ui/src/app/services/components/resource-service.ts
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,6 +25,7 @@
import {IComponentService, ComponentService} from "./component-service";
import {PropertyModel, IAppConfigurtaion, Resource, Component} from "../../models";
import {SharingService} from "../sharing-service";
+import {EventBusService} from "../../ng2/services/event-bus.service";
export interface IResourceService extends IComponentService {
updateResourceGroupProperties(uniqueId:string, groupId:string, properties:Array<PropertyModel>):ng.IPromise<Array<PropertyModel>>
@@ -37,16 +38,18 @@ export class ResourceService extends ComponentService implements IResourceServic
'sdcConfig',
'Sdc.Services.SharingService',
'$q',
- '$base64'
+ '$base64',
+ 'EventBusService'
];
constructor(protected restangular:restangular.IElement,
protected sdcConfig:IAppConfigurtaion,
protected sharingService:SharingService,
protected $q:ng.IQService,
- protected $base64:any
+ protected $base64:any,
+ protected eventBusService:EventBusService
) {
- super(restangular, sdcConfig, sharingService, $q, $base64);
+ super(restangular, sdcConfig, sharingService, $q, $base64, eventBusService);
this.restangular = restangular.one("resources");
}
diff --git a/catalog-ui/src/app/services/components/service-service.ts b/catalog-ui/src/app/services/components/service-service.ts
index f92f5699dc..4229c4aa2a 100644
--- a/catalog-ui/src/app/services/components/service-service.ts
+++ b/catalog-ui/src/app/services/components/service-service.ts
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,6 +25,7 @@
import {IComponentService, ComponentService} from "./component-service";
import {Distribution, DistributionComponent, Service, PropertyModel, Component, IAppConfigurtaion} from "app/models";
import {SharingService} from "../sharing-service";
+import {EventBusService} from "../../ng2/services/event-bus.service";
export interface IServiceService extends IComponentService {
getDistributionsList(uuid:string):ng.IPromise<Array<Distribution>>;
@@ -49,8 +50,9 @@ export class ServiceService extends ComponentService implements IServiceService
protected sdcConfig:IAppConfigurtaion,
protected sharingService:SharingService,
protected $q:ng.IQService,
- protected $base64:any) {
- super(restangular, sdcConfig, sharingService, $q, $base64);
+ protected $base64:any,
+ protected eventBusService:EventBusService) {
+ super(restangular, sdcConfig, sharingService, $q, $base64, eventBusService);
this.restangular = restangular.one("services");
}
sed to deploy certified assets. From the Distribution studio, new Product assets, including their underlying Resources and Services, are deployed into lab environments for testing purposes, and into production after certification is complete. In a future release, there will be a way to export Product information to external Business Support Systems for customer ordering and billing. ## Git Configuration Before cloning the sdc source code it's important to enable long paths on your windows machine, otherwise git won't be able to handle with some files In order to do so just add this section to your global git.config file under the `[core]` key: longpaths = true ## Compiling the Project SDC is built from several projects, while "sdc-main" contains the main pom.xml for all project: - asdctool - set of utilities used for scheme creation and data migration in SDC - catalog-be - backend code - catalog-fe - frontend java code (servlet, proxy) - catalog-dao - database layer - catalog-model - data model of the application - catalog-ui - front end code (javascript, html, css) - common - set of utilities used by the onboarding project - common-app-api - common code for frontend and backend - common-be - utilities, datatypes and enums - security-utils - handle encryption/decryption of passwords - onboarding-be - onboarding backend code - onboarding-ui - onboarding frontend code - test-apis-ci - the automation framework used by SDC for API based testing - ui-ci - the automation framework used by SDC for UI based testing, Based on selenium - sdc-os-chef - chefs scripts used for docker creation and startup - utils - set of dev utils used for working with the project locally In order to build all the projects, go to sdc-main project and run the command: `mvn clean install` Currently SDC build process also supports docker building. In order to build and upload local dockers to a local environment you'll need to define an environment variable on your machine with key: `DOCKER_HOST` and value: `tcp://<ip_address>:2375` For the dockers to be built during the build process use the "docker" profile by adding this: `-P docker` to the `mvn clean install` command More flags to use in the build process are: * -DskipTests - Skips unit tests execution * -DskipUICleanup=true - Skips deleting the UI folders * -Djacoco.skip=true - Skips running jacoco tests * -DskipPMD - Skips creating a PMD report **using those flags will speed up the building process of the project** ## Accessing SDC In order to access the sdc from you're local vagrant environment you'll need to run the webseal_simulator docker. This can be achieved by using the command: `/data/scripts/simulator_docker_run.sh` to Access the simulator just go to this url: `http://<ip_address>:8285/login` For more information regarding using the webseal_simulator please refer to the following guide: [SDC Simulator](https://wiki.onap.org/display/DW/SDC+Simulator) ## Accessing SDC UI in Dev Mode In order ro access the SDC UI from your dev environment you need to couple of things: 1. First got to the file `webpack.server.js` found under the catalog-ui folder in the main sdc project and update the "localhost" variable to be the ip of your local vagrant machine. 2. Now navigate to the catalog-ui folder and run the command: `npm start -- --env.role <wanted_role>` with stating the wanted role to login to SDC as. ## SDC Containers The following table shows the SDC containers found on the vagrant after a successful build: | Name | Description | |---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | sdc-cs | The Docker contains our Cassandra server. On docker startup the Cassandra server is started. | | sdc-cs-init | The docker contains the logic for creating the needed schemas for SDC catalog server, On docker startup, the schemes are created. | | sdc-cs-onboard-init | The docker contains the logic for creating the needed schemas for SDC onboarding server, On docker startup, the schemes are created. | | sdc-es | The Docker contains Elastic Search server. On docker startup, Elastic Search server is started. | | sdc-init-es | The Docker contains the logic for creating the needed mapping for SDC and the views for kibana. On docker startup, the mapping is created. | | sdc-onboard-BE | The Docker contains the onboarding Backend Jetty server. On docker startup, the Jetty server is started with the application. | | sdc-BE | The Docker contains the catalog Backend Jetty server. On docker startup, the Jetty server is started with the application. | | sdc-BE-init | The docker contains the logic for importing the SDC Tosca normative types and the logic for configuring external users for SDC external api's.| | | on start up, the docker executes the rest calls to the catalog server. | | sdc-FE | The Docker contains the SDC Fronted Jetty server. On docker startup, the Jetty server is started with our application. | For further information and an image explaining the containers dependency map please refer to the following page: [SDC Docker Diagram](https://wiki.onap.org/display/DW/SDC+Troubleshooting) ## Testing the Project When building SDC dockers part of the dockers that will be built are the dockers that responsible for running automation tests in the local environment. In order to run the automation tests when starting the dockers on the machine there are 2 falgs to use: * -tad - Use this flag to run the default suite of API tests * -tud - Use this flag to run the default suite of UI tests You can go to this link to view all the commands in the vagrant-onap: [Vagrant Common Commands](https://wiki.onap.org/display/DW/SDC+Vagrant+Common+Commands) And to this guide regarding using the docker run script: [SDC docker_run Script Usage](https://wiki.onap.org/display/DW/SDC+docker_run+Script+Usage) For more information regarding testing the project please refer to the following guide: [SDC Sanity](https://wiki.onap.org/display/DW/SDC+Sanity) ## SDC on OOM For more information regarding SDC on OOM please refer to the following page: [SDC on OOM](https://wiki.onap.org/display/DW/SDC+on+OOM) ## Frontend Local Env - onboarding ### Steps: Install nodejs & gulp 1. download nodejs from here: https://nodejs.org/en/ (take the "current" version with latest features) & install it. 2. install gulp by running the following command: npm install --global gulp-cli ### Install DOX-UI a: 1. pull for latest changes 2. go to folder dox-sequence-diagram-ui 3. run npm install 4. wait for it... 5. go to folder dox-ui 6. run npm install 7. create a copy of devConfig.defaults.json file and name it devConfig.json (we already configured git to ignore it so it will not be pushed) 8. in that file, populate the fields of the IP addresses of your BE machine you'd like to connect (pay attention, it is a JSON file): For example http://<host>:<port> 9. after everything was successful, run gulp 10. after server was up, your favorite UI will wait for you at: http://localhost:9000/sdc1/proxy-designer1#/onboardVendor ### Troubleshooting: | Problem | Why is this happening | Solution | |-------------------------------|-------------------------|--------------------------------------------------------------------------------------------| | npm cannot reach destination | onboarding proxy | When within onboarding network, you should set onboarding proxy to NPM as the following: | | | | npm config set proxy http://genproxy:8080 | | | | npm config set https-proxy http://genproxy:8080 | | | | | | git protocol is blocked | onboarding network | When within onboarding network, you should set globally that when git | | and cannot connect | rules for protocols | protocol is used, then it will be replaced with "https" | | | | git config --global url."https://".insteadOf git:// | -------------------------------------------------------------------------------------------------------------------------------------------------------- ## SDC Troubleshooting In order to check the life state of SDC you can run the command `health` from inside the vagrant. Alternatively you can run the following commands to check the FE and BE status: FE - `curl http://<ip_address>:8181/sdc1/rest/healthCheck` BE - `curl http://<ip_address>:8080/sdc2/rest/healthCheck` Another method to check about problems in SDC in be looking in the log files. The log files of the SDC can be found in the `/data/logs` folder The docker logs are found under the directory `/docker_logs`. The jetty(Applicative) are found in the respective folder according to the wanted section For Example, the BE logs will found under the directory `/BE`. For more information regarding SDC Troubleshooting please refer to the following guide: [SDC Troubleshooting](https://wiki.onap.org/display/DW/SDC+Troubleshooting) ## Getting Help ##### [Mailing list](mailto:onap-sdc@lists.onap.org) ##### [JIRA](http://jira.onap.org) ##### [WIKI](https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal)