Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSKeyValueCoding


   *         value - {@link SavedQuery}
   */
  public static NSDictionary savedQueriesForPageConfigurationNamed(WOSession session, String pageConfigurationName) {
      NSArray savedQueries = null;
     
      NSKeyValueCoding userPreferences = userPreferences(session);
     
      EOKeyValueArchiving.Support.setSupportForClass(newEOKVArchivingTimestampSupport, NSTimestamp._CLASS);
  
      try {
          savedQueries = (NSArray) userPreferences.valueForKey(userPreferenceNameForPageConfiguration(pageConfigurationName));
      } finally {
          EOKeyValueArchiving.Support.setSupportForClass(originalEOKVArchivingTimestampSupport, NSTimestamp._CLASS);
      }

      if (log.isDebugEnabled())
View Full Code Here


  public ERDEmptyListMessage(WOContext context) {
    super(context);
  }

  public NSKeyValueCoding bindings() {
    return new NSKeyValueCoding() {
      public void takeValueForKey(Object obj, String s) {
        // nothing
      }

      public Object valueForKey(String s) {
View Full Code Here

        public void handleBatchSizeChange(NSNotification n) { handleChange("batchSize", n); }
        public void handleSortOrderingChange(NSNotification n) { handleChange("sortOrdering", n); }

        public void handleChange(String prefName, NSNotification n) {
            if (ERCoreBusinessLogic.actor() != null) {
                NSKeyValueCoding context=(NSKeyValueCoding)n.userInfo().objectForKey("d2wContext");
                if (context!=null && context.valueForKey("pageConfiguration") != null) {
                    userPreferences().takeValueForKey(n.object(),
                                                      prefName+"."+(String)context.valueForKey("pageConfiguration"));
                }
            }
        }
View Full Code Here

      if (dictionary == null) {
        return;
      }
     
      // do this check only once in the beginning instead of using NSKeyValueCoding.Utility below
      NSKeyValueCoding keyValueCodingObject = (object instanceof NSKeyValueCoding) ? (NSKeyValueCoding)object : null;
   
      NSArray<String> keys = dictionary.allKeys();
      int count = keys.count();
      for (int i = 0; i < count; i++) {
        String key = keys.objectAtIndex(i);
        Object value = dictionary.objectForKey(key);
        if (value == NSKeyValueCoding.NullValue) {
          value = null;
        }
       
        if (keyValueCodingObject != null) {
          if (ObjectUtils.notEqual(value, keyValueCodingObject.valueForKey(key))) {
            keyValueCodingObject.takeValueForKey(value, key);
          }
        }
        else {
          if (ObjectUtils.notEqual(value, NSKeyValueCoding.DefaultImplementation.valueForKey(object, key))) {
            NSKeyValueCoding.DefaultImplementation.takeValueForKey(object, value, key);
View Full Code Here

     * @param erv a given validation exception
     * @return context to be used for this validation exception
     */
    // CHECKME: Doesn't need to be the NSKeyValueCoding interface now with WO 5
    public NSKeyValueCoding contextForException(ERXValidationException erv) {
        NSKeyValueCoding context = null;
        if (erv.delegate() != null && erv.delegate() instanceof ExceptionDelegateInterface) {
            context = ((ExceptionDelegateInterface)erv.delegate()).contextForException(erv);
        }
        return context;
    }
View Full Code Here

    /**
     * Returns the request headers as a KVC object.
     */
    // ENHANCEME use symbolic names like "remoteHost" to broker between all those different adaptor keys
    public NSKeyValueCoding headers() {
      return new NSKeyValueCoding() {
            public Object valueForKey(String s) {
              return context().request().headerForKey(s);
            }

            public void takeValueForKey(Object obj, String s) {
View Full Code Here

   
    /**
     * Returns the form values as a KVC object.
     */
    public NSKeyValueCoding formValues() {
      return new NSKeyValueCoding() {
            public Object valueForKey(String s) {
              return context().request().formValueForKey(s);
            }

            public void takeValueForKey(Object obj, String s) {
View Full Code Here

                    newValue = cd.validateValueForKey(value, key);
            }
        } catch (ERXValidationException ex) {
            try {
                log.info(ex);
                NSKeyValueCoding d2wContext = (NSKeyValueCoding)page.valueForKey("d2wContext");
                d2wContext.takeValueForKey(key, "propertyKey");
                ex.setContext(d2wContext);
                ex.setTargetLanguage((String)session().valueForKeyPath("language"));
                _errors = ex.getMessage();
            } catch(Exception ex1) {
                _errors = ex1.toString();
View Full Code Here

    public NSArray mainMenuItems() {
        return ERXNavigationManager.manager().navigationItemForName("MainMenu").children();
    }

    public NSKeyValueCoding navigationContext() {
        NSKeyValueCoding context = (NSKeyValueCoding)session().objectForKey("navigationContext");

        if (context().page() instanceof D2WPage) {
            context = ((D2WPage)context().page()).d2wContext();
        }
View Full Code Here

        }
        return context().page().name();
    }
   
    public NSKeyValueCoding navigationContext() {
        NSKeyValueCoding context = (NSKeyValueCoding)session().objectForKey("navigationContext");

        if (context().page() instanceof D2WPage) {
            context = ((D2WPage)context().page()).d2wContext();
        }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSKeyValueCoding

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.