Add platform installer for A1 controller

Change-Id: Ic24aeab182ffba1d4efd937ad4e3359752c5677c
Issue-ID: NONRTRIC-70
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
diff --git a/sdnc-a1-controller/oam/installation/sdnc/pom.xml b/sdnc-a1-controller/oam/installation/sdnc/pom.xml
index b6e1c84..ea1a52b 100644
--- a/sdnc-a1-controller/oam/installation/sdnc/pom.xml
+++ b/sdnc-a1-controller/oam/installation/sdnc/pom.xml
@@ -340,38 +340,7 @@
                             </artifactItems>
                         </configuration>
                     </execution>
-                    <execution>
-                        <id>unpack migration utility</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data-migrator</outputDirectory>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.onap.sdnc.oam</groupId>
-                                    <artifactId>data-migrator</artifactId>
-                                    <version>${project.version}</version>
-                                    <type>zip</type>
-                                </artifactItem>
-                            </artifactItems>
-                        </configuration>
-                    </execution>
                 </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.onap.sdnc.oam</groupId>
-                        <artifactId>platform-logic-installer</artifactId>
-                        <version>1.6.2</version>
-                        <type>pom</type>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.onap.sdnc.oam</groupId>
-                        <artifactId>data-migrator</artifactId>
-                        <version>1.6.2</version>
-                    </dependency>
-                </dependencies>
             </plugin>
             <plugin>
                 <artifactId>exec-maven-plugin</artifactId>
diff --git a/sdnc-a1-controller/oam/platform-logic/.gitignore b/sdnc-a1-controller/oam/platform-logic/.gitignore
new file mode 100644
index 0000000..1b8a6ba
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/.gitignore
@@ -0,0 +1,12 @@
+org.eclipse.core.resources.prefs
+.classpath

+.project

+.settings

+.idea

+.externalToolBuilders

+maven-eclipse.xml

+*.class

+target/

+MANIFEST.MF

+.DS_STORE

+.metadata

diff --git a/sdnc-a1-controller/oam/platform-logic/installer/pom.xml b/sdnc-a1-controller/oam/platform-logic/installer/pom.xml
new file mode 100644
index 0000000..1bc0a03
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/installer/pom.xml
@@ -0,0 +1,55 @@
+<?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>
+
+	<repositories>
+    		<repository>
+      			<id>onap-releases</id>
+          		<name>onap-releases</name>
+          		<url>https://nexus.onap.org/content/repositories/releases/</url>
+    		</repository>
+  	</repositories>
+
+	<parent>
+		<groupId>org.onap.ccsdk.parent</groupId>
+		<artifactId>odlparent-lite</artifactId>
+		<version>1.4.3</version>
+		<relativePath/>
+	</parent>
+
+	<groupId>org.onap.sdnc.oam</groupId>
+	<artifactId>platform-logic-installer</artifactId>
+	<version>1.7.3-SNAPSHOT</version>
+	<packaging>pom</packaging>
+
+	<name>sdnc-oam :: platform-logic :: ${project.artifactId}</name>
+	<description>Contains platform-level service logic installer</description>
+
+	<build>
+		<plugins>
+
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<version>2.6</version>
+				<executions>
+					<execution>
+						<id>create-zip</id>
+						<goals>
+							<goal>single</goal>
+						</goals>
+						<phase>package</phase>
+						<configuration>
+							<attach>true</attach>
+							<descriptors>
+								<descriptor>src/assembly/assemble_zip.xml</descriptor>
+							</descriptors>
+							<appendAssemblyId>false</appendAssemblyId>
+						</configuration>
+					</execution>
+
+				</executions>
+			</plugin>
+
+        </plugins>
+	</build>
+</project>
diff --git a/sdnc-a1-controller/oam/platform-logic/installer/src/assembly/assemble_zip.xml b/sdnc-a1-controller/oam/platform-logic/installer/src/assembly/assemble_zip.xml
new file mode 100644
index 0000000..9fc5ff8
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/installer/src/assembly/assemble_zip.xml
@@ -0,0 +1,62 @@
+<!--
+  ============LICENSE_START=======================================================
+  openECOMP : SDN-C
+  ================================================================================
+  Copyright (C) 2017 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.
+  ============LICENSE_END=========================================================
+  -->
+
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+
+        <fileSet>
+            <directory>../target/svclogic</directory>
+            <outputDirectory>svclogic</outputDirectory>
+            <includes>
+                <include>**/*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>../target/restapi</directory>
+            <outputDirectory>restapi</outputDirectory>
+            <includes>
+                <include>**/*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>../target/restconfapi</directory>
+            <outputDirectory>restconfapi</outputDirectory>
+            <includes>
+                <include>**/*</include>
+            </includes>
+        </fileSet>
+
+    </fileSets>
+
+
+</assembly>
diff --git a/sdnc-a1-controller/oam/platform-logic/pom.xml b/sdnc-a1-controller/oam/platform-logic/pom.xml
new file mode 100644
index 0000000..be067fc
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/pom.xml
@@ -0,0 +1,42 @@
+<?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>
+
+	<repositories>
+    		<repository>
+      			<id>onap-releases</id>
+          		<name>onap-releases</name>
+          		<url>https://nexus.onap.org/content/repositories/releases/</url>
+    		</repository>
+  	</repositories>
+
+    <parent>
+        <groupId>org.onap.ccsdk.parent</groupId>
+        <artifactId>odlparent-lite</artifactId>
+        <version>1.4.3</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.onap.sdnc.oam</groupId>
+    <artifactId>platform-logic</artifactId>
+    <version>1.7.3-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>sdnc-oam :: platform-logic</name>
+    <description>Contains platform-level service logic</description>
+    <organization>
+        <name>ONAP</name>
+    </organization>
+
+    <modules>
+        <module>setup</module>
+        <module>installer</module>
+    </modules>
+
+    <properties>
+        <application.name>platform-logic</application.name>
+
+        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+        <build.number>${maven.build.timestamp}</build.number>
+    </properties>
+</project>
diff --git a/sdnc-a1-controller/oam/platform-logic/setup/pom.xml b/sdnc-a1-controller/oam/platform-logic/setup/pom.xml
new file mode 100644
index 0000000..2efbb2c
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/setup/pom.xml
@@ -0,0 +1,68 @@
+<?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>
+
+	<repositories>
+    		<repository>
+      			<id>onap-releases</id>
+          		<name>onap-releases</name>
+          		<url>https://nexus.onap.org/content/repositories/releases/</url>
+    		</repository>
+  	</repositories>
+
+	<parent>
+        <groupId>org.onap.ccsdk.parent</groupId>
+        <artifactId>odlparent-lite</artifactId>
+        <version>1.4.3</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.onap.sdnc.oam</groupId>
+	<artifactId>platform-logic-setup</artifactId>
+	<version>1.7.3-SNAPSHOT</version>
+	<packaging>pom</packaging>
+
+    <name>sdnc-oam :: platform-logic :: ${project.artifactId}</name>
+	<description>Copies base ONAP platform-logic</description>
+
+	<build>
+		<plugins>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>3.0.0</version>
+				<executions>
+					<execution>
+						<id>unpack</id>
+						<phase>validate</phase>
+						<goals>
+							<goal>unpack</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<artifactItem>
+									<groupId>org.onap.ccsdk.distribution</groupId>
+									<artifactId>platform-logic-installer</artifactId>
+									<version>${ccsdk.distribution.version}</version>
+									<type>zip</type>
+									<overWrite>true</overWrite>
+									<outputDirectory>../target</outputDirectory>
+								</artifactItem>
+							</artifactItems>
+							<overWriteReleases>false</overWriteReleases>
+							<overWriteSnapshots>true</overWriteSnapshots>
+							<overWriteIfNewer>true</overWriteIfNewer>
+							<localRepositoryDirectory>../target/repository</localRepositoryDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+
+
+
+
+		</plugins>
+	</build>
+</project>
diff --git a/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updateDgNamespace.sh b/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updateDgNamespace.sh
new file mode 100755
index 0000000..dde8891
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updateDgNamespace.sh
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+updateFile() {
+sed  -i .orig -e '
+s/openecomp.org/onap.org/g
+' $1
+}
+
+for file in $@
+do
+	updateFile $file
+done
diff --git a/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updatePackages.sh b/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updatePackages.sh
new file mode 100755
index 0000000..2fd0e36
--- /dev/null
+++ b/sdnc-a1-controller/oam/platform-logic/src/main/scripts/updatePackages.sh
@@ -0,0 +1,21 @@
+#! /bin/bash
+
+updateFile() {
+sed  -i .orig -e '
+s/\(plugin=.\)org.openecomp.sdnc.\(prop\)/\org.onap.ccsdk.sli.plugins.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.\(ra\)/\1org.onap.ccsdk.sli.adaptors.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.\(restapicall\)/\1org.onap.ccsdk.sli.plugins.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.sli.\(aai\)/\1org.onap.ccsdk.sli.adaptors.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.sli.common/\1org.onap.ccsdk.sli.core.sli/g
+s/\(plugin=.\)org.openecomp.sdnc.\(sli.provider\)/\1org.onap.ccsdk.sli.core.\2/g
+s/\(plugin=\\\{0,1\}.\)com.att.sdnctl.\(sli.recording\)/\1org.openecomp.sdnc.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.sli.\(resource.mdsal\)/\1org.onap.ccsdk.sli.adaptors.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.sli\(resource.sql\)/\org.onap.ccsdk.sli.adaptors.\2/g
+s/\(plugin=.\)org.openecomp.sdnc.sli.SliPluginUtils/\1org.onap.ccsdk.sli.core.slipluginutils/g
+' $1
+}
+
+for file in $@
+do
+	updateFile $file
+done
diff --git a/sdnc-a1-controller/oam/pom.xml b/sdnc-a1-controller/oam/pom.xml
index d805eba..5b86ce5 100755
--- a/sdnc-a1-controller/oam/pom.xml
+++ b/sdnc-a1-controller/oam/pom.xml
@@ -28,6 +28,10 @@
 		<name>AT&amp;T</name>
 	</organization>
 
+	<modules>
+		<module>platform-logic</module>
+	</modules>
+
 	<scm>
                 <connection>scm:git:ssh://git@${onap.git.host}/sdnc-oam.git</connection>
                 <developerConnection>scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-oam.git</developerConnection>