From 6c658bc08c3032bc7820ef39c950cc316434c387 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Thu, 19 Oct 2017 13:49:11 -0400 Subject: 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 --- .../camunda/bpmn/plugin/urnmap/URNMapPlugin.java | 54 ----- .../urnmap/db/MyBatisExtendedSessionFactory.java | 89 -------- .../urnmap/db/MyBatisQueryCommandExecutor.java | 44 ---- .../camunda/bpmn/plugin/urnmap/db/URNData.java | 47 ---- .../camunda/bpmn/plugin/urnmap/db/URNService.java | 49 ----- .../urnmap/resources/ProcessInstanceResource.java | 98 --------- .../urnmap/resources/URNMapPluginRootResource.java | 41 ---- .../bpmn/plugin/urnmap/resources/URNResource.java | 239 --------------------- ...rg.camunda.bpm.cockpit.plugin.spi.CockpitPlugin | 1 - bpmn/MSOURN-plugin/src/main/resources/mappings.xml | 32 --- .../camunda/bpm/plugin/urnmap/queries/urnMap.xml | 64 ------ .../plugin-webapp/urnMap-plugin/app/dashboard.html | 63 ------ .../plugin-webapp/urnMap-plugin/app/plugin.js | 132 ------------ .../resources/plugin-webapp/urnMap-plugin/info.txt | 1 - 14 files changed, 954 deletions(-) delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/URNMapPlugin.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisExtendedSessionFactory.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/MyBatisQueryCommandExecutor.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNData.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/db/URNService.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/ProcessInstanceResource.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNMapPluginRootResource.java delete mode 100644 bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/mappings.xml delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/org/openecomp/camunda/bpm/plugin/urnmap/queries/urnMap.xml delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js delete mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt (limited to 'bpmn/MSOURN-plugin/src/main') 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> getResourceClasses() { - Set> classes = new HashSet<>(); - - classes.add(URNMapPluginRootResource.class); - - return classes; - } - - @Override - public List 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 getDefaultCommandInterceptorsTxRequired() { - List 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 executeQueryCommand(Command 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 getProperties() { - ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine(); - ProcessEngineConfigurationImpl processEngineConfiguration = processEngine.getProcessEngineConfiguration(); - - MyBatisQueryCommandExecutor commandExecutor = new MyBatisQueryCommandExecutor(processEngineConfiguration, "mappings.xml"); - return commandExecutor.executeQueryCommand(new Command>() { - - @SuppressWarnings("unchecked") - @Override - public List execute(CommandContext commandContext) { - return (List) 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 getUrnDataMap() { - List list = getQueryService() - .executeQuery( - "cockpit.urnMap.retrieveUrnKeyValuePair", - new QueryParameters()); - - 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 getUrnDataMap() - { - List 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 getUrnDataMapOLD() - { - - List list = getQueryService() - .executeQuery("cockpit.urnMap.retrieveUrnKeyValuePair", new QueryParameters()); - - 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 @@ - - - - - - - - - - - - - - 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - insert into MSO_URN_MAPPING (NAME_, VALUE_, REV_) - values ( - #{URNName}, #{URNValue}, 1 - ) - - - - - - - - - - - update MSO_URN_MAPPING set - NAME_ = #{URNName}, - VALUE_ = #{URNValue}, - REV_ = 1 - where NAME_=#{URNName} - - 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 @@ - - -
-
-
-

Process Engine - URN Mapping

-
-
-
- - - - - - - -
-
- - - - - - - -
-
- - - - - - -
-
-
-
-
-
-
-
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 -- cgit 1.2.3-korg