Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.EditPageInterface


    }

    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 newMovieWithPageConfiguration(String pageConfig) {
        EOEditingContext ec = ERXEC.newEditingContext();
        EOEnterpriseObject movie = ERXEOControlUtilities.createAndInsertObject(ec, "Movie");
        EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(pageConfig,
                                                                                           session());
        epi.setObject(movie);
        epi.setNextPage(context().page());
        return (WOComponent)epi;       
    }
View Full Code Here

public class Session extends ERXSession {

    public WOComponent newMovieWithPageConfiguration(String pageConfig) {
        EOEditingContext ec = ERXEC.newEditingContext();
        EOEnterpriseObject movie = ERXEOControlUtilities.createAndInsertObject(ec, "Movie");
        EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(pageConfig, this);
        epi.setObject(movie);
        epi.setNextPage(context().page());
        return (WOComponent)epi;
    }
View Full Code Here

            }
           
            EOEnterpriseObject masterObj = (EOEnterpriseObject) parentObject;
            EOEnterpriseObject newEO = ERXEOControlUtilities.createAndAddObjectToRelationship (masterObj.editingContext (), masterObj, relationshipNameToAddTo, destinationEntityName, null);
           
            EditPageInterface epi = D2W.factory ().editPageForEntityNamed (destinationEntityName, session ());
            epi.setObject (newEO);
           
            return (WOComponent) epi;
        }
View Full Code Here

        EOEnterpriseObject localObject = localInstanceOfObject();
        String configuration = (String)valueForBinding("editConfigurationName");
        if(log.isDebugEnabled()){
           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

  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());
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


    public WOComponent massModify() {
        EOEditingContext localContext = ERXEC.newEditingContext(false); // we will never validate or save this one
        EOEnterpriseObject newEO = ERXEOControlUtilities.createAndInsertObject(localContext, d2wContext().entity().name());
        EditPageInterface epi=(EditPageInterface)D2W.factory().pageForConfigurationNamed((String)d2wContext().valueForKey("massModificationPageConfiguration"),
                                                                                         session());
        epi.setObject(newEO);
        _MassModificatorConfirmationDelegate cb=new _MassModificatorConfirmationDelegate();
        cb.eo=newEO;
        cb.nextPage=context().page();
        cb.entityName=d2wContext().entity().name();
        cb.list=(NSArray)valueForBinding("list");
        epi.setNextPageDelegate(cb);
        WOComponent result=(WOComponent)epi;
        D2WContext editContext=(D2WContext)result.valueForKey("d2wContext");
        editContext.takeValueForKey("massModify", "subTask");

        // we then wipe any default value that might have been put in the EO
View Full Code Here

        return result != null ? result : createEOWithChoices.nextPage();
    }

    public WOComponent edit() {
        EOEnterpriseObject eo = (EOEnterpriseObject)objectKeyPathValue();
        EditPageInterface epi = null;
        if (eo == null) {
            parent().validationFailedWithException(new NSValidation.ValidationException(errorMessage()),objectPropertyValue(), key());
        } else {
            String editConfigurationName = (String)ERDirectToWeb.d2wContextValueForKey("editConfigurationName", eo.entityName());
            epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(editConfigurationName, session());
            epi.setNextPage(context().page());
            if (((ERXEnterpriseObject)eo).isNewObject())
                localContext = ERXEC.newEditingContext(object().editingContext(), false);
            else
                localContext = ERXEC.newEditingContext(object().editingContext().parentObjectStore());
            epi.setObject(EOUtilities.localInstanceOfObject(localContext, eo));
            localContext.hasChanges();
        }
        return (WOComponent)epi;
    }
View Full Code Here

            String createPageConfigurationName = (String)ERDirectToWeb.d2wContextValueForKey("createConfigurationName",
                                                                                             entityNameForNewInstances,
                                                                                             extraValues);
            if (log.isDebugEnabled())
                log.debug("Create Page Config: " + createPageConfigurationName + " for entity: " + entityNameForNewInstances+" - "+extraValues);
            EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(createPageConfigurationName,followPage.session());
            epi.setObject(newEO);
            if (postCreateNextPageDelegate == null) {
                ERDEditOwnedRelationship.PostSaveDelegate postSaveDelegate = new PostSaveDelegate();
                postSaveDelegate.postRelationshipKeys=postRelationshipKeys;
                postSaveDelegate.object=object;
                postSaveDelegate.key=key;
                postSaveDelegate.savedObject=newEO;
                postSaveDelegate.localContext=localContext;
                postSaveDelegate.followPage=followPage;
                epi.setNextPageDelegate(postSaveDelegate);
            } else {
                epi.setNextPageDelegate(postCreateNextPageDelegate);
            }
            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.