Package r194

Examples of r194.GenerateAsm$Statement


   * builder.
   *
   * @return the {@link Statement}
   */
  public Statement toStatement() {
    return new Statement(query,
        MapUtils.toArray(valueMap, new String_ValueMapEntry[] {}));
  }
View Full Code Here


      // Get the InventoryService.
      InventoryServiceInterface inventoryService =
          user.getService(DfpService.V201308.INVENTORY_SERVICE);

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

      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(filterStatement);

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

      // Get the effective root ad unit ID of the network.
      String effectiveRootAdUnitId = networkService.getCurrentNetwork().getEffectiveRootAdUnitId();

      // Create a statement to select the children of the effective root ad
      // unit.
      Statement filterStatement = new StatementBuilder("WHERE parentId = :id LIMIT 500")
          .putValue("id", effectiveRootAdUnitId).toStatement();

      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(filterStatement);
View Full Code Here

      InventoryServiceInterface inventoryService =
          user.getService(DfpService.V201308.INVENTORY_SERVICE);

      // Create statement text to select active ad units.
      String statementText = "WHERE status = :status LIMIT 500";
      Statement filterStatement =
          new StatementBuilder("")
              .putValue("status", InventoryStatus.ACTIVE.toString())
              .toStatement();

      // Set defaults for page and offset.
      AdUnitPage page = new AdUnitPage();
      int offset = 0;
      List<String> adUnitIds = new ArrayList<String>();

      do {
        // Create a statement to page through active ad units.
        filterStatement.setQuery(statementText + " OFFSET " + offset);

        // Get ad units by statement.
        page = inventoryService.getAdUnitsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (AdUnit adUnit : page.getResults()) {
            System.out.println(i + ") Ad unit with ID \"" + adUnit.getId()
                + "\", name \"" + adUnit.getName()
                + "\", and status \"" + adUnit.getStatus() + "\" will be deactivated.");
            adUnitIds.add(adUnit.getId());
            i++;
          }
        }

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

      System.out.println("Number of ad units to be deactivated: " + adUnitIds.size());

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

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

        // Perform action.
View Full Code Here

      InventoryServiceInterface inventoryService =
          user.getService(DfpService.V201308.INVENTORY_SERVICE);

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

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

        // Get ad units by statement.
        page = inventoryService.getAdUnitsByStatement(filterStatement);

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

      // Create statement to select only active custom fields that apply to
      // line items.
      String statementText =
          "WHERE entityType = :entityType and isActive = :isActive LIMIT 500";
      Statement filterStatement =
          new StatementBuilder(statementText)
              .putValue("entityType", CustomFieldEntityType.LINE_ITEM.toString())
              .putValue("isActive", true)
              .toStatement();

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

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

        // Get custom fields by statement.
        page = customFieldService.getCustomFieldsByStatement(filterStatement);

        if (page.getResults() != null) {
          for (CustomField customField : page.getResults()) {
            System.out.println(i + ") Custom field with ID \""
                + customField.getId() + "\" and name \"" + customField.getName()
                + "\" will be deactivated.");
            customFieldIds.add(customField.getId());
            i++;
          }
        }

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

      System.out.println("Number of custom fields to be deactivated: " + customFieldIds.size());

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

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

        // Perform action.
View Full Code Here

      CompanyServiceInterface companyService =
          user.getService(DfpService.V201311.COMPANY_SERVICE);

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

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

        // Get companies by statement.
        page = companyService.getCompaniesByStatement(filterStatement);

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

      CreativeSetServiceInterface creativeSetService =
          user.getService(DfpService.V201311.CREATIVE_SET_SERVICE);

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

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

        // Get creative sets by statement.
        page = creativeSetService.getCreativeSetsByStatement(filterStatement);

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

      // Get the CustomTargetingService.
      CustomTargetingServiceInterface customTargetingService =
          user.getService(DfpService.V201311.CUSTOM_TARGETING_SERVICE);

      // Create a statement to only select predefined custom targeting keys.
      Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").putValue(
          "type", CustomTargetingKeyType.PREDEFINED.toString()).toStatement();

      // Get custom targeting keys by statement.
      CustomTargetingKeyPage page =
          customTargetingService.getCustomTargetingKeysByStatement(filterStatement);
View Full Code Here

      // Set the ID of the master creative to get creative sets for.
      Long masterCreativeId = Long.parseLong("INSERT_MASTER_CREATIVE_ID_HERE");

      // Create statement object to only select creative sets that have the
      // given master creative.
      Statement filterStatement =
          new StatementBuilder("WHERE masterCreativeId = :masterCreativeId LIMIT 500")
              .putValue("masterCreativeId", masterCreativeId).toStatement();

      // Get creative sets by statement.
      CreativeSetPage page = creativeSetService.getCreativeSetsByStatement(filterStatement);
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.