Package com.puppetlabs.geppetto.pp.dsl.adapters

Examples of com.puppetlabs.geppetto.pp.dsl.adapters.PPImportedNamesAdapter$Location


      // Create geographical targeting.
      GeoTargeting geoTargeting = new GeoTargeting();

      // Include the US, Quebec, Canada, and the B3P Canada postal code.
      Location countryLocation = new Location();
      countryLocation.setId(2840L);

      Location regionLocation = new Location();
      regionLocation.setId(20123L);

      Location postalCodeLocation = new Location();
      postalCodeLocation.setId(9000093L);

      geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
          postalCodeLocation});

      // Exclude Chicago and the New York metro area.
      Location cityLocation = new Location();
      cityLocation.setId(1016367L);

      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"});
View Full Code Here


    ppFinder.configure(model);
    resource = model.eResource();
    searchPath = searchPathProvider.get(resource);

    // clear names remembered in the past
    PPImportedNamesAdapter importedNames = PPImportedNamesAdapterFactory.eINSTANCE.adapt(resource);
    importedNames.clear();

    IResourceDescriptions descriptionIndex = indexProvider.getResourceDescriptions(resource);
    IResourceDescription descr = descriptionIndex.getResourceDescription(resource.getURI());

    if(descr == null) {
View Full Code Here

   * @see org.eclipse.xtext.resource.impl.DefaultResourceDescription#getImportedNames()
   */
  @Override
  public Iterable<QualifiedName> getImportedNames() {
    Iterable<QualifiedName> superResult = super.getImportedNames();
    PPImportedNamesAdapter adapter = PPImportedNamesAdapterFactory.eINSTANCE.adapt(getResource());
    if(adapter != null) {
      Collection<QualifiedName> imported = adapter.getNames();
      if(imported.isEmpty())
        return superResult;
      return Iterables.concat(superResult, ImmutableSet.copyOf(imported));
    }
    return superResult;
View Full Code Here

      File importingModuleDir = getContainerHandle(r.getURI(), descriptionIndex, validationContainerManager);
      if(importingModuleDir == null)
        continue;

      // get the imports recorded during linking
      PPImportedNamesAdapter importedAdapter = PPImportedNamesAdapterFactory.eINSTANCE.adapt(r);
      for(IEObjectDescription desc : importedAdapter.getResolvedDescriptions()) {
        // get the container (e.g. a module) of the the desc
        File moduleDir = getContainerHandle(desc.getEObjectURI(), descriptionIndex, validationContainerManager);
        if(moduleDir == null)
          continue;
        ModuleExport me = exports.get(desc);
        if(me == null)
          me = searchMissing(importingModuleDir, moduleDir, exports, desc);
        result.addImport(importingModuleDir, moduleDir, me);
      }
      // get the ambiguities recording during linking
      for(IEObjectDescription desc : importedAdapter.getAmbiguousDescriptions()) {
        // get the container (e.g. a module) of the the desc
        File moduleDir = getContainerHandle(desc.getEObjectURI(), descriptionIndex, validationContainerManager);
        if(moduleDir == null)
          continue;
        ModuleExport me = exports.get(desc);
        if(me == null)
          me = searchMissing(importingModuleDir, moduleDir, exports, desc);
        result.addAmbiguity(importingModuleDir, moduleDir, me);
      }
      // TODO: RECORD BOTH NAME FILE, AND LOCATIONS FOR THAT NAME
      result.addUnresolved(importingModuleDir, r.getURI(), importedAdapter.getUnresolved(), fQualifiedToString);
      // result.addAllUnresolvedNames(
      // importingModuleDir,
      // Iterables.transform(importedAdapter.getUnresolvedNames(), new
      // Function<QualifiedName, String>() {
      //
View Full Code Here

  @Test(enabled = false)
  public void testShouldSetAndGetLocation() {
    //driver.get(pages.html5Page);

    LocationContext d = (LocationContext) new Augmenter().augment(driver);
    Location loc = new Location(40.714353, -74.005973, 0.056747);

    d.setLocation(loc);

    //driver.manage().timeouts().implicitlyWait(2000, MILLISECONDS);
View Full Code Here

          Map<Object, Object> map =
              (Map<Object, Object>) executeMethod.execute(DriverCommand.GET_LOCATION, null);
          double latitude = Long.valueOf((Long) map.get("latitude")).doubleValue();
          double longitude = Long.valueOf((Long) map.get("longitude")).doubleValue();
          double altitude = Long.valueOf((Long) map.get("altitude")).doubleValue();
          return new Location(latitude, longitude, altitude);
        } else if ("setLocation".equals(method.getName())) {
          return executeMethod.execute(DriverCommand.SET_LOCATION, ImmutableMap.of("location", args[0]));
        }
        return null;
      }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.pp.dsl.adapters.PPImportedNamesAdapter$Location

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.