[UI] Support data registration 36/1636/2
authorIoakeim Samaras <ioakeim.samaras@ericsson.com>
Fri, 20 Sep 2019 14:26:55 +0000 (17:26 +0300)
committerIoakeim Samaras <ioakeim.samaras@ericsson.com>
Fri, 20 Sep 2019 17:57:40 +0000 (20:57 +0300)
Data regarding available labs, blueprints, versions,
layers is created/deleted/updated by the UI users
using user-friendly views.

JIRA: VAL-44

Signed-off-by: Ioakeim Samaras <ioakeim.samaras@ericsson.com>
Change-Id: Ic69e5bf9c150e51cc6d83b7ed5124632075943eb

112 files changed:
.coafile
ui/CHANGELOG.md
ui/README.rst
ui/db-scripts/EcompSdkDMLMySql_2_4_OS.sql
ui/db-scripts/akraino_blueprint_validation_db.sql
ui/db-scripts/examples/initialize_db_example.sql
ui/pom.xml
ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java
ui/src/main/java/org/akraino/validation/ui/conf/ValidationTestResultsGetter.java
ui/src/main/java/org/akraino/validation/ui/controller/BlueprintController.java
ui/src/main/java/org/akraino/validation/ui/controller/BlueprintInstanceController.java
ui/src/main/java/org/akraino/validation/ui/controller/BlueprintLayerController.java [new file with mode: 0644]
ui/src/main/java/org/akraino/validation/ui/controller/LabController.java
ui/src/main/java/org/akraino/validation/ui/controller/ModelsViewsController.java
ui/src/main/java/org/akraino/validation/ui/controller/ResultController.java
ui/src/main/java/org/akraino/validation/ui/controller/TimeslotController.java [moved from ui/src/main/java/org/akraino/validation/ui/controller/TimeslotsController.java with 56% similarity]
ui/src/main/java/org/akraino/validation/ui/entity/BlueprintInstance.java
ui/src/main/java/org/akraino/validation/ui/entity/Timeslot.java
ui/src/main/java/org/akraino/validation/ui/service/BlueprintInstanceService.java [deleted file]
ui/src/main/java/org/akraino/validation/ui/service/BlueprintLayerService.java [deleted file]
ui/src/main/java/org/akraino/validation/ui/service/BlueprintService.java [deleted file]
ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java [moved from ui/src/main/java/org/akraino/validation/ui/service/DbResultAdapter.java with 71% similarity]
ui/src/main/java/org/akraino/validation/ui/service/DbSubmissionAdapter.java
ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java
ui/src/main/java/org/akraino/validation/ui/service/JenkinsJobNotificationService.java
ui/src/main/java/org/akraino/validation/ui/service/LabService.java [deleted file]
ui/src/main/java/org/akraino/validation/ui/service/TimeslotService.java [deleted file]
ui/src/main/webapp/WEB-INF/defs/definitions.xml
ui/src/main/webapp/app/BluvalUI/App.Services.js
ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetBlueprints/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLabs/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetLayers/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/GetTimeslots/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/ModifyLab/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/NewSubmission/NewSubmissionController.js
ui/src/main/webapp/app/BluvalUI/NewSubmission/NewSubmissionTemplate.html
ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLab/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterLayer/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLab/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/Route.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.html [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerController.js [new file with mode: 0644]
ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerTemplate.html [new file with mode: 0644]
ui/src/main/webapp/app/fusion/scripts/DS2-view-models/welcome-content.html

index 739b21f..39d09fa 100644 (file)
--- a/.coafile
+++ b/.coafile
@@ -55,12 +55,13 @@ ignore = ui/target/**,
     ui/src/main/java/org/akraino/validation/ui/filter/SecurityXssFilter.java,
     ui/src/main/java/org/akraino/validation/ui/client/jenkins/resources/**.java,
     ui/src/main/java/org/akraino/validation/ui/client/nexus/resources/**.java,
-    ui/src/main/java/org/akraino/validation/ui/service/DbResultAdapter.java,
+    ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java,
     ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java,
     ui/src/main/java/org/akraino/validation/ui/daoimpl/ValidationTestResultDAOImpl.java,
     ui/src/main/java/org/akraino/validation/ui/entity/ValidationDbTestResult.java,
     ui/src/main/java/org/akraino/validation/ui/entity/WRobotDbTestResult.java,
-    ui/src/main/java/org/akraino/validation/ui/entity/Submission.java
+    ui/src/main/java/org/akraino/validation/ui/entity/Submission.java,
+    ui/src/main/java/org/akraino/validation/ui/controller/ModelsViewsController.java
 
 [all.JS]
 bears = ESLintBear,JSComplexityBear
@@ -74,9 +75,24 @@ ignore = ui/src/main/webapp/app/fusion/**,
     ui/target/**,
     ui/src/main/webapp/app/BluvalUI/NewSubmission/NewSubmission.js,
     ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.js,
-    ui/src/main/webapp/app/BluvalUI/GetBySubmissionId/GetBySubmissionId.js,
     ui/src/main/webapp/app/BluvalUI/GetMostRecent/GetMostRecent.js,
     ui/src/main/webapp/app/BluvalUI/GetLastRun/GetLastRun.js,
     ui/src/main/webapp/app/BluvalUI/GetByTimestamp/GetByTimestamp.js,
     ui/src/main/webapp/app/BluvalUI/GetBasedOnDate/GetBasedOnDate.js,
-    ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.js
+    ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.js,
+    ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.js,
+    ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.js,
+    ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.js,
+    ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.js,
+    ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.js,
+    ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.js,
+    ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.js,
+    ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.js,
+    ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.js,
+    ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.js,
+    ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.js,
+    ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.js,
+    ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.js,
+    ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.js,
+    ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.js,
+    ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.js
index 16e6352..75cde42 100644 (file)
@@ -164,3 +164,12 @@ All notable changes to this project will be documented in this file.
 
 ### Removed
 
+## [0.3.1-SNAPSHOT] - 20 September 2019
+### Added
+- Tabs for CRUD operations regarding labs, blueprints, layers, timeslots and blueprint instances have been added.
+
+### Changed
+- Timeslot is now referenced by a blueprint instance
+- The UI searches for results only under the 'bluval_results' directory in Nexus
+
+### Removed
index 100624e..6b32a34 100644 (file)
@@ -41,16 +41,16 @@ In order for the blueprint validation UI to be functional, the following items a
 - An appropriate mariadb instance is up and running (look at the Database subsection).
   This prerequisite concerns both of the UI modes.
 
-- The available labs and their silos (i.e. which silo is used by a lab in order to store results in Nexus) for blueprint validation execution are defined by the corresponding lab owners (look at the Database subsection). It is their responsibility to publish them. Currently, this data is statically stored in the blueprint validation UI mariadb database. In order for a lab owner to update them, he/her must update the corresponding table entries. This inconvenience will be handled in the future.
-  This prerequisite concerns only the full control loop mode.
+- The available labs and their silos (i.e. which silo is used by a lab in order to store results in Nexus) for blueprint validation execution are stored in mariadb (look at the Database subsection). It is the lab owner's responsibility to update them using the UI.
+  This prerequisite concerns both the partial and the full control loop modes.
 
-- The available timeslots for blueprint validation execution of every lab are defined by the corresponding lab owners (look at the Database subsection). It is their responsibility to publish them. Currently, this data is statically stored in the blueprint validation UI mariadb database. In order for a lab owner to update them, he/her must update the corresponding table entries. This inconvenience will be handled in the future.
+- The available timeslots for blueprint validation execution of every lab are stored in the mariadb (look at the Database subsection). It is the lab owner's responsibility to update them using the UI.
   This prerequisite concerns only the full control loop mode.
 
-- The data of available blueprints (i.e. blueprint name) is stored in the mariadb database (look at the Database subsection). This data is automatically updated using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update the corresponding table entries.
+- The data of available blueprints (i.e. blueprint name) is stored in the mariadb database (look at the Database subsection). This data is automatically updated by the UI using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update it using the UI.
   This prerequisite concerns only the full control loop mode.
 
-- The data of an available blueprint instance for validation (i.e. version and layer) is stored in the mariadb database (look at the Database subsection). This data is automatically updated using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update the corresponding table entries.
+- The data of an available blueprint instance for validation (i.e. version and layer) is stored in the mariadb database (look at the Database subsection). This data is automatically updated by the UI using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update it using the UI.
   This prerequisite concerns only the full control loop mode.
 
 - A Jenkins instance exists capable of executing blueprint validation tests on the specified lab and storing the results to Nexus server (look at the Jenkins configuration subsection).
@@ -231,21 +231,25 @@ To this end, after the image build process, the following commands should be exe
     ./deploy.sh TAG_PRE=dev-mariadb MARIADB_ROOT_PASSWORD=<root user password> MARIADB_AKRAINO_PASSWORD=<mariadb akraino user password> UI_ADMIN_PASSWORD=<UI admin user password> UI_AKRAINO_PASSWORD=<UI akraino user password>
     mysql -p<MARIADB_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb container> < ../../ui/db-scripts/examples/initialize_db_example.sql
 
-In the context of the full control loop mode, the following tables must be initialized with appropriate data:
+In the context of the UI application, the following tables exist in the database:
 
-- lab (here every lab owner should store the name of the lab and the silo used for storing results in Nexus)
-- timeslot (here every lab owner should register the available timeslots that can be used for blueprint validation test execution)
-- blueprint_layer (here all the blueprint layers should be registered. These layers will be referenced by the blueprint instances)
-- blueprint (here every blueprint owner should register the name of the blueprint)
-- blueprint_instance_for_validation (here every blueprint owner should register the blueprint instances for validation, i.e. version and layer)
-- blueprint_instance_blueprint_layer (here the many-to-many relationship between blueprint instances and layers is formulated)
+- lab (here, every lab owner should store the name of the lab and the silo used for storing results in Nexus)
+- timeslot (here, every lab owner should register the available timeslots that can be used for blueprint validation test execution)
+- blueprint_layer (here, all the blueprint layers should be registered. These layers will be referenced by the blueprint instances)
+- blueprint (here, every blueprint owner should register the name of the blueprint)
+- blueprint_instance_for_validation (here, every blueprint owner should register the blueprint instances for validation, i.e. version and layer)
+- blueprint_instance_blueprint_layer (here, the many-to-many relationship between blueprint instances and layers is formulated)
+- blueprint_instance_timeslot (here, the many-to-many relationship between blueprint instances and timeslots is formulated)
 
-As it has been already mentioned, these tables are initialized automatically by the UI by fetching data from Nexus.
+As it has been already mentioned, a user can perform CRUD operations on these tables using the UI. Also, all these tables except from lab and timeslot are initialized and updated automatically
+by the UI by fetching data from Nexus. It is the lab owners responsibility to update them if a modifications is needed (especially the data related to lab and timeslot tables).
 
-However, a user may wish to extend or change this data (for example a new blueprint has been created and no results have been pushed to Nexus yet). To this end, the following file can be used (that's why the command 'mysql -p<MARIADB_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb container> < ../../ui/db-scripts/examples/initialize_db_example.sql' has been used previously):
+An example of data initialization is stored in the following file:
 
     db-scripts/examples/initialize_db_example.sql
 
+That is the reason why the command 'mysql -p<MARIADB_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb container> < ../../ui/db-scripts/examples/initialize_db_example.sql' has been used previously.
+
 Some of this data is illustrated below:
 
 .. code-block:: console
@@ -264,17 +268,22 @@ Some of this data is illustrated below:
 
     Blueprint Instances:
     id: 2, blueprint_id: 2 (i.e. rec), version: "master"
-    
+
     blueprint_instances_blueprint_layers
     blueprint_id: 2 (i.e. rec), layer_id: 1 (i.e. hardware)
 
+    blueprint_instances_timeslots
+    blueprint_instance_id: 2 (i.e. rec), timeslot_id: 1 (i.e. now in att lab)
+
 It should be noted that currently the start date and time and the duration of the timeslot are not taken into account by the UI (see limitation section). Therefore, a user should define 'now' and null respectively for their content.
 
 Based on this data, the UI enables the user to select an appropriate blueprint instance for validation.
 
+In the following lines it is explained how a user can update database using the mysql tool. However, it is advised that UI should be used for this purpose as it supports a more user-friendly way.
+
 For example, if a user wants to define a new lab with the following data:
 
-    lab: community, silo : 'community' 
+    lab: community, silo : 'community'
 
 the following file should be created:
 
@@ -310,11 +319,7 @@ Then, the following command should be executed:
 
     mysql -p<MARIADB_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb container> < ./dbscript.sql
 
-Furthermore, if a user wants to define a new blueprint, namely "newBlueprint" and a new instance of this blueprint with the following data:
-
-    version: "master", layer: k8s
-
-the following file should be created:
+Furthermore, if a user wants to define a new blueprint, namely "newBlueprint", and an instance of this blueprint with version "master" and layer "k8s" and assign a timeslot to it, the following file should be created:
 
 name: dbscript
 content:
@@ -324,6 +329,7 @@ content:
     insert into blueprint_instance (id, blueprint_id, version) values(3, 3, 'master');
     insert into blueprint_layer (id, layer) values(4, 'k8s');
     insert into blueprint_instance_blueprint_layer (blueprint_instance_id, blueprint_layer_id) values(3, 4);
+    insert into blueprint_instance_timeslot (blueprint_instance_id, timeslot_id) values(3, 2);
 
 Then, the following command should be executed:
 
@@ -357,17 +363,15 @@ It should be noted that it is not the UI responsibility to deploy a Nexus server
 
 These results must be available in the following url:
 
-    https://nexus.akraino.org/content/sites/logs/<lab_silo>/<Blueprint name>/<Blueprint version>/<timestamp>/results/<layer>/<name_of_the_test_suite>
+    https://nexus.akraino.org/content/sites/logs/<lab_silo>/bluval_results/<Blueprint name>/<Blueprint version>/<timestamp>/results/<layer>/<name_of_the_test_suite>
 
 where <lab_silo> is the silo used by a lab for storing results in Nexus (for example 'att-blu-val'), <Blueprint name> is the name of the blueprint, <Blueprint version> the the blueprint version, <timestamp> is the timestamp used for producinf the results, <layer> is the blueprint layer and <name_of_the_test_suite> is the name of the corresponding test suite.
 
 Below, an example URL is illustrated
 
-   https://nexus.akraino.org/content/sites/logs/att-blu-val/rec/master/20190611-132818/results/hardware/bios_version/
+   https://nexus.akraino.org/content/sites/logs/att-blu-val/bluval_results/rec/master/20190611-132818/results/hardware/bios_version/
 
-Moreover, the results should be stored in the 'output.xml' file and placed in the aforementioned URL using the following format:
-
-TBD
+Moreover, the results should be stored in the 'output.xml' file and placed in the aforementioned URL.
 
 Compiling
 ~~~~~~~~~
@@ -435,4 +439,3 @@ Limitations
 -----------
 - The UI has been tested using Chrome and Firefox browsers.
 - The back-end part of the UI does not take into account the start date and time and duration of the configured timeslot. It immediately triggers the corresponding Jenkins Job.
-- Results data manipulation (filtering, graphical representation, indexing in time order, etc) is not supported.
index 1dc1742..a1b3767 100644 (file)
@@ -26,13 +26,33 @@ INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD,
 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (930, 'Search', 9, 15, 'userProfile', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/search_profile.png');
 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (150022, 'Menus', 10, 60, 'admin#/admin_menu_edit', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', NULL);
 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (150038,'Notebook',5000,135,'samplePage#/notebook','menu_sample','Y',NULL,NULL,NULL,NULL,'APP','N',NULL);
-Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (21, 'New Submission', 1, 10, 'newsubmission', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-building-home');
-Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (22, 'Committed Submissions', 1, 10, 'committedsubmissions', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-building-home');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (21, 'New Submission', 1, 10, 'newsubmission', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-building-home');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (22, 'Committed Submissions', 1, 10, 'committedsubmissions', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-building-home');
 Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (23, 'Validation Results', 1, 10, 'report.htm', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart');
 Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (24, 'Get most recent', 23, 10, 'getmostrecent', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
 Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (25, 'Get by timestamp', 23, 10, 'getbytimestamp', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
 Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (26, 'Get last run', 23, 10, 'getlastrun', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
 Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (27, 'Get based on dates', 23, 10, 'getbasedondate', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (28, 'Register data', 1, 10, 'report.htm', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (29, 'Lab', 28, 10, 'registerlab', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (30, 'Blueprint', 28, 10, 'registerblueprint', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (31, 'Layer', 28, 10, 'registerlayer', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (32, 'Timeslot', 28, 10, 'registertimeslot', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (33, 'Blueprint Instance', 28, 10, 'registerblueprintinstance', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (34, 'Unregister data', 1, 10, 'report.htm', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (35, 'Lab', 34, 10, 'unregisterlab', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (36, 'Blueprint', 34, 10, 'unregisterblueprint', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (37, 'Layer', 34, 10, 'unregisterlayer', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (38, 'Blueprint Instance', 34, 10, 'unregisterblueprintinstance', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (39, 'Modify data', 1, 10, 'report.htm', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (40, 'Lab', 39, 10, 'modifylab', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (41, 'Blueprint Instance', 39, 10, 'modifyblueprintinstance', 'menu_sample', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (42, 'Get data', 1, 10, 'report.htm', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-misc-piechart');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (43, 'Lab', 42, 10, 'getlabs', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (44, 'Blueprints', 42, 10, 'getblueprints', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (45, 'Layers', 42, 10, 'getlayers', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (46, 'Timeslots', 42, 10, 'gettimeslots', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
+Insert into fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (47, 'Blueprint Instances', 42, 10, 'getblueprintinstances', 'menu_tab', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/reports.png');
 
 -- fn_user
 Insert into fn_user (USER_ID,ORG_ID,MANAGER_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,PHONE,FAX,CELLULAR,EMAIL,ADDRESS_ID,ALERT_METHOD_CD,HRID,ORG_USER_ID,ORG_CODE,LOGIN_ID,LOGIN_PWD,LAST_LOGIN_DATE,ACTIVE_YN,CREATED_ID,CREATED_DATE,MODIFIED_ID,MODIFIED_DATE,IS_INTERNAL_YN,ADDRESS_LINE_1,ADDRESS_LINE_2,CITY,STATE_CD,ZIP_CODE,COUNTRY_CD,LOCATION_CLLI,ORG_MANAGER_USERID,COMPANY,DEPARTMENT_NAME,JOB_TITLE,TIMEZONE,DEPARTMENT,BUSINESS_UNIT,BUSINESS_UNIT_NAME,COST_CENTER,FIN_LOC_CODE,SILO_STATUS) values (1,null,null,'admin',null,'User',null,null,null,'admin@email.com',null,null,null,'admin',null,'admin','admin_password',str_to_date('24-OCT-16','%d-%M-%Y'),'Y',null,str_to_date('17-OCT-16','%d-%M-%Y'),1,str_to_date('24-OCT-16','%d-%M-%Y'),'N',null,null,null,'NJ',null,'US',null,null,null,null,null,10,null,null,null,null,null,null);
index a9ccae3..31f9ad5 100644 (file)
@@ -26,6 +26,7 @@ DROP TABLE IF EXISTS blueprint_instance;
 DROP TABLE IF EXISTS blueprint_layer;
 DROP TABLE IF EXISTS blueprint;
 DROP TABLE IF EXISTS timeslot;
+DROP TABLE IF EXISTS blueprint_instance_timeslot;
 DROP TABLE IF EXISTS lab;
 
 create table lab (
@@ -43,8 +44,7 @@ create table timeslot (
    CONSTRAINT id_pk PRIMARY KEY (id),
    CONSTRAINT lab_id_fk FOREIGN KEY (lab_id)
       REFERENCES lab (id) MATCH SIMPLE
-      ON UPDATE NO ACTION ON DELETE NO ACTION,
-   unique (start_date_time, lab_id)
+      ON UPDATE NO ACTION ON DELETE NO ACTION
 );
 
 CREATE TABLE blueprint
@@ -86,13 +86,26 @@ CREATE TABLE blueprint_instance_blueprint_layer
    unique (blueprint_instance_id, blueprint_layer_id)
 );
 
+CREATE TABLE blueprint_instance_timeslot
+(
+   blueprint_instance_id bigint not NULL,
+   timeslot_id bigint not NULL,
+   CONSTRAINT blueprint_instance_id_fk3 FOREIGN KEY (blueprint_instance_id)
+      REFERENCES blueprint_instance (id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
+   CONSTRAINT timeslot_id_fk FOREIGN KEY (timeslot_id)
+      REFERENCES timeslot (id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
+   unique (blueprint_instance_id, timeslot_id)
+);
+
 CREATE TABLE submission
 (
    id bigint not NULL AUTO_INCREMENT,
    status text not NULL,
    timeslot_id bigint not NULL,
    CONSTRAINT id_pk PRIMARY KEY (id),
-   CONSTRAINT timeslot_id_fk FOREIGN KEY (timeslot_id)
+   CONSTRAINT timeslot_id_fk2 FOREIGN KEY (timeslot_id)
       REFERENCES timeslot (id) MATCH SIMPLE
       ON UPDATE NO ACTION ON DELETE NO ACTION
 );
@@ -109,7 +122,7 @@ CREATE TABLE validation_test_result
    submission_id bigint,
    date_of_storage text,
    CONSTRAINT id_pk PRIMARY KEY (id),
-   CONSTRAINT lab_id_fk3 FOREIGN KEY (lab_id)
+   CONSTRAINT lab_id_fk2 FOREIGN KEY (lab_id)
       REFERENCES lab (id) MATCH SIMPLE
       ON UPDATE NO ACTION ON DELETE NO ACTION,
    CONSTRAINT submission_id_fk FOREIGN KEY (submission_id)
index 694c3cb..6f8419e 100644 (file)
@@ -40,4 +40,7 @@ insert into blueprint_instance_blueprint_layer (blueprint_instance_id, blueprint
 insert into blueprint_instance_blueprint_layer (blueprint_instance_id, blueprint_layer_id) values(2, 2); /* os layer is assigned to rec*/
 insert into blueprint_instance_blueprint_layer (blueprint_instance_id, blueprint_layer_id) values(2, 4); /* k8s layer is assigned to rec*/
 
+insert into blueprint_instance_timeslot (blueprint_instance_id, timeslot_id) values(1, 1); /* dummy blueprint instance validation tests can run on ATT lab*/
+insert into blueprint_instance_timeslot (blueprint_instance_id, timeslot_id) values(2, 1); /* rec blueprint instance validation tests can run on ATT lab*/
+
 commit;
index 6baa507..2a6973c 100644 (file)
@@ -14,7 +14,7 @@
 
     <groupId>org.akraino.validation</groupId>
     <artifactId>ui</artifactId>
-    <version>0.2.1-SNAPSHOT</version>
+    <version>0.3.1-SNAPSHOT</version>
     <name>Bluval UI Maven Webapp</name>
     <packaging>war</packaging>
 
index 33e53db..263d7de 100644 (file)
@@ -45,7 +45,7 @@ import org.akraino.validation.ui.entity.BlueprintInstance;
 import org.akraino.validation.ui.entity.LabInfo;
 import org.akraino.validation.ui.entity.ValidationDbTestResult;
 import org.akraino.validation.ui.entity.WRobotDbTestResult;
-import org.akraino.validation.ui.service.DbResultAdapter;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.apache.commons.httpclient.HttpException;
 import org.json.JSONObject;
 import org.json.XML;
@@ -79,7 +79,7 @@ import com.sun.jersey.client.urlconnection.URLConnectionClientHandler;
 public final class NexusExecutorClient {
 
     @Autowired
-    DbResultAdapter dbAdapter;
+    DbAdapter dbAdapter;
 
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(NexusExecutorClient.class);
 
@@ -158,7 +158,7 @@ public final class NexusExecutorClient {
             @Nonnull String timestamp)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version;
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation nexus test result");
         WebResource webResource = this.client.resource(nexusUrl + "/");
         LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
@@ -217,7 +217,7 @@ public final class NexusExecutorClient {
             @Nonnull String siloText, int noOfLastElements)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException, ParseException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version;
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus test results");
         WebResource webResource = this.client.resource(nexusUrl + "/");
         LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
@@ -267,7 +267,7 @@ public final class NexusExecutorClient {
             @Nonnull String siloText, @Nonnull Date date)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version;
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.debug(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus results based on date");
         WebResource webResource = this.client.resource(nexusUrl + "/");
         LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
@@ -300,7 +300,7 @@ public final class NexusExecutorClient {
             @Nonnull String siloText, List<String> layers, Boolean optional, boolean outcome)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version;
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
         LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
@@ -364,7 +364,7 @@ public final class NexusExecutorClient {
             @Nonnull String siloText, Boolean allLayers, Boolean optional, boolean outcome)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version;
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
         LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
@@ -422,7 +422,8 @@ public final class NexusExecutorClient {
             @Nonnull String siloText, @Nonnull String timestamp)
                     throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
                     IOException, KeyManagementException, NoSuchAlgorithmException {
-        String nexusUrl = this.baseurl + "/" + siloText + "/" + name + "/" + version + "/" + timestamp + "/results";
+        String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version + "/"
+                + timestamp + "/results";
         List<WRobotNexusTestResult> listOfwrappers = new ArrayList<WRobotNexusTestResult>();
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get the blueprint layers");
         WebResource webResource = this.client.resource(nexusUrl + "/");
index 981191b..6ad8a37 100644 (file)
@@ -20,7 +20,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 
 import org.akraino.validation.ui.entity.ValidationDbTestResult;
-import org.akraino.validation.ui.service.DbResultAdapter;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.akraino.validation.ui.service.IntegratedResultService;
 import org.akraino.validation.ui.service.utils.PrioritySupplier;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
@@ -42,7 +42,7 @@ public class ValidationTestResultsGetter implements ApplicationListener<ContextR
     IntegratedResultService integratedService;
 
     @Autowired
-    DbResultAdapter dbAdapter;
+    DbAdapter dbAdapter;
 
     @Override
     public void onApplicationEvent(final ContextRefreshedEvent event) {
index 091738a..0f38c38 100644 (file)
@@ -19,7 +19,7 @@ package org.akraino.validation.ui.controller;
 import java.util.List;
 
 import org.akraino.validation.ui.entity.Blueprint;
-import org.akraino.validation.ui.service.BlueprintService;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -37,13 +38,13 @@ public class BlueprintController extends RestrictedBaseController {
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(BlueprintController.class);
 
     @Autowired
-    BlueprintService service;
+    DbAdapter service;
 
     public BlueprintController() {
         super();
     }
 
-    @RequestMapping(value = {"/"}, method = RequestMethod.GET)
+    @RequestMapping(value = { "/" }, method = RequestMethod.GET)
     public ResponseEntity<List<Blueprint>> getBlueprints() {
         try {
             return new ResponseEntity<>(service.getBlueprints(), HttpStatus.OK);
@@ -53,4 +54,26 @@ public class BlueprintController extends RestrictedBaseController {
         }
         return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
     }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+    public ResponseEntity<Blueprint> createBlueprint(@RequestBody Blueprint blueprint) {
+        try {
+            service.saveBlueprint(blueprint);
+            return new ResponseEntity<>(blueprint, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Creation of blueprint failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+    public ResponseEntity<Boolean> deleteBlueprint(@RequestBody Blueprint blueprint) {
+        try {
+            service.deleteBlueprint(blueprint);
+            return new ResponseEntity<>(true, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Deletion of blueprint failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
 }
index 84e0636..71a4d92 100644 (file)
@@ -19,7 +19,7 @@ package org.akraino.validation.ui.controller;
 import java.util.List;
 
 import org.akraino.validation.ui.entity.BlueprintInstance;
-import org.akraino.validation.ui.service.BlueprintInstanceService;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -37,7 +38,7 @@ public class BlueprintInstanceController extends RestrictedBaseController {
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(BlueprintInstanceController.class);
 
     @Autowired
-    BlueprintInstanceService service;
+    DbAdapter service;
 
     public BlueprintInstanceController() {
         super();
@@ -54,4 +55,28 @@ public class BlueprintInstanceController extends RestrictedBaseController {
         return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
     }
 
+    @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+    public ResponseEntity<BlueprintInstance> createBlueprintInstance(@RequestBody BlueprintInstance blueprintInstance) {
+        try {
+            service.saveBlueprintInstance(blueprintInstance);
+            return new ResponseEntity<>(blueprintInstance, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger,
+                    "Creation of blueprintInstance failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+    public ResponseEntity<Boolean> deleteBlueprintInstance(@RequestBody BlueprintInstance inst) {
+        try {
+            service.deleteBlueprintInstance(inst);
+            return new ResponseEntity<>(true, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger,
+                    "Deletion of blueprint instance failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
 }
diff --git a/ui/src/main/java/org/akraino/validation/ui/controller/BlueprintLayerController.java b/ui/src/main/java/org/akraino/validation/ui/controller/BlueprintLayerController.java
new file mode 100644 (file)
index 0000000..7dd2ba2
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.akraino.validation.ui.controller;
+
+import java.util.List;
+
+import org.akraino.validation.ui.entity.BlueprintLayer;
+import org.akraino.validation.ui.service.DbAdapter;
+import org.onap.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+@RequestMapping("/api/v1/layer")
+public class BlueprintLayerController extends RestrictedBaseController {
+
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(BlueprintLayerController.class);
+
+    @Autowired
+    DbAdapter service;
+
+    public BlueprintLayerController() {
+        super();
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.GET)
+    public ResponseEntity<List<BlueprintLayer>> getBlueprintLayers() {
+        try {
+            return new ResponseEntity<>(service.getBlueprintLayers(), HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger,
+                    "Error when trying to get blueprint layers. " + UserUtils.getStackTrace(e));
+        }
+        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+    public ResponseEntity<BlueprintLayer> createBlueprintLayer(@RequestBody BlueprintLayer blueprintLayer) {
+        try {
+            service.saveBlueprintLayer(blueprintLayer);
+            return new ResponseEntity<>(blueprintLayer, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger,
+                    "Creation of blueprint layer failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+    public ResponseEntity<Boolean> deleteBlueprintLayer(@RequestBody BlueprintLayer blueprintLayer) {
+        try {
+            service.deleteBlueprintLayer(blueprintLayer);
+            return new ResponseEntity<>(true, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger,
+                    "Deletion of blueprint layer failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+}
index 1e214f8..f32de4a 100644 (file)
@@ -19,7 +19,7 @@ package org.akraino.validation.ui.controller;
 import java.util.List;
 
 import org.akraino.validation.ui.entity.LabInfo;
-import org.akraino.validation.ui.service.LabService;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -37,7 +38,7 @@ public class LabController extends RestrictedBaseController {
     private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(LabController.class);
 
     @Autowired
-    LabService service;
+    DbAdapter service;
 
     public LabController() {
         super();
@@ -53,4 +54,26 @@ public class LabController extends RestrictedBaseController {
         }
         return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
     }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+    public ResponseEntity<LabInfo> saveLab(@RequestBody LabInfo labInfo) {
+        try {
+            service.saveLab(labInfo);
+            return new ResponseEntity<>(labInfo, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Save of lab failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+    public ResponseEntity<Boolean> deleteLab(@RequestBody LabInfo labInfo) {
+        try {
+            service.deleteLab(labInfo);
+            return new ResponseEntity<>(true, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Deletion of lab failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
 }
index cc9cec2..3d75a4a 100644 (file)
@@ -77,6 +77,102 @@ public class ModelsViewsController extends RestrictedBaseController {
         return new ModelAndView(defaultViewName);
     }
 
+    @RequestMapping(value = { "/registerlab" }, method = RequestMethod.GET)
+    public ModelAndView registerLab(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/unregisterlab" }, method = RequestMethod.GET)
+    public ModelAndView unRegisterLab(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/modifylab" }, method = RequestMethod.GET)
+    public ModelAndView modifyLab(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/getlabs" }, method = RequestMethod.GET)
+    public ModelAndView getLabs(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/registerblueprint" }, method = RequestMethod.GET)
+    public ModelAndView registerBlueprint(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/unregisterblueprint" }, method = RequestMethod.GET)
+    public ModelAndView unRegisterBlueprint(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/getblueprints" }, method = RequestMethod.GET)
+    public ModelAndView getBlueprints(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/registerlayer" }, method = RequestMethod.GET)
+    public ModelAndView registerLayer(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/unregisterlayer" }, method = RequestMethod.GET)
+    public ModelAndView unRegisterLayer(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/getlayers" }, method = RequestMethod.GET)
+    public ModelAndView getLayers(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/registertimeslot" }, method = RequestMethod.GET)
+    public ModelAndView registerTimeslot(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/gettimeslots" }, method = RequestMethod.GET)
+    public ModelAndView getTimeslots(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/registerblueprintinstance" }, method = RequestMethod.GET)
+    public ModelAndView registerBlueprintInstance(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/unregisterblueprintinstance" }, method = RequestMethod.GET)
+    public ModelAndView unRegisterBlueprintInstance(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/getblueprintinstances" }, method = RequestMethod.GET)
+    public ModelAndView getBlueprintInstances(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
+    @RequestMapping(value = { "/modifyblueprintinstance" }, method = RequestMethod.GET)
+    public ModelAndView modifyBlueprintInstance(HttpServletRequest request) {
+        final String defaultViewName = null;
+        return new ModelAndView(defaultViewName);
+    }
+
     @RequestMapping(value = { "/logout.htm" }, method = RequestMethod.GET)
     public ModelAndView login() {
         Map<String, Object> model = new HashMap<>();
index b923d61..83ad0fa 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.akraino.validation.ui.entity.ValidationDbTestResult;
-import org.akraino.validation.ui.service.DbResultAdapter;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.akraino.validation.ui.service.IntegratedResultService;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
@@ -44,7 +44,7 @@ public class ResultController extends RestrictedBaseController {
     IntegratedResultService resultService;
 
     @Autowired
-    DbResultAdapter dbAdapter;
+    DbAdapter dbAdapter;
 
     public ResultController() {
         super();
@@ -19,7 +19,7 @@ package org.akraino.validation.ui.controller;
 import java.util.List;
 
 import org.akraino.validation.ui.entity.Timeslot;
-import org.akraino.validation.ui.service.TimeslotService;
+import org.akraino.validation.ui.service.DbAdapter;
 import org.onap.portalsdk.core.controller.RestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
@@ -27,19 +27,20 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
 @Controller
-@RequestMapping("/api/v1/timeslots")
-public class TimeslotsController extends RestrictedBaseController {
+@RequestMapping("/api/v1/timeslot")
+public class TimeslotController extends RestrictedBaseController {
 
-    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(TimeslotsController.class);
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(TimeslotController.class);
 
     @Autowired
-    TimeslotService service;
+    DbAdapter service;
 
-    public TimeslotsController() {
+    public TimeslotController() {
         super();
     }
 
@@ -49,8 +50,30 @@ public class TimeslotsController extends RestrictedBaseController {
             return new ResponseEntity<>(service.getTimeslots(), HttpStatus.OK);
         } catch (Exception e) {
             LOGGER.error(EELFLoggerDelegate.errorLogger,
-                    "Error occured when trying to retrieve timeslots. " + UserUtils.getStackTrace(e));
+                    "Error occured when trying to retrieve timeslots." + UserUtils.getStackTrace(e));
         }
         return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
     }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+    public ResponseEntity<Timeslot> createTimeslot(@RequestBody Timeslot timeslot) {
+        try {
+            service.saveTimeslot(timeslot);
+            return new ResponseEntity<>(timeslot, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Creation of timeslot failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
+
+    @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+    public ResponseEntity<Boolean> deleteTimeslot(@RequestBody Timeslot timeslot) {
+        try {
+            service.deleteTimeslot(timeslot);
+            return new ResponseEntity<>(true, HttpStatus.OK);
+        } catch (Exception e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Deletion of timeslot failed. " + UserUtils.getStackTrace(e));
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+        }
+    }
 }
index 30722e2..9024b38 100644 (file)
@@ -15,6 +15,7 @@
  */
 package org.akraino.validation.ui.entity;
 
+import java.io.IOException;
 import java.io.Serializable;
 import java.util.HashSet;
 import java.util.Set;
@@ -32,10 +33,19 @@ import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.web.support.UserUtils;
+
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+
 @Entity
 @Table(name = "blueprint_instance")
 public class BlueprintInstance implements Serializable {
 
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(BlueprintInstance.class);
+
     /**
      *
      */
@@ -59,6 +69,12 @@ public class BlueprintInstance implements Serializable {
                     @JoinColumn(name = "blueprint_layer_id") })
     private Set<BlueprintLayer> blueprintLayers = new HashSet<>();
 
+    @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+    @JoinTable(name = "blueprint_instance_timeslot", joinColumns = {
+            @JoinColumn(name = "blueprint_instance_id") }, inverseJoinColumns = { @JoinColumn(name = "timeslot_id") })
+    @JsonSerialize(using = TimeslotsSerializer.class)
+    private Set<Timeslot> timeslots = new HashSet<>();
+
     public int getBlueprintInstanceId() {
         return blueprintInstId;
     }
@@ -91,4 +107,43 @@ public class BlueprintInstance implements Serializable {
         this.blueprintLayers = blueprintLayers;
     }
 
+    public Set<Timeslot> getTimeslots() {
+        return timeslots;
+    }
+
+    public void setTimeslots(Set<Timeslot> timeslots) {
+        this.timeslots = timeslots;
+    }
+
+    static class TimeslotsSerializer extends StdSerializer<Set<Timeslot>> {
+
+        public TimeslotsSerializer() {
+            this(null);
+        }
+
+        public TimeslotsSerializer(Class<Set<Timeslot>> tclass) {
+            super(tclass);
+        }
+
+        @Override
+        public void serialize(Set<Timeslot> timeslots, com.fasterxml.jackson.core.JsonGenerator gen,
+                SerializerProvider provider) throws IOException {
+            Set<Timeslot> results = new HashSet<>();
+            for (Timeslot timeslot : timeslots) {
+                try {
+                    Timeslot result = new Timeslot();
+                    result.setDuration(timeslot.getDuration());
+                    result.setLabInfo(timeslot.getLabInfo());
+                    result.setStartDateTime(timeslot.getStartDateTime());
+                    result.setTimeslotId(timeslot.getTimeslotId());
+                    results.add(result);
+                } catch (Exception ex) {
+                    LOGGER.error(EELFLoggerDelegate.errorLogger,
+                            "Error when serializing." + UserUtils.getStackTrace(ex));
+                }
+            }
+            gen.writeObject(results);
+        }
+    }
+
 }
index be2f250..1e2459b 100644 (file)
@@ -81,4 +81,5 @@ public class Timeslot implements Serializable {
     public LabInfo getLabInfo() {
         return labInfo;
     }
+
 }
diff --git a/ui/src/main/java/org/akraino/validation/ui/service/BlueprintInstanceService.java b/ui/src/main/java/org/akraino/validation/ui/service/BlueprintInstanceService.java
deleted file mode 100644 (file)
index 748085e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * 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. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.akraino.validation.ui.service;
-
-import java.util.List;
-
-import org.akraino.validation.ui.dao.BlueprintInstanceDAO;
-import org.akraino.validation.ui.entity.Blueprint;
-import org.akraino.validation.ui.entity.BlueprintInstance;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Transactional
-public class BlueprintInstanceService {
-
-    @Autowired
-    private BlueprintInstanceDAO dao;
-
-    public void saveBlueprintInstance(BlueprintInstance blueprintIns) {
-        dao.saveOrUpdate(blueprintIns);
-    }
-
-    public List<BlueprintInstance> getBlueprintInstances() {
-        return dao.getBlueprintInstances();
-    }
-
-    public BlueprintInstance getBlueprintInstance(int instId) {
-        return dao.getBlueprintInstance(instId);
-    }
-
-    public BlueprintInstance getBlueprintInstance(Blueprint blueprint, String version) {
-        return dao.getBlueprintInstance(blueprint, version);
-    }
-
-    public void deleteAll() {
-        dao.deleteAll();
-    }
-
-}
diff --git a/ui/src/main/java/org/akraino/validation/ui/service/BlueprintLayerService.java b/ui/src/main/java/org/akraino/validation/ui/service/BlueprintLayerService.java
deleted file mode 100644 (file)
index d814575..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * 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. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.akraino.validation.ui.service;
-
-import java.util.List;
-
-import org.akraino.validation.ui.dao.BlueprintLayerDAO;
-import org.akraino.validation.ui.entity.BlueprintLayer;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Transactional
-public class BlueprintLayerService {
-
-    @Autowired
-    private BlueprintLayerDAO layerDAO;
-
-    public void saveBlueprintLayer(BlueprintLayer layer) {
-        layerDAO.saveOrUpdate(layer);
-    }
-
-    public BlueprintLayer getBlueprintLayer(Integer layerId) {
-        return layerDAO.getBlueprintLayer(layerId);
-    }
-
-    public BlueprintLayer getBlueprintLayer(String layerData) {
-        return layerDAO.getBlueprintLayer(layerData);
-    }
-
-    public List<BlueprintLayer> getBlueprintLayers() {
-        return layerDAO.getBlueprintLayers();
-    }
-
-    public void deleteAll() {
-        layerDAO.deleteAll();
-    }
-
-}
diff --git a/ui/src/main/java/org/akraino/validation/ui/service/BlueprintService.java b/ui/src/main/java/org/akraino/validation/ui/service/BlueprintService.java
deleted file mode 100644 (file)
index ed5aa75..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * 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. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.akraino.validation.ui.service;
-
-import java.util.List;
-
-import org.akraino.validation.ui.dao.BlueprintDAO;
-import org.akraino.validation.ui.entity.Blueprint;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Transactional
-public class BlueprintService {
-
-    @Autowired
-    private BlueprintDAO blueprintDAO;
-
-    public void saveBlueprint(Blueprint blueprint) {
-        blueprintDAO.saveOrUpdate(blueprint);
-    }
-
-    public Blueprint getBlueprint(String name) {
-        return blueprintDAO.getBlueprint(name);
-    }
-
-    public List<Blueprint> getBlueprints() {
-        return blueprintDAO.getBlueprints();
-    }
-
-    public void deleteAll() {
-        blueprintDAO.deleteAll();
-    }
-
-}
@@ -8,6 +8,11 @@ import java.util.Set;
 
 import javax.annotation.Nonnull;
 
+import org.akraino.validation.ui.dao.BlueprintDAO;
+import org.akraino.validation.ui.dao.BlueprintInstanceDAO;
+import org.akraino.validation.ui.dao.BlueprintLayerDAO;
+import org.akraino.validation.ui.dao.LabDAO;
+import org.akraino.validation.ui.dao.TimeslotDAO;
 import org.akraino.validation.ui.dao.ValidationTestResultDAO;
 import org.akraino.validation.ui.dao.WRobotTestResultDAO;
 import org.akraino.validation.ui.data.JnksJobNotify;
@@ -16,6 +21,7 @@ import org.akraino.validation.ui.entity.BlueprintInstance;
 import org.akraino.validation.ui.entity.BlueprintLayer;
 import org.akraino.validation.ui.entity.LabInfo;
 import org.akraino.validation.ui.entity.Submission;
+import org.akraino.validation.ui.entity.Timeslot;
 import org.akraino.validation.ui.entity.ValidationDbTestResult;
 import org.akraino.validation.ui.entity.WRobotDbTestResult;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
@@ -28,14 +34,11 @@ import com.fasterxml.jackson.databind.JsonMappingException;
 
 @Service
 @Transactional
-public class DbResultAdapter {
+public class DbAdapter {
 
-    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(DbResultAdapter.class);
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(DbAdapter.class);
     private static final Object LOCK = new Object();
 
-    @Autowired
-    LabService labService;
-
     @Autowired
     private ValidationTestResultDAO vTestResultDAO;
 
@@ -43,25 +46,49 @@ public class DbResultAdapter {
     private WRobotTestResultDAO wRobotDAO;
 
     @Autowired
-    DbSubmissionAdapter subService;
+    private LabDAO labDAO;
+
+    @Autowired
+    private BlueprintLayerDAO layerDAO;
 
     @Autowired
-    BlueprintService blueprintService;
+    private BlueprintInstanceDAO bluInstDao;
 
     @Autowired
-    BlueprintInstanceService blueprintInstService;
+    private BlueprintDAO blueprintDAO;
 
     @Autowired
-    BlueprintLayerService layerService;
+    private TimeslotDAO timeslotDAO;
+
+    @Autowired
+    DbSubmissionAdapter subService;
 
     public void associateSubmissionWithValidationResult(Submission submission)
             throws JsonParseException, JsonMappingException, IOException {
         synchronized (LOCK) {
             if (!compareBluInstances(submission.getValidationDbTestResult().getBlueprintInstance(),
-                    blueprintInstService.getBlueprintInstance(
+                    bluInstDao.getBlueprintInstance(
                             submission.getValidationDbTestResult().getBlueprintInstance().getBlueprintInstanceId()))) {
                 throw new RuntimeException("Blueprint instance data changed.");
             }
+            if (!compareTimeslots(submission.getTimeslot(),
+                    timeslotDAO.getTimeslot(submission.getTimeslot().getTimeslotId()))) {
+                throw new RuntimeException("Timeslot data changed.");
+            }
+
+            boolean canContinue = false;
+            for (Timeslot timeslot : bluInstDao
+                    .getBlueprintInstance(
+                            submission.getValidationDbTestResult().getBlueprintInstance().getBlueprintInstanceId())
+                    .getTimeslots()) {
+                if (compareTimeslots(timeslot, submission.getTimeslot())) {
+                    canContinue = true;
+                    break;
+                }
+            }
+            if (!canContinue) {
+                throw new RuntimeException("Configured timeslot is no longer assigned to the blueprint instance.");
+            }
             submission.getValidationDbTestResult().setSubmission(submission);
             vTestResultDAO.saveOrUpdate(submission.getValidationDbTestResult());
             if (submission.getValidationDbTestResult().getWRobotDbTestResults() != null) {
@@ -86,24 +113,24 @@ public class DbResultAdapter {
                 if (!checkValidityOfNexusResult(vNexusResult)) {
                     continue;
                 }
-                LabInfo labInfo = labService.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
+                LabInfo labInfo = labDAO.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
                 ValidationDbTestResult vDbResult = vTestResultDAO.getValidationTestResult(labInfo,
                         vNexusResult.getTimestamp());
                 if (vDbResult == null) {
                     vDbResult = vNexusResult;
                     vDbResult.setLab(labInfo);
-                    Blueprint blueprint = blueprintService
+                    Blueprint blueprint = blueprintDAO
                             .getBlueprint(vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName());
                     if (blueprint == null) {
                         blueprint = vNexusResult.getBlueprintInstance().getBlueprint();
-                        blueprintService.saveBlueprint(blueprint);
+                        blueprintDAO.saveOrUpdate(blueprint);
                     }
-                    BlueprintInstance blueprintInst = blueprintInstService.getBlueprintInstance(blueprint,
+                    BlueprintInstance blueprintInst = bluInstDao.getBlueprintInstance(blueprint,
                             (vNexusResult.getBlueprintInstance().getVersion()));
                     if (blueprintInst == null) {
                         blueprintInst = vNexusResult.getBlueprintInstance();
                         blueprintInst.setBlueprint(blueprint);
-                        blueprintInstService.saveBlueprintInstance(blueprintInst);
+                        bluInstDao.saveOrUpdate(blueprintInst);
                     }
                     vDbResult.setBlueprintInstance(blueprintInst);
                 }
@@ -181,19 +208,19 @@ public class DbResultAdapter {
         synchronized (LOCK) {
             LabInfo actualLabInfo = null;
             if (lab != null) {
-                actualLabInfo = labService.getLab(lab);
+                actualLabInfo = labDAO.getLab(lab);
                 if (actualLabInfo == null) {
                     return null;
                 }
             }
             Blueprint blueprint = null;
             if (blueprintName != null) {
-                blueprint = blueprintService.getBlueprint(blueprintName);
+                blueprint = blueprintDAO.getBlueprint(blueprintName);
                 if (blueprint == null) {
                     return null;
                 }
             }
-            BlueprintInstance blueprintInst = blueprintInstService.getBlueprintInstance(blueprint, version);
+            BlueprintInstance blueprintInst = bluInstDao.getBlueprintInstance(blueprint, version);
             if (blueprintInst == null) {
                 return null;
             }
@@ -226,7 +253,7 @@ public class DbResultAdapter {
     public ValidationDbTestResult readResultFromDb(@Nonnull String lab, @Nonnull String timestamp)
             throws JsonParseException, JsonMappingException, IOException {
         synchronized (LOCK) {
-            LabInfo actualLabInfo = labService.getLab(lab);
+            LabInfo actualLabInfo = labDAO.getLab(lab);
             ValidationDbTestResult vDbResult = vTestResultDAO.getValidationTestResult(actualLabInfo, timestamp);
             if (vDbResult == null) {
                 return null;
@@ -247,16 +274,16 @@ public class DbResultAdapter {
             if (vNexusResults == null || vNexusResults.size() < 1) {
                 return;
             }
-            LabInfo labInfo = labService.getLabBasedOnSilo(vNexusResults.get(0).getLab().getSilo());
+            LabInfo labInfo = labDAO.getLabBasedOnSilo(vNexusResults.get(0).getLab().getSilo());
             if (labInfo == null) {
                 return;
             }
-            Blueprint blueprint = blueprintService
+            Blueprint blueprint = blueprintDAO
                     .getBlueprint(vNexusResults.get(0).getBlueprintInstance().getBlueprint().getBlueprintName());
             if (blueprint == null) {
                 return;
             }
-            BlueprintInstance blueInst = blueprintInstService.getBlueprintInstance(blueprint,
+            BlueprintInstance blueInst = bluInstDao.getBlueprintInstance(blueprint,
                     vNexusResults.get(0).getBlueprintInstance().getVersion());
             if (blueInst == null) {
                 return;
@@ -274,7 +301,7 @@ public class DbResultAdapter {
                 String dbTimestamp = vDbResult.getTimestamp();
                 LabInfo dbLabInfo = vDbResult.getLab();
                 for (ValidationDbTestResult vNexusResult : vNexusResults) {
-                    LabInfo nexusLabInfo = labService.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
+                    LabInfo nexusLabInfo = labDAO.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
                     if (nexusLabInfo == null) {
                         continue;
                     }
@@ -313,12 +340,12 @@ public class DbResultAdapter {
         synchronized (LOCK) {
             Blueprint blueprint = null;
             if (blueprintName != null) {
-                blueprint = blueprintService.getBlueprint(blueprintName);
+                blueprint = blueprintDAO.getBlueprint(blueprintName);
                 if (blueprint == null) {
                     return null;
                 }
             }
-            BlueprintInstance bluInst = blueprintInstService.getBlueprintInstance(blueprint, version);
+            BlueprintInstance bluInst = bluInstDao.getBlueprintInstance(blueprint, version);
             if (bluInst == null) {
                 return null;
             }
@@ -334,7 +361,7 @@ public class DbResultAdapter {
 
     public ValidationDbTestResult getValidationTestResult(String labSilo, String timestamp) {
         synchronized (LOCK) {
-            return vTestResultDAO.getValidationTestResult(labService.getLabBasedOnSilo(labSilo), timestamp);
+            return vTestResultDAO.getValidationTestResult(labDAO.getLabBasedOnSilo(labSilo), timestamp);
         }
     }
 
@@ -362,16 +389,194 @@ public class DbResultAdapter {
         }
     }
 
+    public void saveLab(LabInfo lab) {
+        synchronized (LOCK) {
+            labDAO.saveOrUpdate(lab);
+        }
+    }
+
+    public void deleteLab(LabInfo lab) {
+        synchronized (LOCK) {
+            labDAO.deleteLab(lab);
+        }
+    }
+
+    public LabInfo getLab(String lab) {
+        synchronized (LOCK) {
+            return labDAO.getLab(lab);
+        }
+    }
+
+    public LabInfo getLabBasedOnSilo(String silo) {
+        synchronized (LOCK) {
+            return labDAO.getLabBasedOnSilo(silo);
+        }
+    }
+
+    public List<LabInfo> getLabs() {
+        synchronized (LOCK) {
+            return labDAO.getLabs();
+        }
+    }
+
+    public void deleteLabAll() {
+        synchronized (LOCK) {
+            labDAO.deleteAll();
+        }
+    }
+
+    public void saveBlueprintInstance(BlueprintInstance blueprintIns) {
+        synchronized (LOCK) {
+            Set<Timeslot> timeslots = blueprintIns.getTimeslots();
+            if (timeslots != null && timeslots.size() > 1) {
+                for (Timeslot timeslot : timeslots) {
+                    if (!compareTimeslots(timeslot, timeslotDAO.getTimeslot(timeslot.getTimeslotId()))) {
+                        throw new RuntimeException("Timeslot instance data changed.");
+                    }
+                }
+                bluInstDao.merge(blueprintIns);
+                return;
+            }
+            bluInstDao.saveOrUpdate(blueprintIns);
+        }
+    }
+
+    public List<BlueprintInstance> getBlueprintInstances() {
+        synchronized (LOCK) {
+            return bluInstDao.getBlueprintInstances();
+        }
+    }
+
+    public BlueprintInstance getBlueprintInstance(int instId) {
+        synchronized (LOCK) {
+            return bluInstDao.getBlueprintInstance(instId);
+        }
+    }
+
+    public BlueprintInstance getBlueprintInstance(Blueprint blueprint, String version) {
+        synchronized (LOCK) {
+            return bluInstDao.getBlueprintInstance(blueprint, version);
+        }
+    }
+
+    public void deleteBlueprintInstance(BlueprintInstance blueprintIns) {
+        synchronized (LOCK) {
+            bluInstDao.deleteBlueprintInstance(blueprintIns);
+        }
+    }
+
+    public void deleteBluInstAll() {
+        synchronized (LOCK) {
+            bluInstDao.deleteAll();
+        }
+    }
+
+    public void saveBlueprintLayer(BlueprintLayer layer) {
+        synchronized (LOCK) {
+            layerDAO.saveOrUpdate(layer);
+        }
+    }
+
+    public BlueprintLayer getBlueprintLayer(Integer layerId) {
+        synchronized (LOCK) {
+            return layerDAO.getBlueprintLayer(layerId);
+        }
+    }
+
+    public BlueprintLayer getBlueprintLayer(String layerData) {
+        synchronized (LOCK) {
+            return layerDAO.getBlueprintLayer(layerData);
+        }
+    }
+
+    public List<BlueprintLayer> getBlueprintLayers() {
+        synchronized (LOCK) {
+            return layerDAO.getBlueprintLayers();
+        }
+    }
+
+    public void deleteBlueprintLayer(BlueprintLayer layer) {
+        synchronized (LOCK) {
+            layerDAO.deleteBlueprintLayer(layer);
+        }
+    }
+
+    public void deleteBluLayersAll() {
+        synchronized (LOCK) {
+            layerDAO.deleteAll();
+        }
+    }
+
+    public void saveBlueprint(Blueprint blueprint) {
+        synchronized (LOCK) {
+            blueprintDAO.saveOrUpdate(blueprint);
+        }
+    }
+
+    public Blueprint getBlueprint(String name) {
+        synchronized (LOCK) {
+            return blueprintDAO.getBlueprint(name);
+        }
+    }
+
+    public List<Blueprint> getBlueprints() {
+        synchronized (LOCK) {
+            return blueprintDAO.getBlueprints();
+        }
+    }
+
+    public void deleteBlueprint(Blueprint blueprint) {
+        synchronized (LOCK) {
+            blueprintDAO.deleteBlueprint(blueprint);
+        }
+    }
+
+    public void deleteBluAll() {
+        synchronized (LOCK) {
+            blueprintDAO.deleteAll();
+        }
+    }
+
+    public void saveTimeslot(Timeslot timeslot) {
+        synchronized (LOCK) {
+            LabInfo labInfo = timeslot.getLabInfo();
+            if (labInfo != null) {
+                if (!compareLabInfos(labInfo, labDAO.getLab(labInfo.getLabId()))) {
+                    throw new RuntimeException("Lab data changed.");
+                }
+            }
+            timeslotDAO.saveOrUpdate(timeslot);
+        }
+    }
+
+    public List<Timeslot> getTimeslots() {
+        synchronized (LOCK) {
+            return timeslotDAO.getTimeslots();
+        }
+    }
+
+    public void deleteTimeslot(Timeslot timeslot) {
+        synchronized (LOCK) {
+            timeslotDAO.deleteTimeslot(timeslot);
+        }
+    }
+
+    public void deleteTimeslotAll() {
+        synchronized (LOCK) {
+            timeslotDAO.deleteAll();
+        }
+    }
+
     public boolean checkValidityOfNexusResult(ValidationDbTestResult vNexusResult) {
         if (vNexusResult == null) {
             return true;
         }
-        LabInfo labInfo = labService.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
+        LabInfo labInfo = labDAO.getLabBasedOnSilo(vNexusResult.getLab().getSilo());
         if (labInfo == null) {
             throw new RuntimeException("Lab silo : " + vNexusResult.getLab().getSilo() + " not found");
         }
         ValidationDbTestResult vDbResult = vTestResultDAO.getValidationTestResult(
-                labService.getLabBasedOnSilo(vNexusResult.getLab().getSilo()), vNexusResult.getTimestamp());
+                labDAO.getLabBasedOnSilo(vNexusResult.getLab().getSilo()), vNexusResult.getTimestamp());
         Blueprint blueprint = null;
         BlueprintInstance bluInst = null;
         List<WRobotDbTestResult> wRobotDbResults = null;
@@ -380,15 +585,14 @@ public class DbResultAdapter {
             labInfo = vDbResult.getLab();
             wRobotDbResults = wRobotDAO.getWRobotTestResult(vDbResult);
         } else {
-            blueprint = blueprintService
+            blueprint = blueprintDAO
                     .getBlueprint(vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName());
         }
         if (blueprint != null) {
             if (vDbResult != null) {
                 bluInst = vDbResult.getBlueprintInstance();
             } else {
-                bluInst = blueprintInstService.getBlueprintInstance(blueprint,
-                        vNexusResult.getBlueprintInstance().getVersion());
+                bluInst = bluInstDao.getBlueprintInstance(blueprint, vNexusResult.getBlueprintInstance().getVersion());
             }
         }
         // Start comparison, be elastic with allLayers and optional
@@ -488,7 +692,7 @@ public class DbResultAdapter {
                 .equals(vDbTimestamp.getBlueprintInstance().getBlueprint().getBlueprintName())
                 || !vDbSubmission.getBlueprintInstance().getVersion()
                 .equals(vDbTimestamp.getBlueprintInstance().getVersion())
-                || !vDbSubmission.getLab().equals(vDbTimestamp.getLab())) {
+                || !compareLabInfos(vDbSubmission.getLab(), vDbTimestamp.getLab())) {
             LOGGER.error(EELFLoggerDelegate.errorLogger, "No consistency exists in database records.");
             return false;
         }
@@ -496,7 +700,7 @@ public class DbResultAdapter {
     }
 
     private void updateBlueInstLayers(ValidationDbTestResult vNexusResult) {
-        for (BlueprintInstance blueprintInst : blueprintInstService.getBlueprintInstances()) {
+        for (BlueprintInstance blueprintInst : bluInstDao.getBlueprintInstances()) {
             if (!blueprintInst.getBlueprint().getBlueprintName()
                     .equals(vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName())) {
                 continue;
@@ -506,18 +710,18 @@ public class DbResultAdapter {
                 blueprintLayers = new HashSet<BlueprintLayer>();
             }
             for (WRobotDbTestResult nexusResult : vNexusResult.getWRobotDbTestResults()) {
-                BlueprintLayer layer = layerService.getBlueprintLayer(nexusResult.getLayer());
+                BlueprintLayer layer = layerDAO.getBlueprintLayer(nexusResult.getLayer());
                 if (layer == null) {
                     layer = new BlueprintLayer();
                     layer.setLayer(nexusResult.getLayer());
-                    layerService.saveBlueprintLayer(layer);
+                    layerDAO.saveOrUpdate(layer);
                 }
                 if (!blueprintLayers.contains(layer)) {
                     blueprintLayers.add(layer);
                 }
             }
             blueprintInst.setBlueprintLayers(blueprintLayers);
-            blueprintInstService.saveBlueprintInstance(blueprintInst);
+            bluInstDao.saveOrUpdate(blueprintInst);
         }
     }
 
@@ -557,15 +761,60 @@ public class DbResultAdapter {
                 return false;
             }
         }
-        Blueprint blueprint1 = inst1.getBlueprint();
-        Blueprint blueprint2 = inst2.getBlueprint();
-        if (blueprint1.getBlueprintId() != blueprint2.getBlueprintId()) {
+        if (!compareBlueprints(inst1.getBlueprint(), inst2.getBlueprint())) {
+            return false;
+        }
+        return true;
+    }
+
+    private boolean compareTimeslots(Timeslot timeslot1, Timeslot timeslot2) {
+        if (!timeslot1.getStartDateTime().equals(timeslot2.getStartDateTime())
+                || timeslot1.getTimeslotId() != timeslot2.getTimeslotId()) {
             return false;
         }
-        if (!blueprint1.getBlueprintName().equals(blueprint2.getBlueprintName())) {
+        if (!compareLabInfos(timeslot1.getLabInfo(), timeslot2.getLabInfo())) {
             return false;
         }
         return true;
     }
 
+    private boolean compareBlueprints(Blueprint blueprint1, Blueprint blueprint2) {
+        if (blueprint1 != null || blueprint2 != null) {
+            if (blueprint1 != null && blueprint2 == null) {
+                return false;
+            }
+            if (blueprint1 == null && blueprint2 != null) {
+                return false;
+            }
+            if (blueprint1.getBlueprintId() != blueprint2.getBlueprintId()) {
+                return false;
+            }
+            if (!blueprint1.getBlueprintName().equals(blueprint2.getBlueprintName())) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private boolean compareLabInfos(LabInfo labInfo1, LabInfo labInfo2) {
+        if (labInfo1 != null || labInfo2 != null) {
+            if (labInfo1 != null && labInfo2 == null) {
+                return false;
+            }
+            if (labInfo1 == null && labInfo2 != null) {
+                return false;
+            }
+            if (labInfo1.getLabId() != labInfo2.getLabId()) {
+                return false;
+            }
+            if (!labInfo1.getSilo().equals(labInfo2.getSilo())) {
+                return false;
+            }
+            if (!labInfo1.getLab().equals(labInfo2.getLab())) {
+                return false;
+            }
+        }
+        return true;
+    }
+
 }
index 70955c0..648b89f 100644 (file)
@@ -61,10 +61,7 @@ public class DbSubmissionAdapter {
     private JenkinsExecutorClient jenkinsService;
 
     @Autowired
-    private DbResultAdapter dbAdapter;
-
-    @Autowired
-    BlueprintInstanceService bluInstService;
+    private DbAdapter dbAdapter;
 
     public Submission saveSubmission(Submission submission)
             throws JsonParseException, JsonMappingException, IOException {
index e97b5d1..965a78c 100644 (file)
@@ -36,6 +36,7 @@ import org.akraino.validation.ui.client.nexus.NexusExecutorClient;
 import org.akraino.validation.ui.entity.LabInfo;
 import org.akraino.validation.ui.entity.Submission;
 import org.akraino.validation.ui.entity.ValidationDbTestResult;
+import org.apache.commons.httpclient.HttpException;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.web.support.UserUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,17 +61,14 @@ public class IntegratedResultService {
     NexusExecutorClient nexusService;
 
     @Autowired
-    LabService labService;
-
-    @Autowired
-    DbResultAdapter dbAdapter;
+    DbAdapter dbAdapter;
 
     public List<String> getLabsFromNexus()
             throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
             UniformInterfaceException, NoSuchAlgorithmException, IOException, IllegalArgumentException, ParseException {
         List<String> labs = new ArrayList<String>();
         for (String cLabSilo : nexusService.getResource(null)) {
-            for (LabInfo labInfo : labService.getLabs()) {
+            for (LabInfo labInfo : dbAdapter.getLabs()) {
                 if (labInfo.getSilo().equals(cLabSilo)) {
                     labs.add(labInfo.getLab());
                 }
@@ -82,17 +80,22 @@ public class IntegratedResultService {
     public List<String> getBlueprintNamesOfLabFromNexus(@Nonnull String lab)
             throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
             UniformInterfaceException, NoSuchAlgorithmException, IOException, IllegalArgumentException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
-        List<String> cNames = nexusService.getResource(labService.getLab(lab).getSilo());
         List<String> rNames = new ArrayList<String>();
-        for (String cName : cNames) {
-            if (cName.equals("family") || cName.equals("ta") || cName.equals("job")) {
-                continue;
+        try {
+            List<String> cNames = nexusService.getResource(dbAdapter.getLab(lab).getSilo() + "/bluval_results");
+            for (String cName : cNames) {
+                if (cName.equals("family") || cName.equals("ta") || cName.equals("job")) {
+                    continue;
+                }
+                rNames.add(cName);
             }
-            rNames.add(cName);
+        } catch (HttpException ex) {
+            LOGGER.warn(EELFLoggerDelegate.auditLogger,
+                    "Error when retrieving blueprint names from nexus" + UserUtils.getStackTrace(ex));
         }
         return rNames;
     }
@@ -100,28 +103,35 @@ public class IntegratedResultService {
     public List<String> getBlueprintVersionsFromNexus(@Nonnull String name, @Nonnull String lab)
             throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
             UniformInterfaceException, NoSuchAlgorithmException, IOException, IllegalArgumentException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
-        return nexusService.getResource(labInfo.getSilo(), name);
+        return nexusService.getResource(labInfo.getSilo() + "/bluval_results", name);
     }
 
     public List<String> getBlueprintTimeStampsFromNexus(@Nonnull String name, @Nonnull String version,
             @Nonnull String lab) throws JsonParseException, JsonMappingException, KeyManagementException,
     ClientHandlerException, UniformInterfaceException, NoSuchAlgorithmException, IOException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
-        return nexusService.getResource(labInfo.getSilo(), name, version);
+        List<String> timestamps = new ArrayList<String>();
+        try {
+            timestamps = nexusService.getResource(labInfo.getSilo() + "/bluval_results", name, version);
+        } catch (HttpException ex) {
+            LOGGER.warn(EELFLoggerDelegate.auditLogger,
+                    "Error when retrieving blueprint names from nexus" + UserUtils.getStackTrace(ex));
+        }
+        return timestamps;
     }
 
     public List<ValidationDbTestResult> getResultsFromNexus(@Nonnull String name, @Nonnull String version,
             @Nonnull String lab, int noTimestamps)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, IOException, IllegalArgumentException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
@@ -132,7 +142,7 @@ public class IntegratedResultService {
             @Nonnull String timestamp) throws JsonParseException, JsonMappingException, IOException,
     KeyManagementException, ClientHandlerException, UniformInterfaceException, NoSuchAlgorithmException,
     NullPointerException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
@@ -148,7 +158,7 @@ public class IntegratedResultService {
             @Nonnull String lab, Boolean allLayers, Boolean optional, boolean outcome)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, NullPointerException, IOException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
@@ -165,7 +175,7 @@ public class IntegratedResultService {
             @Nonnull String lab, @Nonnull List<String> layers, Boolean optional, boolean outcome)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, NullPointerException, IOException, ParseException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
@@ -182,7 +192,7 @@ public class IntegratedResultService {
             @Nonnull String lab, @Nonnull Date date)
                     throws JsonParseException, JsonMappingException, IOException, ParseException, KeyManagementException,
                     ClientHandlerException, UniformInterfaceException, NoSuchAlgorithmException, NullPointerException {
-        LabInfo labInfo = labService.getLab(lab);
+        LabInfo labInfo = dbAdapter.getLab(lab);
         if (labInfo == null) {
             throw new IllegalArgumentException("Could not retrieve lab : " + lab.toString());
         }
@@ -236,7 +246,7 @@ public class IntegratedResultService {
             @Nonnull String timestamp)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, NullPointerException, IOException, ParseException {
-        LabInfo actualLabInfo = labService.getLab(lab);
+        LabInfo actualLabInfo = dbAdapter.getLab(lab);
         if (actualLabInfo == null) {
             return null;
         }
@@ -248,7 +258,7 @@ public class IntegratedResultService {
             @Nonnull String lab, Boolean allLayers, Boolean optional, boolean outcome)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, IOException, NullPointerException, ParseException {
-        LabInfo actualLabInfo = labService.getLab(lab);
+        LabInfo actualLabInfo = dbAdapter.getLab(lab);
         if (actualLabInfo == null) {
             return null;
         }
@@ -279,7 +289,7 @@ public class IntegratedResultService {
             @Nonnull String lab, List<String> layers, Boolean optional, boolean outcome)
                     throws JsonParseException, JsonMappingException, KeyManagementException, ClientHandlerException,
                     UniformInterfaceException, NoSuchAlgorithmException, IOException, NullPointerException, ParseException {
-        LabInfo actualLabInfo = labService.getLab(lab);
+        LabInfo actualLabInfo = dbAdapter.getLab(lab);
         if (actualLabInfo == null) {
             return null;
         }
index c292b79..95cb1c1 100644 (file)
@@ -45,14 +45,11 @@ public class JenkinsJobNotificationService {
     private DbSubmissionAdapter submissionService;
 
     @Autowired
-    private DbResultAdapter dbAdapter;
+    private DbAdapter dbAdapter;
 
     @Autowired
     private IntegratedResultService iService;
 
-    @Autowired
-    private LabService labService;
-
     @Autowired
     private ValidationTestResultDAO vTestResultDAO;
 
@@ -66,7 +63,7 @@ public class JenkinsJobNotificationService {
             LOGGER.debug(EELFLoggerDelegate.debugLogger, "No related submission was found");
             return;
         }
-        LabInfo labInfo = labService.getLab(submission.getTimeslot().getLabInfo().getLab());
+        LabInfo labInfo = dbAdapter.getLab(submission.getTimeslot().getLabInfo().getLab());
         if (labInfo == null) {
             throw new IllegalArgumentException(
                     "Could not retrieve lab : " + submission.getTimeslot().getLabInfo().getLab().toString());
diff --git a/ui/src/main/java/org/akraino/validation/ui/service/LabService.java b/ui/src/main/java/org/akraino/validation/ui/service/LabService.java
deleted file mode 100644 (file)
index 81fe7b1..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * 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. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.akraino.validation.ui.service;
-
-import java.util.List;
-
-import org.akraino.validation.ui.dao.LabDAO;
-import org.akraino.validation.ui.entity.LabInfo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Transactional
-public class LabService {
-
-    @Autowired
-    private LabDAO labDAO;
-
-    public void saveLab(LabInfo lab) {
-        labDAO.saveOrUpdate(lab);
-    }
-
-    public LabInfo getLab(String lab) {
-        return labDAO.getLab(lab);
-    }
-
-    public LabInfo getLabBasedOnSilo(String silo) {
-        return labDAO.getLabBasedOnSilo(silo);
-    }
-
-    public List<LabInfo> getLabs() {
-        return labDAO.getLabs();
-    }
-
-    public void deleteAll() {
-        labDAO.deleteAll();
-    }
-
-}
diff --git a/ui/src/main/java/org/akraino/validation/ui/service/TimeslotService.java b/ui/src/main/java/org/akraino/validation/ui/service/TimeslotService.java
deleted file mode 100644 (file)
index 6445d7f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
- *
- * 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. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package org.akraino.validation.ui.service;
-
-import java.util.List;
-
-import org.akraino.validation.ui.dao.TimeslotDAO;
-import org.akraino.validation.ui.entity.Timeslot;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Transactional
-public class TimeslotService {
-
-    @Autowired
-    private TimeslotDAO timeslotDAO;
-
-    public void saveTimeslot(Timeslot timeslot) {
-        timeslotDAO.saveOrUpdate(timeslot);
-    }
-
-    public List<Timeslot> getTimeslots() {
-        return timeslotDAO.getTimeslots();
-    }
-
-    public void deleteAll() {
-        timeslotDAO.deleteAll();
-    }
-
-}
index f64ea8f..c8cca69 100644 (file)
     <definition name="validationresults"
         template="/app/BluvalUI/ValidationResults/ValidationResults.html" />
 
+    <definition name="registerlab"
+        template="/app/BluvalUI/RegisterLab/RegisterLab.html" />
+
+    <definition name="unregisterlab"
+        template="/app/BluvalUI/UnRegisterLab/UnRegisterLab.html" />
+
+    <definition name="registerblueprint"
+        template="/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.html" />
+
+    <definition name="unregisterblueprint"
+        template="/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.html" />
+
+    <definition name="registerlayer"
+        template="/app/BluvalUI/RegisterLayer/RegisterLayer.html" />
+
+    <definition name="unregisterlayer"
+        template="/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.html" />
+
+    <definition name="registertimeslot"
+        template="/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.html" />
+
+    <definition name="registerblueprintinstance"
+        template="/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.html" />
+
+    <definition name="unregisterblueprintinstance"
+        template="/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.html" />
+
+    <definition name="modifylab"
+        template="/app/BluvalUI/ModifyLab/ModifyLab.html" />
+
+    <definition name="modifyblueprintinstance"
+        template="/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.html" />
+
+    <definition name="getlabs"
+        template="/app/BluvalUI/GetLabs/GetLabs.html" />
+
+    <definition name="getblueprints"
+        template="/app/BluvalUI/GetBlueprints/GetBlueprints.html" />
+
+    <definition name="getlayers"
+        template="/app/BluvalUI/GetLayers/GetLayers.html" />
+
+    <definition name="gettimeslots"
+        template="/app/BluvalUI/GetTimeslots/GetTimeslots.html" />
+
+    <definition name="getblueprintinstances"
+        template="/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.html" />
+
 </tiles-definitions>
index b5123e1..635286a 100644 (file)
  * limitations under the License.
  */
 
-var services = angular.module('App.Services', ['App.Config']);
+var services = angular.module('App.Services', [ 'App.Config' ]);
 
 services.factory('restAPISvc', [
-    '$http',
-    'appContext',
-    function ($http, appContext) {
-        var svc = [];
-        svc.getRestAPI = function (path, cb) {
-            return $http({
-                method: 'GET',
-                url: appContext + path,
-                headers: {
-                    'Content-Type': "application/json",
-                    'Accept': "application/json"
-                }
-            }).then(
-                function (response) {
-                    if (response.status == 200) {
-                        cb(response.data);
-                    } else {
-                        /* eslint-disable no-console */
-                        console.log("Get REST API error: "
-                            + response.statusText);
-                        /* eslint-enable no-console */
-                        cb(null);
+        '$http',
+        'appContext',
+        function($http, appContext) {
+            var svc = [];
+            svc.getRestAPI = function(path, cb) {
+                return $http({
+                    method : 'GET',
+                    url : appContext + path,
+                    headers : {
+                        'Content-Type' : "application/json",
+                        'Accept' : "application/json"
                     }
-                },
-                function (error) {
-                    /* eslint-disable no-console */
-                    console.log("Get REST API error: "
-                        + error.statusText);
-                    /* eslint-enable no-console */
-                    cb(null);
-                });
-        };
-        svc.postRestAPI = function (path, json, cb) {
-            return $http({
-                method: 'POST',
-                url: appContext + path,
-                headers: {
-                    'Content-Type': "application/json",
-                    'Accept': "application/json"
-                },
-                data: json
-            }).then(
-                function (response) {
-                    if (response.status == 200
-                        || response.status == 201) {
-                        cb(response.data);
-                    } else {
-                        /* eslint-disable no-console */
-                        console.log("Post REST API error: "
-                            + response.statusText);
-                        /* eslint-enable no-console */
-                        cb(null);
-                    }
-                },
-                function (error) {
-                    /* eslint-disable no-console */
-                    console.log("Post REST API error: "
-                        + error.statusText);
-                    /* eslint-enable no-console */
-                    cb(null);
-                });
-        };
-        svc.deleteRestAPI = function (path, json) {
-            return $http({
-                method: 'DELETE',
-                url: appContext + path,
-                headers: {
-                    'Content-Type': "application/json",
-                    'Accept': "application/json"
-                },
-                data: json
-            }).then(
-                function (response) {
-                    if (response.status !== 200) {
-                        /* eslint-disable no-console */
-                        console.log("Delete REST API error: "
-                            + response.statusText);
-                        /* eslint-enable no-console */
-                    }
-                },
-                function (error) {
-                    /* eslint-disable no-console */
-                    console.log("Delete REST API error: "
-                        + error.statusText);
-                    /* eslint-enable no-console */
-                });
-        };
-        return svc;
-    }]);
+                }).then(
+                        function(response) {
+                            if (response.status == 200) {
+                                cb(response.data);
+                            } else {
+                                /* eslint-disable no-console */
+                                console.log("Get REST API error: "
+                                        + response.statusText);
+                                /* eslint-enable no-console */
+                                cb(null);
+                            }
+                        },
+                        function(error) {
+                            /* eslint-disable no-console */
+                            console.log("Get REST API error: "
+                                    + error.statusText);
+                            /* eslint-enable no-console */
+                            cb(null);
+                        });
+            };
+            svc.postRestAPI = function(path, json, cb) {
+                return $http({
+                    method : 'POST',
+                    url : appContext + path,
+                    headers : {
+                        'Content-Type' : "application/json",
+                        'Accept' : "application/json"
+                    },
+                    data : json
+                }).then(
+                        function(response) {
+                            if (response.status == 200
+                                    || response.status == 201) {
+                                cb(response.data);
+                            } else {
+                                /* eslint-disable no-console */
+                                console.log("Post REST API error: "
+                                        + response.statusText);
+                                /* eslint-enable no-console */
+                                cb(null);
+                            }
+                        },
+                        function(error) {
+                            /* eslint-disable no-console */
+                            console.log("Post REST API error: "
+                                    + error.statusText);
+                            /* eslint-enable no-console */
+                            cb(null);
+                        });
+            };
+            svc.deleteRestAPI = function(path, json, cb) {
+                return $http({
+                    method : 'DELETE',
+                    url : appContext + path,
+                    headers : {
+                        'Content-Type' : "application/json",
+                        'Accept' : "application/json"
+                    },
+                    data : json
+                }).then(
+                        function(response) {
+                            if (response.status !== 200) {
+                                /* eslint-disable no-console */
+                                console.log("Delete REST API error: "
+                                        + response.statusText);
+                                /* eslint-enable no-console */
+                                cb(null);
+                            }
+                            cb(response.data);
+                        },
+                        function(error) {
+                            /* eslint-disable no-console */
+                            console.log("Delete REST API error: "
+                                    + error.statusText);
+                            /* eslint-enable no-console */
+                            cb(null);
+                        });
+            };
+            return svc;
+        } ]);
 
-services.factory("sharedContext", function () {
+services.factory("sharedContext", function() {
     var context = [];
-    var addData = function (key, value) {
+    var addData = function(key, value) {
         var data = {
-            key: key,
-            value: value
+            key : key,
+            value : value
         };
         context.push(data);
     }
-    var getData = function (key) {
+    var getData = function(key) {
         var data = [];
-        angular
-            .forEach(
-                context,
-                function (pair) {
-                    if (pair.key === key) {
-                        data = pair.value;
-                    }
-                });
+        angular.forEach(context, function(pair) {
+            if (pair.key === key) {
+                data = pair.value;
+            }
+        });
         return data;
     }
 
     return {
-        addData: addData,
-        getData: getData
+        addData : addData,
+        getData : getData
     }
 });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.html b/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.html
new file mode 100644 (file)
index 0000000..e112535
--- /dev/null
@@ -0,0 +1,181 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Get Blueprint Instances</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script
+    src="app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesController.js"></script>
+<script src="app/BluvalUI/GetBlueprintInstances/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="GetBlueprintInstances">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstances.js
new file mode 100644 (file)
index 0000000..f56d1d5
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("GetBlueprintInstances", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesController.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesController.js
new file mode 100644 (file)
index 0000000..7ce4249
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('GetBlueprintInstances');
+app.controller('GetBlueprintInstancesController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingBlueprintInstances = true;
+        $scope.blueprintInstanceInfos = [];
+        restAPISvc.getRestAPI("/api/v1/blueprintinstance/", function(data) {
+            if (data) {
+                $scope.blueprintInstanceInfos = data;
+            } else {
+                confirm("No blueprint instances found");
+            }
+            $scope.loadingBlueprintInstances = false;
+        });
+    }
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesTemplate.html
new file mode 100644 (file)
index 0000000..a6a8fdc
--- /dev/null
@@ -0,0 +1,89 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <style>
+ul.ul-layer {
+    list-style: none;
+    padding-left: 0;
+    margin-top: 25px;
+}
+
+li.li-layer {
+    border: 1px solid black;
+    display: inline-block;
+    padding: 5px 10px;
+    margin-right: 5px;
+    margin-bottom: 5px;
+    text-transform: capitalize;
+}
+</style>
+    <div>
+        <h1 class="heading-page">Get Blueprint Instances</h1>
+
+        <div ng-show="loadingBlueprintInstances">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <h2 class="heading-small"></h2>
+        <table class="table table-striped table-bordered">
+            <thead>
+                <tr style="background-color: grey;">
+                    <th class>Id&nbsp;</th>
+                    <th class>Version&nbsp;</th>
+                    <th class>Blueprint&nbsp;</th>
+                    <th class>Layer(s)&nbsp;</th>
+                    <th class>Timeslot(s)&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr class="border_bottom"
+                    ng-repeat="blueprintInstanceInfo in blueprintInstanceInfos">
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ blueprintInstanceInfo.blueprintInstanceId }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ blueprintInstanceInfo.version }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ blueprintInstanceInfo.blueprint.blueprintName
+                        }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        <ul class="ul-layer">
+                            <li
+                                ng-repeat="layer in blueprintInstanceInfo.blueprintLayers"
+                                class="li-layer">{{layer.layer}}</li>
+                        </ul>
+                    </td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        <ul class="ul-layer">
+                            <li
+                                ng-repeat="timeslot in blueprintInstanceInfo.timeslots"
+                                class="li-layer">Lab:
+                                {{timeslot.labInfo.lab}}, Start Date and
+                                Time: {{timeslot.startDateTime}}</li>
+                        </ul>
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+
+
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/Route.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprintInstances/Route.js
new file mode 100644 (file)
index 0000000..f8ba348
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2
+        .config(function($routeProvider) {
+            $routeProvider
+                    .otherwise({
+                        templateUrl : 'app/BluvalUI/GetBlueprintInstances/GetBlueprintInstancesTemplate.html',
+                        controller : "GetBlueprintInstancesController"
+                    });
+        });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.html b/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.html
new file mode 100644 (file)
index 0000000..69c64c7
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Get Blueprints</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/GetBlueprints/GetBlueprints.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/GetBlueprints/GetBlueprintsController.js"></script>
+<script src="app/BluvalUI/GetBlueprints/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="GetBlueprints">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprints.js
new file mode 100644 (file)
index 0000000..a631bf7
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("GetBlueprints", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsController.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsController.js
new file mode 100644 (file)
index 0000000..0c3b289
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('GetBlueprints');
+app.controller('GetBlueprintsController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingBlueprints = true;
+        $scope.blueprintInfos = [];
+        restAPISvc.getRestAPI("/api/v1/blueprint/", function(data) {
+            if (data) {
+                $scope.blueprintInfos = data;
+            } else {
+                confirm("No blueprints found");
+            }
+            $scope.loadingBlueprints = false;
+        });
+    }
+
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetBlueprints/GetBlueprintsTemplate.html
new file mode 100644 (file)
index 0000000..45c16b5
--- /dev/null
@@ -0,0 +1,46 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Get Blueprints</h1>
+
+        <div ng-show="loadingBlueprints">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <h2 class="heading-small"></h2>
+        <table class="table table-striped table-bordered">
+            <thead>
+                <tr style="background-color: grey;">
+                    <th class>Id&nbsp;</th>
+                    <th class>Name&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr class="border_bottom"
+                    ng-repeat="blueprintInfo in blueprintInfos">
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ blueprintInfo.blueprintId }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ blueprintInfo.blueprintName }}</td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/GetBlueprints/Route.js b/ui/src/main/webapp/app/BluvalUI/GetBlueprints/Route.js
new file mode 100644 (file)
index 0000000..df08610
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/GetBlueprints/GetBlueprintsTemplate.html',
+        controller : "GetBlueprintsController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.html b/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.html
new file mode 100644 (file)
index 0000000..a8a927d
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Get Lab</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/GetLabs/GetLabs.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/GetLabs/GetLabsController.js"></script>
+<script src="app/BluvalUI/GetLabs/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="GetLabs">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.js b/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.js
new file mode 100644 (file)
index 0000000..f0bebf4
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("GetLabs", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsController.js b/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsController.js
new file mode 100644 (file)
index 0000000..fbcfb4f
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('GetLabs');
+app.controller('GetLabsController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingLabs = true;
+        $scope.labInfos = [];
+        restAPISvc.getRestAPI("/api/v1/lab/", function(data) {
+            if (data) {
+                $scope.labInfos = data;
+            } else {
+                confirm("No labs found");
+            }
+            $scope.loadingLabs = false;
+        });
+    }
+
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabsTemplate.html
new file mode 100644 (file)
index 0000000..effaf88
--- /dev/null
@@ -0,0 +1,50 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Get Labs</h1>
+
+        <div ng-show="loadingLabs">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <h2 class="heading-small"></h2>
+        <table class="table table-striped table-bordered">
+            <thead>
+                <tr style="background-color: grey;">
+                    <th class>Id&nbsp;</th>
+                    <th class>Lab&nbsp;</th>
+                    <th class>Silo&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr class="border_bottom"
+                    ng-repeat="labInfo in labInfos">
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ labInfo.labId }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ labInfo.lab }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">{{
+                        labInfo.silo }}</td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLabs/Route.js b/ui/src/main/webapp/app/BluvalUI/GetLabs/Route.js
new file mode 100644 (file)
index 0000000..8cbc93b
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/GetLabs/GetLabsTemplate.html',
+        controller : "GetLabsController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.html b/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.html
new file mode 100644 (file)
index 0000000..a67ad15
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Get Layers</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/GetLayers/GetLayers.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/GetLayers/GetLayersController.js"></script>
+<script src="app/BluvalUI/GetLayers/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="GetLayers">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.js b/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.js
new file mode 100644 (file)
index 0000000..8905670
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("GetLayers", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersController.js b/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersController.js
new file mode 100644 (file)
index 0000000..8dcf267
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('GetLayers');
+app.controller('GetLayersController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingLayers = true;
+        $scope.layerInfos = [];
+        restAPISvc.getRestAPI("/api/v1/layer/", function(data) {
+            if (data) {
+                $scope.layerInfos = data;
+            } else {
+                confirm("No blueprint layers found");
+            }
+            $scope.loadingLayers = false;
+        });
+    }
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayersTemplate.html
new file mode 100644 (file)
index 0000000..48defa7
--- /dev/null
@@ -0,0 +1,47 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Get Layers</h1>
+
+        <div ng-show="loadingLayers">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <h2 class="heading-small"></h2>
+        <table class="table table-striped table-bordered">
+            <thead>
+                <tr style="background-color: grey;">
+                    <th class>Id&nbsp;</th>
+                    <th class>Layer&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr class="border_bottom"
+                    ng-repeat="layerInfo in layerInfos">
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ layerInfo.blueprintLayerId }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ layerInfo.layer }}</td>
+                </tr>
+            </tbody>
+        </table>
+
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/GetLayers/Route.js b/ui/src/main/webapp/app/BluvalUI/GetLayers/Route.js
new file mode 100644 (file)
index 0000000..dd1dd20
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/GetLayers/GetLayersTemplate.html',
+        controller : "GetLayersController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.html b/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.html
new file mode 100644 (file)
index 0000000..0025a7a
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Get Timeslots</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/GetTimeslots/GetTimeslots.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/GetTimeslots/GetTimeslotsController.js"></script>
+<script src="app/BluvalUI/GetTimeslots/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="GetTimeslots">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.js b/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.js
new file mode 100644 (file)
index 0000000..ef5eb4e
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("GetTimeslots", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsController.js b/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsController.js
new file mode 100644 (file)
index 0000000..eb94721
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('GetTimeslots');
+app.controller('GetTimeslotsController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingTimeslots = true;
+        $scope.timeslotInfos = [];
+        restAPISvc.getRestAPI("/api/v1/timeslot/", function(data) {
+            if (data) {
+                $scope.timeslotInfos = data;
+            } else {
+                confirm("No timeslots found");
+            }
+            $scope.loadingTimeslots = false;
+        });
+    }
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslotsTemplate.html
new file mode 100644 (file)
index 0000000..320dcbe
--- /dev/null
@@ -0,0 +1,51 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Get Timeslots</h1>
+
+        <div ng-show="loadingTimeslots">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <h2 class="heading-small"></h2>
+        <table class="table table-striped table-bordered">
+            <thead>
+                <tr style="background-color: grey;">
+                    <th class>Id&nbsp;</th>
+                    <th class>Start date and time&nbsp;</th>
+                    <th class>Lab&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr class="border_bottom"
+                    ng-repeat="timeslotInfo in timeslotInfos">
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ timeslotInfo.timeslotId }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ timeslotInfo.startDateTime }}</td>
+                    <td class
+                        style="padding-left: 10px; font-size: 15px; width: 13%;">
+                        {{ timeslotInfo.labInfo.lab }}</td>
+                </tr>
+            </tbody>
+        </table>
+
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/GetTimeslots/Route.js b/ui/src/main/webapp/app/BluvalUI/GetTimeslots/Route.js
new file mode 100644 (file)
index 0000000..845739b
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/GetTimeslots/GetTimeslotsTemplate.html',
+        controller : "GetTimeslotsController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.html b/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.html
new file mode 100644 (file)
index 0000000..a4e3dc4
--- /dev/null
@@ -0,0 +1,184 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Modify Blueprint Instance</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<link rel="stylesheet"
+    href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script
+    src="app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceController.js"></script>
+<script src="app/BluvalUI/ModifyBlueprintInstance/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="ModifyBlueprintInstance">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.js b/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstance.js
new file mode 100644 (file)
index 0000000..0a2af3c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("ModifyBlueprintInstance", [ 'ngRoute',
+        'ngMessages', 'modalServices', 'ngCookies', 'b2b.att', 'gridster',
+        'ui.bootstrap', 'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceController.js b/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceController.js
new file mode 100644 (file)
index 0000000..fb6b5ca
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('ModifyBlueprintInstance');
+app
+        .controller(
+                'ModifyBlueprintInstanceController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingBlueprintInstances = true;
+                        $scope.loadingLayers = true;
+                        $scope.blueprintInstanceInfos = [];
+                        $scope.declerativeInsts = [];
+                        $scope.selectedBlueprintInstance = '';
+                        $scope.layers = [];
+                        $scope.layerInfos = [];
+                        $scope.selectedLayer = '';
+                        $scope.configuredLayers = [];
+                        $scope.oldLayers = [];
+                        $scope.newLayers = [];
+                        restAPISvc
+                                .getRestAPI(
+                                        "/api/v1/blueprintinstance/",
+                                        function(data) {
+                                            if (data) {
+                                                $scope.blueprintInstanceInfos = data;
+                                                angular
+                                                        .forEach(
+                                                                data,
+                                                                function(
+                                                                        blueprintInstance) {
+                                                                    var temp = "id: "
+                                                                            + blueprintInstance.blueprintInstanceId
+                                                                            + " name: "
+                                                                            + blueprintInstance["blueprint"]["blueprintName"]
+                                                                            + " version: "
+                                                                            + blueprintInstance["version"];
+                                                                    $scope.declerativeInsts
+                                                                            .push(temp);
+                                                                    restAPISvc
+                                                                            .getRestAPI(
+                                                                                    "/api/v1/layer/",
+                                                                                    function(
+                                                                                            data2) {
+                                                                                        if (data2) {
+                                                                                            $scope.layerInfos = data2;
+                                                                                            angular
+                                                                                                    .forEach(
+                                                                                                            data2,
+                                                                                                            function(
+                                                                                                                    layer) {
+                                                                                                                if ($scope.layers
+                                                                                                                        .indexOf(layer.layer) === -1) {
+                                                                                                                    $scope.layers
+                                                                                                                            .push(layer.layer);
+                                                                                                                }
+                                                                                                            });
+                                                                                        } else {
+                                                                                            confirm("No layers found");
+                                                                                        }
+                                                                                    });
+                                                                });
+                                            } else {
+                                                confirm("No blueprint instances found");
+                                            }
+                                            $scope.loadingBlueprintInstances = false;
+                                            $scope.loadingLayers = false;
+                                        });
+                    }
+
+                    $scope.selectedBlueprintInstanceChange = function() {
+                        $scope.oldLayers = [];
+                        $scope.newLayers = [];
+                        var finalBlueprintInstanceInfo = '';
+                        var id = $scope.selectedBlueprintInstance
+                                .substring($scope.selectedBlueprintInstance
+                                        .indexOf("id:") + 4,
+                                        $scope.selectedBlueprintInstance
+                                                .indexOf("name") - 1);
+                        angular
+                                .forEach(
+                                        $scope.blueprintInstanceInfos,
+                                        function(blueprintInstanceInfo) {
+                                            if (blueprintInstanceInfo.blueprintInstanceId
+                                                    .toString().trim() === id
+                                                    .toString().trim()) {
+                                                finalBlueprintInstanceInfo = blueprintInstanceInfo;
+                                            }
+                                        });
+                        if (!finalBlueprintInstanceInfo) {
+                            confirm("Error in blueprint instance data");
+                            return;
+                        }
+                        angular.forEach(
+                                finalBlueprintInstanceInfo.blueprintLayers,
+                                function(layer) {
+                                    $scope.oldLayers.push(layer.layer);
+                                });
+                    }
+
+                    $scope.addConfiguredLayer = function(configuredLayer) {
+                        if ($scope.configuredLayers.indexOf(configuredLayer
+                                .trim()) === -1) {
+                            $scope.configuredLayers.push(configuredLayer);
+                        }
+                    }
+
+                    $scope.deleteConfiguredLayer = function(index) {
+                        $scope.configuredLayers.splice(index, 1);
+                    }
+
+                    $scope.modify = function() {
+                        if (!$scope.selectedBlueprintInstance
+                                || !$scope.configuredLayers
+                                || $scope.configuredLayers.length === 0) {
+                            confirm("You must specify all the data");
+                            return;
+                        }
+                        var finalBlueprintInstanceInfo = '';
+                        var id = $scope.selectedBlueprintInstance
+                                .substring($scope.selectedBlueprintInstance
+                                        .indexOf("id:") + 4,
+                                        $scope.selectedBlueprintInstance
+                                                .indexOf("name") - 1);
+                        angular
+                                .forEach(
+                                        $scope.blueprintInstanceInfos,
+                                        function(blueprintInstanceInfo) {
+                                            if (blueprintInstanceInfo.blueprintInstanceId
+                                                    .toString().trim() === id
+                                                    .toString().trim()) {
+                                                finalBlueprintInstanceInfo = blueprintInstanceInfo;
+                                            }
+                                        });
+                        if (!finalBlueprintInstanceInfo) {
+                            confirm("Error in blueprint instance data");
+                            return;
+                        }
+
+                        var blueprintLayers = [];
+                        angular.forEach($scope.layerInfos, function(layerInfo) {
+                            if ($scope.configuredLayers
+                                    .indexOf(layerInfo.layer) !== -1) {
+                                blueprintLayers.push(layerInfo);
+                            }
+                        });
+                        if (!blueprintLayers || blueprintLayers.length === 0) {
+                            confirm("Error in blueprint layers data");
+                            return;
+                        }
+                        finalBlueprintInstanceInfo.blueprintLayers = blueprintLayers;
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/blueprintinstance/",
+                                        finalBlueprintInstanceInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint instance has been modified successfully.";
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when modifying the blueprint instance");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceTemplate.html b/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceTemplate.html
new file mode 100644 (file)
index 0000000..c24d821
--- /dev/null
@@ -0,0 +1,132 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <style>
+$
+melon
+:
+
+#F97D75
+
+ ; $ black
+:
+
+#2E3641
+
+ ; *
+
+button {
+    background-color: $melon;
+    border: 0;
+    padding: 8px 20px;
+    color: white;
+    text-transform: uppercase;
+    cursor: pointer;
+    &:
+    focus
+    ,
+    &
+    :
+    active
+    {
+
+
+
+    outline
+    :
+
+
+
+    0;
+}
+
+}
+ul.ul-layer {
+    list-style: none;
+    padding-left: 0;
+    margin-top: 25px;
+}
+
+li.li-layer {
+    border: 1px solid black;
+    display: inline-block;
+    padding: 5px 10px;
+    margin-right: 5px;
+    margin-bottom: 5px;
+    text-transform: capitalize;
+}
+
+.fa-close {
+    cursor: pointer;
+}
+</style>
+    <div>
+        <h1 class="heading-page">Modify Blueprint Instance</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Blueprint
+                    Instance: </label> <select
+                    ng-model="selectedBlueprintInstance"
+                    ng-change="selectedBlueprintInstanceChange()"
+                    ng-options="v for v in declerativeInsts">
+                </select>
+            </div>
+        </div>
+        <br> <label for="textinputID-3a">Old layers: </label>
+        <ul class="ul-layer">
+            <li ng-repeat="oldLayer in oldLayers" class="li-layer">
+                {{oldLayer}}</li>
+        </ul>
+        <br>
+
+        <div ng-show="loadingBlueprintInstances || loadingLayers">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div ng-if="selectedBlueprintInstance">
+            <label for="textinputID-3a">New Layers: </label>
+            <div>
+                <div class="form-row">
+                    <label for="textinputID-3a">Add Layer: </label> <select
+                        ng-model="selectedLayer"
+                        ng-change="selectedLayerChange()"
+                        ng-options="v for v in layers">
+                    </select>
+                    <button ng-disabled="!selectedLayer"
+                        ng-click="addConfiguredLayer(selectedLayer)">Add</button>
+                </div>
+            </div>
+            <br>
+
+            <ul class="ul-layer">
+                <li ng-repeat="configuredLayer in configuredLayers"
+                    class="li-layer"><span
+                    ng-click="deleteConfiguredLayer($index)"><i
+                        class="fa fa-close"></i></span> {{configuredLayer}}</li>
+            </ul>
+
+            <div class="fn-ebz-container"
+                style="position: relative; top: 25px;">
+                <button href="javascript:void(0)" id="addbtn"
+                    style="bottom: -17px;" size="small"
+                    att-accessibility-click="13,32"
+                    class="btn btn-alt btn-small" ng-click="modify();">Modify</button>
+            </div>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/Route.js b/ui/src/main/webapp/app/BluvalUI/ModifyBlueprintInstance/Route.js
new file mode 100644 (file)
index 0000000..9ffcad4
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2
+        .config(function($routeProvider) {
+            $routeProvider
+                    .otherwise({
+                        templateUrl : 'app/BluvalUI/ModifyBlueprintInstance/ModifyBlueprintInstanceTemplate.html',
+                        controller : "ModifyBlueprintInstanceController"
+                    });
+        });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.html b/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.html
new file mode 100644 (file)
index 0000000..add858f
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Modify Lab</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/ModifyLab/ModifyLab.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/ModifyLab/ModifyLabController.js"></script>
+<script src="app/BluvalUI/ModifyLab/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="ModifyLab">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.js b/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLab.js
new file mode 100644 (file)
index 0000000..b5e498a
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("ModifyLab", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabController.js b/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabController.js
new file mode 100644 (file)
index 0000000..f832bf6
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('ModifyLab');
+app
+        .controller(
+                'ModifyLabController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingLabs = true;
+                        $scope.labInfos = [];
+                        $scope.labs = [];
+                        $scope.selectedLab = '';
+                        $scope.oldName = '';
+                        $scope.oldSilo = '';
+                        $scope.newData = {};
+                        restAPISvc.getRestAPI("/api/v1/lab/", function(data) {
+                            if (data) {
+                                $scope.labInfos = data;
+                                angular.forEach(data, function(lab) {
+                                    $scope.labs.push(lab.lab);
+                                });
+                            } else {
+                                confirm("No labs found");
+                            }
+                            $scope.loadingLabs = false;
+                        });
+                    }
+
+                    $scope.selectedLabChange = function() {
+                        $scope.oldName = '';
+                        $scope.oldSilo = '';
+                        $scope.newData = {};
+                        var finalLabInfo = '';
+                        angular.forEach($scope.labInfos, function(labInfo) {
+                            if ($scope.selectedLab.trim() === labInfo.lab
+                                    .trim()) {
+                                finalLabInfo = labInfo;
+                            }
+                        });
+                        if (!finalLabInfo) {
+                            confirm("Error in lab info");
+                            return;
+                        }
+                        $scope.oldName = finalLabInfo.lab;
+                        $scope.oldSilo = finalLabInfo.silo;
+                    }
+
+                    $scope.modify = function() {
+                        if (!$scope.selectedLab || !$scope.newData.name
+                                || !$scope.newData.silo) {
+                            confirm("You must specify all the values");
+                            return;
+                        }
+                        var finalLabInfo = '';
+                        angular.forEach($scope.labInfos, function(labInfo) {
+                            if ($scope.selectedLab.trim() === labInfo.lab
+                                    .trim()) {
+                                finalLabInfo = labInfo;
+                            }
+                        });
+                        if (!finalLabInfo) {
+                            confirm("Error in lab info");
+                            return;
+                        }
+                        finalLabInfo.lab = $scope.newData.name;
+                        finalLabInfo.silo = $scope.newData.silo;
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/lab/",
+                                        finalLabInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The lab has been modified successfully."
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when modifying the lab");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabTemplate.html b/ui/src/main/webapp/app/BluvalUI/ModifyLab/ModifyLabTemplate.html
new file mode 100644 (file)
index 0000000..99b133f
--- /dev/null
@@ -0,0 +1,76 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Modify Lab</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select lab: </label> <select
+                    ng-model="selectedLab"
+                    ng-change="selectedLabChange()"
+                    ng-options="v for v in labs">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div ng-show="loadingLabs">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="Column" ng-if="oldName">
+            <div class="form-row">
+                <label for="textinputID-3a">Old name : </label> <input
+                    ng-model="oldName" readonly></input>
+            </div>
+        </div>
+        <br>
+
+        <div class="Column" ng-if="oldSilo">
+            <div class="form-row">
+                <label for="textinputID-3a">Old silo : </label> <input
+                    ng-model="oldSilo" readonly></input>
+            </div>
+        </div>
+        <br>
+
+        <div class="Column" ng-if="oldName">
+            <div class="form-row">
+                <label for="textinputID-3a">Define new lab name:
+                </label> <input ng-model="newData.name"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="Column" ng-if="oldSilo">
+            <div class="form-row">
+                <label for="textinputID-3a">Define new lab silo:
+                </label> <input ng-model="newData.silo"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="modify();">Modify</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/ModifyLab/Route.js b/ui/src/main/webapp/app/BluvalUI/ModifyLab/Route.js
new file mode 100644 (file)
index 0000000..7a0700f
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/ModifyLab/ModifyLabTemplate.html',
+        controller : "ModifyLabController"
+    });
+});
\ No newline at end of file
index f0ac27c..3468b25 100644 (file)
@@ -24,14 +24,17 @@ app
 
                     function initialize() {
                         $scope.blueprintInstances = [];
+                        $scope.blueprintInstance = '';
                         $scope.blueprintNames = [];
                         $scope.blueprintVersions = [];
+                        $scope.declerativeTimeslots = [];
                         $scope.blueprintLayers = [];
                         $scope.optionals = [];
-                        $scope.selectedBlueprintName = {};
-                        $scope.selectedBlueprintVersion = {};
-                        $scope.selectedBlueprintLayer = {};
-                        $scope.selectedOptional = "";
+                        $scope.selectedBlueprintName = '';
+                        $scope.selectedBlueprintVersion = '';
+                        $scope.selectedDeclerativeTimeslot = '';
+                        $scope.selectedBlueprintLayer = '';
+                        $scope.selectedOptional = '';
                         restAPISvc
                                 .getRestAPI(
                                         "/api/v1/blueprintinstance/",
@@ -51,33 +54,17 @@ app
                                                                 }
                                                             });
                                         });
-                        restAPISvc.getRestAPI("/api/v1/timeslots/", function(
-                                data) {
-                            $scope.timeslots = data;
-                            $scope.declerativeTimeslots = [];
-                            angular.forEach($scope.timeslots,
-                                    function(timeslot) {
-                                        var temp = "id: " + timeslot.timeslotId
-                                                + " Start date and time: "
-                                                + timeslot.startDateTime
-                                                /*
-                                                 * + " duration(in sec) :" +
-                                                 * blueprintInstance["timeslot"].duration
-                                                 */
-                                                + " lab :"
-                                                + timeslot.labInfo.lab;
-                                        $scope.declerativeTimeslots.push(temp);
-                                    });
-                        });
                     }
-
                     $scope.selectedBlueprintNameChange = function() {
+                        $scope.blueprintInstance = '';
                         $scope.blueprintVersions = [];
+                        $scope.declerativeTimeslots = [];
                         $scope.blueprintLayers = [];
                         $scope.optionals = [];
-                        $scope.selectedBlueprintVersion = {};
-                        $scope.selectedBlueprintLayer = {};
-                        $scope.selectedOptional = "";
+                        $scope.selectedBlueprintVersion = '';
+                        $scope.selectedDeclerativeTimeslot = '';
+                        $scope.selectedBlueprintLayer = '';
+                        $scope.selectedOptional = '';
                         angular
                                 .forEach(
                                         $scope.blueprintInstances,
@@ -99,10 +86,13 @@ app
                         if (!$scope.selectedBlueprintName) {
                             return;
                         }
+                        $scope.blueprintInstance = '';
+                        $scope.declerativeTimeslots = [];
                         $scope.blueprintLayers = [];
                         $scope.optionals = [];
-                        $scope.selectedBlueprintLayer = {};
-                        $scope.selectedOptional = "";
+                        $scope.selectedDeclerativeTimeslot = '';
+                        $scope.selectedBlueprintLayer = '';
+                        $scope.selectedOptional = '';
                         angular
                                 .forEach(
                                         $scope.blueprintInstances,
@@ -113,27 +103,53 @@ app
                                                 if ($scope.selectedBlueprintVersion
                                                         .trim() === blueprintInstance["version"]
                                                         .trim()) {
-                                                    angular
-                                                            .forEach(
-                                                                    blueprintInstance.blueprintLayers,
-                                                                    function(
-                                                                            layer) {
-                                                                        $scope.blueprintLayers
-                                                                                .push(layer.layer);
-                                                                    });
+                                                    $scope.blueprintInstance = blueprintInstance;
                                                 }
                                             }
                                         });
+                        if (!$scope.blueprintInstance
+                                || !$scope.blueprintInstance.timeslots
+                                || $scope.blueprintInstance.timeslots.length === 0) {
+                            confirm("No available timeslots for this blueprint instance in this lab");
+                            return;
+                        }
+                        angular.forEach($scope.blueprintInstance.timeslots,
+                                function(timeslot) {
+                                    var temp = "id: " + timeslot.timeslotId
+                                            + " Start date and time: "
+                                            + timeslot.startDateTime
+                                            /*
+                                             * + " duration(in sec) :" +
+                                             * blueprintInstance["timeslot"].duration
+                                             */
+                                            + " lab :" + timeslot.labInfo.lab;
+                                    $scope.declerativeTimeslots.push(temp);
+                                });
+                    }
+
+                    $scope.selectedDeclerativeTimeslotChange = function() {
+                        $scope.blueprintLayers = [];
+                        $scope.optionals = [];
+                        $scope.selectedBlueprintLayer = {};
+                        $scope.selectedOptional = "";
+                        angular.forEach(
+                                $scope.blueprintInstance.blueprintLayers,
+                                function(layer) {
+                                    $scope.blueprintLayers.push(layer.layer);
+                                });
                         $scope.blueprintLayers.push("all");
                     }
 
                     $scope.selectedBlueprintLayerChange = function() {
+                        $scope.optionals = [];
+                        $scope.selectedOptional = "";
                         $scope.optionals = [ 'true', 'false' ];
                     }
 
                     $scope.submit = function() {
                         if (!$scope.selectedBlueprintName
                                 || !$scope.selectedBlueprintVersion
+                                || !$scope.blueprintInstance
                                 || !$scope.selectedBlueprintLayer
                                 || !$scope.selectedOptional
                                 || !$scope.selectedDeclerativeTimeslot) {
@@ -149,7 +165,7 @@ app
                                                 .indexOf("Start date and time:") - 1);
                         angular
                                 .forEach(
-                                        $scope.timeslots,
+                                        $scope.blueprintInstance.timeslots,
                                         function(timeslot) {
                                             if (selectedDeclerativeTimeslotId
                                                     .toString().trim() === timeslot.timeslotId
@@ -168,23 +184,8 @@ app
                             } ];
                         }
 
-                        var blueprintInstanceData = "";
-                        angular
-                                .forEach(
-                                        $scope.blueprintInstances,
-                                        function(blueprintInstance) {
-                                            if ($scope.selectedBlueprintName
-                                                    .trim() === blueprintInstance["blueprint"]["blueprintName"]
-                                                    .trim()) {
-                                                if ($scope.selectedBlueprintVersion
-                                                        .trim() === blueprintInstance["version"]
-                                                        .trim()) {
-                                                    blueprintInstanceData = blueprintInstance;
-                                                }
-                                            }
-                                        });
                         var validationDbTestResult = {
-                            "blueprintInstance" : blueprintInstanceData,
+                            "blueprintInstance" : $scope.blueprintInstance,
                             "allLayers" : allLayers,
                             "wrobotDbTestResults" : wrobotTestResults,
                             "optional" : $scope.selectedOptional,
@@ -207,11 +208,12 @@ app
                                                 confirm("Error when committing the submission");
                                             }
                                         });
-                        $scope.selectedBlueprintName = {};
-                        $scope.selectedBlueprintVersion = {};
-                        $scope.selectedBlueprintLayer = {};
+                        $scope.selectedBlueprintName = '';
+                        $scope.selectedBlueprintVersion = '';
+                        $scope.selectedBlueprintLayer = '';
                         $scope.selectedOptional = "";
-                        $scope.selectedDeclerativeTimeslot = {};
+                        $scope.selectedDeclerativeTimeslot = '';
+                        $scope.blueprintInstance = '';
                     }
 
                 });
index 82dda0f..b90581a 100644 (file)
@@ -42,6 +42,17 @@ limitations under the License.
         </div>
         <br>
 
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Timeslot: </label> <select
+                    ng-model="selectedDeclerativeTimeslot"
+                    ng-change="selectedDeclerativeTimeslotChange()"
+                    ng-options="v for v in declerativeTimeslots">
+                </select>
+            </div>
+        </div>
+        <br>
+
         <div>
             <div class="form-row">
                 <label for="textinputID-3a">Select Blueprint
@@ -64,17 +75,6 @@ limitations under the License.
         </div>
         <br>
 
-
-        <div>
-            <div class="form-row">
-                <label for="textinputID-3a">Select Timeslot: </label> <select
-                    ng-model="selectedDeclerativeTimeslot"
-                    ng-options="v for v in declerativeTimeslots">
-                </select>
-            </div>
-        </div>
-        <br>
-
         <div class="fn-ebz-container"
             style="position: relative; top: 25px;">
             <button href="javascript:void(0)" id="addbtn"
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.html b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.html
new file mode 100644 (file)
index 0000000..89bd3d6
--- /dev/null
@@ -0,0 +1,180 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Register Blueprint</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/RegisterBlueprint/RegisterBlueprint.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/RegisterBlueprint/RegisterBlueprintController.js"></script>
+<script src="app/BluvalUI/RegisterBlueprint/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="RegisterBlueprint">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprint.js
new file mode 100644 (file)
index 0000000..2f34e3a
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("RegisterBlueprint", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintController.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintController.js
new file mode 100644 (file)
index 0000000..00bb7c3
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('RegisterBlueprint');
+app
+        .controller(
+                'RegisterBlueprintController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.definedName = '';
+                    }
+
+                    $scope.register = function() {
+                        if (!$scope.definedName) {
+                            confirm("You must specify the blueprint name");
+                            return;
+                        }
+                        var blueprint = {
+                            "blueprintName" : $scope.definedName
+                        };
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/blueprint/",
+                                        blueprint,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint has been registered successfully. Blueprint id:"
+                                                        + data.blueprintId;
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when registering the blueprint");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintTemplate.html b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/RegisterBlueprintTemplate.html
new file mode 100644 (file)
index 0000000..e0405b0
--- /dev/null
@@ -0,0 +1,37 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Register Blueprint</h1>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define blueprint
+                    name: </label> <input ng-model="definedName"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="register();">Register</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/Route.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprint/Route.js
new file mode 100644 (file)
index 0000000..0ce4f49
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/RegisterBlueprint/RegisterBlueprintTemplate.html',
+        controller : "RegisterBlueprintController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.html b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.html
new file mode 100644 (file)
index 0000000..72d7cf1
--- /dev/null
@@ -0,0 +1,184 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Register Blueprint Instance</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<link rel="stylesheet"
+    href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script
+    src="app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceController.js"></script>
+<script src="app/BluvalUI/RegisterBlueprintInstance/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="RegisterBlueprintInstance">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstance.js
new file mode 100644 (file)
index 0000000..0899816
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("RegisterBlueprintInstance", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceController.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceController.js
new file mode 100644 (file)
index 0000000..e65f4db
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('RegisterBlueprintInstance');
+app
+        .controller(
+                'RegisterBlueprintInstanceController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingBlueprints = true;
+                        $scope.loadingLayers = true;
+                        $scope.blueprints = [];
+                        $scope.blueprintInfos = [];
+                        $scope.layers = [];
+                        $scope.layerInfos = [];
+                        $scope.selectedLayer = '';
+                        $scope.configuredLayers = [];
+                        restAPISvc
+                                .getRestAPI(
+                                        "/api/v1/blueprint/",
+                                        function(data) {
+                                            if (data) {
+                                                $scope.blueprintInfos = data;
+                                                angular
+                                                        .forEach(
+                                                                data,
+                                                                function(
+                                                                        blueprint) {
+                                                                    $scope.blueprints
+                                                                            .push(blueprint.blueprintName);
+                                                                    restAPISvc
+                                                                            .getRestAPI(
+                                                                                    "/api/v1/layer/",
+                                                                                    function(
+                                                                                            data2) {
+                                                                                        if (data2) {
+                                                                                            $scope.layerInfos = data2;
+                                                                                            angular
+                                                                                                    .forEach(
+                                                                                                            data2,
+                                                                                                            function(
+                                                                                                                    layer) {
+                                                                                                                if ($scope.layers
+                                                                                                                        .indexOf(layer.layer) === -1) {
+                                                                                                                    $scope.layers
+                                                                                                                            .push(layer.layer);
+                                                                                                                }
+                                                                                                            });
+                                                                                        } else {
+                                                                                            confirm("No layers found");
+                                                                                        }
+                                                                                    });
+                                                                });
+                                            } else {
+                                                confirm("No blueprints found");
+                                            }
+                                            $scope.loadingBlueprints = false;
+                                            $scope.loadingLayers = false;
+                                        });
+                    }
+
+                    $scope.addConfiguredLayer = function(configuredLayer) {
+                        if ($scope.configuredLayers.indexOf(configuredLayer
+                                .trim()) === -1) {
+                            $scope.configuredLayers.push(configuredLayer);
+                        }
+                    }
+
+                    $scope.deleteConfiguredLayer = function(index) {
+                        $scope.configuredLayers.splice(index, 1);
+                    }
+
+                    $scope.register = function() {
+                        if (!$scope.selectedBlueprint || !$scope.definedVersion
+                                || !$scope.configuredLayers
+                                || $scope.configuredLayers.length === 0) {
+                            confirm("You must specify all the fields");
+                            return;
+                        }
+                        var blueprint = '';
+                        angular
+                                .forEach(
+                                        $scope.blueprintInfos,
+                                        function(blueprintInfo) {
+                                            if (blueprintInfo.blueprintName
+                                                    .toString().trim() === $scope.selectedBlueprint
+                                                    .toString().trim()) {
+                                                blueprint = blueprintInfo;
+                                            }
+                                        });
+                        if (!blueprint) {
+                            confirm("Error in blueprint data");
+                            return;
+                        }
+                        var blueprintLayers = [];
+                        angular.forEach($scope.layerInfos, function(layerInfo) {
+                            if ($scope.configuredLayers
+                                    .indexOf(layerInfo.layer) !== -1) {
+                                blueprintLayers.push(layerInfo);
+                            }
+                        });
+                        if (!blueprintLayers || blueprintLayers.length === 0) {
+                            confirm("Error in blueprint layers data");
+                            return;
+                        }
+                        var blueprintInstance = {
+                            "blueprint" : blueprint,
+                            "version" : $scope.definedVersion,
+                            "blueprintLayers" : blueprintLayers
+                        };
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/blueprintinstance/",
+                                        blueprintInstance,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint instance has been registered successfully. Blueprint instance id:"
+                                                        + data.blueprintInstanceId;
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when registering the blueprint instance");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceTemplate.html b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceTemplate.html
new file mode 100644 (file)
index 0000000..db78ca4
--- /dev/null
@@ -0,0 +1,129 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <style>
+$
+melon
+:
+
+#F97D75
+
+ ; $ black
+:
+
+#2E3641
+
+ ; *
+
+button {
+    background-color: $melon;
+    border: 0;
+    padding: 8px 20px;
+    color: white;
+    text-transform: uppercase;
+    cursor: pointer;
+    &:
+    focus
+    ,
+    &
+    :
+    active
+    {
+
+
+    outline
+    :
+
+
+    0;
+}
+
+}
+ul.ul-layer {
+    list-style: none;
+    padding-left: 0;
+    margin-top: 25px;
+}
+
+li.li-layer {
+    border: 1px solid black;
+    display: inline-block;
+    padding: 5px 10px;
+    margin-right: 5px;
+    margin-bottom: 5px;
+    text-transform: capitalize;
+}
+
+.fa-close {
+    cursor: pointer;
+}
+</style>
+    <div>
+        <h1 class="heading-page">Register Blueprint Instance</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Blueprint: </label> <select
+                    ng-model="selectedBlueprint"
+                    ng-change="selectedBlueprintChange()"
+                    ng-options="v for v in blueprints">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define version: </label> <input
+                    ng-model="definedVersion"</input>
+            </div>
+        </div>
+        <br>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Add Layer: </label> <select
+                    ng-model="selectedLayer"
+                    ng-change="selectedLayerChange()"
+                    ng-options="v for v in layers">
+                </select>
+                <button ng-disabled="!selectedLayer"
+                    ng-click="addConfiguredLayer(selectedLayer)">Add</button>
+            </div>
+        </div>
+        <br>
+
+        <ul class="ul-layer">
+            <li ng-repeat="configuredLayer in configuredLayers"
+                class="li-layer"><span
+                ng-click="deleteConfiguredLayer($index)"><i
+                    class="fa fa-close"></i></span> {{configuredLayer}}</li>
+        </ul>
+
+        <div ng-show="loadingBlueprints || loadingLayers">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="register();">Register</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/Route.js b/ui/src/main/webapp/app/BluvalUI/RegisterBlueprintInstance/Route.js
new file mode 100644 (file)
index 0000000..d7b210c
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/RegisterBlueprintInstance/RegisterBlueprintInstanceTemplate.html',
+        controller : "RegisterBlueprintInstanceController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.html b/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.html
new file mode 100644 (file)
index 0000000..8a67a26
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Register Lab</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/RegisterLab/RegisterLab.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/RegisterLab/RegisterLabController.js"></script>
+<script src="app/BluvalUI/RegisterLab/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="RegisterLab">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.js b/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLab.js
new file mode 100644 (file)
index 0000000..e8d9e23
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("RegisterLab", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabController.js b/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabController.js
new file mode 100644 (file)
index 0000000..5a97da2
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('RegisterLab');
+app
+        .controller(
+                'RegisterLabController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.definedName = '';
+                        $scope.definedSilo = '';
+                    }
+
+                    $scope.register = function() {
+                        if (!$scope.definedName || !$scope.definedSilo) {
+                            confirm("You must specify all data fields");
+                            return;
+                        }
+                        var labInfo = {
+                            "lab" : $scope.definedName,
+                            "silo" : $scope.definedSilo
+                        };
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/lab/",
+                                        labInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The lab has been registered successfully. Lab id:"
+                                                        + data.labId;
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when registering the lab");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabTemplate.html b/ui/src/main/webapp/app/BluvalUI/RegisterLab/RegisterLabTemplate.html
new file mode 100644 (file)
index 0000000..51c58c9
--- /dev/null
@@ -0,0 +1,45 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Register Lab</h1>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define lab name: </label> <input
+                    ng-model="definedName"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define lab silo: </label> <input
+                    ng-model="definedSilo"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="register();">Register</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLab/Route.js b/ui/src/main/webapp/app/BluvalUI/RegisterLab/Route.js
new file mode 100644 (file)
index 0000000..758ed9d
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/RegisterLab/RegisterLabTemplate.html',
+        controller : "RegisterLabController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.html b/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.html
new file mode 100644 (file)
index 0000000..3326c17
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Register Layer</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/RegisterLayer/RegisterLayer.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/RegisterLayer/RegisterLayerController.js"></script>
+<script src="app/BluvalUI/RegisterLayer/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="RegisterLayer">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.js b/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayer.js
new file mode 100644 (file)
index 0000000..b5cbe33
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("RegisterLayer", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerController.js b/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerController.js
new file mode 100644 (file)
index 0000000..ec82a4a
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('RegisterLayer');
+app
+        .controller(
+                'RegisterLayerController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.definedLayer = '';
+                    }
+
+                    $scope.register = function() {
+                        if (!$scope.definedLayer) {
+                            confirm("You must specify the blueprint layer");
+                            return;
+                        }
+                        var blueprintLayer = {
+                            "layer" : $scope.definedLayer
+                        };
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/layer/",
+                                        blueprintLayer,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint layer has been registered successfully. Blueprint layer id:"
+                                                        + data.blueprintLayerId;
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when registering the blueprint layer");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerTemplate.html b/ui/src/main/webapp/app/BluvalUI/RegisterLayer/RegisterLayerTemplate.html
new file mode 100644 (file)
index 0000000..cbf6a1c
--- /dev/null
@@ -0,0 +1,37 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Register Blueprint Layer</h1>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define blueprint
+                    layer: </label> <input ng-model="definedLayer"</input>
+            </div>
+        </div>
+        <br>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="register();">Register</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterLayer/Route.js b/ui/src/main/webapp/app/BluvalUI/RegisterLayer/Route.js
new file mode 100644 (file)
index 0000000..af31e62
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/RegisterLayer/RegisterLayerTemplate.html',
+        controller : "RegisterLayerController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.html b/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.html
new file mode 100644 (file)
index 0000000..1462866
--- /dev/null
@@ -0,0 +1,183 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Register Timeslot</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<link rel="stylesheet"
+    href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/RegisterTimeslot/RegisterTimeslot.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/RegisterTimeslot/RegisterTimeslotController.js"></script>
+<script src="app/BluvalUI/RegisterTimeslot/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="RegisterTimeslot">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.js b/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslot.js
new file mode 100644 (file)
index 0000000..6a6facb
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("RegisterTimeslot", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotController.js b/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotController.js
new file mode 100644 (file)
index 0000000..952d478
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('RegisterTimeslot');
+app
+        .controller(
+                'RegisterTimeslotController',
+                function($scope, restAPISvc, $q) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingLabs = true;
+                        $scope.loadingBlueprintInstances = true;
+                        $scope.definedStart = "now";
+                        $scope.labInfos = [];
+                        $scope.labs = [];
+                        $scope.selectedLab = '';
+                        $scope.blueprintInstances = [];
+                        $scope.declerativeInsts = [];
+                        $scope.selectedDeclerativeInst = '';
+                        $scope.insts = [];
+                        restAPISvc
+                                .getRestAPI(
+                                        "/api/v1/lab/",
+                                        function(data) {
+                                            if (data) {
+                                                $scope.labInfos = data;
+                                                angular.forEach(data, function(
+                                                        lab) {
+                                                    $scope.labs.push(lab.lab);
+                                                });
+                                                restAPISvc
+                                                        .getRestAPI(
+                                                                "/api/v1/blueprintinstance/",
+                                                                function(data2) {
+                                                                    if (data2) {
+                                                                        $scope.blueprintInstances = data2;
+                                                                        angular
+                                                                                .forEach(
+                                                                                        $scope.blueprintInstances,
+                                                                                        function(
+                                                                                                blueprintInstance) {
+                                                                                            var temp = "id: "
+                                                                                                    + blueprintInstance.blueprintInstanceId
+                                                                                                    + " name: "
+                                                                                                    + blueprintInstance["blueprint"]["blueprintName"]
+                                                                                                    + " version: "
+                                                                                                    + blueprintInstance["version"];
+                                                                                            $scope.declerativeInsts
+                                                                                                    .push(temp);
+                                                                                        });
+                                                                    } else {
+                                                                        confirm("No blueprint instances found");
+                                                                    }
+                                                                });
+                                            } else {
+                                                confirm("No labs found");
+                                            }
+                                            $scope.loadingLabs = false;
+                                            $scope.loadingBlueprintInstances = false;
+                                        });
+                    }
+
+                    $scope.addInst = function(selectedDeclerativeInst) {
+                        if ($scope.insts
+                                .indexOf(selectedDeclerativeInst.trim()) === -1) {
+                            $scope.insts.push(selectedDeclerativeInst);
+                        }
+                    }
+
+                    $scope.deleteInst = function(index) {
+                        $scope.insts.splice(index, 1);
+                    }
+
+                    $scope.register = function() {
+                        if (!$scope.selectedLab || !$scope.insts
+                                || $scope.insts.length === 0) {
+                            confirm("You must specify all the fields");
+                            return;
+                        }
+                        var lab = '';
+                        angular.forEach($scope.labInfos, function(labInfo) {
+                            if (labInfo.lab.trim() === $scope.selectedLab) {
+                                lab = labInfo;
+                            }
+                        });
+                        if (!lab) {
+                            confirm("Error in lab data");
+                            return;
+                        }
+                        var timeslot = {
+                            "startDateTime" : $scope.definedStart,
+                            "labInfo" : lab
+                        };
+                        restAPISvc
+                                .postRestAPI(
+                                        "/api/v1/timeslot/",
+                                        timeslot,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The timeslot has been registered successfully. Timeslot id:"
+                                                        + data.timeslotId;
+                                                confirm(confirmText);
+                                                updateBlusInsts(data);
+                                            } else {
+                                                confirm("Error when registering the timeslot");
+                                            }
+                                        });
+                    }
+
+                    function updateBlusInsts(timeslot) {
+                        var blueprintInstances = [];
+                        angular
+                                .forEach(
+                                        $scope.insts,
+                                        function(inst) {
+                                            var id = inst.substring(inst
+                                                    .indexOf("id:") + 4, inst
+                                                    .indexOf("name") - 1);
+                                            angular
+                                                    .forEach(
+                                                            $scope.blueprintInstances,
+                                                            function(
+                                                                    blueprintInstance) {
+                                                                if (blueprintInstance.blueprintInstanceId
+                                                                        .toString()
+                                                                        .trim() === id
+                                                                        .toString()
+                                                                        .trim()) {
+                                                                    blueprintInstances
+                                                                            .push(blueprintInstance);
+                                                                }
+                                                            });
+                                        });
+                        if (!blueprintInstances) {
+                            confirm("Error in blueprint instances data");
+                            return;
+                        }
+                        var promises = [];
+                        angular
+                                .forEach(
+                                        blueprintInstances,
+                                        function(blueprintInstance) {
+                                            if (blueprintInstance.timeslots) {
+                                                blueprintInstance.timeslots
+                                                        .push(timeslot);
+                                            } else {
+                                                blueprintInstance.timeslots = [ timeslot ];
+                                            }
+                                            promises
+                                                    .push(restAPISvc
+                                                            .postRestAPI(
+                                                                    "/api/v1/blueprintinstance/",
+                                                                    blueprintInstance,
+                                                                    function(
+                                                                            data) {
+                                                                        if (data) {
+                                                                            var text = "Blueprint instance: "
+                                                                                    + blueprintInstance.blueprint.blueprintName
+                                                                                    + " version: "
+                                                                                    + blueprintInstance.version
+                                                                                    + " updated successfully";
+                                                                            confirm(text);
+                                                                        } else {
+                                                                            var text2 = "Failed to update blueprint instance: "
+                                                                                    + blueprintInstance.blueprint.blueprintName
+                                                                                    + " version: "
+                                                                                    + blueprintInstance.version;
+                                                                            confirm(text2);
+                                                                        }
+                                                                    }));
+                                        });
+                        $q
+                                .all(promises)
+                                .then(
+                                        function() {
+                                            confirm("All blueprint instances have been updated");
+                                            $scope.selectedLab = '';
+                                            $scope.selectedDeclerativeInst = '';
+                                            $scope.insts = [];
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotTemplate.html b/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/RegisterTimeslotTemplate.html
new file mode 100644 (file)
index 0000000..113cd21
--- /dev/null
@@ -0,0 +1,137 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <style>
+$
+melon
+:
+
+#F97D75
+
+ ; $ black
+:
+
+#2E3641
+
+ ; *
+
+button {
+    background-color: $melon;
+    border: 0;
+    padding: 8px 20px;
+    color: white;
+    text-transform: uppercase;
+    cursor: pointer;
+    &:
+    focus
+    ,
+    &
+    :
+    active
+    {
+
+
+
+
+
+
+    outline
+    :
+
+
+
+
+
+
+    0;
+}
+
+}
+ul.ul-timeslot {
+    list-style: none;
+    padding-left: 0;
+    margin-top: 25px;
+}
+
+li.li-timeslot {
+    border: 1px solid black;
+    display: inline-block;
+    padding: 5px 10px;
+    margin-right: 5px;
+    margin-bottom: 5px;
+    text-transform: capitalize;
+}
+
+.fa-close {
+    cursor: pointer;
+}
+</style>
+    <div>
+        <h1 class="heading-page">Register Timeslot</h1>
+
+        <div class="Column">
+            <div class="form-row">
+                <label for="textinputID-3a">Define start date
+                    and time : </label> <input ng-model="definedStart" readonly></input>
+            </div>
+        </div>
+        <br>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Lab: </label> <select
+                    ng-model="selectedLab"
+                    ng-change="selectedLabChange()"
+                    ng-options="v for v in labs">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Add Blueprint
+                    Instance: </label> <select
+                    ng-model="selectedDeclerativeInst"
+                    ng-change="selectedDeclerativeInstChange()"
+                    ng-options="v for v in declerativeInsts">
+                </select>
+                <button ng-disabled="!selectedDeclerativeInst"
+                    ng-click="addInst(selectedDeclerativeInst)">Add</button>
+            </div>
+        </div>
+        <br>
+
+        <ul class="ul-timeslot">
+            <li ng-repeat="inst in insts" class="li-timeslot"><span
+                ng-click="deleteInst($index)"><i
+                    class="fa fa-close"></i></span> {{inst}}</li>
+        </ul>
+
+        <div ng-show="loadingLabs || loadingBlueprintInstances">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="register();">Register</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/Route.js b/ui/src/main/webapp/app/BluvalUI/RegisterTimeslot/Route.js
new file mode 100644 (file)
index 0000000..576b4e2
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/RegisterTimeslot/RegisterTimeslotTemplate.html',
+        controller : "RegisterTimeslotController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/Route.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/Route.js
new file mode 100644 (file)
index 0000000..53929d2
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2
+        .config(function($routeProvider) {
+            $routeProvider
+                    .otherwise({
+                        templateUrl : 'app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintTemplate.html',
+                        controller : "UnRegisterBlueprintController"
+                    });
+        });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.html
new file mode 100644 (file)
index 0000000..ae81f56
--- /dev/null
@@ -0,0 +1,180 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Unregister Blueprint</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintController.js"></script>
+<script src="app/BluvalUI/UnRegisterBlueprint/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="UnRegisterBlueprint">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprint.js
new file mode 100644 (file)
index 0000000..4df1a25
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("UnRegisterBlueprint", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintController.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintController.js
new file mode 100644 (file)
index 0000000..eefd9a5
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('UnRegisterBlueprint');
+app
+        .controller(
+                'UnRegisterBlueprintController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingBlueprints = true;
+                        $scope.blueprintInfos = [];
+                        $scope.blueprints = [];
+                        $scope.selectedBlueprint = '';
+                        restAPISvc.getRestAPI("/api/v1/blueprint/", function(
+                                data) {
+                            if (data) {
+                                $scope.blueprintInfos = data;
+                                angular.forEach(data, function(blueprint) {
+                                    $scope.blueprints
+                                            .push(blueprint.blueprintName);
+                                });
+                            } else {
+                                confirm("No blueprints found");
+                            }
+                            $scope.loadingBlueprints = false;
+                        });
+                    }
+
+                    $scope.unRegister = function() {
+                        if (!$scope.selectedBlueprint) {
+                            confirm("You must select a blueprint");
+                            return;
+                        }
+                        var finalBlueprintInfo = '';
+                        angular
+                                .forEach(
+                                        $scope.blueprintInfos,
+                                        function(blueprintInfo) {
+                                            if ($scope.selectedBlueprint.trim() === blueprintInfo.blueprintName
+                                                    .trim()) {
+                                                finalBlueprintInfo = blueprintInfo;
+                                            }
+                                        });
+                        if (!finalBlueprintInfo) {
+                            return;
+                        }
+                        restAPISvc
+                                .deleteRestAPI(
+                                        "/api/v1/blueprint/",
+                                        finalBlueprintInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint has been unregistered successfully."
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when unregistering the blueprint");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintTemplate.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprint/UnRegisterBlueprintTemplate.html
new file mode 100644 (file)
index 0000000..9d746fb
--- /dev/null
@@ -0,0 +1,44 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Unregister Blueprint</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Blueprint: </label> <select
+                    ng-model="selectedBlueprint"
+                    ng-change="selectedBlueprintChange()"
+                    ng-options="v for v in blueprints">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div ng-show="loadingBlueprints">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="unRegister();">Unregister</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/Route.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/Route.js
new file mode 100644 (file)
index 0000000..db38d90
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2
+        .config(function($routeProvider) {
+            $routeProvider
+                    .otherwise({
+                        templateUrl : 'app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceTemplate.html',
+                        controller : "UnRegisterBlueprintInstanceController"
+                    });
+        });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.html
new file mode 100644 (file)
index 0000000..03e7e49
--- /dev/null
@@ -0,0 +1,180 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Unregister Blueprint Instance</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script
+    src="app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceController.js"></script>
+<script src="app/BluvalUI/UnRegisterBlueprintInstance/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="UnRegisterBlueprintInstance">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstance.js
new file mode 100644 (file)
index 0000000..8ab00e8
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("UnRegisterBlueprintInstance", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceController.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceController.js
new file mode 100644 (file)
index 0000000..277f676
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('UnRegisterBlueprintInstance');
+app
+        .controller(
+                'UnRegisterBlueprintInstanceController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingBlueprintInstances = true;
+                        $scope.blueprintInstanceInfos = [];
+                        $scope.declerativeInsts = [];
+                        $scope.selectedBlueprintInstance = '';
+                        restAPISvc
+                                .getRestAPI(
+                                        "/api/v1/blueprintinstance/",
+                                        function(data) {
+                                            if (data) {
+                                                $scope.blueprintInstanceInfos = data;
+                                                angular
+                                                        .forEach(
+                                                                data,
+                                                                function(
+                                                                        blueprintInstance) {
+                                                                    var temp = "id: "
+                                                                            + blueprintInstance.blueprintInstanceId
+                                                                            + " name: "
+                                                                            + blueprintInstance["blueprint"]["blueprintName"]
+                                                                            + " version: "
+                                                                            + blueprintInstance["version"];
+                                                                    $scope.declerativeInsts
+                                                                            .push(temp);
+                                                                });
+                                            } else {
+                                                confirm("No blueprint instances found");
+                                            }
+                                            $scope.loadingBlueprintInstances = false;
+                                        });
+                    }
+
+                    $scope.unRegister = function() {
+                        if (!$scope.selectedBlueprintInstance) {
+                            confirm("You must select a blueprint instance");
+                            return;
+                        }
+                        var finalBlueprintInstanceInfo = '';
+                        var id = $scope.selectedBlueprintInstance
+                                .substring($scope.selectedBlueprintInstance
+                                        .indexOf("id:") + 4,
+                                        $scope.selectedBlueprintInstance
+                                                .indexOf("name") - 1);
+                        angular
+                                .forEach(
+                                        $scope.blueprintInstanceInfos,
+                                        function(blueprintInstanceInfo) {
+                                            if (blueprintInstanceInfo.blueprintInstanceId
+                                                    .toString().trim() === id
+                                                    .toString().trim()) {
+                                                finalBlueprintInstanceInfo = blueprintInstanceInfo;
+                                            }
+                                        });
+                        if (!finalBlueprintInstanceInfo) {
+                            confirm("Error in blueprint instance data");
+                            return;
+                        }
+                        restAPISvc
+                                .deleteRestAPI(
+                                        "/api/v1/blueprintinstance/",
+                                        finalBlueprintInstanceInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint instance has been unregistered successfully."
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when unregistering the blueprint instance");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceTemplate.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterBlueprintInstance/UnRegisterBlueprintInstanceTemplate.html
new file mode 100644 (file)
index 0000000..76d968e
--- /dev/null
@@ -0,0 +1,45 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Unregister Blueprint Instance</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Blueprint
+                    Instance: </label> <select
+                    ng-model="selectedBlueprintInstance"
+                    ng-change="selectedBlueprintInstanceChange()"
+                    ng-options="v for v in declerativeInsts">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div ng-show="loadingBlueprintInstances">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="unRegister();">Unregister</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/Route.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/Route.js
new file mode 100644 (file)
index 0000000..59ad1da
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2.config(function($routeProvider) {
+    $routeProvider.otherwise({
+        templateUrl : 'app/BluvalUI/UnRegisterLab/UnRegisterLabTemplate.html',
+        controller : "UnRegisterLabController"
+    });
+});
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.html
new file mode 100644 (file)
index 0000000..f9d04ff
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Unregister Lab</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/UnRegisterLab/UnRegisterLab.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/UnRegisterLab/UnRegisterLabController.js"></script>
+<script src="app/BluvalUI/UnRegisterLab/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="UnRegisterLab">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLab.js
new file mode 100644 (file)
index 0000000..f3dac5c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("UnRegisterLab", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabController.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabController.js
new file mode 100644 (file)
index 0000000..1fede9c
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('UnRegisterLab');
+app.controller('UnRegisterLabController', function($scope, restAPISvc) {
+
+    initialize();
+
+    function initialize() {
+        $scope.loadingLabs = true;
+        $scope.labInfos = [];
+        $scope.labs = [];
+        $scope.selectedLab = '';
+        restAPISvc.getRestAPI("/api/v1/lab/", function(data) {
+            if (data) {
+                $scope.labInfos = data;
+                angular.forEach(data, function(lab) {
+                    $scope.labs.push(lab.lab);
+                });
+            } else {
+                confirm("No labs found");
+            }
+            $scope.loadingLabs = false;
+        });
+    }
+
+    $scope.unRegister = function() {
+        if (!$scope.selectedLab) {
+            confirm("You must select a lab");
+            return;
+        }
+        var finalLabInfo = '';
+        angular.forEach($scope.labInfos, function(labInfo) {
+            if ($scope.selectedLab.trim() === labInfo.lab.trim()) {
+                finalLabInfo = labInfo;
+            }
+        });
+        if (!finalLabInfo) {
+            return;
+        }
+        restAPISvc.deleteRestAPI("/api/v1/lab/", finalLabInfo, function(data) {
+            if (data) {
+                var confirmText = "The lab has been unregistered successfully."
+                confirm(confirmText);
+            } else {
+                confirm("Error when unregistering the lab");
+            }
+            initialize();
+        });
+    }
+});
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabTemplate.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterLab/UnRegisterLabTemplate.html
new file mode 100644 (file)
index 0000000..ee55605
--- /dev/null
@@ -0,0 +1,44 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Unregister Lab</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select lab: </label> <select
+                    ng-model="selectedLab"
+                    ng-change="selectedLabChange()"
+                    ng-options="v for v in labs">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div ng-show="loadingLabs">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="unRegister();">Unregister</button>
+        </div>
+    </div>
+</div>
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/Route.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/Route.js
new file mode 100644 (file)
index 0000000..68b158d
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+appDS2
+        .config(function($routeProvider) {
+            $routeProvider
+                    .otherwise({
+                        templateUrl : 'app/BluvalUI/UnRegisterLayer/UnRegisterLayerTemplate.html',
+                        controller : "UnRegisterLayerController"
+                    });
+        });
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.html
new file mode 100644 (file)
index 0000000..2c96131
--- /dev/null
@@ -0,0 +1,179 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!DOCTYPE html>
+<!-- Single-page application for EPSDK-App using DS2 look and feel. -->
+<html>
+
+<head>
+<meta charset="ISO-8859-1">
+<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
+
+<title>Unregister Layer</title>
+
+<!-- B2b Library -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/b2b-angular.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/b2b/css/b2b-angular/font_icons.css">
+
+<!-- icons in open source -->
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ionicons.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css">
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-bootstrap/ui-bootstrap-csp.css">
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/external/angular-gridster/dist/angular-gridster.min.css">
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/scribble.css" />
+<link rel="stylesheet" type="text/css"
+    href="static/fusion/sample/css/welcome.css" />
+
+<link rel="stylesheet" type="text/css"
+    href="app/fusion/styles/ecomp.css">
+
+<!-- Common scripts -->
+<script src="app/fusion/external/angular-1.4.8/angular.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-messages.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-touch.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-sanitize.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-route.min.js"></script>
+<script src="app/fusion/external/angular-1.4.8/angular-cookies.min.js"></script>
+<script src="app/fusion/external/jquery/dist/jquery.min.js"></script>
+<script
+    src="app/fusion/external/javascript-detect-element-resize/jquery.resize.js"></script>
+<script
+    src="app/fusion/external/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
+<script
+    src="app/fusion/external/angular-gridster/dist/angular-gridster.min.js"></script>
+
+<!-- EPSDK App scripts and common services -->
+<!-- B2b Library -->
+<script src="app/fusion/external/b2b/js/b2b-angular/b2b-library.min.js"></script>
+<script src="app/fusion/scripts/DS2-services/ds2-modal/modalService.js"></script>
+<script src="app/BluvalUI/App.Config.js"></script>
+<script src="app/BluvalUI/App.Services.js"></script>
+<script src="app/BluvalUI/UnRegisterLayer/UnRegisterLayer.js"></script>
+
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/headerServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/leftMenuServiceDS2.js"></script>
+<script src="app/fusion/scripts/DS2-services/manifestService.js"></script>
+
+<script src="app/fusion/scripts/DS2-directives/footer.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2Header.js"></script>
+<script src="app/fusion/scripts/DS2-directives/ds2LeftMenu.js"></script>
+<script src="app/fusion/scripts/DS2-directives/b2b-leftnav-ext.js"></script>
+<script src="app/fusion/scripts/DS2-services/userInfoServiceDS2.js"></script>
+
+<!-- Page specific items -->
+<script src="app/BluvalUI/UnRegisterLayer/UnRegisterLayerController.js"></script>
+<script src="app/BluvalUI/UnRegisterLayer/Route.js"></script>
+
+<style>
+.controls {
+    margin-bottom: 20px;
+}
+
+.page-header {
+    margin-top: 20px;
+}
+
+ul {
+    list-style: none;
+}
+
+.box {
+    height: 100%;
+    border: 1px solid #ccc;
+    background-color: #fff;
+    position: relative;
+    overflow: hidden;
+}
+
+.box-header {
+    background-color: #eee;
+    padding: 0px 0px 0px 0px;
+    margin-bottom: -25px;
+    cursor: move;
+    position: relative;
+}
+
+.box-header h3 {
+    margin-top: 0px;
+    display: inline-block;
+}
+
+.box-content {
+    padding: 10px;
+    display: block;
+    height: 100%;
+    position: relative;
+    overflow-x: auto;
+    overflow-y: auto;
+}
+
+.box-header-btns {
+    top: 15px;
+    right: 10px;
+    cursor: pointer;
+    position: absolute;
+}
+
+.gridster {
+    border: none;
+    position: relative;
+}
+
+.box-content .box-content-frame {
+
+}
+
+.box table {
+    border: none;
+    display: block;
+}
+
+.box table tr {
+    line-height: 20px;
+}
+
+.box table th {
+    border: none;
+    line-height: 20px;
+}
+
+.menu-container {
+    margin-top: 0px
+}
+
+.handle-e {
+    width: 3px;
+}
+</style>
+</head>
+
+<body class="appBody" ng-app="UnRegisterLayer">
+    <div ds2-Header class="header-container"></div>
+    <div ds2-menu id="menuContainer" class="menu-container"></div>
+    <div ng-view id="rightContentProfile" class="content-container"></div>
+    <div ds2-Footer class="footer-container"></div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayer.js
new file mode 100644 (file)
index 0000000..a92b508
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var appDS2 = angular.module("UnRegisterLayer", [ 'ngRoute', 'ngMessages',
+        'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap',
+        'ui.bootstrap.modal', 'App.Services' ]);
\ No newline at end of file
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerController.js b/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerController.js
new file mode 100644 (file)
index 0000000..39ea854
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var app = angular.module('UnRegisterLayer');
+app
+        .controller(
+                'UnRegisterLayerController',
+                function($scope, restAPISvc) {
+
+                    initialize();
+
+                    function initialize() {
+                        $scope.loadingLayers = true;
+                        $scope.layerInfos = [];
+                        $scope.layers = [];
+                        $scope.selectedLayer = '';
+                        restAPISvc.getRestAPI("/api/v1/layer/", function(data) {
+                            if (data) {
+                                $scope.layerInfos = data;
+                                angular.forEach(data, function(layer) {
+                                    $scope.layers.push(layer.layer);
+                                });
+                            } else {
+                                confirm("No blueprint layers found");
+                            }
+                            $scope.loadingLayers = false;
+                        });
+                    }
+
+                    $scope.unRegister = function() {
+                        if (!$scope.selectedLayer) {
+                            confirm("You must select a blueprint layer");
+                            return;
+                        }
+                        var finalLayerInfo = '';
+                        angular.forEach($scope.layerInfos, function(layerInfo) {
+                            if ($scope.selectedLayer.trim() === layerInfo.layer
+                                    .trim()) {
+                                finalLayerInfo = layerInfo;
+                            }
+                        });
+                        if (!finalLayerInfo) {
+                            return;
+                        }
+                        restAPISvc
+                                .deleteRestAPI(
+                                        "/api/v1/layer/",
+                                        finalLayerInfo,
+                                        function(data) {
+                                            if (data) {
+                                                var confirmText = "The blueprint layer has been unregistered successfully."
+                                                confirm(confirmText);
+                                            } else {
+                                                confirm("Error when unregistering the blueprint layer");
+                                            }
+                                            initialize();
+                                        });
+                    }
+                });
diff --git a/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerTemplate.html b/ui/src/main/webapp/app/BluvalUI/UnRegisterLayer/UnRegisterLayerTemplate.html
new file mode 100644 (file)
index 0000000..2d6cc9b
--- /dev/null
@@ -0,0 +1,44 @@
+<!--
+Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+
+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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<div id="page-content" class="content" style="padding: 25px;">
+    <div>
+        <h1 class="heading-page">Unregister Layer</h1>
+
+        <div>
+            <div class="form-row">
+                <label for="textinputID-3a">Select Layer: </label> <select
+                    ng-model="selectedLayer"
+                    ng-change="selectedLayerChange()"
+                    ng-options="v for v in layers">
+                </select>
+            </div>
+        </div>
+        <br>
+
+        <div ng-show="loadingLayers">
+            <img src=" static/fusion/images/giphy.gif" />
+        </div>
+
+        <div class="fn-ebz-container"
+            style="position: relative; top: 25px;">
+            <button href="javascript:void(0)" id="addbtn"
+                style="bottom: -17px;" size="small"
+                att-accessibility-click="13,32"
+                class="btn btn-alt btn-small" ng-click="unRegister();">Unregister</button>
+        </div>
+    </div>
+</div>
index 05ee699..0dfd377 100644 (file)
@@ -19,9 +19,9 @@ limitations under the License.
 
 <head>
     <meta charset="UTF-8">
-    <meta http-equiv="refresh" content="0; url=/bluvalui/committedsubmissions">
+    <meta http-equiv="refresh" content="0; url=/bluvalui/getmostrecent">
     <script type="text/javascript">
-        window.location.href = location.host + "/bluvalui/committedsubmissions"
+        window.location.href = location.host + "/bluvalui/getmostrecent"
     </script>
     <title>Page Redirection</title>
 </head>