Examples of EOEnterpriseObject


Examples of com.webobjects.eocontrol.EOEnterpriseObject

        WOComponent result;
        if (isEntityReadOnly()) {
            throw new IllegalStateException("You cannot create new instances of " + entity().name() + "; it is read-only.");
        } else {
            _state = NEW;
            EOEnterpriseObject eo = ERXEOControlUtilities.createAndInsertObject( editingContext(), destinationEntity().name());
            EditPageInterface epi = D2W.factory().editPageForEntityNamed(destinationEntity().name(),
                                                                         session());
            epi.setObject(eo);
            CreateNewEODelegate delegate = new CreateNewEODelegate();
            delegate.editRelationshipPage = this;
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        if(browserSelection()!=null){
            NSArray sortedObjects=relationshipDisplayGroup.displayedObjects();
            // make the compiler happy
            sortedObjects.count();
            int selectedIndex = ((Integer)browserSelection().valueForKey(indexKey())).intValue();
            EOEnterpriseObject lastObject =
                (EOEnterpriseObject)relationshipDisplayGroup.displayedObjects().lastObject();
            int lastIndex =
                ((Integer)lastObject.valueForKey(indexKey())).intValue();
            if(selectedIndex!=lastIndex){
                objectAtIndex(selectedIndex+1).takeValueForKey(Integer.valueOf(selectedIndex),
                                                               indexKey());
                browserSelection().takeValueForKey(Integer.valueOf(selectedIndex+1),
                                                   indexKey());
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        protected abstract void perform(EOEditingContext ec, ERXEnterpriseObject eo);
       
        public void perform(EOEditingContext ec, NSArray eos) {
            if(eos != null && eos.count() > 0) {
                for (Enumeration enumerator = eos.objectEnumerator(); enumerator.hasMoreElements();) {
                    EOEnterpriseObject eo = (EOEnterpriseObject) enumerator.nextElement();
                    if(eo instanceof ERXEnterpriseObject) {
                        perform(ec, (ERXEnterpriseObject)eo);
                    }
                }
            }
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        relationshipDisplayGroup.updateDisplayedObjects();
        return null;
    }

    public EOEnterpriseObject objectAtIndex(int index){
        EOEnterpriseObject result = null;
        if(log.isDebugEnabled()){
            log.debug("looking for index "+index);
        }
        for(Enumeration e = relationshipDisplayGroup.displayedObjects().objectEnumerator();
            e.hasMoreElements();){
            EOEnterpriseObject indexObject = (EOEnterpriseObject)e.nextElement();
            if(log.isDebugEnabled()){
                log.debug("object is at index"+indexObject.valueForKey(indexKey()));
            }
            if( ((Integer)indexObject.valueForKey(indexKey())).intValue() == index){
                result = indexObject;
                break;
            }
        }
        return result;
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        }
        return result;
    }

    public EOEnterpriseObject objectForHashCode(String hashCode){
        EOEnterpriseObject result = null;
        if(log.isDebugEnabled()){
            log.debug("looking for hashCode "+hashCode+".");
        }
        for(Enumeration e = relationshipDisplayGroup.displayedObjects().objectEnumerator();
            e.hasMoreElements();){
            EOEnterpriseObject indexObject = (EOEnterpriseObject)e.nextElement();
            if(log.isDebugEnabled()){
                log.debug("object's hashCode is "+indexObject.hashCode());
            }
            if( (Integer.toString(indexObject.hashCode())).equals(hashCode)){
                result = indexObject;
                break;
            }
        }
        return result;
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

    }
  }

  public er.ajax.mootools.example.components.Employee createEmployeesRelationship() {
    EOClassDescription eoClassDesc = EOClassDescription.classDescriptionForEntityName("Employee");
    EOEnterpriseObject eo = eoClassDesc.createInstanceWithEditingContext(editingContext(), null);
    editingContext().insertObject(eo);
    addObjectToBothSidesOfRelationshipWithKey(eo, "employees");
    return (er.ajax.mootools.example.components.Employee) eo;
  }
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

    public void awake() {}
   
    public String entityName() {
        String entityName = (String)valueForBinding("entityName");
        if(entityName == null) {
            EOEnterpriseObject eo = (EOEnterpriseObject)valueForBinding("object");
            if(eo != null)
                entityName = eo.entityName();
        }
        return entityName;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        if(keyPath != null) {
            int indexOfDot = keyPath.indexOf(".");
            if(indexOfDot > 0) {
                String entityName = keyPath.substring(0, indexOfDot);
                String relationshipPath = keyPath.substring(indexOfDot+1, keyPath.length());
                EOEnterpriseObject eo = EOUtilities.objectWithPrimaryKey(ec, entityName, primaryKeyFromRequest(ec, entityName));
                EOArrayDataSource ds = new EOArrayDataSource(cd, ec);
                ds.setArray((NSArray)eo.valueForKeyPath(relationshipPath));
                return ds;
            }
        }
        return null;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        }
        return result;
    }

    public EOEnterpriseObject browserSelection(){
        EOEnterpriseObject result = null;
        if (browserSelections != null && browserSelections.count()!=0) {
            if(browserSelections.count()>1){
                throw new RuntimeException("Please choose only one element");
            }else
                result = (EOEnterpriseObject)browserSelections.objectAtIndex(0);
View Full Code Here

Examples of com.webobjects.eocontrol.EOEnterpriseObject

        return null;
    }

    protected void prepareEditPage(D2WContext context, EditPageInterface epi, String entityName) {
        EOEditingContext ec = newEditingContext();
        EOEnterpriseObject eo = null;

        ec.lock();
        try {
            if(context.dynamicPage().startsWith(createPrefix) || primaryKeyFromRequest(ec, entityName) == null) {
                eo = EOUtilities.createAndInsertInstance(ec,entityName);
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.