diff options
author | Rob Daugherty <rd472p@att.com> | 2017-10-19 13:49:11 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2017-10-19 13:49:11 -0400 |
commit | 6c658bc08c3032bc7820ef39c950cc316434c387 (patch) | |
tree | ccd271c54567be8b14ae49582ed974045bd4e498 /bpmn/MSOURN-plugin | |
parent | f2cc7284ebee1ac9159a95a8666467b4d85328f8 (diff) |
Restore MSOMockServer to the build
Classes in this artifact are needed for unit tests.
For a long term solution, we should find a way to
build these classes into a test-scoped artifact.
Issue: SO-242
Change-Id: I1a57fead07250c841a9f59afb805aea26c7bc102
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOURN-plugin')
17 files changed, 0 insertions, 1086 deletions
diff --git a/bpmn/MSOURN-plugin/build.properties b/bpmn/MSOURN-plugin/build.properties deleted file mode 100644 index 7e5fb9f22f..0000000000 --- a/bpmn/MSOURN-plugin/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Copy this file to 'build.properties' and modify it to match your system -# Alternatively, you can also copy it to '${user.home}/.camunda/build.properties' -# to have a central configuration that works with all camunda BPM projects - -# Defines the deployment folder in a camunda BPM installation (backslashes need to be escaped or replaced by forward slashes). -#deploy.jboss.dir=C:/camunda/camunda-bpm-jboss-7.3.0/server/jboss-as-${jboss-version}/standalone/deployments -deploy.jboss.dir=C:/D2/jboss-ee/server/jboss-as-7.2.0.Final/standalone/deployments
\ No newline at end of file diff --git a/bpmn/MSOURN-plugin/build.xml b/bpmn/MSOURN-plugin/build.xml deleted file mode 100644 index f2dbc55e52..0000000000 --- a/bpmn/MSOURN-plugin/build.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="urnMap-plugin" default="deploy.jboss"> - - <property file="build.properties" /> - <property file="${user.home}/.camunda/build.properties" /> - <property name="target.dir" value="target" /> - - <condition property="mvn.executable" value="mvn.bat" else="mvn"> - <os family="windows"/> - </condition> - - <target name="deploy.jboss" depends="package.mvn, install.cockpit.plugin" description="Copies the cockit plugin to the deployment directory defined in '${basedir}/build.properties' or '${user.home}/.camunda/build.properties'" /> - - <target name="deploy.tomcat" depends="package.mvn" description="Copies the cockpit plugin to the deployment directory defined in '${basedir}/build.properties' or '${user.home}/.camunda/build.properties'"> - <fail unless="deploy.tomcat.dir" message="No deployment folder has been configured. Please copy the file '${basedir}/build.properties.example' to '${basedir}/build.properties' or '${user.home}/.camunda/build.properties' and change it according to your environment." /> - <copy file="${target.dir}/${ant.project.name}.jar" todir="${deploy.tomcat.dir}/camunda/WEB-INF/lib" /> - <touch file="${deploy.tomcat.dir}/camunda/WEB-INF/web.xml"/> - </target> - - <target name="package.mvn"> - <exec executable="${mvn.executable}" dir="." failonerror="true"> - <env key="MAVEN_OPTS" value="-Xmx1024m -Xms512m -DskipTests=true -Dmaven.test.skip=true" /> - <arg line="clean package" /> - </exec> - </target> - - <target name="install.cockpit.plugin"> - <fail unless="deploy.jboss.dir" message="No deployment folder has been configured. Please copy the file '${basedir}/build.properties.example' to '${basedir}/build.properties' or '${user.home}/.camunda/build.properties' and change it according to your environment." /> - <path id="cockpit.file.id"> - <fileset dir="${deploy.jboss.dir}"> - <include name="camunda-webapp-*.war"/> - </fileset> - </path> - <property name="cockpit.file" refid="cockpit.file.id"/> - <war destfile="${cockpit.file}" update="true"> - <zipfileset file="${target.dir}/${ant.project.name}.jar" fullpath="WEB-INF/lib/${ant.project.name}.jar" /> - </war> - </target> - - <target name="undeploy.jboss" description="Deletes the cockpit plugin from the deployment directory defined in '${basedir}/build.properties' or '${user.home}/.camunda/build.properties'"> - <path id="cockpit.file.id"> - <fileset dir="${deploy.jboss.dir}"> - <include name="camunda-webapp-*.war"/> - </fileset> - </path> - <property name="cockpit.file" refid="cockpit.file.id"/> - <basename property="cockpit.filename" file="${cockpit.file}"/> - <move file="${cockpit.file}" todir="${java.io.tmpdir}"/> - <zip destfile="${cockpit.file}"> - <zipfileset src="${java.io.tmpdir}/${cockpit.filename}"> - <exclude name="WEB-INF/lib/${ant.project.name}.jar"/> - </zipfileset> - </zip> - </target> - - <target name="undeploy.tomcat" description="Deletes the cockpit plugin from the deployment directory defined in '${basedir}/build.properties' or '${user.home}/.camunda/build.properties'"> - <delete file="${deploy.tomcat.dir}/camunda/WEB-INF/lib/${ant.project.name}.jar" /> - </target> - -</project> diff --git a/bpmn/MSOURN-plugin/pom.xml b/bpmn/MSOURN-plugin/pom.xml deleted file mode 100644 index 40dcd1f666..0000000000 --- a/bpmn/MSOURN-plugin/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ -<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.openecomp.so</groupId>
- <artifactId>bpmn</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.openecomp.so</groupId>
- <artifactId>cockpit-urnmap-plugin</artifactId>
-
- <packaging>jar</packaging>
-
- <name>MSO URN Mapping Cockpit Plugin</name>
-
- <dependencies>
- <dependency>
- <groupId>org.camunda.bpm.webapp</groupId>
- <artifactId>camunda-webapp</artifactId>
- <classifier>classes</classifier>
- <version>${camunda.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0</version>
- </dependency>
- <!-- TODO Upate it to ee version -->
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine</artifactId>
- <version>${camunda.version}</version>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.0.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/URNMapPlugin.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/URNMapPlugin.java deleted file mode 100644 index 4f6ead0299..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/URNMapPlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.camunda.bpm.cockpit.plugin.spi.impl.AbstractCockpitPlugin;
-import org.openecomp.camunda.bpmn.plugin.urnmap.resources.URNMapPluginRootResource;
-
-
-
-public class URNMapPlugin extends AbstractCockpitPlugin{
- public static final String ID = "urnMap-plugin";
-
- @Override
- public String getId() {
- return ID;
- }
-
- @Override
- public Set<Class<?>> getResourceClasses() {
- Set<Class<?>> classes = new HashSet<>();
-
- classes.add(URNMapPluginRootResource.class);
-
- return classes;
- }
-
- @Override
- public List<String> getMappingFiles() {
- return Arrays.asList("org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml");
- }
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java deleted file mode 100644 index 60d65665fe..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java +++ /dev/null @@ -1,89 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.db;
-
-import org.camunda.bpm.engine.ProcessEngineConfiguration;
-import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
-import org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration;
-import org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor;
-import org.camunda.bpm.engine.impl.interceptor.CommandInterceptor;
-import org.camunda.bpm.engine.impl.interceptor.LogInterceptor;
-import org.camunda.bpm.engine.impl.util.ReflectUtil;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class MyBatisExtendedSessionFactory extends StandaloneProcessEngineConfiguration {
-
- private String resourceName;
-
- @Override
- protected void init() {
- throw new IllegalArgumentException(
- "Normal 'init' on process engine only used for extended MyBatis mappings is not allowed, please use 'initFromProcessEngineConfiguration'. You cannot construct a process engine with this configuration.");
- }
-
- /**
- * initialize the {@link ProcessEngineConfiguration} from an existing one,
- * just using the database settings and initialize the database / MyBatis
- * stuff.
- */
- public void initFromProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration, String resourceName) {
- this.resourceName = resourceName;
-
- setDatabaseType(processEngineConfiguration.getDatabaseType());
- setDataSource(processEngineConfiguration.getDataSource());
- setDatabaseTablePrefix(processEngineConfiguration.getDatabaseTablePrefix());
-
- initDataSource();
- initCommandContextFactory();
- initTransactionFactory();
- initTransactionContextFactory();
- initCommandExecutors();
- initSqlSessionFactory();
- initIncidentHandlers();
- initIdentityProviderSessionFactory();
- initSessionFactories();
- }
-
- /**
- * In order to always open a new command context set the property
- * "alwaysOpenNew" to true inside the CommandContextInterceptor.
- *
- * If you execute the custom queries inside the process engine
- * (for example in a service task), you have to do this.
- */
- @Override
- protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
- List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<>();
- defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
- defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this, true));
- return defaultCommandInterceptorsTxRequired;
- }
-
- @Override
- protected InputStream getMyBatisXmlConfigurationSteam() {
- return ReflectUtil.getResourceAsStream(resourceName);
- }
-
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisQueryCommandExecutor.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisQueryCommandExecutor.java deleted file mode 100644 index f81d8c604d..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisQueryCommandExecutor.java +++ /dev/null @@ -1,44 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.db;
-
-import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
-import org.camunda.bpm.engine.impl.interceptor.Command;
-
-/**
- * Helper to initialize a minimized process engine which does all the transaction and MyBatis mapping stuff for us
- * and can be used to execute queries.
- */
-public class MyBatisQueryCommandExecutor {
-
- private MyBatisExtendedSessionFactory myBatisExtendedSessionFactory;
-
- public MyBatisQueryCommandExecutor(ProcessEngineConfigurationImpl processEngineConfiguration, String mappingResourceName) {
- myBatisExtendedSessionFactory = new MyBatisExtendedSessionFactory();
- myBatisExtendedSessionFactory.initFromProcessEngineConfiguration(processEngineConfiguration, mappingResourceName);
- }
-
- public <T> T executeQueryCommand(Command<T> command) {
- return myBatisExtendedSessionFactory.getCommandExecutorTxRequired().execute(command);
- }
-
-
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNData.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNData.java deleted file mode 100644 index b2dcefb304..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNData.java +++ /dev/null @@ -1,47 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.db;
-
-public class URNData {
-
- private String URNName;
- private String URNValue;
- private String Ver_;
- public String getURNName() {
- return URNName;
- }
- public void setURNName(String uRNName) {
- URNName = uRNName;
- }
- public String getURNValue() {
- return URNValue;
- }
- public void setURNValue(String uRNValue) {
- URNValue = uRNValue;
- }
- public String getVer_() {
- return Ver_;
- }
- public void setVer_(String ver_) {
- Ver_ = ver_;
- }
-
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNService.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNService.java deleted file mode 100644 index 1eb0ba6f97..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNService.java +++ /dev/null @@ -1,49 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.db;
-
-import java.util.List;
-
-import org.camunda.bpm.engine.ProcessEngines;
-import org.camunda.bpm.engine.impl.ProcessEngineImpl;
-import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
-import org.camunda.bpm.engine.impl.interceptor.Command;
-import org.camunda.bpm.engine.impl.interceptor.CommandContext;
-
-public class URNService {
-
-
- public List<URNData> getProperties() {
- ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
- ProcessEngineConfigurationImpl processEngineConfiguration = processEngine.getProcessEngineConfiguration();
-
- MyBatisQueryCommandExecutor commandExecutor = new MyBatisQueryCommandExecutor(processEngineConfiguration, "mappings.xml");
- return commandExecutor.executeQueryCommand(new Command<List<URNData>>() {
-
- @SuppressWarnings("unchecked")
- @Override
- public List<URNData> execute(CommandContext commandContext) {
- return (List<URNData>) commandContext.getDbSqlSession().selectList("retrieveUrnKeyValuePair", null);
- }
- });
- }
-
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/ProcessInstanceResource.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/ProcessInstanceResource.java deleted file mode 100644 index 484981c99d..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/ProcessInstanceResource.java +++ /dev/null @@ -1,98 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.resources;
-
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.camunda.bpm.cockpit.db.QueryParameters;
-import org.camunda.bpm.cockpit.plugin.resource.AbstractPluginResource;
-import org.openecomp.camunda.bpmn.plugin.urnmap.db.*;
-
-public class ProcessInstanceResource extends AbstractPluginResource {
-
- private static final Logger log = LoggerFactory.getLogger(ProcessInstanceResource.class);
-
- public ProcessInstanceResource(String engineName) {
- super(engineName);
- }
-
- @GET
- public List<URNData> getUrnDataMap() {
- List<URNData> list = getQueryService()
- .executeQuery(
- "cockpit.urnMap.retrieveUrnKeyValuePair",
- new QueryParameters<URNData>());
-
- log.info("urnmap-plugin project - Results Retrieved: ");
- log.info("URNName: " + " " + "URNValue: " );
- for(URNData d: list)
- {
- log.info( d.getURNName() + " " + d.getURNValue());
- }
-
- return list;
- }
-
- @PUT
- //public void insertNewRow(String key, String value)
- public void insertNewRow(String temp)
- {
- log.info("AddNewRow: XXXXXXXXXXXXXXXXX ---> " + temp);
- StringTokenizer st = new StringTokenizer(temp, "|");
- String key = "";
- String value = "";
-
- while(st.hasMoreTokens()) {
- key = st.nextToken();
- value = st.nextToken();
- log.info(key + "\t" + value);
- }
-
- log.info("AddNewRow: XXXXXXXXXXXXXXXXX ---> key: " + key + " , Value: " + value);
- URNData nRow = new URNData();
- nRow.setVer_("1");
- nRow.setURNName(key);
- nRow.setURNValue(value);
-
- getQueryService().executeQuery("cockpit.urnMap.insertNewRow", nRow, URNData.class);
-
- log.info("AddNewRow: XXXXXX END XXXXXXXXXXX");
- }
-
- @POST
- public void getPersistData(URNData d) {
-
- log.info("getPersistData: UrnName: " + d.getURNName() + " , URNValue: " + d.getURNValue() );
-
- getQueryService().executeQuery("cockpit.urnMap.persistURNData", d, URNData.class);
-
-
- log.info("XXXXXXXXXX - END - XXXXXXXXXXXXXXX");
- }
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNMapPluginRootResource.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNMapPluginRootResource.java deleted file mode 100644 index e8e5e47c07..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNMapPluginRootResource.java +++ /dev/null @@ -1,41 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.resources;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-
-import org.camunda.bpm.cockpit.plugin.resource.AbstractPluginRootResource;
-import org.openecomp.camunda.bpmn.plugin.urnmap.URNMapPlugin;
-
-@SuppressWarnings("deprecation")
-@Path("plugin/" + URNMapPlugin.ID)
-public class URNMapPluginRootResource extends AbstractPluginRootResource
-{
- public URNMapPluginRootResource() {
- super(URNMapPlugin.ID);
- }
-
- @Path("{engineName}/process-instance")
- public URNResource getProcessInstanceResource(@PathParam("engineName") String engineName) {
- return subResource(new URNResource(engineName), engineName);
- }
-}
diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java deleted file mode 100644 index 938b9d377f..0000000000 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java +++ /dev/null @@ -1,239 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * 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=========================================================
- */
-
-package org.openecomp.camunda.bpmn.plugin.urnmap.resources;
-/***
-import java.beans.Statement;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-*/
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-
-import org.camunda.bpm.cockpit.db.QueryParameters;
-import org.camunda.bpm.cockpit.plugin.resource.AbstractCockpitPluginResource;
-
-
-//import org.camunda.bpm.cockpit.plugin.resource.AbstractPluginResource;
-import org.openecomp.camunda.bpmn.plugin.urnmap.db.URNData;
-import org.openecomp.mso.logger.MsoLogger;
-
-
-//public class ProcessInstanceResource extends AbstractPluginResource {
-public class URNResource extends AbstractCockpitPluginResource{
- public URNResource(String engineName) {
- super(engineName);
- }
-
- private Connection conn;
- private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
- @GET
- public List<URNData> getUrnDataMap()
- {
- List<URNData> list = new ArrayList();
- PreparedStatement psData = null;
- try {
-
- conn = getDBConnection();
- psData = conn
- .prepareStatement("select * from MSO_URN_MAPPING order by NAME_");
-
- ResultSet r = psData.executeQuery();
-
- while(r.next())
- {
- URNData d = new URNData();
- d.setURNName(r.getString("NAME_"));
- d.setURNValue(r.getString("VALUE_"));
- d.setVer_( r.getString("REV_"));
-
- list.add(d);
- }
-
- } catch (Exception e)
- {
- msoLogger.debug("Exception in getUrnDataMap ", e);
- } finally {
- if(psData != null){
- try {
- psData.close();
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: ", e);
- }
- }
- if(conn != null){
- try {
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: ", e);
- }
- }
- }
-
- for(URNData d: list)
- {
- msoLogger.debug( d.getURNName() + " " + d.getURNValue());
- //msoLogger.debug("Started Executing " + getTaskName());
- msoLogger.debug("Started Executing " + d.getURNName() + " " + d.getURNValue());
- }
-
- return list;
- }
-
- public List<URNData> getUrnDataMapOLD()
- {
-
- List<URNData> list = getQueryService()
- .executeQuery("cockpit.urnMap.retrieveUrnKeyValuePair", new QueryParameters<URNData>());
-
- msoLogger.debug("urnmap-plugin project - Results Retrieved: ");
- msoLogger.debug("URNName: " + " " + "URNValue: " );
-
- for(URNData d: list)
- {
- msoLogger.debug( d.getURNName() + " " + d.getURNValue());
- }
-
- return list;
- }
-
- public Connection getDBConnection()
- {
- try {
-
- if(conn == null)
- {
- Context ctx = new InitialContext();
- DataSource ds = (DataSource)ctx.lookup("java:jboss/datasources/ProcessEngine");//jboss
- conn = ds.getConnection();
-
- }
-
- } catch (Exception e)
- {
- msoLogger.debug("Exception in DBConnection ", e);
- }
-
- return conn;
- }
-
- @PUT
- public void insertNewRow(String temp)
- {
- msoLogger.debug("AddNewRow: XXXXXXXXXXXXXXXXX ---> " + temp);
- msoLogger.debug("AddNewRow: EngineName ---> " + engineName);
-
- StringTokenizer st = new StringTokenizer(temp, "|");
- String key_ = "";
- String value_ = "";
-
- while(st.hasMoreTokens()) {
- key_ = st.nextToken();
- value_ = st.nextToken();
- msoLogger.debug(key_ + "\t" + value_);
- }
-
- msoLogger.debug("AddNewRow: XXXXXXXXXXXXXXXXX ---> key: " + key_ + " , Value: " + value_);
- final URNData nRow = new URNData();
- nRow.setVer_("1");
- PreparedStatement psData = null;
-
- msoLogger.debug("----------- START ----------------------");
- try {
-
- conn = getDBConnection();
- psData = conn
- .prepareStatement("Insert into MSO_URN_MAPPING values ('" + key_ + "', '" + value_ + "', '1')");
-
- psData.executeUpdate();
-
- } catch (Exception e)
- {
- msoLogger.debug("Exception in insertNewRow ", e);
- }finally {
- if(psData != null){
- try {
- psData.close();
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: ", e);
- }
- }
- if(conn != null){
- try {
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: ", e);
- }
- }
- }
- // getQueryService().executeQuery("cockpit.urnMap.insertNewRow", nRow, URNData.class);
- }
-
- @POST
- public void getPersistData(URNData d) {
-
- //getQueryService().executeQuery("cockpit.urnMap.persistURNData", d, URNData.class);
- PreparedStatement psData = null;
- try {
-
- conn = getDBConnection();
- psData = conn
- .prepareStatement("UPDATE MSO_URN_MAPPING set VALUE_ ='"+ d.getURNValue() + "' WHERE NAME_='" + d.getURNName() + "'");
-
- psData.executeUpdate();
-
- } catch (Exception e)
- {
- msoLogger.debug("Exception in PersistData ", e);
- }finally {
- if(psData != null){
- try {
- psData.close();
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: ", e);
- }
- }
- if(conn != null){
- try {
- conn.close();
- } catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: ", e);
- }
- }
- }
-
- }
-}
diff --git a/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin b/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin deleted file mode 100644 index 9a5055af22..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin +++ /dev/null @@ -1 +0,0 @@ -org.openecomp.camunda.bpm.plugin.urnmap.URNMapPlugin
\ No newline at end of file diff --git a/bpmn/MSOURN-plugin/src/main/resources/mappings.xml b/bpmn/MSOURN-plugin/src/main/resources/mappings.xml deleted file mode 100644 index c66704ed15..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/mappings.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ECOMP MSO
- ================================================================================
- 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=========================================================
- -->
-
-
-<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
-
-<configuration>
- <settings>
- <setting name="lazyLoadingEnabled" value="false" />
- </settings>
- <mappers>
- <mapper resource="org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml" />
- </mappers>
-</configuration>
diff --git a/bpmn/MSOURN-plugin/src/main/resources/org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml b/bpmn/MSOURN-plugin/src/main/resources/org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml deleted file mode 100644 index d0b58618e4..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!-- - ============LICENSE_START======================================================= - ECOMP MSO - ================================================================================ - 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========================================================= - --> - - -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="cockpit.urnMap"> - <resultMap id="urnDataMap" type="org.openecomp.camunda.bpm.plugin.urnmap.db.URNData"> - <result property="URNName" column="URNNAME" jdbcType="VARCHAR"/> - <result property="URNValue" column="URNVALUE" jdbcType="VARCHAR" /> - </resultMap> - - <select id="retrieveUrnKeyValuePair" resultMap="urnDataMap"> - select NAME_ URNName, VALUE_ URNValue from MSO_URN_MAPPING - </select> - - - <!-- INSERT cockpit.InsertURNData keyProperty="NAME_" --> - <resultMap id="insertNewRow" type="org.openecomp.camunda.bpm.plugin.urnmap.db.URNData"> - <result property="URNName" column="NAME_" jdbcType="VARCHAR" /> - <result property="URNValue" column="VALUE_" jdbcType="VARCHAR" /> - <result property="1" column="REV_" jdbcType="INTEGER"/> - </resultMap> - - <insert id="insertNewRow" parameterType="org.openecomp.camunda.bpm.plugin.urnmap.db.URNData"> - insert into MSO_URN_MAPPING (NAME_, VALUE_, REV_) - values ( - #{URNName}, #{URNValue}, 1 - ) - </insert> - -<!-- UPDATE cockpit.InsertURNData --> - <resultMap id="saveURNMappingDataMap" type="org.openecomp.camunda.bpm.plugin.urnmap.db.URNData"> - <result property="URNName" column="NAME_" jdbcType="VARCHAR" /> - <result property="URNValue" column="VALUE_" jdbcType="VARCHAR" /> - <result property="1" column="REV_" jdbcType="INTEGER"/> - </resultMap> - - <update id="persistURNData"> - update MSO_URN_MAPPING set - NAME_ = #{URNName}, - VALUE_ = #{URNValue}, - REV_ = 1 - where NAME_=#{URNName} -</update> -</mapper> diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html deleted file mode 100644 index cc794e5518..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html +++ /dev/null @@ -1,63 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - ECOMP MSO - ================================================================================ - 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========================================================= - --> - -<div class="form-group container"> - <form novalidate="novalidate" class="simple-form" name="urnMapper"> - <div class="panel panel-default"> - <div class="panel-heading" style="padding:3px;background:#871020 !important;color:#fff"> <h3 style="margin:1px" class="heading">Process Engine - URN Mapping</h3></div> - <div class="panel-body"> - <div class="well"> - <div class="input-group well" style="padding:5px"> - <input id="new_key" class="form-control input-md" placeholder="New URN Key" size="25" type="text" name="URNName" value="" ng-blur="enableAddRowBtn()"> - <span class="input-group-btn" style="width:0px;"></span> - <input type="text" class="form-control input-md" size="55" style="margin-left:-1px" id="new_value" placeholder="New URN Value" name="URNValue" /> - <span class="input-group-btn" style="width:0px;"></span> - <span class="input-group-btn"> - <button class="btn btn-primary" type="button" id="addRow_BTN" data-ng-click="addNewRow(); setTimeout( retrieveData(), 1000);" disabled data-original-title="" title="">Add!</button> - </span> - </div> - <div> - <table cellpadding="0" cellspacing="0" class="table responsive" widht="100%"> - <tbody> - <tr data-ng-repeat="urnData in UrnDataMap"> - <td> - <div class="input-group"> - <input id="{{ urnData.urnname }}_key" type="text" style="border:0px solid #bfbfbf" size="25" class="form-control input-md" ng-blur="SaveRow( urnData )" value="{{ urnData.urnName }}" data-ng-model= "urnData.urnname" data-ng-change="enableButton(urnData)"/> - <span class="input-group-btn" style="width:0px;"></span> - <input id="{{ urnData.urnname }}_value" type="text" style="border:0px solid #dfdfdf;border-left:1px solid #bfbfbf" size="55" class="form-control input-md" ng-blur="SaveRow( urnData )" value="{{ urnData.urnvalue }}" data-ng-model="urnData.urnvalue" data-ng-change="enableButton(urnData)"/> - <span class="input-group-btn"> - <button disabled="true" class="btn btn-primary" type="button" id="btn_{{ urnData.urnname }}_key" data-ng-click="SaveRow( urnData ); setTimeout( retrieveData(), 1000);"> - <span class="glyphicon glyphicon-floppy-disk"></span> - </button> - </span> - </div><!-- /input-group --> - </td> - <!-- - <td><button id="btn_{{ urnData.urnname }}_key" data-ng-click="SaveRow( urnData )" disabled>SaveRecord</button> </td> - --> - </tr> - </tbody> - </table> - </div> - </div> - </div> - </div> - </form> -</div> diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js deleted file mode 100644 index 702f6cd3f5..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * 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========================================================= - */ - -define(['angular'], function(angular) { - - var DashboardController = ["$scope", "$http", "Uri", function($scope, $http, Uri) { - - $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) - .success(function(data) { - $scope.UrnDataMap = data; - }); - - //enable saveRow button - $scope.enableButton=function(urnData) - { - document.getElementById("btn_" + urnData.urnname + "_key").disabled = false; - }; - - $scope.enableAddRowBtn=function() - { - if(document.getElementById("new_key").value.trim().length >0) - document.getElementById("addRow_BTN").disabled = false; - else - document.getElementById("addRow_BTN").disabled = true; - }; - - - $scope.addNewRow = function() - { - var newKey = document.getElementById("new_key").value.trim(); - var newValue = document.getElementById("new_value").value.trim(); - var x; - - for (var i=0;i<$scope.UrnDataMap.length;i++) - { - var n = $scope.UrnDataMap[i].urnname.localeCompare(newKey); - if(n == 0){ - x = "match"; - } - } - - if(Boolean(x)) - { - alert("URN Name already exists, please check the KEY!"); - } - else - { - if(newKey.length >0 ) - { - - var temp = newKey + "|" + newValue; - - $http.put(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance"), temp); - - document.getElementById("new_key").value = ""; - document.getElementById("new_value").value = ""; - - } - - } - //this.enableAddRowBtn; - document.getElementById("addRow_BTN").disabled = true; - - $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) - .success(function(data) { - $scope.UrnDataMap = data; - }); - - - } - - $scope.retrieveData = function() { - - $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) - .success(function(data) { - $scope.UrnDataMap = data; - }); - } - - $scope.SaveRow = function(user) - { - $http.post(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance"), user); - - document.getElementById("btn_" + user.urnname + "_key").disabled = true; - document.getElementById(user.urnname + "_status").style.display = ""; - this.enableAddRowBtn; - - $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) - .success(function(data) { - $scope.UrnDataMap = data; - }); - - }; - }]; - - var Configuration = ['ViewsProvider', function(ViewsProvider) { - - ViewsProvider.registerDefaultView('cockpit.dashboard', { - id: 'process-definitions', - label: 'Deployed Processes', - url: 'plugin://urnMap-plugin/static/app/dashboard.html', - controller: DashboardController, - // make sure we have a higher priority than the default plugin - priority: 12 - }); - }]; -//START -//END - - var ngModule = angular.module('cockpit.plugin.urnMap-plugin', []); - - ngModule.config(Configuration); - - return ngModule; -}); diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt deleted file mode 100644 index 09b62620e6..0000000000 --- a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt +++ /dev/null @@ -1 +0,0 @@ -# Client side assets of the urnMap-plugin
\ No newline at end of file |