Package com.google.api.ads.adwords.awreporting.processors

Examples of com.google.api.ads.adwords.awreporting.processors.ReportProcessor


          resource = new FileSystemResource(file);
        }
        DynamicPropertyPlaceholderConfigurer.setDynamicResource(resource);
        Properties properties = PropertiesLoaderUtils.loadProperties(resource);
       
        ReportProcessor processor = getApplicationContext().getBean(ReportProcessor.class);

        // Launching a new Service(Thread) to make the request async.
        RunnableReport runnableReport = new RunnableReport(topAccountId, processor, properties, dateStart, dateEnd);
       
        taskService.submit(runnableReport);
View Full Code Here


      }

      Properties properties = initApplicationContextAndProperties(propertiesPath);

      LOGGER.debug("Creating ReportProcessor bean...");
      ReportProcessor processor = createReportProcessor();
      LOGGER.debug("... success.");

      String mccAccountId = properties.getProperty("mccAccountId").replaceAll("-", "");;

      if (cmdLine.hasOption("generatePdf")) {

        LOGGER.debug("GeneratePDF option detected.");

        // Get HTML template and output directory
        String[] pdfFiles = cmdLine.getOptionValues("generatePdf");
        File htmlTemplateFile = new File(pdfFiles[0]);
        File outputDirectory = new File(pdfFiles[1]);
        boolean sumAdExtensions = false;

        if (cmdLine.hasOption("sumAdExtensions")) {
          LOGGER.debug("sumAdExtensions option detected.");
          sumAdExtensions = true;
        }

        LOGGER.debug("Html template file to be used: " + htmlTemplateFile);
        LOGGER.debug("Output directory for PDF: " + outputDirectory);
       
        // Export Reports
        ReportExporterLocal reportExporter = createReportExporter();
        reportExporter.exportReports(
            createAuthenticator().getOAuth2Credential(null, mccAccountId, false),
            mccAccountId, cmdLine.getOptionValue("startDate"),
            cmdLine.getOptionValue("endDate"),
            processor.retrieveAccountIds(null, mccAccountId),
            properties, htmlTemplateFile,
            outputDirectory, sumAdExtensions);

      } else if (cmdLine.hasOption("startDate") && cmdLine.hasOption("endDate")) {
        // Generate Reports

        String dateStart = cmdLine.getOptionValue("startDate");
        String dateEnd = cmdLine.getOptionValue("endDate");

        LOGGER.info(
            "Starting report download for dateStart: " + dateStart + " and dateEnd: " + dateEnd);

        processor.generateReportsForMCC(null, mccAccountId, ReportDefinitionDateRangeType.CUSTOM_DATE, dateStart,
            dateEnd, accountIdsSet, properties, null, null);

      } else if (cmdLine.hasOption("dateRange")) {

        ReportDefinitionDateRangeType dateRangeType =
            ReportDefinitionDateRangeType.fromValue(cmdLine.getOptionValue("dateRange"));

        LOGGER.info("Starting report download for dateRange: " + dateRangeType.name());

        processor.generateReportsForMCC(null, mccAccountId, dateRangeType, null, null, accountIdsSet, properties, null, null);

      } else {
        errors = true;
        LOGGER.error("Configuration incomplete. Missing options for command line.");
      }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.awreporting.processors.ReportProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.