Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.ConfirmPageInterface


            lpi.setNextPage(page);
          } else if (page instanceof SelectPageInterface) {
            SelectPageInterface lpi = (SelectPageInterface) page;
            lpi.setDataSource(ERXEOControlUtilities.dataSourceForArray(ec, entityName, new NSArray(EOUtilities.createAndInsertInstance(ec, entityName))));
          } else if (page instanceof ConfirmPageInterface) {
            ConfirmPageInterface cpi = (ConfirmPageInterface) page;
            // nothing
          } else if (page instanceof QueryPageInterface) {
            QueryPageInterface qpi = (QueryPageInterface) page;
            // nothing
          } else {
View Full Code Here


    return ERXValueUtilities.booleanValueWithDefault(d2wContext().valueForKey("isEntityPrintable"), false);
  }

  public WOComponent deleteObjectAction() {
    String confirmDeleteConfigurationName = (String) d2wContext().valueForKey("confirmDeleteConfigurationName");
    ConfirmPageInterface nextPage;
    if (confirmDeleteConfigurationName == null) {
      log.warn("Using default delete template: ERD2WConfirmPageTemplate, set the 'confirmDeleteConfigurationName' key to something more sensible");
      nextPage = (ConfirmPageInterface) pageWithName("ERD2WConfirmPageTemplate");
    } else {
      nextPage = (ConfirmPageInterface) D2W.factory().pageForConfigurationNamed(confirmDeleteConfigurationName, session());
    }
    nextPage.setConfirmDelegate(new ERDDeletionDelegate(object(), dataSource(), context().page()));
    nextPage.setCancelDelegate(new ERDDeletionDelegate(null, null, context().page()));
    if (nextPage instanceof InspectPageInterface) {
      ((InspectPageInterface) nextPage).setObject(object());
    } else {
      String message = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("ERD2WList.confirmDeletionMessage", d2wContext());
      nextPage.setMessage(message);
    }
    return (WOComponent) nextPage;
  }
View Full Code Here

    public ERDConfirmObjectDelegate(EOEnterpriseObject eo, String confirmPageName, NextPageDelegate delegate) {
        this(eo, confirmPageName, delegate, delegate);
    }

    public WOComponent nextPage(WOComponent sender) {
        ConfirmPageInterface cpi = (ConfirmPageInterface)D2W.factory().pageForConfigurationNamed(_confirmPageName, sender.session());
        ((D2WPage)cpi).setObject(_eo);
        cpi.setConfirmDelegate(_confirmDelegate);
        cpi.setCancelDelegate(_cancelDelegate);
        return (WOComponent)cpi;
    }
View Full Code Here

    @Override
    public WOComponent cancelAction() {
        WOComponent result=null;
        if (_currentStep>1 && ERXEOControlUtilities.isNewObject(object())) { // only show this if we've been through more than one page
            ConfirmPageInterface cpi = (ConfirmPageInterface)D2W.factory().pageForConfigurationNamed("ConfirmCancelCreationOf" + entityName(),
                                                                                                     session());
            cpi.setCancelDelegate(new ERDPageDelegate(context().page()));
            cpi.setConfirmDelegate(new _confirmCancellationDelegate());
            cpi.setMessage((String)d2wContext().valueForKey("cancelMessage"));
            if(cpi instanceof InspectPageInterface) {
                ((InspectPageInterface)cpi).setObject(object());
            }
            result=(WOComponent)cpi;
        } else {
View Full Code Here

    public boolean canDelete() {
        return object() != null && object() instanceof ERXGuardedObjectInterface ? ((ERXGuardedObjectInterface)object()).canDelete() : true;
    }

    public WOComponent deleteObjectAction() {
        ConfirmPageInterface nextPage = (ConfirmPageInterface)D2W.factory().pageForConfigurationNamed((String)valueForBinding("confirmDeleteConfigurationName"), session());
        nextPage.setConfirmDelegate(new ERDDeletionDelegate(object(), dataSource(), context().page()));
        nextPage.setCancelDelegate(new ERDPageDelegate(context().page()));
        D2WPage d2wPage = ((D2WPage)nextPage);
       
        String message = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("ERDTrashcan.confirmDeletionMessage", d2wContext());
        nextPage.setMessage(message);
        d2wPage.setObject(object());
        return (WOComponent) nextPage;
    }
View Full Code Here

        public String entityName;
        public WOComponent nextPage;
        public WOComponent nextPage(WOComponent sender) {
            WOComponent result=nextPage;
            if (eo.editingContext()!=null) { // save was clicked
                ConfirmPageInterface confirmPage = D2W.factory().confirmPageForEntityNamed(entityName,
                        sender.session());
                _MassModificatorDelegate cb=new _MassModificatorDelegate();
                NSMutableArray keys = new NSMutableArray();
                for (Enumeration e = displayPropertyKeys.objectEnumerator(); e.hasMoreElements();) {
                    String key = (String) e.nextElement();
                    if(key.matches("^((\\w+).?)+$")) {
                        keys.addObject(key);
                    }
                }
                cb.eo=eo; cb.displayPropertyKeys=keys; cb.nextPage=nextPage; cb.list=list;
                confirmPage.setConfirmDelegate(cb);
                confirmPage.setCancelDelegate(new ERDPageDelegate(nextPage));
                StringBuffer message=new StringBuffer("You are about to modify <b>"+list.count()+"</b> "+entityName+"(s) in the following manner:<br><br>");
                for (Enumeration e= keys.objectEnumerator(); e.hasMoreElements();) {
                    String key=(String)e.nextElement();
                    if(key.matches("((\\w+).?)+")) {
                        Object value=eo.valueForKey(key);
                        if (value!=null && (!(value instanceof String) || ((String)value).length()>0)) { // for text areas which return ""
                            message.append(key);
                            message.append("<br>");
                        }
                    }
                }
                message.append("<br><br>Are you sure you want to proceed?");               
                confirmPage.setMessage(message.toString());   
                result=(WOComponent)confirmPage;
            }
            return result;
        }
View Full Code Here

      if (shouldUseAjax()) {
        EOEditingContext ec = ERXEC.newEditingContext(object().editingContext());
        EOEnterpriseObject localObj = ERXEOControlUtilities.localInstanceOfObject(ec, object());
        d2wContext().takeValueForKey(localObj, Keys.objectPendingDeletion);
      } else {
        ConfirmPageInterface nextPage = (ConfirmPageInterface)D2W.factory().pageForConfigurationNamed((String)valueForBinding("confirmDeleteConfigurationName"), session());
        nextPage.setConfirmDelegate(new ERDDeletionDelegate(object(), dataSource(), context().page()));
        nextPage.setCancelDelegate(new ERDPageDelegate(context().page()));
        D2WPage d2wPage = ((D2WPage)nextPage);

        String message = ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObject("ERDTrashcan.confirmDeletionMessage", d2wContext());
        nextPage.setMessage(message);
        d2wPage.setObject(object());
        result = (WOActionResults)nextPage;
      }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.webobjects.directtoweb.ConfirmPageInterface

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.