Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEnterpriseObject.editingContext()


    if (object == null) {
      hashCode = 0;
    }
    else if (eoSupport(component) && object instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo = (EOEnterpriseObject)object;
      EOEditingContext editingContext = eo.editingContext();
      EOGlobalID gid = null;
      if (editingContext != null) {
        gid = editingContext.globalIDForObject(eo);
      }
      // If the EO isn't in an EC, or it has a null GID, then just fall back to the hash code
View Full Code Here


  public void deleteObjects(NSArray objects) {
    for (int i = objects.count(); i-- > 0;) {
      Object o = objects.objectAtIndex(i);
      if (o instanceof EOEnterpriseObject) {
        EOEnterpriseObject eo = (EOEnterpriseObject) o;
        if (eo.editingContext() != null) {
          eo.editingContext().deleteObject(eo);
        }
      }
    }
  }
View Full Code Here

    for (int i = objects.count(); i-- > 0;) {
      Object o = objects.objectAtIndex(i);
      if (o instanceof EOEnterpriseObject) {
        EOEnterpriseObject eo = (EOEnterpriseObject) o;
        if (eo.editingContext() != null) {
          eo.editingContext().deleteObject(eo);
        }
      }
    }
  }
View Full Code Here

            if(contextID != null)
                page = session().restorePageForContextID(contextID);
            log.debug("Page: " + (page != null ? "Yes" : "No"));
            if(page != null && true) {
                eo = (EOEnterpriseObject)page.valueForKey("object");
                eo.editingContext().lock();
                int dotOffset = key.lastIndexOf('.');
                if(dotOffset > 0) {
                    Object otherEO = eo.valueForKeyPath(key.substring(0, dotOffset));
                    if(otherEO != null) {
                        NSValidation.Utility.validateValueForKey(otherEO, value, key.substring(dotOffset+1));
View Full Code Here

                _errors = ex1.toString();
            }
        } catch (NSValidation.ValidationException ex1) {
            _errors = ex1.getMessage();
        } finally {       
            if (eo != null && eo.editingContext() != null) {
                eo.editingContext().unlock();
            }
        }
    }
   
View Full Code Here

            }
        } catch (NSValidation.ValidationException ex1) {
            _errors = ex1.getMessage();
        } finally {       
            if (eo != null && eo.editingContext() != null) {
                eo.editingContext().unlock();
            }
        }
    }
   
    @Override
View Full Code Here

     * in-line confirmation dialog. Calls saveChanges on the parent ec if the finalCommit flag is true.
     */
    public WOActionResults deleteObjectWithFinalCommit(boolean finalCommit) {
      dataSource().deleteObject(object());
      EOEnterpriseObject obj = (EOEnterpriseObject)d2wContext().valueForKey(Keys.objectPendingDeletion);
      obj.editingContext().deleteObject(obj);

      try {
        obj.editingContext().saveChanges();
        if (displayGroup() != null && displayGroup().displayedObjects().count() == 0) {
          displayGroup().displayPreviousBatch();
View Full Code Here

      dataSource().deleteObject(object());
      EOEnterpriseObject obj = (EOEnterpriseObject)d2wContext().valueForKey(Keys.objectPendingDeletion);
      obj.editingContext().deleteObject(obj);

      try {
        obj.editingContext().saveChanges();
        if (displayGroup() != null && displayGroup().displayedObjects().count() == 0) {
          displayGroup().displayPreviousBatch();
        }
            if (finalCommit && !ERXEOControlUtilities.isNewObject(object())) {
                // if we are editing a new object, then don't save
View Full Code Here

     * Reverts the ec, and purges the objectPendingDeletion in the d2wContext to hide the in-line
     * confirmation dialog.
     */
    public WOActionResults cancelAction() {
      EOEnterpriseObject obj = (EOEnterpriseObject)d2wContext().valueForKey(Keys.objectPendingDeletion);
      obj.editingContext().revert();
      d2wContext().takeValueForKey(null, Keys.objectPendingDeletion);
      return null;
    }
   
    /**
 
View Full Code Here

  public static void assertEOEquals(Object obj1, Object obj2) {
    if (obj1 != null && obj2 != null && obj1 instanceof EOEnterpriseObject && obj2 instanceof EOEnterpriseObject) {
      EOEnterpriseObject eo1 = (EOEnterpriseObject) obj1;
      EOEnterpriseObject eo2 = (EOEnterpriseObject) obj2;
      if (!ERXEOControlUtilities.eoEquals(eo1, eo2)) {
        throw new AssertionFailedError("Expected " + eo1.editingContext().globalIDForObject(eo1) + ", but got " + eo2.editingContext().globalIDForObject(eo2));
      }
    }
    else {
      assertEquals(obj1, obj2);
    }
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.