Examples of NSArray


Examples of com.webobjects.foundation.NSArray

   */
  public NSDictionary<String, Object> committedSnapshot() {
    if (!isNewObject()) {
      return editingContext().committedSnapshotForObject(this);
    }
    NSArray keys = allPropertyKeys();
    NSMutableDictionary allNullDict = new NSMutableDictionary(keys.count());
    ERXDictionaryUtilities.setObjectForKeys(allNullDict, NSKeyValueCoding.NullValue, keys);
    return allNullDict;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  public ERXEnterpriseObject refetchObjectFromDBinEditingContext(EOEditingContext ec) {
    EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName());
    EOQualifier qual = entity.qualifierForPrimaryKey(primaryKeyDictionary(false));
    EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName(), qual, null);
    fetchSpec.setRefreshesRefetchedObjects(true);
    NSArray results = ec.objectsWithFetchSpecification(fetchSpec);
    ERXEnterpriseObject freshObject = null;
    if (results.count() > 0) {
      freshObject = (ERXEnterpriseObject) results.objectAtIndex(0);
    }
    return freshObject;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    public void setSelection(String anIndex) {
        if (anIndex != null) {
            int idx = Integer.parseInt(anIndex);
            // ** push the selection to the parent
            NSArray anItemList = (NSArray)_WOJExtensionsUtil.valueForBindingOrNull("list",this);
            Object aSelectedObject = anItemList.objectAtIndex(idx);
            setValueForBinding(aSelectedObject, "selection");
        }
        // ** and force it to be pulled if there's a next time.
        _selection = null;
    }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    }

    @Override
    public NSArray<EOSQLExpression> statementsToInsertColumnForAttribute(final EOAttribute attribute, final NSDictionary options) {
      String clause = _columnCreationClauseForAttribute(attribute);
      return new NSArray(_expressionForString("alter table " + formatTableName(attribute.entity().externalName()) + " add column " + clause));
    }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

                eo._setUpdateInverseRelationships(oldUpdateInverseRelationship);
              }
            }
          }
          else {
            NSArray values = (NSArray) eo.valueForKey(inverse);
            if (values != null && !values.containsObject(object)) {
              boolean oldUpdateInverseRelationship = eo._setUpdateInverseRelationships(false);
              try {
                eo.addObjectToPropertyWithKey(object, inverse);
              }
              finally {
View Full Code Here

Examples of com.webobjects.foundation.NSArray

                eo._setUpdateInverseRelationships(oldUpdateInverseRelationship);
              }
            }
          }
          else {
            NSArray values = (NSArray) eo.valueForKey(inverse);
            if (values.containsObject(object)) {
              boolean oldUpdateInverseRelationship = eo._setUpdateInverseRelationships(false);
              try {
                eo.removeObjectFromPropertyWithKey(object, inverse);
              }
              finally {
View Full Code Here

Examples of com.webobjects.foundation.NSArray

           
            ERXGenericRecord.checkMatchingEditingContexts(object, key, newValueEO);

            //object._superTakeValueForKey(value, key);
            if (newValueEO.isToManyKey(inverse)) {
              NSArray inverseOldValues = (NSArray) newValueEO.valueForKey(inverse);
              if (inverseOldValues == null || !inverseOldValues.containsObject(object)) {
                boolean oldUpdateInverseRelationship = newValueEO._setUpdateInverseRelationships(false);
                try {
                  newValueEO.addObjectToPropertyWithKey(object, inverse);
                }
                finally {
                  newValueEO._setUpdateInverseRelationships(oldUpdateInverseRelationship);
                }
              }
            }
            else {
              EOEnterpriseObject inverseOldValue = (EOEnterpriseObject) newValueEO.valueForKey(inverse);
              if (inverseOldValue != object) {
                boolean oldUpdateInverseRelationship = newValueEO._setUpdateInverseRelationships(false);
                try {
                  newValueEO.takeStoredValueForKey(object, inverse);
                }
                finally {
                  newValueEO._setUpdateInverseRelationships(oldUpdateInverseRelationship);
                }
              }
            }
          }
          // If the object is a null, we need to perform the equivalent of
          // an removeObjectFromBothSidesOfRelationshipWithKey
          else {
            //object._superTakeValueForKey(null, key);
            if (oldValueEO != null) {
              if (oldValueEO.isToManyKey(inverse)) {
                NSArray inverseOldValues = (NSArray) oldValueEO.valueForKey(inverse);
                if (inverseOldValues != null && inverseOldValues.containsObject(object)) {
                  boolean oldUpdateInverseRelationship = oldValueEO._setUpdateInverseRelationships(false);
                  try {
                    oldValueEO.removeObjectFromPropertyWithKey(object, inverse);
                  }
                  finally {
View Full Code Here

Examples of com.webobjects.foundation.NSArray

    public void setSelections(NSArray aFormValuesArray) {
        // ** This is where we accept the formValues.  Kind of weird.
        NSMutableArray aSelectionsArray = new NSMutableArray();
        if (aFormValuesArray != null) {
            Enumeration anIndexEnumerator = aFormValuesArray.objectEnumerator();
            NSArray anItemList = (NSArray)_WOJExtensionsUtil.valueForBindingOrNull("list",this);
            if (anItemList == null) {
                anItemList = NSArray.EmptyArray;
            }
            int anItemCount = anItemList.count();
            while (anIndexEnumerator.hasMoreElements()) {
                int i = Integer.parseInt((String)anIndexEnumerator.nextElement());
                if (i < anItemCount) {
                    Object anObject = anItemList.objectAtIndex(i);
                    aSelectionsArray.addObject(anObject);
                } else {
                    // ** serious problem here. Raise an exception?
                }
            }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

               
                try {
                    if (second.indexOf(".") == -1) {
                        result = NSKeyValueCoding.Utility.valueForKey(result, second);
                    } else {
                        NSArray parts = NSArray.componentsSeparatedByString(second, ".");
                        for (int j = 0; j < parts.count(); j++) {
                            String part = (String)parts.objectAtIndex(j);
                            result = NSKeyValueCoding.Utility.valueForKey(result, part);
                            if (result == null)
                                break;
                        }
                    }
View Full Code Here

Examples of com.webobjects.foundation.NSArray

  @Override
  public void appendToResponse(WOResponse response, WOContext context) {
    super.appendToResponse(response, context);
    WOComponent component = context.component();
    NSArray updateContainerIDs = (NSArray) _updateContainerIDs.valueInComponent(component);
    if (updateContainerIDs != null && updateContainerIDs.count() > 0) {
      AjaxUtils.appendScriptHeader(response);
      Enumeration updateContainerIDEnum = updateContainerIDs.objectEnumerator();
      while (updateContainerIDEnum.hasMoreElements()) {
        String updateContainerID = (String) updateContainerIDEnum.nextElement();
        // PROTOTYPE FUNCTIONS
        Object evalScripts = ERXComponentUtilities.valueForBinding("evalScripts", "true", _associations, component);
        response.appendContentString("if ($wi('" + updateContainerID + "')) { ");
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.