aboutsummaryrefslogtreecommitdiffstats
path: root/appc-directed-graph/dg-loader/provider
diff options
context:
space:
mode:
Diffstat (limited to 'appc-directed-graph/dg-loader/provider')
-rw-r--r--appc-directed-graph/dg-loader/provider/pom.xml36
-rw-r--r--appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java5
-rw-r--r--appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh38
3 files changed, 23 insertions, 56 deletions
diff --git a/appc-directed-graph/dg-loader/provider/pom.xml b/appc-directed-graph/dg-loader/provider/pom.xml
index cb9e332f5..3abb4fefb 100644
--- a/appc-directed-graph/dg-loader/provider/pom.xml
+++ b/appc-directed-graph/dg-loader/provider/pom.xml
@@ -164,41 +164,5 @@
</plugin>
</plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- com.brocade.developer
- </groupId>
- <artifactId>
- providermodule-plugin
- </artifactId>
- <versionRange>
- [1.2.0.100-SNAPSHOT,)
- </versionRange>
- <goals>
- <goal>process</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
</build>
</project>
diff --git a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
index d88958239..424a2d6cd 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
+++ b/appc-directed-graph/dg-loader/provider/src/main/java/org/onap/sdnc/dg/loader/DGXMLLoadNActivate.java
@@ -168,11 +168,6 @@ public class DGXMLLoadNActivate {
"Sufficient inputs for DGXMLLoadNActivate are missing <xmlpath> <activatefile> <dbPropertyfile>");
}
- // propertyPath =
- // "/Users/bs2796/0Source/ecomp/bvc-3.2.2/others/properties/dblib.properties";
- // xmlPath = DGXMLLoadNActivate.class.getClassLoader().getResource(".").getPath()
- // +"/xml" ;
-
DGXMLLoadNActivate dgXMLLoadDB = new DGXMLLoadNActivate(propertyPath);
dgXMLLoadDB.loadDGXMLDir(xmlPath);
dgXMLLoadDB.activateDg(activateFile);
diff --git a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
index d12654282..b499b081d 100644
--- a/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
+++ b/appc-directed-graph/dg-loader/provider/src/main/resources/scripts/dg_load_activate.sh
@@ -25,30 +25,38 @@
###
-export BVC_DIR=/opt/app/bvc
-export DG_DIR=${BVC_DIR}/dg
+###
+### Convert XML DGs to JSON DGs using dg-loader, then load/activate them in the MySQL DB. ###
+###
+
+export APPC_HOME=${APPC_HOME:-/opt/onap/appc}
+
+# SVCLOGIC_DIR env variable points to /opt/onap/appc/svclogic
+export SVCLOGIC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
-if (( "$#" != 1 ))
+#Path to the dg-loader jar file
+export DG_LOADER=${APPC_HOME}/data/dg-loader-provider-jar-with-dependencies.jar
+
+# Check if the JSON Directory exists under the env. variable defined
+export DG_JSON_DIR=${SVCLOGIC_DIR}/graphs/appc/json/dg-loader-dgs
+echo "Processing DG JSON directory : ${DG_JSON_DIR}"
+if [ ! -d "$DG_JSON_DIR" ]
then
- echo "DG JSON Directory is Missing"
+ echo "DG-Loader JSON Directory is Missing"
exit 1
fi
-export DG_JSON_DIR=$1
-echo "Processing DG JSON directory : ${DG_JSON_DIR}"
cd ${DG_JSON_DIR}
+mkdir -p ${DG_JSON_DIR}/converted-xml
-######################################################################
-rm -rf ${DG_JSON_DIR}/xml
-
-################## To Genetare XML from JSON ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/xml
+# Generate XML DGs from JSON DGs
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLGenerator ${DG_JSON_DIR} ${DG_JSON_DIR}/converted-xml
-################## To Load DG XML ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/xml ${BVC_DIR}/properties/dblib.properties
+# Load converted XML DGs to the SVC_LOGIC DB in the MySQL Docker Container
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLLoad ${DG_JSON_DIR}/converted-xml ${APPC_HOME}/data/properties/dblib.properties
-################## To Activate ########################
-$JAVA_HOME/bin/java -cp ${DG_DIR}/lib/dg-loader-provider.jar org.onap.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${BVC_DIR}/properties/dblib.properties
+# Activate converted XML DGs to the SVC_LOGIC DB in the MySQL Docker Container
+$JAVA_HOME/bin/java -cp ${DG_LOADER} org.onap.sdnc.dg.loader.DGXMLActivate ${DG_JSON_DIR}/dg_activate.txt ${APPC_HOME}/data/properties/dblib.properties
exit 0