Package com.google.api.ads.dfp.v201302

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


      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201302.THIRD_PARTY_SLOT_SERVICE);

      // Create a statement to get one active third party slot.
      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 1")
              .putValue("status", ThirdPartySlotStatus.ACTIVE.toString()).toStatement();

      // Get third party slot by statement.
      ThirdPartySlotPage page =
          thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);
     
      if (page.getResults() != null) {
        ThirdPartySlot[] thirdPartySlots = page.getResults();

        // Update each local third party slot by changing its description.
        for (ThirdPartySlot thirdPartySlot : thirdPartySlots) {
          thirdPartySlot.setDescription("Updated description");
         
          // Update the third party slot on the server.
          thirdPartySlot = thirdPartySlotService.updateThirdPartySlot(thirdPartySlot);
         
          // Display results.
          if (thirdPartySlot != null) {
            System.out.println("A third party slot with ID \"" + thirdPartySlot.getId()
              + "\" and description \"" + thirdPartySlot.getDescription() + "\" was updated.");
View Full Code Here


      dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

      // Target only the weekend in the browser's timezone.
      DayPart saturdayDayPart = new DayPart();
      saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
      saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
      saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

      DayPart sundayDayPart = new DayPart();
      sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
      sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
      sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
      dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

      // Create technology targeting.
      TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here

          new LongCreativeTemplateVariableValue();
      imageHeightVariableValue.setUniqueName("Imageheight");
      imageHeightVariableValue.setValue(250L);

      // Create the URL variable value.
      UrlCreativeTemplateVariableValue urlVariableValue =
          new UrlCreativeTemplateVariableValue();
      urlVariableValue.setUniqueName("ClickthroughURL");
      urlVariableValue.setValue("www.google.com");

      // Create the target window variable value.
      StringCreativeTemplateVariableValue targetWindowVariableValue =
          new StringCreativeTemplateVariableValue();
      targetWindowVariableValue.setUniqueName("Targetwindow");
View Full Code Here

      Location metroLocation = new Location();
      metroLocation.setId(200501L);
      geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});

      // Exclude domains that are not under the network's control.
      UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
      userDomainTargeting.setDomains(new String[] {"usa.gov"});
      userDomainTargeting.setTargeted(false);

      // Create day-part targeting.
      DayPartTargeting dayPartTargeting = new DayPartTargeting();
      dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);
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.v201302.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.