summaryrefslogtreecommitdiffstats
path: root/sliapi/provider/pom.xml
blob: 533b18e0c9bab36f8d7bb9da53c477403bac5663 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.onap.ccsdk.parent</groupId>
        <artifactId>binding-parent</artifactId>
        <version>1.4.0-SNAPSHOT</version>
        <relativePath/>
    </parent>

    <groupId>org.onap.ccsdk.sli.core</groupId>
    <artifactId>sliapi-provider</artifactId>
    <version>0.6.0-SNAPSHOT</version>
    <packaging>bundle</packaging>

    <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
    
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.onap.ccsdk.sli.core</groupId>
				<artifactId>dblib-provider</artifactId>
				<version>${project.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.onap.ccsdk.sli.core</groupId>
            <artifactId>sliapi-model</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.opendaylight.mdsal</groupId>
            <artifactId>mdsal-binding-api</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-binding-api</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-binding-broker-impl</artifactId>
        </dependency> 
        
        <dependency>
            <groupId>org.opendaylight.mdsal</groupId>
            <artifactId>mdsal-binding-dom-adapter</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.opendaylight.mdsal</groupId>
            <artifactId>yang-binding</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-common-util</artifactId>
        </dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
			<scope>provided</scope>
		</dependency>

        <dependency>
            <groupId>org.onap.ccsdk.sli.core</groupId>
            <artifactId>sli-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.onap.ccsdk.sli.core</groupId>
            <artifactId>sli-provider</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.onap.ccsdk.sli.core</groupId>
            <artifactId>sli-provider-base</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>sal-core-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>yang-data-impl</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
ss="kd">@HostListener('window:keyup.delete', ['$event']) ondelete(event: KeyboardEvent) { if (this.showProperties || 0 >= this.selectedElements.length) { return; } this.selectedElements.forEach(element => { if (this.modelService.isNode(element)) { let selectNode = element as WorkflowNode; const parentId = this.jsPlumbService.getParentNodeId(selectNode.id); this.jsPlumbService.remove(selectNode); this.modelService.deleteNode(parentId, selectNode.id); } else { let sequenceFlow = element as SequenceFlow; this.modelService.deleteConnection(sequenceFlow.sourceRef, sequenceFlow.targetRef); this.jsPlumbService.deleteConnect(sequenceFlow.sourceRef, sequenceFlow.targetRef); } }); this.selectedElements = []; } @HostListener('document:mouseup', ['$event']) onmouseup() { if (this.isSelecting) { this.nodeSelector.nativeElement.style.display = 'none'; this.mainContainer.nativeElement.onmousemove = null; this.isSelecting = false; this.broadcastService.broadcast(this.broadcastService.showProperty, null); this.broadcastService.broadcast(this.broadcastService.selectedElement, this.selectedElements); } } public ngOnInit() { this.jsPlumbService.initJsPlumbInstance(this.modelService.rootNodeId); this.broadcastService.initModel$.subscribe(() => { this.needInitSequence = true; }); this.broadcastService.showProperty$.subscribe(element=>{ this.showProperties = null !== element; }); } public ngAfterViewInit() { this.jsPlumbService.canvasDroppable(); this.broadcastService.selectedElement$.subscribe(elements => { if (elements) { this.selectedElements = elements; } else { this.selectedElements = []; } }); } public ngAfterViewChecked() { if (this.needInitSequence) { this.needInitSequence = false; // Add the connection this.jsPlumbService.connectChildrenNodes(this.modelService.rootNodeId); } } public ngOnDestroy() { if (this.mainContainer.nativeElement.onmousemove) { this.mainContainer.nativeElement.document.onmousemove = null; } } public canvasMouseDown(event) { this.selectedElements = []; this.isSelecting = true; let posx = event.clientX + this.mainContainer.nativeElement.scrollLeft; posx = 220 > posx ? 0 : posx - 220; let posy = event.clientY + this.mainContainer.nativeElement.scrollTop; posy = 60 > posy ? 0 : posy - 60; let element = this.nodeSelector.nativeElement; element.style.left = posx + "px"; element.style.top = posy + "px"; element.style.width = '0px'; element.style.height = '0px'; element.style.display = 'block'; let curThis = this; this.mainContainer.nativeElement.onmousemove = function (moveEvent) { let movePosx = moveEvent.clientX + curThis.mainContainer.nativeElement.scrollLeft; movePosx = 220 > movePosx ? 0 : movePosx - 220; let movePosy = moveEvent.clientY + curThis.mainContainer.nativeElement.scrollTop; movePosy = 60 > movePosy ? 0 : movePosy - 60; const left = Math.min(movePosx, posx); const top = Math.min(movePosy, posy); const width = Math.abs(posx - movePosx); const height = Math.abs(posy - movePosy); element.style.left = left + "px"; element.style.top = top + "px"; element.style.width = width + "px"; element.style.height = height + "px"; curThis.selectNodes(left, top, width, height); }; } private selectNodes(left: number, top: number, width: number, height: number) { this.selectedElements = []; const allNodes = this.modelService.getNodes(); allNodes.forEach(node => { const np = node.position; let selected = false; if (left < np.left) { if ((top < np.top && left + width > np.left && top + height > np.top) || (top >= np.top && top < np.top + np.height && left + width > np.left)) { selected = true; } } else if (left < np.left + np.width) { if ((top < np.top && top + height > np.top) || (top >= np.top && top < np.top + np.height)) { selected = true; } } if (selected) { this.selectedElements.push(node); } }); this.broadcastService.broadcast(this.broadcastService.selectedElement, this.selectedElements); } }