Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.EditPageInterface


    }
   
    public WOComponent newObjectForEntityName(String entityName) {
        WOComponent nextPage = null;
        try {
            EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(entityName, session());
            epi.setNextPage(session().context().page());
            nextPage = (WOComponent) epi;
        } catch (IllegalArgumentException e) {
            ErrorPageInterface epf = D2W.factory().errorPage(session());
            epf.setMessage(e.toString());
            epf.setNextPage(session().context().page());
View Full Code Here


   
    public WOComponent editObjectInRelationship(){
        WOComponent result = null;
        if(browserSelections != null && browserSelections.count() == 1) {
            String editConfigurationName = (String)d2wContext().valueForKey("editConfigurationName");
            EditPageInterface epi;
            if(editConfigurationName != null && editConfigurationName.length() > 0) {
                epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(editConfigurationName,session());
            } else {
                epi = D2W.factory().editPageForEntityNamed(object().entityName(),session());
            }           
            EOEnterpriseObject eo = (EOEnterpriseObject)browserSelections.objectAtIndex(0);
            epi.setObject(eo);
            epi.setNextPage(context().page());
            result = (WOComponent)epi;
        }
        return result;
    }
View Full Code Here

        return eo;
    }

  @Override
    public EditPageInterface editPageForNewObjectWithEntityNamed(String entityName, WOSession session) {
        EditPageInterface epi = (EditPageInterface) pageForConfigurationNamed("Create" + entityName, session);
        EOEditingContext peerContext = ERXEC.newEditingContext(session.defaultEditingContext().parentObjectStore());
        EOEnterpriseObject newObject = _newObjectWithEntity(_entityNamed(entityName, session), peerContext);
        epi.setObject(newObject);
        peerContext.hasChanges();
        return epi;
    }
View Full Code Here

        return epi;
    }

  @Override
    public EditPageInterface editPageForNewObjectWithConfigurationNamed(String configurationName, WOSession session) {
        EditPageInterface epi = (EditPageInterface) pageForConfigurationNamed(configurationName, session);
        EOEditingContext peerContext = ERXEC.newEditingContext(session.defaultEditingContext().parentObjectStore());
        D2WContext d2wcontext = ((D2WPage) epi).d2wContext();
        EOEnterpriseObject newObject = _newObjectWithEntity(d2wcontext.entity(), peerContext);
        epi.setObject(newObject);
        peerContext.hasChanges();
        return epi;
    }
View Full Code Here

    }
   
    public WOComponent newObjectForEntityName(String entityName) {
        WOComponent nextPage = null;
        try {
            EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(entityName, session());
            epi.setNextPage(session().context().page());
            nextPage = (WOComponent) epi;
        } catch (IllegalArgumentException e) {
            ErrorPageInterface epf = D2W.factory().errorPage(session());
            epf.setMessage(e.toString());
            epf.setNextPage(session().context().page());
View Full Code Here

        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;
            delegate.createdEO = eo;
            epi.setNextPageDelegate(delegate);
            result = (WOComponent)epi;
        }
        return result;
    }
View Full Code Here

    }

    public WOComponent newObjectAction() {
        WOComponent nextPage = null;
        try {
            EditPageInterface epi = D2W.factory().editPageForNewObjectWithEntityNamed(_manipulatedEntityName, session());
            epi.setNextPage(context().page());
            nextPage = (WOComponent) epi;
        } catch (IllegalArgumentException e) {
            ErrorPageInterface epf = D2W.factory().errorPage(session());
            epf.setMessage(e.toString());
            epf.setNextPage(context().page());
View Full Code Here

   
    public WOComponent editAction() {
        WOComponent returnPage = null;
        if (previousPage() == null) {
            String editConfigurationName = (String)d2wContext().valueForKey("editConfigurationName");
            EditPageInterface editPage;
            if(editConfigurationName != null && editConfigurationName.length() > 0) {
                editPage = (EditPageInterface)D2W.factory().pageForConfigurationNamed(editConfigurationName,session());
            } else {
                editPage = D2W.factory().editPageForEntityNamed(object().entityName(),session());
            }
        Object value = d2wContext().valueForKey("useNestedEditingContext");
        boolean createNestedContext = ERXValueUtilities.booleanValue(value);
        EOEnterpriseObject object = ERXEOControlUtilities.editableInstanceOfObject(object(), createNestedContext);
        editPage.setObject(object);
            editPage.setNextPage(nextPage());
            returnPage = (WOComponent)editPage;
        }
        return returnPage != null ? returnPage : previousPage();
    }
View Full Code Here

    return (WOComponent) nextPage;
  }

  public WOComponent editObjectAction() {
      WOComponent result = null;
    EditPageInterface epi;
    ERDEditObjectDelegate editObjectDelegate = null;
    String editConfigurationName = (String) d2wContext().valueForKey("editConfigurationName");
    EOEnterpriseObject leo = localInstanceOfObject();
    log.debug("editConfigurationName: " + editConfigurationName);
    if ((editObjectDelegate  = editObjectDelegateInstance()) != null) {
            result = editObjectDelegate.editObject(leo, context().page());
        }
    else {
        if (editConfigurationName != null) {
          epi = (EditPageInterface) D2W.factory().pageForConfigurationNamed(editConfigurationName, session());
        }
        else {
          epi = D2W.factory().editPageForEntityNamed(object().entityName(), session());
        }
       
        epi.setObject(leo);
        epi.setNextPage(context().page());
        result = (WOComponent) epi;
    }
    return result;
  }
View Full Code Here

        // Could use a child context if we didn't want the talent to go to the database
        EOEditingContext ec = ERXEC.newEditingContext();
        EOEnterpriseObject director = ERXEOControlUtilities.createAndInsertObject(ec, "Talent");
       
        // Let's throw to a regular edit page
        EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed("EditTalent", session());
        epi.setObject(director);
        epi.setNextPageDelegate(new CreateDirectorDelegate(movie(), context().page()));
        return (WOComponent)epi;
    }
View Full Code Here

TOP

Related Classes of com.webobjects.directtoweb.EditPageInterface

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.