Merge "Update package type name"
authorDan Timoney <dtimoney@att.com>
Wed, 24 Apr 2019 13:39:37 +0000 (13:39 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 24 Apr 2019 13:39:37 +0000 (13:39 +0000)
14 files changed:
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.scss
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.service.ts [new file with mode: 0644]
docs/CBA/index.rst
docs/CDS_Architecture_Design.pptx [moved from docs/CBA/CDS_Architecture_Design.pptx with 100% similarity]
docs/CDS_architecture.JPG [moved from docs/media/CDS_architecture.JPG with 100% similarity]
docs/bluePrintsProcessorMS.rst [moved from docs/bluePrintsProcessor.rst with 100% similarity]
docs/controllerBlueprintStudioProcessorMS.rst [moved from docs/controllerBlueprintStudioProcessor.rst with 100% similarity]
docs/datadictionary/index.rst
docs/datadictionary/resourceDefinitionCode.rst [new file with mode: 0644]
docs/image0.jpg [moved from docs/media/image0.jpg with 100% similarity]
docs/index.rst

index de81e23..4bd4ad4 100644 (file)
@@ -19,7 +19,7 @@
 */-->
 
 
-<button (click) ="changeView()" class="toggle-view-btn">{{viewText}}</button>
+<button disabled style="opacity: 0.5;" (click) ="changeView()" class="toggle-view-btn">{{viewText}}</button>
 <br><br>
 <div *ngIf="designerMode">
    <mat-card class="metadata-card">
@@ -50,5 +50,5 @@
 <div class="btn"> 
        <button mat-button matStepperPrevious>Back</button></div>
 <div class="btn">
-       <button mat-button matStepperNext type="submit" (click)="updateResourcesState()">Upload</button>
+       <button mat-button matStepperNext type="submit" (click)="saveToBackend()">Save</button>
 </div> 
index 280645e..9c2d42a 100644 (file)
@@ -41,7 +41,7 @@
     background:#3f51b5; 
     margin-top: 10px; 
     position: absolute;
-    border-radius: 1em;
+    border-radius: 4px;
 }
 .mat-card-title{
    padding-top: 7px;
   margin: 0 25px 25px 0;
   display: inline-block;
   vertical-align: top;
+  border-radius: 4px;
 }
 .toggle-view-btn{
     color:white;
     background:#3f51b5; 
-    border-radius: 1em;
+    border-radius: 4px;
     margin-top: 10px;
     padding:0.6em;
     border: 1px solid #3f51b5;
index 55b8062..77e9017 100644 (file)
@@ -27,6 +27,7 @@ import { IAppState } from '../../../common/core/store/state/app.state';
 import { JsonEditorComponent, JsonEditorOptions } from 'ang-jsoneditor';
 import { Observable } from 'rxjs';
 import { A11yModule } from '@angular/cdk/a11y';
+import { ResourceEditService } from './resource-edit.service';
 
 @Component({
   selector: 'app-resource-edit',
@@ -38,13 +39,13 @@ export class ResourceEditComponent implements OnInit {
     resources:IResources;
     data:IResources;
     rdState: Observable<IResourcesState>;
-    designerMode: boolean = true;
-    editorMode: boolean = false;
+    designerMode: boolean = false;
+    editorMode: boolean = true;
     viewText: string = "Open in Editor Mode";
     @ViewChild(JsonEditorComponent) editor: JsonEditorComponent;
     options = new JsonEditorOptions();
   
-  constructor(private store: Store<IAppState>) {
+  constructor(private store: Store<IAppState>, private resourceEditService: ResourceEditService) {
        this.rdState = this.store.select('resources');
     this.options.mode = 'text';
     this.options.modes = [ 'text', 'tree', 'view'];
@@ -92,5 +93,15 @@ export class ResourceEditComponent implements OnInit {
       this.designerMode = true;
       this.viewText = 'Open in Editor Mode'
     }
-  }  
+  } 
+
+  saveToBackend() {
+    this.resourceEditService.saveResource(this.data)
+    .subscribe(response=>{
+      window.alert("save success");
+    },
+    error=>{
+      window.alert('Error saving resources');
+    })
+  }
 }
index 2b25ae3..ae7143c 100644 (file)
@@ -30,6 +30,7 @@ import { SourcesTemplateComponent } from './sources-template/sources-template.co
 import { ResourceMetadataComponent } from './resource-metadata/resource-metadata.component';
 import { DragDropModule } from '@angular/cdk/drag-drop';
 import { NgJsonEditorModule } from 'ang-jsoneditor';
+import { ResourceEditService } from './resource-edit.service';
 
 @NgModule({
   declarations: [ ResourceEditComponent,SourcesTemplateComponent,ResourceMetadataComponent ],
@@ -42,6 +43,7 @@ import { NgJsonEditorModule } from 'ang-jsoneditor';
    MatExpansionModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule,  MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule,
    NgJsonEditorModule
   ],
-  exports: [ ResourceEditComponent,SharedModule ]
+  exports: [ ResourceEditComponent,SharedModule ],
+  providers: [ ResourceEditService ]
 })
 export class ResourceEditModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.service.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.service.ts
new file mode 100644 (file)
index 0000000..982d71d
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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.
+============LICENSE_END============================================
+*/
+
+
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable, observable } from 'rxjs';
+import { ApiService } from  '../../../common/core/services/api.service';
+import { LoopbackConfig, ResourceDictionaryURLs } from '../../../common/constants/app-constants';
+
+@Injectable()
+export class ResourceEditService {
+    // blueprintUrl = '../../constants/blueprint.json';
+
+    constructor(private _http: HttpClient, private api: ApiService) {
+    }
+
+    saveResource(resource) {
+       return this.api.post(LoopbackConfig.url+ ResourceDictionaryURLs.saveResourceDictionary, resource);
+    }
+}
\ No newline at end of file
index 43317e6..27d69b0 100644 (file)
@@ -93,13 +93,6 @@ Steps
    3. cd cds ; mvn clean install ; cd ..
    4. Open the cds-ui/client code for development
    
-Data Flow:
-==========
-|image1|
-
-.. |image1| image:: media/image1.jpg
-   :width: 7.88889in 
-   :height: 4.43750in
    
 Functional Decomposition:
 =========================
@@ -109,8 +102,3 @@ Functional Decomposition:
    :width: 7.88889in 
    :height: 4.43750in
    
-Controller design Studio Presentation:
-======================================
-
-Details about CDS Architecture and Design detail, Please click the link.
-:download:`CDS_Architecture_Design.pptx`
\ No newline at end of file
index 2405000..64abdec 100644 (file)
@@ -13,12 +13,9 @@ A Resource definition models the how a specific resource can be resolved.
 
 A resource is a variable/parameter in the context of the service. It can be anything, but it should not be confused with SDC or Openstack resources.
 
-A Resource definition can have multiple sources to handle resolution in different ways.
-
-The main goal of Resource definition is to define re-usable entity that could be shared.
-
-Creation of data dictionaries is a standalone activity, separated from the blueprint design.
+A Resource definition can have multiple sources to handle resolution in different ways. The main goal of Resource definition is to define re-usable entity that could be shared.
 
+Creation of Resource definition is a standalone activity, separated from the blueprint design.
 
 As part of modelling a Resource definition entry, the following generic information should be provided:
 
@@ -28,7 +25,7 @@ As part of modelling a Resource definition entry, the following generic informat
    :width: 7.88889in 
    :height: 4.43750in
 
-Bellow are properties that all the resource source have will have
+Below are properties that all the resource source have will have
 
 The modeling does allow for data translation between external capability and CDS for both input and output key mapping.
 
@@ -45,33 +42,12 @@ vf-module-model-customization-uuid and vf-module-label are two data dictionaries
 
 Here is how input-key-mapping, output-key-mapping and key-dependencies can be used:
 
-vf-module-label Resource definition  
-
-{
-  "name" : "vf-module-label",
-  "tags" : "vf-module-label",
-  "updated-by" : "adetalhouet",
-  "property" : {
-    "description" : "vf-module-label",
-    "type" : "string"
-  },
-  "sources" : {
-    "primary-db" : {
-      "type" : "source-primary-db",
-      "properties" : {
-        "type" : "SQL",
-        "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
-        "input-key-mapping" : {
-          "customizationid" : "vf-module-model-customization-uuid"
-        },
-        "output-key-mapping" : {
-          "vf-module-label" : "vf_module_label"
-        },
-        "key-dependencies" : [ "vf-module-model-customization-uuid" ]
-      }
-    }
-  }
-}
+.. toctree::
+   :maxdepth: 1
+   
+resourceDefintionCode 
+
+
 
 
 Resource source:
@@ -81,7 +57,7 @@ Defines the contract to resolve a resource.
 
 A resource source is modeled, following TOSCA_ node type definition and derives from the Resource_ source.
 
-Also please click below for detailed resource source details
+Also please click below for resource source available details
 
 .. toctree::
    :maxdepth: 1
@@ -89,4 +65,4 @@ Also please click below for detailed resource source details
    resourcesource
 
 .. _TOSCA: http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/csprd01/TOSCA-Simple-Profile-YAML-v1.0-csprd01.html#DEFN_ENTITY_NODE_TYPE
-.. _Resource_: https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-NodeResourceSource
\ No newline at end of file
+.. _Resource: https://wiki.onap.org/display/DW/Modeling+Concepts#ModelingConcepts-NodeResourceSource
\ No newline at end of file
diff --git a/docs/datadictionary/resourceDefinitionCode.rst b/docs/datadictionary/resourceDefinitionCode.rst
new file mode 100644 (file)
index 0000000..a917676
--- /dev/null
@@ -0,0 +1,48 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+Source Capability Code
+======================
+
+{
+  "description": "This is Component Resource Source Node Type",
+  "version": "1.0.0",
+  "properties": {
+    "script-type": {
+      "required": true,
+      "type": "string",
+      "default": "kotlin",
+      "constraints": [
+        {
+          "valid_values": [
+            "kotlin",
+            "jython"
+          ]
+        }
+      ]
+    },
+    "script-class-reference": {
+      "description": "Capability reference name for internal and kotlin, for jython script file path",
+      "required": true,
+      "type": "string"
+    },
+    "instance-dependencies": {
+      "required": false,
+      "description": "Instance dependency Names to Inject to Kotlin / Jython Script.",
+      "type": "list",
+      "entry_schema": {
+        "type": "string"
+      }
+    },
+    "key-dependencies": {
+      "description": "Resource Resolution dependency dictionary names.",
+      "required": true,
+      "type": "list",
+      "entry_schema": {
+        "type": "string"
+      }
+    }
+  },
+  "derived_from": "tosca.nodes.ResourceSource"
+}
similarity index 100%
rename from docs/media/image0.jpg
rename to docs/image0.jpg
index 5f39026..ed558bf 100644 (file)
@@ -27,7 +27,7 @@ Tosca Model Reference:
 
 |image0|
 
-.. |image0| image:: media/image0.jpg
+.. |image0| image:: image0.jpg
    :width: 7.88889in 
    :height: 4.43750in
 
@@ -46,8 +46,8 @@ MicroServices:
    :maxdepth: 1
    :glob:
     
-       controllerBlueprintStudioProcessor
-       bluePrintsProcessor
+       controllerBlueprintStudioProcessorMS
+       bluePrintsProcessorMS
 
 Architecture:
 =============
@@ -58,7 +58,7 @@ The GUI handles direct user input and allows for displaying both design time and
 
 |image0|
 
-.. |image0| image:: media/CDS_architecture.jpg
+.. |image0| image:: CDS_architecture.jpg
    :height: 4.43750in
    :width: 7.88889in