From 2a12e3d3819ecc899ea5caefcf8ba90aa47a5e97 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Oct 28 2013 08:17:50 +0000 Subject: Bump version --- diff --git a/.gitignore b/.gitignore index a189282..912fd12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /gooddata-cl-1.1.4.tar.gz /gooddata-cl-1.1.9.tar.gz /gooddata-cl-1.2.56.tar.gz +/gooddata-cl-1.2.69.tar.gz diff --git a/0001-Avoid-using-proprietary-Sun-API.patch b/0001-Avoid-using-proprietary-Sun-API.patch deleted file mode 100644 index 3a7d6b8..0000000 --- a/0001-Avoid-using-proprietary-Sun-API.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 212b8c0a5ac03bccdbbbbb43646b20600eb6f210 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 16 Aug 2012 16:18:55 +0200 -Subject: [PATCH 1/2] Avoid using proprietary Sun API - -[ERROR] SoapExecutor.java:[26,48] OutputFormat is internal proprietary API and may be removed in a future release -[ERROR] SoapExecutor.java:[27,48] XMLSerializer is internal proprietary API and may be removed in a future release ---- - .../gooddata/integration/soap/SoapExecutor.java | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java b/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java -index ff07da9..eb2aab8 100644 ---- a/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java -+++ b/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java -@@ -23,8 +23,8 @@ - - package com.gooddata.integration.soap; - --import com.sun.org.apache.xml.internal.serialize.OutputFormat; --import com.sun.org.apache.xml.internal.serialize.XMLSerializer; -+import org.apache.xml.serialize.OutputFormat; -+import org.apache.xml.serialize.XMLSerializer; - import org.jaxen.JaxenException; - import org.jaxen.SimpleNamespaceContext; - import org.jaxen.XPath; --- -1.7.1 -diff --git a/connector/pom.xml b/connector/pom.xml -index 8431e4a..ec37afb 100644 ---- a/connector/pom.xml -+++ b/connector/pom.xml -@@ -78,6 +78,11 @@ - axis - axis - -+ -+ org.apache.axis -+ axis-jaxrpc -+ 1.4 -+ - - javassist - javassist -diff --git a/pom.xml b/pom.xml -index 9341bf4..f377184 100755 ---- a/pom.xml -+++ b/pom.xml -@@ -330,26 +330,15 @@ - - jaxen - jaxen -- -- -- xerces -- xmlParserAPIs -- -- -- xalan -- xalan -- -- -- xerces -- xercesImpl -- -- -- xml-apis -- xml-apis -- -- - 1.1.1 - -+ -+ -+ org.apache.axis -+ axis-jaxrpc -+ 1.4 -+ -+ - - org.slf4j - log4j-over-slf4j diff --git a/0001-Drag-in-packages-we-ship-split.patch b/0001-Drag-in-packages-we-ship-split.patch index ba6d5d3..1f574cd 100644 --- a/0001-Drag-in-packages-we-ship-split.patch +++ b/0001-Drag-in-packages-we-ship-split.patch @@ -1,15 +1,15 @@ -From bea0df9ad753101d0936a8a0fe17a02cf785e19e Mon Sep 17 00:00:00 2001 +From 14cc75ab5defa55ab7dc13e70c6e8a697af6deb3 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 3 Aug 2012 14:40:13 +0200 -Subject: [PATCH 1/6] Drag in packages we ship split +Subject: [PATCH 01/10] Drag in packages we ship split --- - connector/pom.xml | 11 +++++++++++ - pom.xml | 12 +++++++++++- - 2 files changed, 22 insertions(+), 1 deletions(-) + connector/pom.xml | 11 +++++++++++ + pom.xml | 12 +++++++++++- + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/connector/pom.xml b/connector/pom.xml -index 4dac54f..7554130 100644 +index 7007a05..a43a0ee 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -58,6 +58,17 @@ @@ -31,10 +31,10 @@ index 4dac54f..7554130 100644 net.sf.opencsv diff --git a/pom.xml b/pom.xml -index 5331384..e27ff09 100755 +index 54beba7..8267e09 100755 --- a/pom.xml +++ b/pom.xml -@@ -223,7 +223,17 @@ +@@ -221,7 +221,17 @@ com.google.gdata gdata-java-client @@ -54,5 +54,5 @@ index 5331384..e27ff09 100755 net.sf.opencsv -- -1.7.1 +1.8.3.1 diff --git a/0001-Drop-GA-connector.patch b/0001-Drop-GA-connector.patch deleted file mode 100644 index 38a71e8..0000000 --- a/0001-Drop-GA-connector.patch +++ /dev/null @@ -1,665 +0,0 @@ -From bf282d52f5944838e4d1830efa51be075042c9a2 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 11 Jul 2013 18:20:31 +0200 -Subject: [PATCH] Drop GA connector - ---- - .../main/java/com/gooddata/processor/GdcDI.java | 1 - - connector/pom.xml | 15 - - .../java/com/gooddata/connector/GaConnector.java | 349 --------------------- - .../com/gooddata/google/analytics/FeedDumper.java | 130 -------- - .../com/gooddata/google/analytics/GaQuery.java | 51 --- - pom.xml | 15 - - .../main/java/com/gooddata/web/WebInterface.java | 7 +- - 7 files changed, 3 insertions(+), 565 deletions(-) - delete mode 100644 connector/src/main/java/com/gooddata/connector/GaConnector.java - delete mode 100644 connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java - delete mode 100644 connector/src/main/java/com/gooddata/google/analytics/GaQuery.java - -diff --git a/cli/src/main/java/com/gooddata/processor/GdcDI.java b/cli/src/main/java/com/gooddata/processor/GdcDI.java -index d4f6633..17ddcd7 100644 ---- a/cli/src/main/java/com/gooddata/processor/GdcDI.java -+++ b/cli/src/main/java/com/gooddata/processor/GdcDI.java -@@ -1456,7 +1456,6 @@ public class GdcDI implements Executor { - private Connector[] instantiateConnectors() throws IOException { - return new Connector[]{ - CsvConnector.createConnector(), -- GaConnector.createConnector(), - SfdcConnector.createConnector(), - JdbcConnector.createConnector(), - PtConnector.createConnector(), -diff --git a/connector/pom.xml b/connector/pom.xml -index ec37afb..40db2cc 100644 ---- a/connector/pom.xml -+++ b/connector/pom.xml -@@ -56,21 +56,6 @@ - - - -- com.google.gdata -- gdata-java-client -- 1.40.0 -- -- -- com.google.gdata -- gdata-java-core -- 1.40.0 -- -- -- com.google.gdata -- gdata-java-analytics -- 1.40.0 -- -- - net.sf.opencsv - opencsv - -diff --git a/connector/src/main/java/com/gooddata/connector/GaConnector.java b/connector/src/main/java/com/gooddata/connector/GaConnector.java -deleted file mode 100644 -index 43c9102..0000000 ---- a/connector/src/main/java/com/gooddata/connector/GaConnector.java -+++ /dev/null -@@ -1,349 +0,0 @@ --/* -- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. -- */ -- --package com.gooddata.connector; -- --import com.gooddata.exception.InternalErrorException; --import com.gooddata.exception.InvalidArgumentException; --import com.gooddata.exception.InvalidCommandException; --import com.gooddata.exception.ProcessingException; --import com.gooddata.google.analytics.FeedDumper; --import com.gooddata.google.analytics.GaQuery; --import com.gooddata.modeling.model.SourceColumn; --import com.gooddata.modeling.model.SourceSchema; --import com.gooddata.processor.CliParams; --import com.gooddata.processor.Command; --import com.gooddata.processor.ProcessingContext; --import com.gooddata.transform.Transformer; --import com.gooddata.util.CSVWriter; --import com.gooddata.util.FileUtil; --import com.google.gdata.client.ClientLoginAccountType; --import com.google.gdata.client.analytics.AnalyticsService; --import com.google.gdata.data.analytics.DataFeed; --import com.google.gdata.util.AuthenticationException; --import com.google.gdata.util.ServiceException; --import org.apache.log4j.Logger; -- --import java.io.File; --import java.io.IOException; --import java.net.MalformedURLException; -- --/** -- * GoodData Google Analytics Connector -- * -- * @author zd -- * @version 1.0 -- */ --public class GaConnector extends AbstractConnector implements Connector { -- -- public static final String GA_DATE = "ga:date"; -- -- private static Logger l = Logger.getLogger(GaConnector.class); -- -- private static final String APP_NAME = "gdc-ga-client"; -- -- private static final int GOOGLE_ANALYTICS_CHUNK = 9900; -- private String googleAnalyticsUsername; -- private String googleAnalyticsPassword; -- private String googleAnalyticsToken; -- private GaQuery googleAnalyticsQuery; -- -- /** -- * Creates a new Google Analytics Connector -- */ -- protected GaConnector() { -- } -- -- /** -- * Creates a new Google Analytics Connector -- * -- * @return a new instance of the GA connector -- */ -- public static GaConnector createConnector() { -- return new GaConnector(); -- } -- -- /** -- * Saves a template of the config file -- * -- * @param name the new config file name -- * @param configFileName the new config file name -- * @param gQuery the Google Analytics query -- * @throws com.gooddata.exception.InvalidArgumentException -- * if there is a problem with arguments -- * @throws IOException if there is a problem with writing the config file -- */ -- public static void saveConfigTemplate(String name, String configFileName, GaQuery gQuery) -- throws IOException { -- l.debug("Saving GA config template."); -- String dims = gQuery.getDimensions(); -- String mtrs = gQuery.getMetrics(); -- SourceSchema s = SourceSchema.createSchema(name); -- SourceColumn cp = new SourceColumn("id", SourceColumn.LDM_TYPE_CONNECTION_POINT, "id"); -- s.addColumn(cp); -- cp = new SourceColumn("profileId", SourceColumn.LDM_TYPE_ATTRIBUTE, "profileId"); -- s.addColumn(cp); -- if (dims != null && dims.length() > 0) { -- String[] dimensions = dims.split("\\|"); -- for (String dim : dimensions) { -- // remove the "ga:" -- if (dim != null && dim.length() > 3) { -- String d = dim.substring(3); -- if (GA_DATE.equals(dim)) { -- SourceColumn sc = new SourceColumn(d, SourceColumn.LDM_TYPE_DATE, d); -- sc.setFormat("yyyy-MM-dd"); -- s.addColumn(sc); -- } else { -- SourceColumn sc = new SourceColumn(d, SourceColumn.LDM_TYPE_ATTRIBUTE, d); -- s.addColumn(sc); -- } -- } else { -- l.debug("Invalid dimension name '" + dim + "'"); -- throw new InvalidArgumentException("Invalid dimension name '" + dim + "'"); -- } -- } -- } else { -- l.debug("Please specify Google Analytics dimensions separated by comma."); -- throw new InvalidArgumentException("Please specify Google Analytics dimensions separated by comma."); -- } -- if (mtrs != null && mtrs.length() > 0) { -- String[] metrics = mtrs.split("\\|"); -- for (String mtr : metrics) { -- // remove the "ga:" -- if (mtr != null && mtr.length() > 3) { -- String m = mtr.substring(3); -- SourceColumn sc = new SourceColumn(m, SourceColumn.LDM_TYPE_FACT, m); -- s.addColumn(sc); -- } else { -- l.debug("Invalid dimension name '" + mtr + "'"); -- throw new InvalidArgumentException("Invalid metric name '" + mtr + "'"); -- } -- } -- } else { -- l.debug("Please specify Google Analytics metrics separated by comma."); -- throw new InvalidArgumentException("Please specify Google Analytics metrics separated by comma."); -- } -- s.writeConfig(new File(configFileName)); -- l.debug("Saved GA config template."); -- } -- -- /** -- * {@inheritDoc} -- */ -- public void extract(String file, final boolean transform) throws IOException { -- try { -- AnalyticsService as = new AnalyticsService(APP_NAME); -- if (googleAnalyticsToken != null && googleAnalyticsToken.length() > 0) { -- as.setAuthSubToken(googleAnalyticsToken); -- } else if (googleAnalyticsUsername != null && googleAnalyticsUsername.length() > 0 && -- googleAnalyticsPassword != null && googleAnalyticsPassword.length() > 0) { -- as.setUserCredentials(googleAnalyticsUsername, googleAnalyticsPassword, ClientLoginAccountType.GOOGLE); -- } else { -- throw new InvalidCommandException("The UseGoogleAnalytics command requires either GA token or " + -- "username and password!"); -- } -- File dataFile = new File(file); -- GaQuery gaq = getGoogleAnalyticsQuery(); -- gaq.setMaxResults(GOOGLE_ANALYTICS_CHUNK); -- int cnt = 1; -- -- CSVWriter cw = FileUtil.createUtf8CsvWriter(dataFile); -- Transformer t = Transformer.create(schema); -- -- String[] header = t.getHeader(transform); -- cw.writeNext(header); -- -- for (int startIndex = 1; cnt > 0; startIndex += cnt + 1) { -- gaq.setStartIndex(startIndex); -- DataFeed feed = as.getFeed(gaq.getUrl(), DataFeed.class); -- l.debug("Retrieving GA data from index=" + startIndex); -- cnt = FeedDumper.dump(cw, feed, gaq, t, transform); -- l.debug("Retrieved " + cnt + " entries."); -- } -- cw.close(); -- } catch (AuthenticationException e) { -- throw new InternalErrorException(e); -- } catch (ServiceException e) { -- throw new InternalErrorException(e); -- } -- } -- -- -- /** -- * Google Analytics username getter -- * -- * @return Google Analytics username -- */ -- public String getGoogleAnalyticsUsername() { -- return googleAnalyticsUsername; -- } -- -- /** -- * Google Analytics username setter -- * -- * @param googleAnalyticsUsername Google Analytics username -- */ -- public void setGoogleAnalyticsUsername(String googleAnalyticsUsername) { -- this.googleAnalyticsUsername = googleAnalyticsUsername; -- } -- -- /** -- * Google Analytics password getter -- * -- * @return Google Analytics password -- */ -- public String getGoogleAnalyticsPassword() { -- return googleAnalyticsPassword; -- } -- -- /** -- * Google Analytics password setter -- * -- * @param googleAnalyticsPassword Google Analytics password -- */ -- public void setGoogleAnalyticsPassword(String googleAnalyticsPassword) { -- this.googleAnalyticsPassword = googleAnalyticsPassword; -- } -- -- /** -- * Google Analytics query getter -- * -- * @return Google Analytics query -- */ -- public GaQuery getGoogleAnalyticsQuery() { -- return googleAnalyticsQuery; -- } -- -- /** -- * Google Analytics query setter -- * -- * @param googleAnalyticsQuery Google Analytics query -- */ -- public void setGoogleAnalyticsQuery(GaQuery googleAnalyticsQuery) { -- this.googleAnalyticsQuery = googleAnalyticsQuery; -- } -- -- /** -- * {@inheritDoc} -- */ -- public boolean processCommand(Command c, CliParams cli, ProcessingContext ctx) throws ProcessingException { -- l.debug("Processing command " + c.getCommand()); -- try { -- if (c.match("GenerateGoogleAnalyticsConfig")) { -- generateGAConfig(c, cli, ctx); -- } else if (c.match("UseGoogleAnalytics")) { -- loadGA(c, cli, ctx); -- } else { -- l.debug("No match passing the command " + c.getCommand() + " further."); -- return super.processCommand(c, cli, ctx); -- } -- } catch (IOException e) { -- throw new ProcessingException(e); -- } -- l.debug("Processed command " + c.getCommand()); -- return true; -- } -- -- /** -- * Loads new GA data command processor -- * -- * @param c command -- * @param p command line arguments -- * @param ctx current processing context -- * @throws IOException in case of IO issues -- */ -- private void loadGA(Command c, CliParams p, ProcessingContext ctx) throws IOException { -- GaQuery gq; -- try { -- gq = new GaQuery(); -- } catch (MalformedURLException e) { -- throw new IllegalArgumentException(e.getMessage()); -- } -- String configFile = c.getParamMandatory("configFile"); -- String usr = c.getParam("username"); -- String psw = c.getParam("password"); -- String token = c.getParam("token"); -- String id = c.getParamMandatory("profileId"); -- File conf = FileUtil.getFile(configFile); -- initSchema(conf.getAbsolutePath()); -- gq.setIds(id); -- if (token != null && token.length() > 0) { -- setGoogleAnalyticsToken(token); -- } else if (usr != null && usr.length() > 0 && -- psw != null && psw.length() > 0) { -- setGoogleAnalyticsUsername(usr); -- setGoogleAnalyticsPassword(psw); -- } else { -- throw new InvalidCommandException("The UseGoogleAnalytics command requires either GA token or " + -- "username and password!"); -- } -- setGoogleAnalyticsQuery(gq); -- gq.setDimensions(c.getParamMandatory("dimensions").replace("|", ",")); -- gq.setMetrics(c.getParamMandatory("metrics").replace("|", ",")); -- gq.setStartDate(c.getParamMandatory("startDate")); -- gq.setEndDate(c.getParamMandatory("endDate")); -- if (c.checkParam("filters")) -- gq.setFilters(c.getParam("filters")); -- c.paramsProcessed(); -- -- // sets the current connector -- ctx.setConnector(this); -- setProjectId(ctx); -- l.info("Google Analytics Connector successfully loaded (id: " + id + ")."); -- } -- -- /** -- * Generate GA config command processor -- * -- * @param c command -- * @param p command line arguments -- * @param ctx current processing context -- * @throws IOException in case of IO issues -- */ -- private void generateGAConfig(Command c, CliParams p, ProcessingContext ctx) throws IOException { -- String configFile = c.getParamMandatory("configFile"); -- String name = c.getParamMandatory("name"); -- String dimensions = c.getParamMandatory("dimensions"); -- String metrics = c.getParamMandatory("metrics"); -- c.paramsProcessed(); -- -- GaQuery gq; -- try { -- gq = new GaQuery(); -- } catch (MalformedURLException e) { -- throw new IllegalArgumentException(e.getMessage()); -- } -- gq.setDimensions(dimensions); -- gq.setMetrics(metrics); -- GaConnector.saveConfigTemplate(name, configFile, gq); -- l.info("Google Analytics Connector configuration successfully generated. See config file: " + configFile); -- } -- -- public String getGoogleAnalyticsToken() { -- return googleAnalyticsToken; -- } -- -- public void setGoogleAnalyticsToken(String googleAnalyticsToken) { -- this.googleAnalyticsToken = googleAnalyticsToken; -- } --} -diff --git a/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java b/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java -deleted file mode 100644 -index 2cc1618..0000000 ---- a/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java -+++ /dev/null -@@ -1,130 +0,0 @@ --/* -- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. -- */ -- --package com.gooddata.google.analytics; -- --import com.gooddata.connector.AbstractConnector; --import com.gooddata.connector.GaConnector; --import com.gooddata.exception.InvalidParameterException; --import com.gooddata.transform.Transformer; --import com.gooddata.util.CSVWriter; --import com.gooddata.util.DateUtil; --import com.google.gdata.data.analytics.DataEntry; --import com.google.gdata.data.analytics.DataFeed; --import com.google.gdata.data.analytics.Dimension; --import com.google.gdata.data.analytics.Metric; --import org.apache.log4j.Logger; --import org.joda.time.DateTime; --import org.joda.time.format.DateTimeFormatter; -- --import java.io.IOException; --import java.util.ArrayList; --import java.util.List; -- --/** -- * Google feed dumper dumps the Google result data to CSV -- * -- * @author ZD -- * @version 1.0 -- */ --public class FeedDumper { -- -- private static final String UNKNOWN_DATE = "(other)"; -- -- private static final String IN_FMT = "yyyyMMdd"; -- private static final String OUT_FMT = "yyyy-MM-dd"; -- -- private static Logger l = Logger.getLogger(FeedDumper.class); -- -- /** -- * Dupmps the gdata feed to CSV -- * -- * @param cw CSVWriter -- * @param feed Google feed -- * @param gaq Google Analytics Query -- * @param t Transformer -- * @param transform perform transformations? -- * @throws IOException in case of an IO problem -- */ -- public static int dump(CSVWriter cw, DataFeed feed, GaQuery gaq, Transformer t, boolean transform) throws IOException { -- l.debug("Dumping GA feed."); -- String profileId = gaq.getIds(); -- if (profileId == null || profileId.length() <= 0) -- throw new InvalidParameterException("Empty Google Analytics profile ID in query."); -- List entries = feed.getEntries(); -- List dimensions = null; -- List dimensionNames = new ArrayList(); -- List metrics = null; -- -- if (!entries.isEmpty()) { -- DataEntry singleEntry = entries.get(0); -- dimensions = singleEntry.getDimensions(); -- metrics = singleEntry.getMetrics(); -- } else -- return 0; -- -- final List headers = new ArrayList(); -- for (Dimension dimension : dimensions) { -- headers.add(dimension.getName()); -- dimensionNames.add(dimension.getName()); -- } -- for (Metric metric : metrics) { -- headers.add(metric.getName()); -- } -- -- final DateTimeFormatter inFmt = DateUtil.getDateFormatter(IN_FMT, false); -- final DateTimeFormatter outFmt = DateUtil.getDateFormatter(OUT_FMT, false); -- for (DataEntry entry : entries) { -- final List row = new ArrayList(); -- for (String dataName : headers) { -- final String valueIn = entry.stringValueOf(dataName); -- String valueOut; -- if (GaConnector.GA_DATE.equalsIgnoreCase(dataName)) { -- if (valueIn == null || valueIn.length() != 8 || UNKNOWN_DATE.equals(valueIn)) { -- valueOut = ""; -- l.debug("Invalid date value '" + valueIn + "'"); -- } else { -- try { -- DateTime dt = inFmt.parseDateTime(valueIn); -- valueOut = outFmt.print(dt); -- } catch (IllegalArgumentException e) { -- valueOut = ""; -- l.debug("Invalid date value '" + valueIn + "'"); -- } -- } -- } else { -- valueOut = valueIn; -- } -- row.add(valueOut); -- } -- row.add(0, profileId); -- String[] r = row.toArray(new String[]{}); -- if (transform) -- r = t.transformRow(r, AbstractConnector.DATE_LENGTH_UNRESTRICTED); -- cw.writeNext(r); -- } -- l.debug("Dumped " + entries.size() + " rows from GA feed."); -- return entries.size(); -- } -- --} -\ No newline at end of file -diff --git a/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java b/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java -deleted file mode 100644 -index ac735ec..0000000 ---- a/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java -+++ /dev/null -@@ -1,51 +0,0 @@ --/* -- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. -- */ -- --package com.gooddata.google.analytics; -- --import com.google.gdata.client.analytics.DataQuery; -- --import java.net.MalformedURLException; --import java.net.URL; -- --/** -- * Google analytics query -- * -- * @author zd -- * @version 1.0 -- */ --public class GaQuery extends DataQuery { -- -- // GA API URL -- private static final String DATA_QUERY_URL = "https://www.google.com/analytics/feeds/data"; -- -- /** -- * Constructor -- * -- * @throws MalformedURLException internal error -- */ -- public GaQuery() throws MalformedURLException { -- super(new URL(DATA_QUERY_URL)); -- } -- --} -diff --git a/pom.xml b/pom.xml -index f377184..605934c 100755 ---- a/pom.xml -+++ b/pom.xml -@@ -218,21 +218,6 @@ - - - -- com.google.gdata -- gdata-java-client -- 1.40.0 -- -- -- com.google.gdata -- gdata-java-core -- 1.40.0 -- -- -- com.google.gdata -- gdata-java-analytics -- 1.40.0 -- -- - net.sf.opencsv - opencsv - 2.1 -diff --git a/web/src/main/java/com/gooddata/web/WebInterface.java b/web/src/main/java/com/gooddata/web/WebInterface.java -index e378293..467efa8 100644 ---- a/web/src/main/java/com/gooddata/web/WebInterface.java -+++ b/web/src/main/java/com/gooddata/web/WebInterface.java -@@ -25,10 +25,9 @@ package com.gooddata.web; - - import com.gooddata.Constants; - import com.gooddata.util.FileUtil; --import com.google.gdata.util.common.util.Base64; --import com.google.gdata.util.common.util.Base64DecoderException; - import net.sf.json.JSONObject; - import org.apache.commons.codec.digest.DigestUtils; -+import org.apache.commons.codec.binary.Base64; - import org.joda.time.DateTime; - import org.joda.time.format.DateTimeFormat; - import org.joda.time.format.DateTimeFormatter; -@@ -242,12 +241,12 @@ public class WebInterface extends HttpServlet { - if (base64 != null) { - String content = base64.split("\\.")[1]; - try { -- String decodedContent = new String(Base64.decodeWebSafe(content)); -+ String decodedContent = new String(new Base64(true).decodeBase64(content)); - JSONObject json = JSONObject.fromObject(decodedContent); - if (json.containsKey("oauth_token")) - token = json.getString("oauth_token"); - debug("Extracting token: token=" + token); -- } catch (Base64DecoderException e) { -+ } catch (IllegalArgumentException e) { - throw new IOException(e.getMessage()); - } - } --- -1.8.3.1 - diff --git a/0001-Drop-jdk15-classifiers.patch b/0001-Drop-jdk15-classifiers.patch deleted file mode 100644 index 9151b48..0000000 --- a/0001-Drop-jdk15-classifiers.patch +++ /dev/null @@ -1,52 +0,0 @@ -From c5e6278aeec950ff9d7932337edb9242022b1949 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 24 Oct 2013 13:53:59 +0200 -Subject: [PATCH] Drop jdk15 classifiers - -Maven is otherwise unable to retrieve locally installed json-lib: -[ERROR] Failed to execute goal on project gooddata-cl-common: Could not resolve dependencies for project com.gooddata.cl:gooddata-cl-common:jar:1.2.56: Cannot access atlassian (https://m2proxy.atlassian.com/repository/public/) in offline mode and the artifact net.sf.json-lib:json-lib:jar:jdk15:2.3 has not been downloaded from it before. -> [Help 1] ---- - backend/pom.xml | 1 - - common/pom.xml | 1 - - pom.xml | 1 - - 3 files changed, 3 deletions(-) - -diff --git a/backend/pom.xml b/backend/pom.xml -index 8212772..3a6f96d 100644 ---- a/backend/pom.xml -+++ b/backend/pom.xml -@@ -79,7 +79,6 @@ - - net.sf.json-lib - json-lib -- jdk15 - - - com.thoughtworks.xstream -diff --git a/common/pom.xml b/common/pom.xml -index 454ea66..51be94b 100644 ---- a/common/pom.xml -+++ b/common/pom.xml -@@ -50,7 +50,6 @@ - - net.sf.json-lib - json-lib -- jdk15 - - - net.sf.opencsv -diff --git a/pom.xml b/pom.xml -index 5dfb010..ea4edde 100755 ---- a/pom.xml -+++ b/pom.xml -@@ -165,7 +165,6 @@ - net.sf.json-lib - json-lib - 2.3 -- jdk15 - - - com.thoughtworks.xstream --- -1.8.3.1 - diff --git a/0001-Pull-in-xerces-since-the-XML-api-got-deprecated.patch b/0001-Pull-in-xerces-since-the-XML-api-got-deprecated.patch deleted file mode 100644 index 82727ae..0000000 --- a/0001-Pull-in-xerces-since-the-XML-api-got-deprecated.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9e50915752e1eff5e604dd131d47e3918b957c67 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 24 Oct 2013 14:05:15 +0200 -Subject: [PATCH] Pull in xerces, since the XML api got deprecated - ---- - backend/pom.xml | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/backend/pom.xml b/backend/pom.xml -index 3a6f96d..d9eacdc 100644 ---- a/backend/pom.xml -+++ b/backend/pom.xml -@@ -125,5 +125,10 @@ - org.slf4j - log4j-over-slf4j - -+ -+ xerces -+ xercesImpl -+ 2.11.0 -+ - - --- -1.8.3.1 - diff --git a/0002-No-separate-commons-httpclient-for-signpost.patch b/0002-No-separate-commons-httpclient-for-signpost.patch index 2ce3c7b..47b6df6 100644 --- a/0002-No-separate-commons-httpclient-for-signpost.patch +++ b/0002-No-separate-commons-httpclient-for-signpost.patch @@ -1,14 +1,14 @@ -From 947eec383ceb2a668f56adb8d3503388ecdaf07d Mon Sep 17 00:00:00 2001 +From de0985c1814da5d514b4bf8e76d4934f55d858f2 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 3 Aug 2012 14:41:24 +0200 -Subject: [PATCH 2/6] No separate commons-httpclient for signpost +Subject: [PATCH 02/10] No separate commons-httpclient for signpost --- - connector/pom.xml | 5 ----- - 1 files changed, 0 insertions(+), 5 deletions(-) + connector/pom.xml | 5 ----- + 1 file changed, 5 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml -index 7554130..8431e4a 100644 +index a43a0ee..db841e3 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -88,11 +88,6 @@ @@ -24,5 +24,5 @@ index 7554130..8431e4a 100644 json-simple -- -1.7.1 +1.8.3.1 diff --git a/0002-Remove-FTP-support-it-should-not-be-used.patch b/0002-Remove-FTP-support-it-should-not-be-used.patch deleted file mode 100644 index db31229..0000000 --- a/0002-Remove-FTP-support-it-should-not-be-used.patch +++ /dev/null @@ -1,288 +0,0 @@ -From d458a5f099d174f09350fc8e294b49d5d4ff2815 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Thu, 16 Aug 2012 16:27:45 +0200 -Subject: [PATCH 2/2] Remove FTP support, it should not be used - ---- - .../gooddata/integration/ftp/GdcFTPApiWrapper.java | 240 -------------------- - doc/README.md | 2 +- - doc/architecture.dot | 2 +- - doc/architecture.png | Bin 118576 -> 53097 bytes - 4 files changed, 2 insertions(+), 242 deletions(-) - delete mode 100644 backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java - -diff --git a/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java b/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java -deleted file mode 100644 -index ffc862b..0000000 ---- a/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java -+++ /dev/null -@@ -1,240 +0,0 @@ --/* -- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. -- */ -- --package com.gooddata.integration.ftp; -- --import com.gooddata.exception.GdcUploadErrorException; --import com.gooddata.integration.datatransfer.GdcDataTransferAPI; --import com.gooddata.integration.rest.configuration.NamePasswordConfiguration; --import com.gooddata.util.FileUtil; --import org.apache.commons.net.ftp.FTPClient; --import org.apache.commons.net.ftp.FTPReply; --import org.apache.commons.net.ftp.FTPSClient; --import org.apache.log4j.Logger; -- --import java.io.*; --import java.security.NoSuchAlgorithmException; --import java.util.HashMap; --import java.util.Map; -- --/** -- * GoodData FTP API Java wrapper -- * -- * @author zd -- * @version 1.0 -- */ --public class GdcFTPApiWrapper implements GdcDataTransferAPI { -- -- private static Logger l = Logger.getLogger(GdcFTPApiWrapper.class); -- -- protected static final String DEFAULT_ARCHIVE_NAME = "upload.zip"; -- -- protected FTPClient client; -- protected NamePasswordConfiguration config; -- -- /** -- * Constructs the GoodData FTP API Java wrapper -- * -- * @param config NamePasswordConfiguration object with the GDC name and password configuration -- */ -- public GdcFTPApiWrapper(NamePasswordConfiguration config) { -- this.config = config; -- if (config.getProtocol().equals("ftps")) { -- try { -- client = new FTPSClient(); -- } catch (NoSuchAlgorithmException e) { -- throw new GdcUploadErrorException("Failed to initialize secure FTP client"); -- } -- } else { -- l.debug("Using insecure FTP transfer"); -- client = new FTPClient(); -- } -- } -- -- /** -- * FTP transfers a local directory to the remote GDC FTP server -- * -- * @param archiveName the name of the ZIP archive that is going to be transferred -- * @throws IOException in case of IO issues -- */ -- public void transferDir(String archiveName) throws IOException { -- l.debug("Transfering archive " + archiveName); -- try { -- File file = new File(archiveName); -- String dir = file.getName().split("\\.")[0]; -- client.connect(config.getGdcHost()); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.enterLocalPassiveMode(); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.login(config.getUsername(), config.getPassword()); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.makeDirectory(dir); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.changeWorkingDirectory(dir); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.setFileType(FTPClient.BINARY_FILE_TYPE); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.storeFile(file.getName(), new FileInputStream(file)); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.rename(file.getName(), DEFAULT_ARCHIVE_NAME); -- if (!FTPReply.isPositiveCompletion(client.getReplyCode())) { -- l.debug("Can't change the file's name: server=" -- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't change the file's name: server=" -- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't copy file to the FTP: server=" -- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't copy file to the FTP: server=" -- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't set the BINARY file transfer: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't set the BINARY file transfer: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't cd to the '" + dir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't cd to the '" + dir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't create the '" + dir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't create the '" + dir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- } -- client.logout(); -- } else { -- l.debug("Can't FTP login: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't FTP login: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't set FTP PASV mode: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't set FTP PASV mode: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); -- } -- } finally { -- if (client.isConnected()) { -- try { -- client.disconnect(); -- } catch (IOException ioe) { -- // do nothing -- } -- } -- } -- l.debug("Transferred archive " + archiveName); -- } -- -- /** -- * GET the transfer logs from the FTP server -- * -- * @param remoteDir the primary transfer directory that contains the logs -- * @return Map with the log name and content -- * @throws IOException in case of IO issues -- */ -- public Map getTransferLogs(String remoteDir) throws IOException { -- l.debug("Retrieveing transfer logs."); -- Map result = new HashMap(); -- try { -- client.connect(config.getGdcHost()); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.enterLocalPassiveMode(); -- client.login(config.getUsername(), config.getPassword()); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.changeWorkingDirectory(remoteDir); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- client.setFileType(FTPClient.ASCII_FILE_TYPE); -- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { -- String[] files = client.listNames(); -- for (String file : files) { -- if (file.endsWith(".log")) { -- ByteArrayOutputStream logContent = new ByteArrayOutputStream(); -- InputStream in = client.retrieveFileStream(file); -- FileUtil.copy(in, logContent); -- boolean st = client.completePendingCommand(); -- if (!st || !FTPReply.isPositiveCompletion(client.getReplyCode())) { -- l.debug("Can't retrieve log file: server=" -- + config.getGdcHost() + ", file=" + file + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't retrieve log file: server=" -- + config.getGdcHost() + ", file=" + file + ", " + clientReply(client)); -- } -- result.put(file, new String(logContent.toByteArray())); -- } -- } -- } else { -- l.debug("Can't set the ASCII file transfer: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't set the ASCII file transfer: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't cd to the '" + remoteDir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't cd to the '" + remoteDir + "' directory: server=" -- + config.getGdcHost() + ", " + clientReply(client)); -- } -- client.logout(); -- } else { -- l.debug("Can't FTP login: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't FTP login: server=" + config.getGdcHost() -- + ", username=" + config.getUsername() + ", " + clientReply(client)); -- } -- } else { -- l.debug("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); -- throw new GdcUploadErrorException("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); -- } -- } finally { -- if (client.isConnected()) { -- try { -- client.disconnect(); -- } catch (IOException ioe) { -- // do nothing -- } -- } -- } -- l.debug("Transfer logs retrieved."); -- return result; -- } -- -- /** -- * gets client reply -- * -- * @param client ftp client -- * @return client reply -- */ -- private String clientReply(FTPClient client) { -- return client.getReplyString() + " (code: " + client.getReplyCode() + ")"; -- } --} -diff --git a/doc/README.md b/doc/README.md -index 337e1f5..6e317e3 100644 ---- a/doc/README.md -+++ b/doc/README.md -@@ -16,6 +16,6 @@ The framework contains following components: - 5. package and transfer the data to the GoodData project. - - 3. *GdcRESTApiWrapper* that is a communication stub that wraps the GoodData HTTP API in Java. This class de-facto translates the Java calls to the invocations of the GoodData HTTP API. The *GdcRESTApiWrapper* returns few info structures that describe the GoodData project, Data Loading Interface (DLI), DLI parts etc. --4. *GdcFTPApiWrapper* that is a communication stub that wraps the GoodData FTP API in Java. This class takes care of the transfer of the data package to a secure private space on GoodData servers. -+4. *GdcWebDavApiWrapper* that is a communication stub that wraps the GoodData staging area access API in Java. This class takes care of the transfer of the data package to a secure private space on GoodData servers. - 5. *Connector Backend* performs the data transformation. The backend is implemented in the Derby SQL (embedded, low performance) and MySQL (needs installation, improves performance) databases. The connector backends transform the incoming data to the [3NF](http://en.wikipedia.org/wiki/Third_normal_form) - 6. *MAQLGenerator* generates the [MAQL DDL](http://developer.gooddata.com/api/maql-ddl.html) script that creates the GoodData LDM -diff --git a/doc/architecture.dot b/doc/architecture.dot -index 1f36f35..98898ca 100755 ---- a/doc/architecture.dot -+++ b/doc/architecture.dot -@@ -8,7 +8,7 @@ digraph GoodDataCL { - JdbcConnector -> AbstractConnector; - CsvConnector -> AbstractConnector; - AbstractConnector -> GdcRestAPIWrapper; -- AbstractConnector -> GdcFtpAPIWrapper; -+ AbstractConnector -> GdcWebDavApiWrapper; - AbstractConnector -> MySqlConnectorBackend; - AbstractConnector -> DerbyConnectorBackend; - AbstractConnector -> MAQLGenerator; - --- -1.7.1 - diff --git a/0003-Disable-modules-we-can-t-build-due-missing-closed-de.patch b/0003-Disable-modules-we-can-t-build-due-missing-closed-de.patch new file mode 100644 index 0000000..8bb6839 --- /dev/null +++ b/0003-Disable-modules-we-can-t-build-due-missing-closed-de.patch @@ -0,0 +1,55 @@ +From f73e4135a36981aac530c073f67d75454e6403b4 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 3 Aug 2012 14:41:57 +0200 +Subject: [PATCH 03/10] Disable modules we can't build due missing/closed + dependencies + +--- + pom.xml | 17 ----------------- + 1 file changed, 17 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 8267e09..c4943db 100755 +--- a/pom.xml ++++ b/pom.xml +@@ -46,8 +46,6 @@ + + cli + web +- notification +- sfdc + backend + connector + common +@@ -105,11 +103,6 @@ + ${project.version} + + +- com.gooddata.cl +- gooddata-sfdc-lib +- ${project.version} +- +- + org.snaplogic + snapi + 2.3.0 +@@ -120,16 +113,6 @@ + 2.3.0 + + +- sfdc-partner +- com.sforce.partner +- 18 +- +- +- sfdc-ws +- com.sforce.ws +- 20 +- +- + gooddata-notification + com.gooddata.cl + ${project.version} +-- +1.8.3.1 + diff --git a/0004-Disable-modules-we-can-t-build-due-missing-closed-de.patch b/0004-Disable-modules-we-can-t-build-due-missing-closed-de.patch deleted file mode 100644 index 1818b7f..0000000 --- a/0004-Disable-modules-we-can-t-build-due-missing-closed-de.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 9eb94970a89def2d47e7b79a56e90ecf4dacc39d Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Fri, 3 Aug 2012 14:41:57 +0200 -Subject: [PATCH 4/6] Disable modules we can't build due missing/closed dependencies - ---- - pom.xml | 3 --- - 1 files changed, 0 insertions(+), 3 deletions(-) - -diff --git a/pom.xml b/pom.xml -index e27ff09..9341bf4 100755 ---- a/pom.xml -+++ b/pom.xml -@@ -46,10 +46,7 @@ - - cli - web -- notification - sfdc -- gooddata-snaplogic -- snaplogic - backend - connector - common --- -1.7.1 - -diff --git a/pom.xml b/pom.xml -index 605934c..5dfb010 100755 ---- a/pom.xml -+++ b/pom.xml -@@ -46,7 +46,6 @@ - - cli - web -- sfdc - backend - connector - common -@@ -104,11 +103,6 @@ - ${project.version} - - -- com.gooddata.cl -- gooddata-sfdc-lib -- ${project.version} -- -- - org.snaplogic - snapi - 2.3.0 -@@ -119,16 +113,6 @@ - 2.3.0 - - -- sfdc-partner -- com.sforce.partner -- 18 -- -- -- sfdc-ws -- com.sforce.ws -- 20 -- -- - gooddata-notification - com.gooddata.cl - ${project.version} diff --git a/0004-Sanitize-logging-defaults.patch b/0004-Sanitize-logging-defaults.patch new file mode 100644 index 0000000..495e284 --- /dev/null +++ b/0004-Sanitize-logging-defaults.patch @@ -0,0 +1,25 @@ +From b011590a64cc36fa97fb291ef036b38d33fecafc Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 3 Aug 2012 14:42:52 +0200 +Subject: [PATCH 04/10] Sanitize logging defaults + +--- + common/src/main/resources/log4j.configuration | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/common/src/main/resources/log4j.configuration b/common/src/main/resources/log4j.configuration +index 0658a64..c042013 100644 +--- a/common/src/main/resources/log4j.configuration ++++ b/common/src/main/resources/log4j.configuration +@@ -1,6 +1,6 @@ + log4j.rootLogger=info, stdout +-log4j.logger.com.gooddata.util.JdbcUtil=debug, S +-log4j.logger.org.apache.commons.httpclient=debug,H ++#log4j.logger.com.gooddata.util.JdbcUtil=debug, S ++#log4j.logger.org.apache.commons.httpclient=debug,H + + # Prevent Axis to issue harmless complains about missing javax.activation.DataHandler + # and javax.mail.internet.MimeMultipart. Attachment support is not required. +-- +1.8.3.1 + diff --git a/0005-Do-not-hardwire-classpath-in-CLI.patch b/0005-Do-not-hardwire-classpath-in-CLI.patch new file mode 100644 index 0000000..3cfaa82 --- /dev/null +++ b/0005-Do-not-hardwire-classpath-in-CLI.patch @@ -0,0 +1,38 @@ +From 7d6d97e5bbed2f3059b4b50aef01abe700f9151e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 3 Aug 2012 14:43:49 +0200 +Subject: [PATCH 05/10] Do not hardwire classpath in CLI + +--- + cli/pom.xml | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git a/cli/pom.xml b/cli/pom.xml +index f5e44a6..e01f79a 100644 +--- a/cli/pom.xml ++++ b/cli/pom.xml +@@ -84,14 +84,6 @@ + + org.apache.maven.plugins + maven-jar-plugin +- +- +- +- true +- com.gooddata.processor.GdcDI +- +- +- + + + maven-assembly-plugin +@@ -109,4 +101,4 @@ + + + +- +\ No newline at end of file ++ +-- +1.8.3.1 + diff --git a/0005-Sanitize-logging-defaults.patch b/0005-Sanitize-logging-defaults.patch deleted file mode 100644 index 91e949c..0000000 --- a/0005-Sanitize-logging-defaults.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1710324954515ea0e70ef97c1981e93142c4ec31 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Fri, 3 Aug 2012 14:42:52 +0200 -Subject: [PATCH 5/6] Sanitize logging defaults - ---- - common/src/main/resources/log4j.configuration | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/common/src/main/resources/log4j.configuration b/common/src/main/resources/log4j.configuration -index 0658a64..c042013 100644 ---- a/common/src/main/resources/log4j.configuration -+++ b/common/src/main/resources/log4j.configuration -@@ -1,6 +1,6 @@ - log4j.rootLogger=info, stdout --log4j.logger.com.gooddata.util.JdbcUtil=debug, S --log4j.logger.org.apache.commons.httpclient=debug,H -+#log4j.logger.com.gooddata.util.JdbcUtil=debug, S -+#log4j.logger.org.apache.commons.httpclient=debug,H - - # Prevent Axis to issue harmless complains about missing javax.activation.DataHandler - # and javax.mail.internet.MimeMultipart. Attachment support is not required. --- -1.7.1 - diff --git a/0006-Avoid-using-proprietary-Sun-API.patch b/0006-Avoid-using-proprietary-Sun-API.patch new file mode 100644 index 0000000..0d6719c --- /dev/null +++ b/0006-Avoid-using-proprietary-Sun-API.patch @@ -0,0 +1,85 @@ +From da594e0a6888f4ff762818367e2f96e0992ba1d8 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 16 Aug 2012 16:18:55 +0200 +Subject: [PATCH 06/10] Avoid using proprietary Sun API + +[ERROR] SoapExecutor.java:[26,48] OutputFormat is internal proprietary API and may be removed in a future release +[ERROR] SoapExecutor.java:[27,48] XMLSerializer is internal proprietary API and may be removed in a future release +--- + .../gooddata/integration/soap/SoapExecutor.java | 4 ++-- + connector/pom.xml | 5 +++++ + pom.xml | 25 ++++++---------------- + 3 files changed, 14 insertions(+), 20 deletions(-) + +diff --git a/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java b/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java +index ff07da9..eb2aab8 100644 +--- a/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java ++++ b/backend/src/main/java/com/gooddata/integration/soap/SoapExecutor.java +@@ -23,8 +23,8 @@ + + package com.gooddata.integration.soap; + +-import com.sun.org.apache.xml.internal.serialize.OutputFormat; +-import com.sun.org.apache.xml.internal.serialize.XMLSerializer; ++import org.apache.xml.serialize.OutputFormat; ++import org.apache.xml.serialize.XMLSerializer; + import org.jaxen.JaxenException; + import org.jaxen.SimpleNamespaceContext; + import org.jaxen.XPath; +diff --git a/connector/pom.xml b/connector/pom.xml +index db841e3..1b0848c 100644 +--- a/connector/pom.xml ++++ b/connector/pom.xml +@@ -78,6 +78,11 @@ + axis + axis + ++ ++ org.apache.axis ++ axis-jaxrpc ++ 1.4 ++ + + javassist + javassist +diff --git a/pom.xml b/pom.xml +index c4943db..21bc89c 100755 +--- a/pom.xml ++++ b/pom.xml +@@ -308,26 +308,15 @@ + + jaxen + jaxen +- +- +- xerces +- xmlParserAPIs +- +- +- xalan +- xalan +- +- +- xerces +- xercesImpl +- +- +- xml-apis +- xml-apis +- +- + 1.1.1 + ++ ++ ++ org.apache.axis ++ axis-jaxrpc ++ 1.4 ++ ++ + + org.slf4j + log4j-over-slf4j +-- +1.8.3.1 + diff --git a/0006-Do-not-hardwire-classpath-in-CLI.patch b/0006-Do-not-hardwire-classpath-in-CLI.patch deleted file mode 100644 index cf746d3..0000000 --- a/0006-Do-not-hardwire-classpath-in-CLI.patch +++ /dev/null @@ -1,38 +0,0 @@ -From d954eef29bf4f745def220d6efada98e77923dc5 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Fri, 3 Aug 2012 14:43:49 +0200 -Subject: [PATCH 6/6] Do not hardwire classpath in CLI - ---- - cli/pom.xml | 10 +--------- - 1 files changed, 1 insertions(+), 9 deletions(-) - -diff --git a/cli/pom.xml b/cli/pom.xml -index ef14a05..e7d3d81 100644 ---- a/cli/pom.xml -+++ b/cli/pom.xml -@@ -84,14 +84,6 @@ - - org.apache.maven.plugins - maven-jar-plugin -- -- -- -- true -- com.gooddata.processor.GdcDI -- -- -- - - - maven-assembly-plugin -@@ -109,4 +101,4 @@ - - - -- -\ No newline at end of file -+ --- -1.7.1 - diff --git a/0007-Remove-FTP-support-it-should-not-be-used.patch b/0007-Remove-FTP-support-it-should-not-be-used.patch new file mode 100644 index 0000000..d149ce7 --- /dev/null +++ b/0007-Remove-FTP-support-it-should-not-be-used.patch @@ -0,0 +1,286 @@ +From c9ec977d948d13bf46a6abcd9dd19eb2335c307f Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 16 Aug 2012 16:27:45 +0200 +Subject: [PATCH 07/10] Remove FTP support, it should not be used + +--- + .../gooddata/integration/ftp/GdcFTPApiWrapper.java | 240 --------------------- + doc/README.md | 2 +- + doc/architecture.dot | 2 +- + 3 files changed, 2 insertions(+), 242 deletions(-) + delete mode 100644 backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java + +diff --git a/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java b/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java +deleted file mode 100644 +index ffc862b..0000000 +--- a/backend/src/main/java/com/gooddata/integration/ftp/GdcFTPApiWrapper.java ++++ /dev/null +@@ -1,240 +0,0 @@ +-/* +- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. +- */ +- +-package com.gooddata.integration.ftp; +- +-import com.gooddata.exception.GdcUploadErrorException; +-import com.gooddata.integration.datatransfer.GdcDataTransferAPI; +-import com.gooddata.integration.rest.configuration.NamePasswordConfiguration; +-import com.gooddata.util.FileUtil; +-import org.apache.commons.net.ftp.FTPClient; +-import org.apache.commons.net.ftp.FTPReply; +-import org.apache.commons.net.ftp.FTPSClient; +-import org.apache.log4j.Logger; +- +-import java.io.*; +-import java.security.NoSuchAlgorithmException; +-import java.util.HashMap; +-import java.util.Map; +- +-/** +- * GoodData FTP API Java wrapper +- * +- * @author zd +- * @version 1.0 +- */ +-public class GdcFTPApiWrapper implements GdcDataTransferAPI { +- +- private static Logger l = Logger.getLogger(GdcFTPApiWrapper.class); +- +- protected static final String DEFAULT_ARCHIVE_NAME = "upload.zip"; +- +- protected FTPClient client; +- protected NamePasswordConfiguration config; +- +- /** +- * Constructs the GoodData FTP API Java wrapper +- * +- * @param config NamePasswordConfiguration object with the GDC name and password configuration +- */ +- public GdcFTPApiWrapper(NamePasswordConfiguration config) { +- this.config = config; +- if (config.getProtocol().equals("ftps")) { +- try { +- client = new FTPSClient(); +- } catch (NoSuchAlgorithmException e) { +- throw new GdcUploadErrorException("Failed to initialize secure FTP client"); +- } +- } else { +- l.debug("Using insecure FTP transfer"); +- client = new FTPClient(); +- } +- } +- +- /** +- * FTP transfers a local directory to the remote GDC FTP server +- * +- * @param archiveName the name of the ZIP archive that is going to be transferred +- * @throws IOException in case of IO issues +- */ +- public void transferDir(String archiveName) throws IOException { +- l.debug("Transfering archive " + archiveName); +- try { +- File file = new File(archiveName); +- String dir = file.getName().split("\\.")[0]; +- client.connect(config.getGdcHost()); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.enterLocalPassiveMode(); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.login(config.getUsername(), config.getPassword()); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.makeDirectory(dir); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.changeWorkingDirectory(dir); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.setFileType(FTPClient.BINARY_FILE_TYPE); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.storeFile(file.getName(), new FileInputStream(file)); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.rename(file.getName(), DEFAULT_ARCHIVE_NAME); +- if (!FTPReply.isPositiveCompletion(client.getReplyCode())) { +- l.debug("Can't change the file's name: server=" +- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't change the file's name: server=" +- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't copy file to the FTP: server=" +- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't copy file to the FTP: server=" +- + config.getGdcHost() + ", file=" + file.getName() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't set the BINARY file transfer: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't set the BINARY file transfer: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't cd to the '" + dir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't cd to the '" + dir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't create the '" + dir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't create the '" + dir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- } +- client.logout(); +- } else { +- l.debug("Can't FTP login: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't FTP login: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't set FTP PASV mode: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't set FTP PASV mode: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); +- } +- } finally { +- if (client.isConnected()) { +- try { +- client.disconnect(); +- } catch (IOException ioe) { +- // do nothing +- } +- } +- } +- l.debug("Transferred archive " + archiveName); +- } +- +- /** +- * GET the transfer logs from the FTP server +- * +- * @param remoteDir the primary transfer directory that contains the logs +- * @return Map with the log name and content +- * @throws IOException in case of IO issues +- */ +- public Map getTransferLogs(String remoteDir) throws IOException { +- l.debug("Retrieveing transfer logs."); +- Map result = new HashMap(); +- try { +- client.connect(config.getGdcHost()); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.enterLocalPassiveMode(); +- client.login(config.getUsername(), config.getPassword()); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.changeWorkingDirectory(remoteDir); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- client.setFileType(FTPClient.ASCII_FILE_TYPE); +- if (FTPReply.isPositiveCompletion(client.getReplyCode())) { +- String[] files = client.listNames(); +- for (String file : files) { +- if (file.endsWith(".log")) { +- ByteArrayOutputStream logContent = new ByteArrayOutputStream(); +- InputStream in = client.retrieveFileStream(file); +- FileUtil.copy(in, logContent); +- boolean st = client.completePendingCommand(); +- if (!st || !FTPReply.isPositiveCompletion(client.getReplyCode())) { +- l.debug("Can't retrieve log file: server=" +- + config.getGdcHost() + ", file=" + file + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't retrieve log file: server=" +- + config.getGdcHost() + ", file=" + file + ", " + clientReply(client)); +- } +- result.put(file, new String(logContent.toByteArray())); +- } +- } +- } else { +- l.debug("Can't set the ASCII file transfer: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't set the ASCII file transfer: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't cd to the '" + remoteDir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't cd to the '" + remoteDir + "' directory: server=" +- + config.getGdcHost() + ", " + clientReply(client)); +- } +- client.logout(); +- } else { +- l.debug("Can't FTP login: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't FTP login: server=" + config.getGdcHost() +- + ", username=" + config.getUsername() + ", " + clientReply(client)); +- } +- } else { +- l.debug("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); +- throw new GdcUploadErrorException("Can't FTP connect: server=" + config.getGdcHost() + ", " + clientReply(client)); +- } +- } finally { +- if (client.isConnected()) { +- try { +- client.disconnect(); +- } catch (IOException ioe) { +- // do nothing +- } +- } +- } +- l.debug("Transfer logs retrieved."); +- return result; +- } +- +- /** +- * gets client reply +- * +- * @param client ftp client +- * @return client reply +- */ +- private String clientReply(FTPClient client) { +- return client.getReplyString() + " (code: " + client.getReplyCode() + ")"; +- } +-} +diff --git a/doc/README.md b/doc/README.md +index 1ccfff1..8f2627c 100644 +--- a/doc/README.md ++++ b/doc/README.md +@@ -16,6 +16,6 @@ The framework contains following components: + 5. package and transfer the data to the GoodData project. + + 3. *GdcRESTApiWrapper* that is a communication stub that wraps the GoodData HTTP API in Java. This class de-facto translates the Java calls to the invocations of the GoodData HTTP API. The *GdcRESTApiWrapper* returns few info structures that describe the GoodData project, Data Loading Interface (DLI), DLI parts etc. +-4. *GdcFTPApiWrapper* that is a communication stub that wraps the GoodData FTP API in Java. This class takes care of the transfer of the data package to a secure private space on GoodData servers. ++4. *GdcWebDavApiWrapper* that is a communication stub that wraps the GoodData staging area access API in Java. This class takes care of the transfer of the data package to a secure private space on GoodData servers. + 5. *Connector Backend* performs the data transformation. The backend is implemented in the Derby SQL (embedded, low performance) and MySQL (needs installation, improves performance) databases. The connector backends transform the incoming data to the [3NF](http://en.wikipedia.org/wiki/Third_normal_form) + 6. *MAQLGenerator* generates the [MAQL DDL](http://developer.gooddata.com/reference/maql/maql-ddl) script that creates the GoodData LDM +diff --git a/doc/architecture.dot b/doc/architecture.dot +index 1f36f35..98898ca 100755 +--- a/doc/architecture.dot ++++ b/doc/architecture.dot +@@ -8,7 +8,7 @@ digraph GoodDataCL { + JdbcConnector -> AbstractConnector; + CsvConnector -> AbstractConnector; + AbstractConnector -> GdcRestAPIWrapper; +- AbstractConnector -> GdcFtpAPIWrapper; ++ AbstractConnector -> GdcWebDavApiWrapper; + AbstractConnector -> MySqlConnectorBackend; + AbstractConnector -> DerbyConnectorBackend; + AbstractConnector -> MAQLGenerator; +-- +1.8.3.1 + diff --git a/0008-Drop-GA-connector.patch b/0008-Drop-GA-connector.patch new file mode 100644 index 0000000..b4fa554 --- /dev/null +++ b/0008-Drop-GA-connector.patch @@ -0,0 +1,665 @@ +From af41697fe5cf1608970f79cc099b5b8ce8b5074e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 11 Jul 2013 18:20:31 +0200 +Subject: [PATCH 08/10] Drop GA connector + +--- + .../main/java/com/gooddata/processor/GdcDI.java | 1 - + connector/pom.xml | 15 - + .../java/com/gooddata/connector/GaConnector.java | 349 --------------------- + .../com/gooddata/google/analytics/FeedDumper.java | 130 -------- + .../com/gooddata/google/analytics/GaQuery.java | 51 --- + pom.xml | 15 - + .../main/java/com/gooddata/web/WebInterface.java | 7 +- + 7 files changed, 3 insertions(+), 565 deletions(-) + delete mode 100644 connector/src/main/java/com/gooddata/connector/GaConnector.java + delete mode 100644 connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java + delete mode 100644 connector/src/main/java/com/gooddata/google/analytics/GaQuery.java + +diff --git a/cli/src/main/java/com/gooddata/processor/GdcDI.java b/cli/src/main/java/com/gooddata/processor/GdcDI.java +index d9c1c00..d068227 100644 +--- a/cli/src/main/java/com/gooddata/processor/GdcDI.java ++++ b/cli/src/main/java/com/gooddata/processor/GdcDI.java +@@ -1484,7 +1484,6 @@ public class GdcDI implements Executor { + private Connector[] instantiateConnectors() throws IOException { + return new Connector[]{ + CsvConnector.createConnector(), +- GaConnector.createConnector(), + SfdcConnector.createConnector(), + JdbcConnector.createConnector(), + PtConnector.createConnector(), +diff --git a/connector/pom.xml b/connector/pom.xml +index 1b0848c..683db98 100644 +--- a/connector/pom.xml ++++ b/connector/pom.xml +@@ -56,21 +56,6 @@ + + + +- com.google.gdata +- gdata-java-client +- 1.40.0 +- +- +- com.google.gdata +- gdata-java-core +- 1.40.0 +- +- +- com.google.gdata +- gdata-java-analytics +- 1.40.0 +- +- + net.sf.opencsv + opencsv + +diff --git a/connector/src/main/java/com/gooddata/connector/GaConnector.java b/connector/src/main/java/com/gooddata/connector/GaConnector.java +deleted file mode 100644 +index 43c9102..0000000 +--- a/connector/src/main/java/com/gooddata/connector/GaConnector.java ++++ /dev/null +@@ -1,349 +0,0 @@ +-/* +- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. +- */ +- +-package com.gooddata.connector; +- +-import com.gooddata.exception.InternalErrorException; +-import com.gooddata.exception.InvalidArgumentException; +-import com.gooddata.exception.InvalidCommandException; +-import com.gooddata.exception.ProcessingException; +-import com.gooddata.google.analytics.FeedDumper; +-import com.gooddata.google.analytics.GaQuery; +-import com.gooddata.modeling.model.SourceColumn; +-import com.gooddata.modeling.model.SourceSchema; +-import com.gooddata.processor.CliParams; +-import com.gooddata.processor.Command; +-import com.gooddata.processor.ProcessingContext; +-import com.gooddata.transform.Transformer; +-import com.gooddata.util.CSVWriter; +-import com.gooddata.util.FileUtil; +-import com.google.gdata.client.ClientLoginAccountType; +-import com.google.gdata.client.analytics.AnalyticsService; +-import com.google.gdata.data.analytics.DataFeed; +-import com.google.gdata.util.AuthenticationException; +-import com.google.gdata.util.ServiceException; +-import org.apache.log4j.Logger; +- +-import java.io.File; +-import java.io.IOException; +-import java.net.MalformedURLException; +- +-/** +- * GoodData Google Analytics Connector +- * +- * @author zd +- * @version 1.0 +- */ +-public class GaConnector extends AbstractConnector implements Connector { +- +- public static final String GA_DATE = "ga:date"; +- +- private static Logger l = Logger.getLogger(GaConnector.class); +- +- private static final String APP_NAME = "gdc-ga-client"; +- +- private static final int GOOGLE_ANALYTICS_CHUNK = 9900; +- private String googleAnalyticsUsername; +- private String googleAnalyticsPassword; +- private String googleAnalyticsToken; +- private GaQuery googleAnalyticsQuery; +- +- /** +- * Creates a new Google Analytics Connector +- */ +- protected GaConnector() { +- } +- +- /** +- * Creates a new Google Analytics Connector +- * +- * @return a new instance of the GA connector +- */ +- public static GaConnector createConnector() { +- return new GaConnector(); +- } +- +- /** +- * Saves a template of the config file +- * +- * @param name the new config file name +- * @param configFileName the new config file name +- * @param gQuery the Google Analytics query +- * @throws com.gooddata.exception.InvalidArgumentException +- * if there is a problem with arguments +- * @throws IOException if there is a problem with writing the config file +- */ +- public static void saveConfigTemplate(String name, String configFileName, GaQuery gQuery) +- throws IOException { +- l.debug("Saving GA config template."); +- String dims = gQuery.getDimensions(); +- String mtrs = gQuery.getMetrics(); +- SourceSchema s = SourceSchema.createSchema(name); +- SourceColumn cp = new SourceColumn("id", SourceColumn.LDM_TYPE_CONNECTION_POINT, "id"); +- s.addColumn(cp); +- cp = new SourceColumn("profileId", SourceColumn.LDM_TYPE_ATTRIBUTE, "profileId"); +- s.addColumn(cp); +- if (dims != null && dims.length() > 0) { +- String[] dimensions = dims.split("\\|"); +- for (String dim : dimensions) { +- // remove the "ga:" +- if (dim != null && dim.length() > 3) { +- String d = dim.substring(3); +- if (GA_DATE.equals(dim)) { +- SourceColumn sc = new SourceColumn(d, SourceColumn.LDM_TYPE_DATE, d); +- sc.setFormat("yyyy-MM-dd"); +- s.addColumn(sc); +- } else { +- SourceColumn sc = new SourceColumn(d, SourceColumn.LDM_TYPE_ATTRIBUTE, d); +- s.addColumn(sc); +- } +- } else { +- l.debug("Invalid dimension name '" + dim + "'"); +- throw new InvalidArgumentException("Invalid dimension name '" + dim + "'"); +- } +- } +- } else { +- l.debug("Please specify Google Analytics dimensions separated by comma."); +- throw new InvalidArgumentException("Please specify Google Analytics dimensions separated by comma."); +- } +- if (mtrs != null && mtrs.length() > 0) { +- String[] metrics = mtrs.split("\\|"); +- for (String mtr : metrics) { +- // remove the "ga:" +- if (mtr != null && mtr.length() > 3) { +- String m = mtr.substring(3); +- SourceColumn sc = new SourceColumn(m, SourceColumn.LDM_TYPE_FACT, m); +- s.addColumn(sc); +- } else { +- l.debug("Invalid dimension name '" + mtr + "'"); +- throw new InvalidArgumentException("Invalid metric name '" + mtr + "'"); +- } +- } +- } else { +- l.debug("Please specify Google Analytics metrics separated by comma."); +- throw new InvalidArgumentException("Please specify Google Analytics metrics separated by comma."); +- } +- s.writeConfig(new File(configFileName)); +- l.debug("Saved GA config template."); +- } +- +- /** +- * {@inheritDoc} +- */ +- public void extract(String file, final boolean transform) throws IOException { +- try { +- AnalyticsService as = new AnalyticsService(APP_NAME); +- if (googleAnalyticsToken != null && googleAnalyticsToken.length() > 0) { +- as.setAuthSubToken(googleAnalyticsToken); +- } else if (googleAnalyticsUsername != null && googleAnalyticsUsername.length() > 0 && +- googleAnalyticsPassword != null && googleAnalyticsPassword.length() > 0) { +- as.setUserCredentials(googleAnalyticsUsername, googleAnalyticsPassword, ClientLoginAccountType.GOOGLE); +- } else { +- throw new InvalidCommandException("The UseGoogleAnalytics command requires either GA token or " + +- "username and password!"); +- } +- File dataFile = new File(file); +- GaQuery gaq = getGoogleAnalyticsQuery(); +- gaq.setMaxResults(GOOGLE_ANALYTICS_CHUNK); +- int cnt = 1; +- +- CSVWriter cw = FileUtil.createUtf8CsvWriter(dataFile); +- Transformer t = Transformer.create(schema); +- +- String[] header = t.getHeader(transform); +- cw.writeNext(header); +- +- for (int startIndex = 1; cnt > 0; startIndex += cnt + 1) { +- gaq.setStartIndex(startIndex); +- DataFeed feed = as.getFeed(gaq.getUrl(), DataFeed.class); +- l.debug("Retrieving GA data from index=" + startIndex); +- cnt = FeedDumper.dump(cw, feed, gaq, t, transform); +- l.debug("Retrieved " + cnt + " entries."); +- } +- cw.close(); +- } catch (AuthenticationException e) { +- throw new InternalErrorException(e); +- } catch (ServiceException e) { +- throw new InternalErrorException(e); +- } +- } +- +- +- /** +- * Google Analytics username getter +- * +- * @return Google Analytics username +- */ +- public String getGoogleAnalyticsUsername() { +- return googleAnalyticsUsername; +- } +- +- /** +- * Google Analytics username setter +- * +- * @param googleAnalyticsUsername Google Analytics username +- */ +- public void setGoogleAnalyticsUsername(String googleAnalyticsUsername) { +- this.googleAnalyticsUsername = googleAnalyticsUsername; +- } +- +- /** +- * Google Analytics password getter +- * +- * @return Google Analytics password +- */ +- public String getGoogleAnalyticsPassword() { +- return googleAnalyticsPassword; +- } +- +- /** +- * Google Analytics password setter +- * +- * @param googleAnalyticsPassword Google Analytics password +- */ +- public void setGoogleAnalyticsPassword(String googleAnalyticsPassword) { +- this.googleAnalyticsPassword = googleAnalyticsPassword; +- } +- +- /** +- * Google Analytics query getter +- * +- * @return Google Analytics query +- */ +- public GaQuery getGoogleAnalyticsQuery() { +- return googleAnalyticsQuery; +- } +- +- /** +- * Google Analytics query setter +- * +- * @param googleAnalyticsQuery Google Analytics query +- */ +- public void setGoogleAnalyticsQuery(GaQuery googleAnalyticsQuery) { +- this.googleAnalyticsQuery = googleAnalyticsQuery; +- } +- +- /** +- * {@inheritDoc} +- */ +- public boolean processCommand(Command c, CliParams cli, ProcessingContext ctx) throws ProcessingException { +- l.debug("Processing command " + c.getCommand()); +- try { +- if (c.match("GenerateGoogleAnalyticsConfig")) { +- generateGAConfig(c, cli, ctx); +- } else if (c.match("UseGoogleAnalytics")) { +- loadGA(c, cli, ctx); +- } else { +- l.debug("No match passing the command " + c.getCommand() + " further."); +- return super.processCommand(c, cli, ctx); +- } +- } catch (IOException e) { +- throw new ProcessingException(e); +- } +- l.debug("Processed command " + c.getCommand()); +- return true; +- } +- +- /** +- * Loads new GA data command processor +- * +- * @param c command +- * @param p command line arguments +- * @param ctx current processing context +- * @throws IOException in case of IO issues +- */ +- private void loadGA(Command c, CliParams p, ProcessingContext ctx) throws IOException { +- GaQuery gq; +- try { +- gq = new GaQuery(); +- } catch (MalformedURLException e) { +- throw new IllegalArgumentException(e.getMessage()); +- } +- String configFile = c.getParamMandatory("configFile"); +- String usr = c.getParam("username"); +- String psw = c.getParam("password"); +- String token = c.getParam("token"); +- String id = c.getParamMandatory("profileId"); +- File conf = FileUtil.getFile(configFile); +- initSchema(conf.getAbsolutePath()); +- gq.setIds(id); +- if (token != null && token.length() > 0) { +- setGoogleAnalyticsToken(token); +- } else if (usr != null && usr.length() > 0 && +- psw != null && psw.length() > 0) { +- setGoogleAnalyticsUsername(usr); +- setGoogleAnalyticsPassword(psw); +- } else { +- throw new InvalidCommandException("The UseGoogleAnalytics command requires either GA token or " + +- "username and password!"); +- } +- setGoogleAnalyticsQuery(gq); +- gq.setDimensions(c.getParamMandatory("dimensions").replace("|", ",")); +- gq.setMetrics(c.getParamMandatory("metrics").replace("|", ",")); +- gq.setStartDate(c.getParamMandatory("startDate")); +- gq.setEndDate(c.getParamMandatory("endDate")); +- if (c.checkParam("filters")) +- gq.setFilters(c.getParam("filters")); +- c.paramsProcessed(); +- +- // sets the current connector +- ctx.setConnector(this); +- setProjectId(ctx); +- l.info("Google Analytics Connector successfully loaded (id: " + id + ")."); +- } +- +- /** +- * Generate GA config command processor +- * +- * @param c command +- * @param p command line arguments +- * @param ctx current processing context +- * @throws IOException in case of IO issues +- */ +- private void generateGAConfig(Command c, CliParams p, ProcessingContext ctx) throws IOException { +- String configFile = c.getParamMandatory("configFile"); +- String name = c.getParamMandatory("name"); +- String dimensions = c.getParamMandatory("dimensions"); +- String metrics = c.getParamMandatory("metrics"); +- c.paramsProcessed(); +- +- GaQuery gq; +- try { +- gq = new GaQuery(); +- } catch (MalformedURLException e) { +- throw new IllegalArgumentException(e.getMessage()); +- } +- gq.setDimensions(dimensions); +- gq.setMetrics(metrics); +- GaConnector.saveConfigTemplate(name, configFile, gq); +- l.info("Google Analytics Connector configuration successfully generated. See config file: " + configFile); +- } +- +- public String getGoogleAnalyticsToken() { +- return googleAnalyticsToken; +- } +- +- public void setGoogleAnalyticsToken(String googleAnalyticsToken) { +- this.googleAnalyticsToken = googleAnalyticsToken; +- } +-} +diff --git a/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java b/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java +deleted file mode 100644 +index 2cc1618..0000000 +--- a/connector/src/main/java/com/gooddata/google/analytics/FeedDumper.java ++++ /dev/null +@@ -1,130 +0,0 @@ +-/* +- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. +- */ +- +-package com.gooddata.google.analytics; +- +-import com.gooddata.connector.AbstractConnector; +-import com.gooddata.connector.GaConnector; +-import com.gooddata.exception.InvalidParameterException; +-import com.gooddata.transform.Transformer; +-import com.gooddata.util.CSVWriter; +-import com.gooddata.util.DateUtil; +-import com.google.gdata.data.analytics.DataEntry; +-import com.google.gdata.data.analytics.DataFeed; +-import com.google.gdata.data.analytics.Dimension; +-import com.google.gdata.data.analytics.Metric; +-import org.apache.log4j.Logger; +-import org.joda.time.DateTime; +-import org.joda.time.format.DateTimeFormatter; +- +-import java.io.IOException; +-import java.util.ArrayList; +-import java.util.List; +- +-/** +- * Google feed dumper dumps the Google result data to CSV +- * +- * @author ZD +- * @version 1.0 +- */ +-public class FeedDumper { +- +- private static final String UNKNOWN_DATE = "(other)"; +- +- private static final String IN_FMT = "yyyyMMdd"; +- private static final String OUT_FMT = "yyyy-MM-dd"; +- +- private static Logger l = Logger.getLogger(FeedDumper.class); +- +- /** +- * Dupmps the gdata feed to CSV +- * +- * @param cw CSVWriter +- * @param feed Google feed +- * @param gaq Google Analytics Query +- * @param t Transformer +- * @param transform perform transformations? +- * @throws IOException in case of an IO problem +- */ +- public static int dump(CSVWriter cw, DataFeed feed, GaQuery gaq, Transformer t, boolean transform) throws IOException { +- l.debug("Dumping GA feed."); +- String profileId = gaq.getIds(); +- if (profileId == null || profileId.length() <= 0) +- throw new InvalidParameterException("Empty Google Analytics profile ID in query."); +- List entries = feed.getEntries(); +- List dimensions = null; +- List dimensionNames = new ArrayList(); +- List metrics = null; +- +- if (!entries.isEmpty()) { +- DataEntry singleEntry = entries.get(0); +- dimensions = singleEntry.getDimensions(); +- metrics = singleEntry.getMetrics(); +- } else +- return 0; +- +- final List headers = new ArrayList(); +- for (Dimension dimension : dimensions) { +- headers.add(dimension.getName()); +- dimensionNames.add(dimension.getName()); +- } +- for (Metric metric : metrics) { +- headers.add(metric.getName()); +- } +- +- final DateTimeFormatter inFmt = DateUtil.getDateFormatter(IN_FMT, false); +- final DateTimeFormatter outFmt = DateUtil.getDateFormatter(OUT_FMT, false); +- for (DataEntry entry : entries) { +- final List row = new ArrayList(); +- for (String dataName : headers) { +- final String valueIn = entry.stringValueOf(dataName); +- String valueOut; +- if (GaConnector.GA_DATE.equalsIgnoreCase(dataName)) { +- if (valueIn == null || valueIn.length() != 8 || UNKNOWN_DATE.equals(valueIn)) { +- valueOut = ""; +- l.debug("Invalid date value '" + valueIn + "'"); +- } else { +- try { +- DateTime dt = inFmt.parseDateTime(valueIn); +- valueOut = outFmt.print(dt); +- } catch (IllegalArgumentException e) { +- valueOut = ""; +- l.debug("Invalid date value '" + valueIn + "'"); +- } +- } +- } else { +- valueOut = valueIn; +- } +- row.add(valueOut); +- } +- row.add(0, profileId); +- String[] r = row.toArray(new String[]{}); +- if (transform) +- r = t.transformRow(r, AbstractConnector.DATE_LENGTH_UNRESTRICTED); +- cw.writeNext(r); +- } +- l.debug("Dumped " + entries.size() + " rows from GA feed."); +- return entries.size(); +- } +- +-} +\ No newline at end of file +diff --git a/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java b/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java +deleted file mode 100644 +index ac735ec..0000000 +--- a/connector/src/main/java/com/gooddata/google/analytics/GaQuery.java ++++ /dev/null +@@ -1,51 +0,0 @@ +-/* +- * Copyright (c) 2009, GoodData Corporation. 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 the GoodData Corporation 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. +- */ +- +-package com.gooddata.google.analytics; +- +-import com.google.gdata.client.analytics.DataQuery; +- +-import java.net.MalformedURLException; +-import java.net.URL; +- +-/** +- * Google analytics query +- * +- * @author zd +- * @version 1.0 +- */ +-public class GaQuery extends DataQuery { +- +- // GA API URL +- private static final String DATA_QUERY_URL = "https://www.google.com/analytics/feeds/data"; +- +- /** +- * Constructor +- * +- * @throws MalformedURLException internal error +- */ +- public GaQuery() throws MalformedURLException { +- super(new URL(DATA_QUERY_URL)); +- } +- +-} +diff --git a/pom.xml b/pom.xml +index 21bc89c..2112059 100755 +--- a/pom.xml ++++ b/pom.xml +@@ -202,21 +202,6 @@ + + + +- com.google.gdata +- gdata-java-client +- 1.40.0 +- +- +- com.google.gdata +- gdata-java-core +- 1.40.0 +- +- +- com.google.gdata +- gdata-java-analytics +- 1.40.0 +- +- + net.sf.opencsv + opencsv + 2.1 +diff --git a/web/src/main/java/com/gooddata/web/WebInterface.java b/web/src/main/java/com/gooddata/web/WebInterface.java +index e378293..467efa8 100644 +--- a/web/src/main/java/com/gooddata/web/WebInterface.java ++++ b/web/src/main/java/com/gooddata/web/WebInterface.java +@@ -25,10 +25,9 @@ package com.gooddata.web; + + import com.gooddata.Constants; + import com.gooddata.util.FileUtil; +-import com.google.gdata.util.common.util.Base64; +-import com.google.gdata.util.common.util.Base64DecoderException; + import net.sf.json.JSONObject; + import org.apache.commons.codec.digest.DigestUtils; ++import org.apache.commons.codec.binary.Base64; + import org.joda.time.DateTime; + import org.joda.time.format.DateTimeFormat; + import org.joda.time.format.DateTimeFormatter; +@@ -242,12 +241,12 @@ public class WebInterface extends HttpServlet { + if (base64 != null) { + String content = base64.split("\\.")[1]; + try { +- String decodedContent = new String(Base64.decodeWebSafe(content)); ++ String decodedContent = new String(new Base64(true).decodeBase64(content)); + JSONObject json = JSONObject.fromObject(decodedContent); + if (json.containsKey("oauth_token")) + token = json.getString("oauth_token"); + debug("Extracting token: token=" + token); +- } catch (Base64DecoderException e) { ++ } catch (IllegalArgumentException e) { + throw new IOException(e.getMessage()); + } + } +-- +1.8.3.1 + diff --git a/0009-Drop-jdk15-classifiers.patch b/0009-Drop-jdk15-classifiers.patch new file mode 100644 index 0000000..5513d53 --- /dev/null +++ b/0009-Drop-jdk15-classifiers.patch @@ -0,0 +1,52 @@ +From f7c955b4bb8b3686c492c67311c02c87020bd719 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 24 Oct 2013 13:53:59 +0200 +Subject: [PATCH 09/10] Drop jdk15 classifiers + +Maven is otherwise unable to retrieve locally installed json-lib: +[ERROR] Failed to execute goal on project gooddata-cl-common: Could not resolve dependencies for project com.gooddata.cl:gooddata-cl-common:jar:1.2.56: Cannot access atlassian (https://m2proxy.atlassian.com/repository/public/) in offline mode and the artifact net.sf.json-lib:json-lib:jar:jdk15:2.3 has not been downloaded from it before. -> [Help 1] +--- + backend/pom.xml | 1 - + common/pom.xml | 1 - + pom.xml | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/backend/pom.xml b/backend/pom.xml +index 90b94a8..2706be6 100644 +--- a/backend/pom.xml ++++ b/backend/pom.xml +@@ -79,7 +79,6 @@ + + net.sf.json-lib + json-lib +- jdk15 + + + com.thoughtworks.xstream +diff --git a/common/pom.xml b/common/pom.xml +index 22448e1..d03710e 100644 +--- a/common/pom.xml ++++ b/common/pom.xml +@@ -50,7 +50,6 @@ + + net.sf.json-lib + json-lib +- jdk15 + + + net.sf.opencsv +diff --git a/pom.xml b/pom.xml +index 2112059..20439ef 100755 +--- a/pom.xml ++++ b/pom.xml +@@ -165,7 +165,6 @@ + net.sf.json-lib + json-lib + 2.3 +- jdk15 + + + com.thoughtworks.xstream +-- +1.8.3.1 + diff --git a/0010-Pull-in-xerces-since-the-XML-api-got-deprecated.patch b/0010-Pull-in-xerces-since-the-XML-api-got-deprecated.patch new file mode 100644 index 0000000..4a67e76 --- /dev/null +++ b/0010-Pull-in-xerces-since-the-XML-api-got-deprecated.patch @@ -0,0 +1,27 @@ +From 95f5e856b1799cbf7e2c0a2d5b6ce5186b9fdfb1 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 24 Oct 2013 14:05:15 +0200 +Subject: [PATCH 10/10] Pull in xerces, since the XML api got deprecated + +--- + backend/pom.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/backend/pom.xml b/backend/pom.xml +index 2706be6..f1ce419 100644 +--- a/backend/pom.xml ++++ b/backend/pom.xml +@@ -125,5 +125,10 @@ + org.slf4j + log4j-over-slf4j + ++ ++ xerces ++ xercesImpl ++ 2.11.0 ++ + + +-- +1.8.3.1 + diff --git a/gooddata-cl.spec b/gooddata-cl.spec index 5abd849..e6a1647 100644 --- a/gooddata-cl.spec +++ b/gooddata-cl.spec @@ -1,6 +1,6 @@ Name: gooddata-cl -Version: 1.2.56 -Release: 8%{dist} +Version: 1.2.69 +Release: 1%{dist} Summary: GoodData integration toolkit Group: Applications/Internet @@ -9,23 +9,23 @@ URL: http://developer.gooddata.com/gooddata-cl/ # The repository contains possibly non-free jars # git clone http://github.com/gooddata/GoodData-CL.git # cd GoodData-CL -# mkdir gooddata-cl-1.2.56 -# git --work-tree=gooddata-cl-1.2.56 checkout -f 1.2.56 -# find gooddata-cl-1.2.56 -name '*.jar' -delete -# tar czf gooddata-cl-1.2.56.tar.gz gooddata-cl-1.2.56 +# mkdir gooddata-cl-1.2.69 +# git --work-tree=gooddata-cl-1.2.69 checkout -f 1.2.69 +# find gooddata-cl-1.2.69 -name '*.jar' -delete +# tar czf gooddata-cl-1.2.69.tar.gz gooddata-cl-1.2.69 Source0: gooddata-cl-%{version}.tar.gz Source1: gooddata-cl.conf Patch1: 0001-Drag-in-packages-we-ship-split.patch Patch2: 0002-No-separate-commons-httpclient-for-signpost.patch -Patch4: 0004-Disable-modules-we-can-t-build-due-missing-closed-de.patch -Patch5: 0005-Sanitize-logging-defaults.patch -Patch6: 0006-Do-not-hardwire-classpath-in-CLI.patch -Patch7: 0001-Avoid-using-proprietary-Sun-API.patch -Patch8: 0002-Remove-FTP-support-it-should-not-be-used.patch -Patch9: 0001-Drop-GA-connector.patch -Patch10: 0001-Drop-jdk15-classifiers.patch -Patch11: 0001-Pull-in-xerces-since-the-XML-api-got-deprecated.patch +Patch3: 0003-Disable-modules-we-can-t-build-due-missing-closed-de.patch +Patch4: 0004-Sanitize-logging-defaults.patch +Patch5: 0005-Do-not-hardwire-classpath-in-CLI.patch +Patch6: 0006-Avoid-using-proprietary-Sun-API.patch +Patch7: 0007-Remove-FTP-support-it-should-not-be-used.patch +Patch8: 0008-Drop-GA-connector.patch +Patch9: 0009-Drop-jdk15-classifiers.patch +Patch10: 0010-Pull-in-xerces-since-the-XML-api-got-deprecated.patch Requires: apache-commons-beanutils Requires: apache-commons-cli @@ -126,6 +126,7 @@ GoodData REST APIs. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 @@ -133,7 +134,6 @@ GoodData REST APIs. %patch8 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 %build # These don't ship with POMs yet. diff --git a/sources b/sources index e681c88..08275cc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ddf62f744545779e43e21bd76eb45eb3 gooddata-cl-1.2.56.tar.gz +2820f712645f0b7989a311272188a9bd gooddata-cl-1.2.69.tar.gz