This repository has been archived by the owner on Nov 22, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEIIDTOOLS-469 Addition of add composition wizard
- Loading branch information
Showing
46 changed files
with
2,195 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Column } from "@dataservices/shared/column.model"; | ||
|
||
describe("Column", () => { | ||
let column: Column; | ||
|
||
beforeEach(() => { | ||
column = null; | ||
}); | ||
|
||
it("should create", () => { | ||
console.log("========== [Column] should create"); | ||
column = Column.create( | ||
{ | ||
"keng__baseUri": "http://das-beetle-studio.192.168.42.67.nip.io/vdb-builder/v1/", | ||
"keng__id": "account_id", | ||
"keng__dataPath": "/tko:komodo/tko:workspace/admin/pgConn/pgconnschemavdb/pgconnschemamodel/account/account_id", | ||
"keng__kType": "Column", | ||
"keng__hasChildren": false, | ||
"Datatype": "INTEGER", | ||
"keng___links": [ | ||
{ | ||
"rel": "self", | ||
"href": "http://das-beetle-studio.192.168.42.67.nip.io/vdb-builder/v1/workspace/blah/account/Columns/account_id" | ||
}, | ||
{ | ||
"rel": "parent", | ||
"href": "http://das-beetle-studio.192.168.42.67.nip.io/vdb-builder/v1/workspace/blah/account" | ||
}, | ||
{ | ||
"rel": "children", | ||
"href": "http://das-beetle-studio.192.168.42.67.nip.io/vdb-builder/v1/workspace/s" | ||
} | ||
] | ||
} | ||
); | ||
|
||
expect(column.getName()).toEqual("account_id"); | ||
expect(column.getDatatype()).toEqual("INTEGER"); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
/** | ||
* @license | ||
* Copyright 2017 JBoss Inc | ||
* | ||
* 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. | ||
*/ | ||
|
||
export class Column { | ||
|
||
private isSelected = false; | ||
private keng__id: string; | ||
private Datatype: string; | ||
private size: number; | ||
|
||
/** | ||
* @param {Object} json the JSON representation of a Column | ||
* @returns {Column} the new Column (never null) | ||
*/ | ||
public static create( json: object = {} ): Column { | ||
const column = new Column(); | ||
column.setValues( json ); | ||
return column; | ||
} | ||
|
||
constructor() { | ||
// nothing to do | ||
} | ||
|
||
/** | ||
* @returns {string} the column name | ||
*/ | ||
public getName(): string { | ||
return this.keng__id; | ||
} | ||
|
||
/** | ||
* @param {string} name the column name | ||
*/ | ||
public setName( name?: string ): void { | ||
this.keng__id = name ? name : null; | ||
} | ||
|
||
/** | ||
* @returns {string} the column type | ||
*/ | ||
public getDatatype(): string { | ||
return this.Datatype; | ||
} | ||
|
||
/** | ||
* @param {string} name the column type | ||
*/ | ||
public setDatatype( type: string ): void { | ||
this.Datatype = type; | ||
} | ||
|
||
/** | ||
* @returns {number} the column size | ||
*/ | ||
public getSize(): number { | ||
return this.size; | ||
} | ||
|
||
/** | ||
* @param {number} size the column size | ||
*/ | ||
public setSize( size: number ): void { | ||
this.size = size; | ||
} | ||
|
||
/** | ||
* @returns {boolean} 'true' if column isSelected | ||
*/ | ||
public get selected(): boolean { | ||
return this.isSelected; | ||
} | ||
|
||
/** | ||
* @param {boolean} selected the column isSelected state | ||
*/ | ||
public setSelected( selected: boolean ): void { | ||
this.isSelected = selected; | ||
} | ||
|
||
/** | ||
* Set all object values using the supplied View json | ||
* @param {Object} values | ||
*/ | ||
public setValues(values: object = {}): void { | ||
Object.assign(this, values); | ||
} | ||
|
||
} |
Oops, something went wrong.