Package com.webobjects.foundation

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


    }
    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

  }

  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

  public static Object toJavaCollections(Object obj) {
    Object result;
    if (obj instanceof NSDictionary) {
      Map map = new HashMap();
      NSDictionary nsDict = (NSDictionary) obj;
      Enumeration keysEnum = nsDict.allKeys().objectEnumerator();
      while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        Object value = nsDict.objectForKey(key);
        key = toJavaCollections(key);
        value = toJavaCollections(value);
        map.put(key, value);
      }
      result = map;
View Full Code Here

        String aModelName = anEntity.model().name();
        EODatabaseContext aDatabaseContext = EOUtilities
            .databaseContextForModelNamed(anEditingContext,
                aModelName);
        aDatabaseContext.lock();
        NSDictionary aRow = aDatabaseContext
            .snapshotForGlobalID(aGlobalID);
        aDatabaseContext.unlock();
        EOQualifier aQualifier = aRelationship
            .qualifierWithSourceRow(aRow);
View Full Code Here

    }

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

    NSDictionary defaultConnectionDictionary;
    Map overrideConnectionDictionary = (Map) databaseConfig.get("connectionDictionary");
    if (overrideConnectionDictionary != null) {
      NSDictionary connectionDictionary = (NSDictionary) EOFSQLUtils53.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

    }
    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

  }

  public Map externalTypes() {
    EODatabaseContext dbc = new EODatabaseContext(new EODatabase(_model));
    EOAdaptorContext ac = dbc.adaptorContext();
    NSDictionary jdbc2Info = ((JDBCAdaptor) ac.adaptor()).plugIn().jdbcInfo();
    return (Map) EOFSQLUtils53.toJavaCollections(jdbc2Info);
  }
View Full Code Here

  public static Object toJavaCollections(Object obj) {
    Object result;
    if (obj instanceof NSDictionary) {
      Map map = new HashMap();
      NSDictionary nsDict = (NSDictionary) obj;
      Enumeration keysEnum = nsDict.allKeys().objectEnumerator();
      while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        Object value = nsDict.objectForKey(key);
        key = toJavaCollections(key);
        value = toJavaCollections(value);
        map.put(key, value);
      }
      result = map;
View Full Code Here

  }

  public static void formWithEntityName(String entityName,
                                        EOGlobalID globalID) {
    EOControllerFactory f = EOControllerFactory.sharedControllerFactory();
    EOController controller = f.controllerWithSpecification(new NSDictionary(new Object[] { entityName,
                                                                                           EOControllerFactory.FormTask,
                                                                                           EOControllerFactory.TopLevelWindowQuestion },
                                                                             new Object[] { EOControllerFactory.EntitySpecification,
                                                                                           EOControllerFactory.TaskSpecification,
                                                                                           EOControllerFactory.QuestionSpecification }),
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSDictionary

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.