Package r194

Examples of r194.GenerateAsm$Statement


      // Set the line item to get LICAs by.
      Long lineItemId = Long.parseLong("INSERT_LINE_ITEM_ID_HERE");

      // Create a statement to only select LICAs for the given lineItem ID.
      Statement filterStatement =
          new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500")
              .putValue("lineItemId", lineItemId).toStatement();

      // Get LICAs by statement.
      LineItemCreativeAssociationPage page =
View Full Code Here


      SuggestedAdUnitServiceInterface suggestedAdUnitService =
          user.getService(DfpService.V201311.SUGGESTED_AD_UNIT_SERVICE);

      // Create a statement to only select suggested ad units that have more
      // than 50 requests.
      Statement filterStatement =
          new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500")
              .putValue("numRequests", 50).toStatement();

      // Get suggested ad units by statement.
      SuggestedAdUnitPage page =
View Full Code Here

      SuggestedAdUnitServiceInterface suggestedAdUnitService =
          user.getService(DfpService.V201311.SUGGESTED_AD_UNIT_SERVICE);

      // Set defaults for page and filterStatement.
      SuggestedAdUnitPage page = new SuggestedAdUnitPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all suggested ad units.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get suggested ad units by statement.
        page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

      // Set the ID of the advertiser (company) to get orders for.
      Long advertiserId = Long.parseLong("INSERT_ADVERTISER_COMPANY_ID_HERE");

      // Create a statement to only select orders for a given advertiser.
      Statement filterStatement =
        new StatementBuilder("WHERE advertiserId = :advertiserId LIMIT 500")
            .putValue("advertiserId", advertiserId).toStatement();

      // Get orders by statement.
      OrderPage page = orderService.getOrdersByStatement(filterStatement);
View Full Code Here

      // Get the LineItemCreativeAssociationService.
      LineItemCreativeAssociationServiceInterface licaService =
          user.getService(DfpService.V201311.LINEITEMCREATIVEASSOCIATION_SERVICE);

      // Create a statement to get all LICAs.
      Statement filterStatement = new Statement("LIMIT 500", null);

      // Get LICAs by statement.
      LineItemCreativeAssociationPage page =
          licaService.getLineItemCreativeAssociationsByStatement(filterStatement);
View Full Code Here

      OrderServiceInterface orderService =
          user.getService(DfpService.V201311.ORDER_SERVICE);

      // Sets defaults for page and filter.
      OrderPage page = new OrderPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all orders.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get orders by statement.
        page = orderService.getOrdersByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

      CreativeTemplateServiceInterface creativeTemplateService =
          user.getService(DfpService.V201311.CREATIVE_TEMPLATE_SERVICE);

      // Set defaults for page and filterStatement.
      CreativeTemplatePage page = new CreativeTemplatePage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all creative templates.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get creative templates by statement.
        page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

      // Get the ActivityGroupService.
      ActivityGroupServiceInterface activityGroupService =
          user.getService(DfpService.V201311.ACTIVITY_GROUP_SERVICE);

      // Create a statement to only select active activity groups.
      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 500")
              .putValue("status", ActivityGroupStatus.ACTIVE.toString()).toStatement();

      // Get activity groups by statement.
      ActivityGroupPage page = activityGroupService.getActivityGroupsByStatement(filterStatement);
View Full Code Here

      Long orderId = Long.parseLong("INSERT_ORDER_ID_HERE");

      // Create a statement to only select line items from the specified order
      // that are in the approved (needs creatives) state.
      String statementText = "WHERE orderID = :orderId and status = :status LIMIT 500";
      Statement filterStatement =
          new StatementBuilder("")
              .putValue("orderId", orderId)
              .putValue("status", ComputedStatus.NEEDS_CREATIVES.toString())
              .toStatement();

      // Set defaults for page and offset.
      LineItemPage page = new LineItemPage();
      int offset = 0;
      int i = 0;
      List<Long> lineItemIds = new ArrayList<Long>();

      do {
        // Create a statement to page through approved line items.
        filterStatement.setQuery(statementText + " OFFSET " + offset);

        // Get line items by statement.
        page = lineItemService.getLineItemsByStatement(filterStatement);

        if (page.getResults() != null) {
          for (LineItemSummary lineItem : page.getResults()) {
            // Archived line items cannot be activated.
            if (!lineItem.getIsArchived()) {
              System.out.println(i + ") Line item with ID \""
                  + lineItem.getId() + "\", belonging to order ID \""
                  + lineItem.getOrderId() + "\", and name \"" + lineItem.getName()
                  + "\" will be activated.");
              lineItemIds.add(lineItem.getId());
              i++;
            }
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of line items to be activated: " + lineItemIds.size());

      if (lineItemIds.size() > 0) {
        // Modify statement for action.
        filterStatement.setQuery("WHERE id IN (" + StringUtils.join(lineItemIds, ",") + ")");

        // Create action.
        ActivateLineItems action = new ActivateLineItems();

        // Perform action.
View Full Code Here

      LineItemCreativeAssociationServiceInterface licaService =
          user.getService(DfpService.V201311.LINEITEMCREATIVEASSOCIATION_SERVICE);

      // Sets defaults for page and filterStatement.
      LineItemCreativeAssociationPage page = new LineItemCreativeAssociationPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all LICAs.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get LICAs by statement.
        page = licaService.getLineItemCreativeAssociationsByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

TOP

Related Classes of r194.GenerateAsm$Statement

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.