code cleanup with eslint and checkstyle

This commit is contained in:
TonyO 2017-12-24 00:52:40 -06:00
parent 9afd19be0a
commit cccd722f44
39 changed files with 1082 additions and 1073 deletions

View File

@ -0,0 +1,28 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
}

View File

@ -20,10 +20,16 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>ch.acanda.eclipse.pmd.builder.PMDNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -1,12 +1,12 @@
This project is an extension for Google Refine that provides a way to import database data using JDBC. This project is an extension for OpenRefine that provides a way to import database data using JDBC.
INSTALL INSTALL
1. Before installing this extension download Google Refine code from http://code.google.com/p/google-refine/source/checkout. 1. Before installing this extension download OpenRefine code from http://code.google.com/p/google-refine/source/checkout.
2. Pull this extension's code into folder database under folder /extensions. 2. Pull this extension's code into folder database under folder /extensions.
For more information on how to write a Google Refine extensions and where to put the files see http://code.google.com/p/google-refine/wiki/WriteAnExtension For more information on how to write a OpenRefine extensions and where to put the files see http://code.google.com/p/google-refine/wiki/WriteAnExtension
The folder structure should resemble this: The folder structure should resemble this:
grefine-all/ grefine-all/

View File

@ -1,34 +1,30 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2010, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/* /*

View File

@ -3,13 +3,13 @@
*# *#
<html> <html>
<head> <head>
<title>Google Refine Database Extension v$version</title> <title>OpenRefine Database Extension v$version</title>
</head> </head>
<body> <body>
<h1>Google Refine DATABASE Extension v$version</h1> <h1>OpenRefine DATABASE Extension v$version</h1>
<h2>by Tony O <tcbuzor@gmail.com></h2> <h2>by Tony Opara <tcbuzor@gmail.com></h2>
<p>The JDBC extension allows OpenRefine to read <p>The JDBC extension allows OpenRefine to read
(and write, soon) data from JDBC compatible databases(MySQL, PostgreSQL, Oracle). (and write, soon) data from JDBC compatible databases(MySQL, PostgreSQL, MariaDB).
</p> </p>
<h3>Known Limitations</h3> <h3>Known Limitations</h3>
<ul> <ul>

View File

@ -1,35 +1,32 @@
/* /*
* Copyright (c) 2017, Tony Opara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of Google nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Copyright 2010, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$(function(){ $(function(){
$.contextMenu({ $.contextMenu({
selector: '.context-menu-one', selector: '.context-menu-one',
@ -64,13 +61,13 @@ DatabaseExtension.handleSavedConnectionClicked = function(menuKey, connectionNam
var jdbcConnectionInfo = {}; var jdbcConnectionInfo = {};
jdbcConnectionInfo.connectionName = connectionName; jdbcConnectionInfo.connectionName = connectionName;
if(menuKey == "edit"){ if(menuKey === "edit"){
DatabaseExtension.handleEditConnectionClicked(connectionName); DatabaseExtension.handleEditConnectionClicked(connectionName);
}else if(menuKey == "delete"){ }else if(menuKey === "delete"){
DatabaseExtension.handleDeleteConnectionClicked(connectionName); DatabaseExtension.handleDeleteConnectionClicked(connectionName);
}else if(menuKey == "connect"){ }else if(menuKey === "connect"){
DatabaseExtension.handleConnectClicked(connectionName); DatabaseExtension.handleConnectClicked(connectionName);
} }
@ -154,11 +151,6 @@ DatabaseExtension.handleDeleteConnectionClicked = function(connectionName) {
$( "#menuListUl" ).empty(); $( "#menuListUl" ).empty();
var items = []; var items = [];
$.each(settings.savedConnections,function(index,savedConnection){ $.each(settings.savedConnections,function(index,savedConnection){
// items.push('<li class="context-menu-one pure-menu-item"><a href="#" class="pure-menu-link">'
// + savedConnection.connectionName
// + '</a></li>');
items.push('<li class="pure-menu-item sc-list"><a href="#" class="pure-menu-link context-menu-one">' items.push('<li class="pure-menu-item sc-list"><a href="#" class="pure-menu-link context-menu-one">'
+ '<span class="context-menu-text" >' + savedConnection.connectionName + '</span>' + '<span class="context-menu-text" >' + savedConnection.connectionName + '</span>'
+ '<span class="sc-context-more-vert pull-right"> </span></a></li>'); + '<span class="sc-context-more-vert pull-right"> </span></a></li>');
@ -203,4 +195,3 @@ DatabaseExtension.handleEditConnectionClicked = function(connectionName) {
); );
} }

View File

@ -1,34 +1,30 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2011, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
//Internationalization init //Internationalization init

View File

@ -1,34 +1,30 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2011, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
Refine.DatabaseSourceUI = function(controller) { Refine.DatabaseSourceUI = function(controller) {
@ -87,7 +83,7 @@ Refine.DatabaseSourceUI.prototype.attachUI = function(body) {
this._elmts.testDatabaseButton.click(function(evt) { this._elmts.testDatabaseButton.click(function(evt) {
if(self._validateNewConnectionForm() == true){ if(self._validateNewConnectionForm() === true){
self._testDatabaseConnect(self._getConnectionInfo()); self._testDatabaseConnect(self._getConnectionInfo());
} }
@ -95,7 +91,7 @@ Refine.DatabaseSourceUI.prototype.attachUI = function(body) {
this._elmts.databaseConnectButton.click(function(evt) { this._elmts.databaseConnectButton.click(function(evt) {
if(self._validateNewConnectionForm() == true){ if(self._validateNewConnectionForm() === true){
self._connect(self._getConnectionInfo()); self._connect(self._getConnectionInfo());
} }

View File

@ -1,34 +1,30 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2011, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
var dictionary = ""; var dictionary = "";

View File

@ -1,36 +1,31 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2011, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@import-less url("theme.less"); @import-less url("theme.less");
.database-container { .database-container {

View File

@ -1,34 +1,30 @@
/* /*
* Copyright (c) 2017, Tony Opara
Copyright 2011, Google Inc. * All rights reserved.
All rights reserved. *
* Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are * - Redistributions of source code must retain the above copyright notice, this
met: * list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer in the documentation
notice, this list of conditions and the following disclaimer. * and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above *
copyright notice, this list of conditions and the following disclaimer * Neither the name of Google nor the names of its contributors may be used to
in the documentation and/or other materials provided with the * endorse or promote products derived from this software without specific
distribution. * prior written permission.
* Neither the name of Google Inc. nor the names of its *
contributors may be used to endorse or promote products derived from * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
this software without specific prior written permission. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@import-less url("../../../../main/webapp/modules/core/styles/theme.less"); @import-less url("../../../../main/webapp/modules/core/styles/theme.less");

View File

@ -44,7 +44,7 @@ import com.google.refine.importing.ImportingJob;
public class DBQueryResultImportReader implements TableDataReader { public class DBQueryResultImportReader implements TableDataReader {
static final Logger logger = LoggerFactory.getLogger("DBQueryResultImportReader"); private static final Logger logger = LoggerFactory.getLogger("DBQueryResultImportReader");
private final ImportingJob job; private final ImportingJob job;
private final String querySource; private final String querySource;

View File

@ -44,7 +44,7 @@ import com.google.refine.importing.ImportingJob;
public class DBQueryResultPreviewReader implements TableDataReader { public class DBQueryResultPreviewReader implements TableDataReader {
static final Logger logger = LoggerFactory.getLogger("DBQueryResultPreviewReader"); private static final Logger logger = LoggerFactory.getLogger("DBQueryResultPreviewReader");
private final ImportingJob job; private final ImportingJob job;
private final String querySource; private final String querySource;

View File

@ -63,7 +63,7 @@ import com.google.refine.util.ParsingUtilities;
public class DatabaseImportController implements ImportingController { public class DatabaseImportController implements ImportingController {
final static Logger logger = LoggerFactory.getLogger("DatabaseImportController"); private static final Logger logger = LoggerFactory.getLogger("DatabaseImportController");
protected RefineServlet servlet; protected RefineServlet servlet;
public static int DEFAULT_PREVIEW_LIMIT = 100; public static int DEFAULT_PREVIEW_LIMIT = 100;
public static String OPTIONS_KEY = "options"; public static String OPTIONS_KEY = "options";

View File

@ -47,7 +47,7 @@ import edu.mit.simile.butterfly.ButterflyModuleImpl;
public class DatabaseModuleImpl extends ButterflyModuleImpl implements Jsonizable { public class DatabaseModuleImpl extends ButterflyModuleImpl implements Jsonizable {
final static Logger logger = LoggerFactory.getLogger("DatabaseModuleImpl"); private static final Logger logger = LoggerFactory.getLogger("DatabaseModuleImpl");
public static DatabaseModuleImpl instance; public static DatabaseModuleImpl instance;

View File

@ -45,7 +45,7 @@ import com.google.refine.extension.database.pgsql.PgSQLDatabaseService;
public abstract class DatabaseService { public abstract class DatabaseService {
static final Logger logger = LoggerFactory.getLogger("DatabaseService"); private static final Logger logger = LoggerFactory.getLogger("DatabaseService");
public static class DBType { public static class DBType {

View File

@ -46,7 +46,7 @@ import com.google.refine.io.FileProjectManager;
public class DatabaseUtils { public class DatabaseUtils {
final static Logger logger = LoggerFactory.getLogger("DatabaseUtils"); private static final Logger logger = LoggerFactory.getLogger("DatabaseUtils");
private final static String DATABASE_EXTENSION_DIR = "dbextension"; private final static String DATABASE_EXTENSION_DIR = "dbextension";

View File

@ -50,7 +50,7 @@ import com.google.refine.extension.database.model.DatabaseInfo;
public class ConnectCommand extends DatabaseCommand { public class ConnectCommand extends DatabaseCommand {
static final Logger logger = LoggerFactory.getLogger("ConnectCommand"); private static final Logger logger = LoggerFactory.getLogger("ConnectCommand");
@Override @Override
public void doPost(HttpServletRequest request, HttpServletResponse response) public void doPost(HttpServletRequest request, HttpServletResponse response)

View File

@ -44,7 +44,6 @@ import com.google.refine.extension.database.DatabaseServiceException;
public abstract class DatabaseCommand extends Command { public abstract class DatabaseCommand extends Command {
final static protected Logger logger = LoggerFactory.getLogger("jdbcCommand");
/** /**
* *
* @param request * @param request

View File

@ -50,7 +50,7 @@ import com.google.refine.extension.database.model.DatabaseInfo;
public class ExecuteQueryCommand extends DatabaseCommand { public class ExecuteQueryCommand extends DatabaseCommand {
static final Logger logger = LoggerFactory.getLogger("QueryCommand"); private static final Logger logger = LoggerFactory.getLogger("ExecuteQueryCommand");
@Override @Override
public void doPost(HttpServletRequest request, HttpServletResponse response) public void doPost(HttpServletRequest request, HttpServletResponse response)

View File

@ -48,7 +48,7 @@ import com.google.refine.extension.database.DatabaseUtils;
public class SavedConnectionCommand extends DatabaseCommand { public class SavedConnectionCommand extends DatabaseCommand {
static final Logger logger = LoggerFactory.getLogger("SavedConnectionCommand"); private static final Logger logger = LoggerFactory.getLogger("SavedConnectionCommand");
@Override @Override

View File

@ -48,7 +48,7 @@ import com.google.refine.extension.database.DatabaseServiceException;
public class TestConnectCommand extends DatabaseCommand { public class TestConnectCommand extends DatabaseCommand {
static final Logger logger = LoggerFactory.getLogger("TestConnectCommand"); private static final Logger logger = LoggerFactory.getLogger("TestConnectCommand");
@Override @Override
public void doPost(HttpServletRequest request, HttpServletResponse response) public void doPost(HttpServletRequest request, HttpServletResponse response)

View File

@ -50,7 +50,7 @@ import com.google.refine.extension.database.model.DatabaseInfo;
public class TestQueryCommand extends DatabaseCommand { public class TestQueryCommand extends DatabaseCommand {
static final Logger logger = LoggerFactory.getLogger("TestQueryCommand"); private static final Logger logger = LoggerFactory.getLogger("TestQueryCommand");
@Override @Override
public void doPost(HttpServletRequest request, HttpServletResponse response) public void doPost(HttpServletRequest request, HttpServletResponse response)

View File

@ -43,7 +43,7 @@ import com.google.refine.extension.database.SQLType;
public class MariaDBConnectionManager { public class MariaDBConnectionManager {
static final Logger logger = LoggerFactory.getLogger("MariaDBConnectionManager"); private static final Logger logger = LoggerFactory.getLogger("MariaDBConnectionManager");
private Connection connection; private Connection connection;
private SQLType type; private SQLType type;

View File

@ -54,7 +54,7 @@ import com.google.refine.extension.database.mysql.MySQLConnectionManager;
public class MariaDBDatabaseService extends DatabaseService { public class MariaDBDatabaseService extends DatabaseService {
static final Logger logger = LoggerFactory.getLogger("MariaDBDatabaseService"); private static final Logger logger = LoggerFactory.getLogger("MariaDBDatabaseService");
public static final String DB_NAME = "mariadb"; public static final String DB_NAME = "mariadb";
public static final String DB_DRIVER = "org.mariadb.jdbc.Driver"; public static final String DB_DRIVER = "org.mariadb.jdbc.Driver";

View File

@ -42,7 +42,7 @@ import com.google.refine.extension.database.SQLType;
public class MySQLConnectionManager { public class MySQLConnectionManager {
static final Logger logger = LoggerFactory.getLogger("MySQLConnectionManager"); private static final Logger logger = LoggerFactory.getLogger("MySQLConnectionManager");
private Connection connection; private Connection connection;
private SQLType type; private SQLType type;

View File

@ -51,7 +51,7 @@ import com.mysql.jdbc.ResultSetMetaData;
public class MySQLDatabaseService extends DatabaseService { public class MySQLDatabaseService extends DatabaseService {
private final static Logger logger = LoggerFactory.getLogger("MySQLDatabaseService"); private static final Logger logger = LoggerFactory.getLogger("MySQLDatabaseService");
public static final String DB_NAME = "mysql"; public static final String DB_NAME = "mysql";
public static final String DB_DRIVER = "com.mysql.jdbc.Driver"; public static final String DB_DRIVER = "com.mysql.jdbc.Driver";

View File

@ -43,7 +43,7 @@ import com.google.refine.extension.database.SQLType;
public class PgSQLConnectionManager { public class PgSQLConnectionManager {
static final Logger logger = LoggerFactory.getLogger("PgSQLConnectionManager"); private static final Logger logger = LoggerFactory.getLogger("PgSQLConnectionManager");
private Connection connection; private Connection connection;
private SQLType type; private SQLType type;

View File

@ -51,7 +51,7 @@ import com.google.refine.extension.database.mysql.MySQLConnectionManager;
public class PgSQLDatabaseService extends DatabaseService { public class PgSQLDatabaseService extends DatabaseService {
private final static Logger logger = LoggerFactory.getLogger("PgSQLDatabaseService"); private static final Logger logger = LoggerFactory.getLogger("PgSQLDatabaseService");
public static final String DB_NAME = "postgresql"; public static final String DB_NAME = "postgresql";
public static final String DB_DRIVER = "org.postgresql.Driver"; public static final String DB_DRIVER = "org.postgresql.Driver";

View File

@ -198,8 +198,8 @@ public class DBExtensionTestUtils {
} }
private String getNextIMEI(int i) { private String getNextIMEI(int index) {
index++;
// byte[] array = new byte[16]; // length is bounded by 7 // byte[] array = new byte[16]; // length is bounded by 7
// new Random().nextBytes(array); // new Random().nextBytes(array);
// String generatedString = new String(array, Charset.forName("UTF-8")); // String generatedString = new String(array, Charset.forName("UTF-8"));
@ -210,27 +210,32 @@ public class DBExtensionTestUtils {
private int getMNC(int i) { private int getMNC(int index) {
index++;
// TODO Auto-generated method stub // TODO Auto-generated method stub
return mncMap.get(rand.nextInt(3)); return mncMap.get(rand.nextInt(3));
} }
private int getMCC(int i) { private int getMCC(int index) {
index++;
// System.out.println(rand.nextInt(3)); // System.out.println(rand.nextInt(3));
return mccMap.get(rand.nextInt(3)); return mccMap.get(rand.nextInt(3));
} }
private Date getNextEndDate(int i) { private Date getNextEndDate(int index) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
index++;
return new Date(System.currentTimeMillis() + 1); return new Date(System.currentTimeMillis() + 1);
} }
private Date getNextStartDate(int i) { private Date getNextStartDate(int index) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
index++;
return new Date(System.currentTimeMillis()); return new Date(System.currentTimeMillis());
} }
private String getNextUeId(int i) { private String getNextUeId(int index) {
index++;
int n = 300000000 + rand.nextInt(900000000); int n = 300000000 + rand.nextInt(900000000);
return "" + n; return "" + n;

View File

@ -7,11 +7,12 @@ public class DBQueryResultImportReaderTest {
@BeforeTest @BeforeTest
public void beforeTest() { public void beforeTest() {
//add test logic
} }
@Test @Test
public void testGetNextRowOfCells() { public void testGetNextRowOfCells() {
//add test logic
} }
} }

View File

@ -7,11 +7,12 @@ public class DBQueryResultPreviewReaderTest {
@BeforeTest @BeforeTest
public void beforeTest() { public void beforeTest() {
//add test logic
} }
@Test @Test
public void testGetNextRowOfCells() { public void testGetNextRowOfCells() {
//add test logic
} }
} }

View File

@ -9,17 +9,18 @@ public class DatabaseImportControllerTest {
@BeforeTest @BeforeTest
public void beforeTest() { public void beforeTest() {
//add test logic
} }
@Test @Test
public void testDoGet() { public void testDoGet() {
//add test logic
} }
@Test @Test
public void testDoPost() { public void testDoPost() {
//add test logic
} }

View File

@ -76,17 +76,17 @@ public class SavedConnectionCommandTest {
@Test @Test
public void testDoGet() { public void testDoGet() {
//add test logic
} }
@Test @Test
public void testDoPut() { public void testDoPut() {
//add test logic
} }
@Test @Test
public void testDoDelete() { public void testDoDelete() {
//add test logic
} }
} }

View File

@ -7,51 +7,52 @@ public class MariaDBDatabaseServiceTest {
@BeforeTest @BeforeTest
public void beforeTest() { public void beforeTest() {
//add test logic
} }
@Test @Test
public void testGetDatabaseUrl() { public void testGetDatabaseUrl() {
//add test logic
} }
@Test @Test
public void testGetConnection() { public void testGetConnection() {
//add test logic
} }
@Test @Test
public void testTestConnection() { public void testTestConnection() {
//add test logic
} }
@Test @Test
public void testConnect() { public void testConnect() {
//add test logic
} }
@Test @Test
public void testExecuteQuery() { public void testExecuteQuery() {
//add test logic
} }
@Test @Test
public void testBuildLimitQuery() { public void testBuildLimitQuery() {
//add test logic
} }
@Test @Test
public void testGetRows() { public void testGetRows() {
//add test logic
} }
@Test @Test
public void testGetInstance() { public void testGetInstance() {
//add test logic
} }
@Test @Test
public void testGetColumnsDatabaseConfigurationString() { public void testGetColumnsDatabaseConfigurationString() {
//add test logic
} }
} }

View File

@ -7,51 +7,52 @@ public class MySQLDatabaseServiceTest {
@BeforeTest @BeforeTest
public void beforeTest() { public void beforeTest() {
//add test logic
} }
@Test @Test
public void testGetDatabaseUrl() { public void testGetDatabaseUrl() {
//add test logic
} }
@Test @Test
public void testGetConnection() { public void testGetConnection() {
//add test logic
} }
@Test @Test
public void testTestConnection() { public void testTestConnection() {
//add test logic
} }
@Test @Test
public void testConnect() { public void testConnect() {
//add test logic
} }
@Test @Test
public void testExecuteQuery() { public void testExecuteQuery() {
//add test logic
} }
@Test @Test
public void testBuildLimitQuery() { public void testBuildLimitQuery() {
//add test logic
} }
@Test @Test
public void testGetRows() { public void testGetRows() {
//add test logic
} }
@Test @Test
public void testGetInstance() { public void testGetInstance() {
//add test logic
} }
@Test @Test
public void testGetColumnsDatabaseConfigurationString() { public void testGetColumnsDatabaseConfigurationString() {
//add test logic
} }
} }

View File

@ -36,25 +36,25 @@ public class PgSQLDatabaseServiceTest {
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testGetConnection(@Optional("postgres") String dbName) { public void testGetConnection(@Optional("postgres") String dbName) {
System.out.println("dbName::" + dbName); //add test logic
} }
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testTestConnection(@Optional("postgres") String dbName) { public void testTestConnection(@Optional("postgres") String dbName) {
//add test logic
} }
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testConnect(@Optional("postgres") String dbName) { public void testConnect(@Optional("postgres") String dbName) {
//add test logic
} }
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testExecuteQuery(@Optional("postgres") String dbName) { public void testExecuteQuery(@Optional("postgres") String dbName) {
//add test logic
} }
@Test @Test
@ -67,19 +67,19 @@ public class PgSQLDatabaseServiceTest {
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testGetRows(@Optional("postgres") String dbName) { public void testGetRows(@Optional("postgres") String dbName) {
//add test logic
} }
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testGetInstance(@Optional("postgres") String dbName) { public void testGetInstance(@Optional("postgres") String dbName) {
//add test logic
} }
@Test @Test
@Parameters("dbName") @Parameters("dbName")
public void testGetColumns(@Optional("postgres") String dbName) { public void testGetColumns(@Optional("postgres") String dbName) {
//add test logic
} }
} }