Examples of NSDictionary


Examples of com.dd.plist.NSDictionary

  private final List<WebkitApplication> apps = new ArrayList<WebkitApplication>();

  public ReportConnectedApplicationsMessage(String rawMessage) throws Exception {
    super(rawMessage);
    NSDictionary list = (NSDictionary) arguments.objectForKey("WIRApplicationDictionaryKey");
    String[] keys = list.allKeys();
    for (String key : keys) {
      NSDictionary app = (NSDictionary) list.objectForKey(key);
      WebkitApplication application = new WebkitApplication(app);
      apps.add(application);
    }
  }
View Full Code Here

Examples of com.dd.plist.NSDictionary

  private static final Logger log = Logger.getLogger(ApplicationSentListingMessage.class.getName());

  public ApplicationSentListingMessage(String rawMessage) throws Exception {
    super(rawMessage);

    NSDictionary list = (NSDictionary) arguments.objectForKey("WIRListingKey");
    String[] keys = list.allKeys();

    for (String key : keys) {
      NSDictionary page = (NSDictionary) list.objectForKey(key);
      pages.add(new WebkitPage(page));
    }
    if (log.isLoggable(Level.FINE))
      log.fine("got: " + this);
  }
View Full Code Here

Examples of com.dd.plist.NSDictionary

  public void setDefaultDevice(DeviceType device, boolean putDefaultFirst) {
    try {
      File plist = new File(app, "Info.plist");

      PListFormat format = getFormat(plist);
      NSDictionary root = (NSDictionary) PropertyListParser.parse(new FileInputStream(plist));

      NSArray devices = (NSArray) root.objectForKey("UIDeviceFamily");
      int length = devices.getArray().length;
      if (length == 1) {
        return;
      }

      NSArray rearrangedArray = new NSArray(length);
      NSNumber defaultDevice = null;
      int index = putDefaultFirst ? 1 : 0;
      for (int i = 0; i < length; i++) {
        NSNumber d = (NSNumber) devices.objectAtIndex(i);
        if (d.intValue() == device.getDeviceFamily()) {
          defaultDevice = d;
        } else {
          rearrangedArray.setValue(index, d);
          index++;
        }
      }
      if (defaultDevice == null) {
        throw new WebDriverException(
            "Cannot find device " + device + " in the supported device list.");
      }
      rearrangedArray.setValue(putDefaultFirst ? 0 : index, defaultDevice);
      root.put("UIDeviceFamily", rearrangedArray);

      write(plist, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot change the default device for the app." + e.getMessage(), e);
    }
View Full Code Here

Examples of com.dd.plist.NSDictionary

  private void setSafariBuiltinFavories(File builtinFavoritesPList) {
    try {
      PListFormat format = getFormat(builtinFavoritesPList);

      NSArray root = new NSArray(1);
      NSDictionary favorite = new NSDictionary();
      favorite.put("Title", "about:blank");
      favorite.put("URL", "about:blank");
      root.setValue(0, favorite);

      write(builtinFavoritesPList, root, format);
    } catch (Exception e) {
      throw new WebDriverException("Cannot set " + builtinFavoritesPList.getAbsolutePath()
View Full Code Here

Examples of com.dd.plist.NSDictionary

                    inputStream.closeEntry();
                    zipEntry = inputStream.getNextEntry();
                }

                if (zipEntry != null) {
                    NSDictionary object = (NSDictionary) PropertyListParser.parse(inputStream);
                    if (object != null) {
                        NSString cfBundleIdentifier = (NSString) object.objectForKey("CFBundleIdentifier");
                        NSString cfBundleVersion = (NSString) object.objectForKey("CFBundleVersion");
                        NSString cfBundleName = (NSString) object.objectForKey("CFBundleName");

                        applicationVersion.setCfBundleIdentifier(cfBundleIdentifier.toString());
                        applicationVersion.setCfBundleVersion(cfBundleVersion.toString());
                        applicationVersion.setCfBundleName(cfBundleName.toString());
                    }
View Full Code Here

Examples of com.dd.plist.NSDictionary

        }

        String downloadUrl = createIOSDownloadIPAUrl(applicationVersion, webRequest, token);
//        String iconUrl = createIOSIconUrl(applicationVersion);

        NSDictionary nsDictionary = createIOSPlistNSDictionary(applicationVersion.getCfBundleIdentifier(), applicationVersion.getCfBundleVersion(), applicationVersion.getCfBundleName(), downloadUrl, null);

        String xmlPlist = null;
        if (nsDictionary != null) {
            xmlPlist = nsDictionary.toXMLPropertyList();
        }
        return xmlPlist;
    }
View Full Code Here

Examples of com.dd.plist.NSDictionary

        // Could not create icon URL
        return "";
    }

    private NSDictionary createIOSPlistNSDictionary(String cfBundleIdentifier, String cfBundleVersion, String cfBundleName, String ipaUrl, String iconUrl) {
        NSDictionary mainDict = new NSDictionary();

        NSArray items = new NSArray(1);
        NSArray assets;
        if (StringUtils.hasText(iconUrl)) {
            assets = new NSArray(2);
        } else {
            assets = new NSArray(1);
        }
        NSDictionary itemsDict = new NSDictionary();

        NSDictionary assetsDict = new NSDictionary();
        assetsDict.put("kind", "software-package");
        assetsDict.put("url", ipaUrl);

        assets.setValue(0, assetsDict);

        if (StringUtils.hasText(iconUrl)) {
            NSDictionary iconsDict = new NSDictionary();
            iconsDict.put("kind", "display-image");
            iconsDict.put("needs-shine", true);
            iconsDict.put("url", "https://d1g1p4u8ho16cr.cloudfront.net/static/cb2639330650/resources/img/default_icon.png");

            assets.setValue(1, iconsDict);
        }

        NSDictionary mettadataDict = new NSDictionary();
        mettadataDict.put("bundle-identifier", cfBundleIdentifier);
        mettadataDict.put("bundle-version", cfBundleVersion);
        mettadataDict.put("kind", "software");
        mettadataDict.put("title", cfBundleName);

        itemsDict.put("assets", assets);
        itemsDict.put("metadata", mettadataDict);

        items.setValue(0, itemsDict);
View Full Code Here

Examples of com.webobjects.foundation.NSDictionary

    }

    _entities = new NSMutableArray();
    _model = _modelGroup.modelNamed(modelName);

    NSDictionary defaultConnectionDictionary;
    Map overrideConnectionDictionary = (Map) databaseConfig.get("connectionDictionary");
    if (overrideConnectionDictionary != null) {
      NSDictionary connectionDictionary = (NSDictionary) EOFSQLUtils56.toWOCollections(overrideConnectionDictionary);
      _model.setConnectionDictionary(connectionDictionary);
      String eomodelProcessorClassName = (String) connectionDictionary.valueForKey("eomodelProcessorClassName");
      if (eomodelProcessorClassName != null) {
        findModelProcessor(eomodelProcessorClassName, true);
      }
      defaultConnectionDictionary = connectionDictionary;
    } else {
      defaultConnectionDictionary = _model.connectionDictionary();
    }

    Enumeration modelsEnum = _modelGroup.models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel model = (EOModel) modelsEnum.nextElement();
      if (model.connectionDictionary() == null) {
        model.setConnectionDictionary(defaultConnectionDictionary);
      }
    }

    if (_modelProcessor == null) {
      findModelProcessor("org.objectstyle.wolips.eomodeler.EOModelProcessor", false);
    }
    if (entityNames == null || entityNames.size() == 0) {
      Enumeration entitiesEnum = _model.entities().objectEnumerator();
      while (entitiesEnum.hasMoreElements()) {
        EOEntity entity = (EOEntity) entitiesEnum.nextElement();
        if (!isPrototype(entity)) {// &&
          // entityUsesSeparateTable(entity))
          // {
          _entities.addObject(entity);
        }
      }
    } else {
      Iterator entityNamesIter = entityNames.iterator();
      while (entityNamesIter.hasNext()) {
        String entityName = (String) entityNamesIter.next();
        EOEntity entity = _model.entityNamed(entityName);
        if (entity != null) {
          _entities.addObject(entity);
        }
      }
    }

    // MS: Remove jdbc2Info prior to SQL generation
    NSDictionary connectionDictionary = _model.connectionDictionary();
    if (connectionDictionary != null) {
      NSMutableDictionary mutableConnectionDictionary = connectionDictionary.mutableClone();
      mutableConnectionDictionary.removeObjectForKey("jdbc2Info");
      _model.setConnectionDictionary(mutableConnectionDictionary);
    }

    // MS: Add the "inEntityModeler" flag so that plugins can adjust their
    // behavior
    // if they need to.
    if (runInEntityModeler) {
      NSMutableDictionary modelUserInfo = _model.userInfo().mutableClone();
      NSDictionary entityModelerDict = (NSDictionary) modelUserInfo.valueForKey("_EntityModeler");
      NSMutableDictionary mutableEntityModelerDict;
      if (entityModelerDict == null) {
        mutableEntityModelerDict = new NSMutableDictionary();
      } else {
        mutableEntityModelerDict = entityModelerDict.mutableClone();
      }
      mutableEntityModelerDict.takeValueForKey(Boolean.TRUE, "inEntityModeler");
      modelUserInfo.takeValueForKey(mutableEntityModelerDict, "_EntityModeler");
      _model.setUserInfo(modelUserInfo);
    }
View Full Code Here

Examples of com.webobjects.foundation.NSDictionary

    }
    NSMutableArray mutableClassProperties = classProperties.mutableClone();
    NSMutableArray mutableAttributesUsedForLocking = attributesUsedForLocking.mutableClone();
    for (Enumeration e = attributes.objectEnumerator(); e.hasMoreElements();) {
      EOAttribute attribute = (EOAttribute) e.nextElement();
      NSDictionary userInfo = attribute.userInfo();
      String name = attribute.name();
      if (userInfo != null) {
        Object l = userInfo.valueForKey("ERXLanguages");
        if (l != null && !(l instanceof NSArray)) {
          l = (entity.model().userInfo() != null ? entity.model().userInfo().valueForKey("ERXLanguages") : null);
        }

        NSArray languages = (NSArray) l;
View Full Code Here

Examples of com.webobjects.foundation.NSDictionary

  }

  public Map externalTypes() {
    EODatabaseContext dbc = EODatabaseContext.Factory.newDatabaseContextForDatabase(EODatabase.Factory.newDatabaseForModel(_model));
    EOAdaptorContext ac = dbc.adaptorContext();
    NSDictionary jdbc2Info = ((JDBCAdaptor) ac.adaptor()).plugIn().jdbcInfo();
    return (Map) EOFSQLUtils56.toJavaCollections(jdbc2Info);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.