Package com.google.api.ads.dfp.v201308

Examples of com.google.api.ads.dfp.v201308.EnvironmentType


      // Get the ContentService.
      ContentServiceInterface contentService = user.getService(DfpService.V201308.CONTENT_SERVICE);

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

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

        // Get content by statement.
        page = contentService.getContentByStatement(filterStatement);

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


      CreativeServiceInterface creativeService =
          user.getService(DfpService.V201308.CREATIVE_SERVICE);

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

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

        // Get creatives by statement.
        page = creativeService.getCreativesByStatement(filterStatement);

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

   */
  public static Value createValue(Object value) {
    if (value instanceof Value) {
      return (Value) value;
    } else if (value == null) {
      return new TextValue(null, null);
    } else {
      if (value instanceof Boolean) {
        return new BooleanValue(null, (Boolean) value);
      } else if (value instanceof Double) {
        return new NumberValue(null, value.toString());
      } else if (value instanceof String) {
        return new TextValue(null, (String) value);
      } else if (value instanceof Long) {
        return new NumberValue(null, value.toString());
      } else if (value instanceof DateTime) {
        return new DateTimeValue(null, (DateTime) value);
      } else if (value instanceof Date) {
View Full Code Here

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

        // Perform action.
        UpdateResult result = inventoryService.performAdUnitAction(action, filterStatement);

        // Display results.
        if (result != null && result.getNumChanges() > 0) {
          System.out.println("Number of ad units deactivated: " + result.getNumChanges());
        } else {
          System.out.println("No ad units were deactivated.");
        }
      }
    } catch (Exception e) {
View Full Code Here

        : "car";

    ArtifactType artifact = createArtifact(groupId, artifactId, version, type);
    org.apache.geronimo.xml.ns.deployment_1.ObjectFactory serviceFactory = new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory();
  
    EnvironmentType env = serviceFactory.createEnvironmentType();
    env.setModuleId(artifact);

    if (cfg != null && cfg.isSharedLib()) {
      DependenciesType dt = serviceFactory.createDependenciesType();
      DependencyType sharedLib = createDependency("org.apache.geronimo.configs", "sharedlib", null, "car");
      dt.getDependency().add(sharedLib);
      env.setDependencies(dt);
    }

         Trace.tracePoint("Exit ", "V11DeploymentPlanCreationOperation.getConfigEnvironment", env);
    return env;
  }
View Full Code Here

            IModule[] module = (IModule[]) modules.get(ii);
            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
            if (moduleDeltaKind != ServerBehaviourDelegate.REMOVED) {
              //GERONIMODEVTOOLS-361
              for (IModule singleModule:module){
                EnvironmentType environment = getEnvironment(singleModule);
                  if (environment != null) {
                      ArtifactType child = environment.getModuleId();
                      DependenciesType dependencies = environment.getDependencies();
                      if (dependencies != null) {
                          List<DependencyType> depList = dependencies.getDependency();
                          for ( DependencyType dep : depList) {
                              ArtifactType parent = deploymentFactory.createArtifactType();
                              parent.setGroupId( dep.getGroupId() );
                              parent.setArtifactId( dep.getArtifactId() );
                              parent.setVersion( dep.getVersion() );
                              parent.setType( dep.getType() );
                             
                              StringBuilder configId = new StringBuilder();
                              if (dep.getGroupId()!=null)
                                configId.append(dep.getGroupId());
                              configId.append("/");
                              if (dep.getArtifactId()!=null)
                                configId.append(dep.getArtifactId());
                              configId.append("/");
                              if (dep.getVersion()!=null)
                                configId.append(dep.getVersion());
                              configId.append("/");
                              if (dep.getType()!=null)
                                configId.append(dep.getType());
                             
                              if (!DeploymentUtils.isInstalledModule(server,configId.toString()))
                                   dm.addDependency( child, parent );
                          }
                      }
                  }
              }
            }
        }

        //
        // Iterate through all the modules again and reorder as necessary
        //
        for (int ii=0; ii<modules.size(); ii++) {
            IModule[] module = (IModule[]) modules.get(ii);
            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
            if (module!=null && !reorderedModules.contains(module)) {
                // Not already moved
                if (moduleDeltaKind == ServerBehaviourDelegate.REMOVED) {
                    // Move module if going to be removed
                    reorderedModules.add(module);
                    reorderedKinds.add(moduleDeltaKind);
                }
                else {
                    EnvironmentType environment = getEnvironment(module[0]);
                    if (environment != null) {
                        ArtifactType artifact = environment.getModuleId();
                        if (artifact == null) {
                            // Move if null (nothing can be done)
                            if (!reorderedModules.contains(module)) {
                                reorderedModules.add(module);
                                reorderedKinds.add(moduleDeltaKind);
View Full Code Here

        //
        // Iterate through all the JAXBElements and register the dependencies
        //
        for (JAXBElement jaxbElement : jaxbElements) {
            EnvironmentType environment = getEnvironment(jaxbElement);
            if (environment != null) {
                ArtifactType child = environment.getModuleId();
                if (child != null) {
                    DependenciesType dependencies = environment.getDependencies();
                    if (dependencies != null) {
                        List<DependencyType> depList = dependencies.getDependency();
                        if (depList != null) {
                            for ( DependencyType dep : depList) {
                                ArtifactType parent = deploymentFactory.createArtifactType();
                                parent.setGroupId( dep.getGroupId() );
                                parent.setArtifactId( dep.getArtifactId() );
                                parent.setVersion( dep.getVersion() );
                                parent.setType( dep.getType() );
                                dm.addDependency( child, parent );
                            }
                        }
                    }
                }
            }
        }

        //
        // Iterate through all the JAXBElements again and reorder as necessary
        //
        for (JAXBElement jaxbElement : jaxbElements) {
            if (!reorderedJAXBElements.contains(jaxbElement)) {
                // Not already moved
                EnvironmentType environment = getEnvironment(jaxbElement);
                if (environment != null) {
                    ArtifactType artifact = environment.getModuleId();
                    if (artifact == null) {
                        // Move if null (nothing can be done)
                        if (!reorderedJAXBElements.contains(jaxbElement)) {
                            reorderedJAXBElements.add(jaxbElement);
                        }
View Full Code Here

     * @return Environment
     */
    private EnvironmentType getEnvironment(IModule module) {
        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", module);

        EnvironmentType environment = null;
        if (GeronimoUtils.isWebModule(module)) {
            if (getWebDeploymentPlan(module) != null) {
                WebAppType plan = getWebDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getEnvironment();
View Full Code Here

        Trace.tracePoint("Enter", "DependencyHelper.getModule", artifact);

        for (int ii=0; ii<inputModules.size(); ii++) {
            IModule[] module = (IModule[]) inputModules.get(ii);
            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
            EnvironmentType environment = getEnvironment(module[0]);
            if (environment != null) {
                ArtifactType moduleArtifact = environment.getModuleId();
                if (artifact.equals(moduleArtifact)) {
                    Trace.tracePoint("Exit ", "DependencyHelper.getModule", module);
                    return module;
                }
            }
View Full Code Here

        Trace.tracePoint("Enter", "DependencyHelper.getDeltaKind", artifact);

        for (int ii=0; ii<inputModules.size(); ii++) {
            IModule[] module = (IModule[]) inputModules.get(ii);
            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
            EnvironmentType environment = getEnvironment(module[0]);
            if (environment != null) {
                ArtifactType moduleArtifact = environment.getModuleId();
                if (artifact.equals(moduleArtifact)) {
                    Trace.tracePoint("Exit ", "DependencyHelper.getDeltaKind", moduleDeltaKind);
                    return moduleDeltaKind;
                }
            }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201308.EnvironmentType

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.