Examples of editingContext()


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

                if(eo.editingContext() != null && eo.editingContext() != ec) {
                  eo.editingContext().lock();
                  try {
                    result = ERXEOControlUtilities.localInstanceOfObject(ec, eo);
                  } finally {
                    eo.editingContext().unlock();
                  }
                }
            } else {
               throw new ClassCastException("Expected EO, got : " + result.getClass().getName() + ", " + result);
            }
View Full Code Here

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

    try {
      EOEnterpriseObject eo = (EOEnterpriseObject) o;
      JSONObject obj = new JSONObject();
      obj.put("javaClass", o.getClass().getName());

      EOEditingContext ec = eo.editingContext();
      String ecid = registerEditingContext(ec);
      String type;
      String pkStr;
      EOGlobalID gid = ec.globalIDForObject(eo);
      if (gid instanceof EOTemporaryGlobalID) {
View Full Code Here

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

        return returnPage != null ? returnPage : previousPage();
    }

    public WOComponent deleteAction() throws Throwable {
        EOEnterpriseObject anEO = object();
        if (anEO.editingContext()!=null) {
            anEO.editingContext().deleteObject(anEO);
            return tryToSaveChanges(false) ? nextPage() : null;
        }
        return nextPage();
    }  
View Full Code Here

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

    }

    public WOComponent deleteAction() throws Throwable {
        EOEnterpriseObject anEO = object();
        if (anEO.editingContext()!=null) {
            anEO.editingContext().deleteObject(anEO);
            return tryToSaveChanges(false) ? nextPage() : null;
        }
        return nextPage();
    }  
View Full Code Here

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

    NSMutableArray objects = new NSMutableArray();
    for (Enumeration iter = list.objectEnumerator(); iter.hasMoreElements();) {
      Object o = iter.nextElement();

      EOEnterpriseObject eo = recordForObject(ec, o);
      ec = eo.editingContext();
      cd = eo.classDescription();
      objects.addObject(eo);
    }
    EOArrayDataSource ds = new EOArrayDataSource(cd, ec);
    ds.setArray(objects);
View Full Code Here

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

                } else {
                  //Place the EO into a nested ec and try to delete there
                  //to prevent the appearance of a successful delete if
                  //validation fails.
                  EOEnterpriseObject eo = ERXEOControlUtilities.editableInstanceOfObject(_object, true);
                  EOEditingContext childEC = eo.editingContext();
                  childEC.deleteObject(eo);
                  childEC.saveChanges();
                 
                    if (ERXEOControlUtilities.isNewObject(_object)) {
                        // This is necessary to force state synching, e.g., for display groups, etc.
View Full Code Here

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

    if (obj == null) {
      pkValue = null;
    }
    else {
      EOEnterpriseObject eo = (EOEnterpriseObject) obj;
      EOEditingContext editingContext = eo.editingContext();
      if (editingContext != null) {
        editingContext.lock();
        try {
          pkValue = ERXEOControlUtilities.primaryKeyObjectForObject(eo);
          if (pkValue == null) {
View Full Code Here

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

            epi.setNextPage(context().page());
          } else if(nextPage instanceof EditPageInterface) {
              Object value = d2wContext().valueForKey("useNestedEditingContext");
              boolean createNestedContext = ERXValueUtilities.booleanValue(value);
              EOEnterpriseObject object = ERXEOControlUtilities.editableInstanceOfObject(object(), createNestedContext);
           EOEditingContext ec = object.editingContext();
            ec.lock();
            try {
              EOEnterpriseObject eo = ERXEOControlUtilities.createAndAddObjectToRelationship(ec, object, key(), (String)valueForBinding("destinationEntityName"), null);
              EditPageInterface epi = (EditPageInterface)nextPage;
              epi.setObject(eo);
View Full Code Here

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

           log.debug("configuration = "+configuration);
        }
        EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(configuration, session());
        epi.setObject(localObject);
        epi.setNextPage(context().page());
        localObject.editingContext().hasChanges(); // Ensuring it survives.
        return (WOComponent)epi;
    }
}
View Full Code Here

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

        EOEnterpriseObject masterObject = (EOEnterpriseObject) a.objectAtIndex(0);
        String relationshipKey = (String) a.objectAtIndex(1);
        if (masterObject != null
                && !ERXStringUtilities.stringIsNullOrEmpty(relationshipKey)) {
            EOEntity masterEntity = EOUtilities.entityForObject(
                    masterObject.editingContext(), masterObject);
            EORelationship rel = masterEntity.relationshipNamed(relationshipKey);
            // set currentRelationship key to allow unique ID creation
            // (wonder-140)
            d2wContext().takeValueForKey(rel, "currentRelationship");
        }
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.