Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSDictionary$_JavaNSDictionaryMapEntry


    private EOAttribute _attribute;

    @SuppressWarnings("deprecation")
    public IndexAttribute(EOAttribute attribute) {
      _attribute = attribute;
      NSDictionary dict = attribute.userInfo() != null ? attribute.userInfo() : NSDictionary.emptyDictionary();
      _columnName = attribute.columnName();
      boolean isClassProperty = _attribute.entity().classPropertyNames().contains(_attribute.name());
      boolean isDataProperty = _attribute.className().endsWith("NSData");
      boolean isStringProperty = _attribute.className().endsWith("String");
      _termVector = (TermVector) classValue(dict, "termVector", TermVector.class, isClassProperty && !isDataProperty && isStringProperty ? "YES" : "NO");
      _store = (Store) classValue(dict, "store", Store.class, "YES");
      _index = (Index) classValue(dict, "index", Index.class, isClassProperty && !isDataProperty && isStringProperty ? "ANALYZED" : "NOT_ANALYZED");
      String analyzerClass = (String) dict.objectForKey("analyzer");
      if (analyzerClass == null && _columnName.matches("\\w+_(\\w+)")) {
        String locale = _columnName.substring(_columnName.lastIndexOf('_') + 1).toLowerCase();
        analyzerClass = LOCALES.objectForKey(locale);
        if (analyzerClass != null) {
          analyzerClass = ERXPatcher.classForName("org.apache.lucene.analysis." + locale + "." + analyzerClass).getName();
        }
      }
      if (analyzerClass == null) {
        analyzerClass = StandardAnalyzer.class.getName();
      }
      Class c = ERXPatcher.classForName(analyzerClass);
      _analyzer = (Analyzer) _NSUtilities.instantiateObject(c, new Class[] { Version.class }, new Object[] { Version.LUCENE_20 }, true, false);

      _format = (Format) create((String) dict.objectForKey("format"));
      String numberFormat = (String) dict.objectForKey("numberformat");
      if (numberFormat != null) {
        _format = new NSNumberFormatter(numberFormat);
      }
      String dateformat = (String) dict.objectForKey("dateformat");
      if (dateformat != null) {
        _format = new NSTimestampFormatter(dateformat);
      }
    }
View Full Code Here


        validationFailedWithException(ERXValidationFactory.defaultFactory().createException(object(), key(), password(), errorCode), password(), key() + "," + passwordPropertyKey());
    }

    public String passwordPropertyKey() {
        String passwordPropertyKey = null;
        NSDictionary userInfo = (NSDictionary) ERXWOContext.contextDictionary().objectForKey("ERDEditPassword");
        if(userInfo != null) {
            passwordPropertyKey = (String) userInfo.valueForKey(ERDEditPassword.passwordPropertyKey);
        }
        if(passwordPropertyKey == null) {
            throw new IllegalStateException("Can't find the passwordPropertyKey. There needs to be a ERDEditPassword component on this page and its 'passwordConfirmationValidates' needs to be true for this component to work.");
        }
        return passwordPropertyKey;
View Full Code Here

        return passwordPropertyKey() == null || object() == null ? null : object().valueForKeyPath(passwordPropertyKey());
    }

    public String password() {
        String password = null;
        NSDictionary userInfo = (NSDictionary) ERXWOContext.contextDictionary().objectForKey("ERDEditPassword");
        if(userInfo != null) {
            password = (String) userInfo.objectForKey("ERDEditPassword." + passwordPropertyKey() + ".value");
        }
        return password;
    }
View Full Code Here

            Object choices = valueForBinding("possibleChoices");
            if(choices != null) {
                NSMutableArray keyChoices = new NSMutableArray();
                if(choices instanceof NSArray) {
                    for(Enumeration e = ((NSArray)choices).objectEnumerator(); e.hasMoreElements(); ) {
                        NSDictionary dict = (NSDictionary)e.nextElement();
                        String key = (String)dict.allKeys().lastObject();
                        String value = (String)dict.objectForKey(key);
                        keyChoices.addObject(new ERXKeyValuePair(key, ERXLocalizer.currentLocalizer().localizedStringForKeyWithDefault(value)));
                    }
                } else if(choices instanceof NSDictionary) {
                    NSArray keys = ((NSDictionary)choices).allKeys();
                    keys = ERXArrayUtilities.sortedArraySortedWithKey(keys, "toString");
View Full Code Here

import com.webobjects.foundation.NSDictionary;

public class ERLuceneAdaptorException extends EOGeneralAdaptorException {

  public ERLuceneAdaptorException(String message, Throwable throwable) {
    super(message, throwable == null ? NSDictionary.emptyDictionary() : new NSDictionary(throwable, "originalException"));

  }
View Full Code Here

                    _object = null;
                }
            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
View Full Code Here

            Object choices = d2wContext().valueForKey("possibleChoices");
            if(choices != null) {
                NSMutableArray keyChoices = new NSMutableArray();
                if(choices instanceof NSArray) {
                    for(Enumeration e = ((NSArray)choices).objectEnumerator(); e.hasMoreElements(); ) {
                        NSDictionary dict = (NSDictionary)e.nextElement();
                        String key = (String)dict.allKeys().lastObject();
                        String value = (String)dict.objectForKey(key);
                        keyChoices.addObject(new ERXKeyValuePair(key, ERXLocalizer.currentLocalizer().localizedStringForKeyWithDefault(value)));
                    }
                } else if(choices instanceof NSDictionary) {
                    NSArray keys = ((NSDictionary)choices).allKeys();
                    keys = ERXArrayUtilities.sortedArraySortedWithKey(keys, "toString");
View Full Code Here

          dbcs.setObjectForKey(dbc, key);
        }
        EODatabase database = dbc.database();
        NSMutableDictionary snapshotsByGlobalID = new NSMutableDictionary();
        for (Enumeration snapshotsEnumerator = snapshots.objectEnumerator(); snapshotsEnumerator.hasMoreElements();) {
          NSDictionary snapshot = (NSDictionary) snapshotsEnumerator.nextElement();
          EOGlobalID globalID = entity.globalIDForRow(snapshot);
          snapshotsByGlobalID.setObjectForKey(snapshot, globalID);
        }
        if (snapshotsByGlobalID.count() > 0) {
          dbc.lock();
View Full Code Here

    private static final NSSelector TakeValuesFromDictionarySelector = new NSSelector("takeValuesFromDictionary", new Class [] {NSDictionary.class});
    private NSDictionary _lastAppliedMassChanges;
    public WOComponent propagateChangesToVisibleObjects() {
        final NSArray displayedObjects = displayGroup().displayedObjects();
        final NSDictionary changes = massChangeEO().pendingChanges();

        _lastAppliedMassChanges = null;
        if (displayedObjects != null && changes != null && changes.count() > 0) {
            displayedObjects.makeObjectsPerformSelector(TakeValuesFromDictionarySelector, new Object[]{changes});
            _lastAppliedMassChanges = changes;
            clearMassChangeEO();
        }
View Full Code Here

            EODatabaseContext dbContext = ERCNNotificationCoordinator.databaseContextForEntityNamed(entityName, ec);
            EODatabase database = dbContext.database();
            NSArray snapshots = (NSArray)ercnSnapshot.shapshotsForUpdateGroupedByEntity().objectForKey(entityName);
            Enumeration snapshotsEnumerator = snapshots.objectEnumerator();
            while (snapshotsEnumerator.hasMoreElements()) {
                NSDictionary snapshot = (NSDictionary)snapshotsEnumerator.nextElement();
                if (NSLog.debug.isEnabled())
                    NSLog.debug.appendln(ERCNNotificationCoordinator.LOG_HEADER + "Snapshot: " + snapshot);
                if (snapshot != null) {
                    EOGlobalID globalID = entity.globalIDForRow(snapshot);
                    dbContext.lock();
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSDictionary$_JavaNSDictionaryMapEntry

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.