Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.D2WContext


   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here


   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here

                exception = e;
            }
            if(exception != null) {
                if (exception instanceof ERXValidationException) {
                    ERXValidationException ex = (ERXValidationException) exception;
                    D2WContext context = d2wContext();
                    Object o = ex.object();

                    if (o instanceof EOEnterpriseObject) {
                        EOEnterpriseObject eo = (EOEnterpriseObject) o;
                        context.takeValueForKey(eo.entityName(), "entityName");
                        context.takeValueForKey(ex.propertyKey(), "propertyKey");
                    }
                    ((ERXValidationException) exception).setContext(context);
                   
                    log.info("Validation Exception: " + exception + exception.getMessage());
                    editingContext.revert();
View Full Code Here

            if(entityName == null)
                throw new IllegalStateException("entityName or d2wContext can't both be null.");
            qpi = D2W.factory().queryPageForEntityNamed(entityName, session());
        }
        qpi.setNextPageDelegate(new _FilterDelegate(context().page(), displayGroup()));
        D2WContext d2wContext = (D2WContext)((WOComponent)qpi).valueForKey("d2wContext");
        d2wContext.takeValueForKey("filter", "subTask");
        return (WOComponent)qpi;
    }
View Full Code Here

    /**
     * @return the threads d2w context
     */
    public static D2WContext d2wContext() {
        D2WContext result = (D2WContext) ERXThreadStorage.valueForKey("ERD2Rest.d2wContext");
        if(result == null) {
            result = ERD2WContext.newContext();
            ERXThreadStorage.takeValueForKey(result, "ERD2Rest.d2wContext");
        }
        return result;
View Full Code Here

   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W in embedded configs
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here

import er.rest.entityDelegates.IERXRestSecurityDelegate;

public class ERD2RestDefaultSecurityDelegate implements IERXRestSecurityDelegate {

    protected boolean booleanValueForKey(String key, String propertyKey, EOEnterpriseObject eo) {
        D2WContext context = ERDirectToRest.d2wContext();
        context.setPropertyKey(propertyKey);
        context.takeValueForKey(eo, "object");
        return ERXValueUtilities.booleanValue(context.valueForKey(key));
    }
View Full Code Here

                exception = e;
            }
            if(exception != null) {
                if (exception instanceof ERXValidationException) {
                    ERXValidationException ex = (ERXValidationException) exception;
                    D2WContext context = d2wContext();
                    Object o = ex.object();

                    if (o instanceof EOEnterpriseObject) {
                        EOEnterpriseObject eo = (EOEnterpriseObject) o;
                        context.takeValueForKey(eo.entityName(), "entityName");
                        context.takeValueForKey(ex.propertyKey(), "propertyKey");
                    }
                    ((ERXValidationException) exception).setContext(context);
                   
                    log.info("Validation Exception: " + exception + exception.getMessage());
                    editingContext.revert();
View Full Code Here

   
    /*
     * Using same mechanism as EditRelationship page to opt-in for the New... button
     */
    public boolean isEntityEditable() {
      D2WContext subContext = new D2WContext(session());
      EOEntity destinationEntity = EOModelGroup.defaultGroup().entityNamed(destinationEntityName());
      subContext.setEntity(destinationEntity);
      subContext.setTask("editRelationship");
     
      return ERXValueUtilities.booleanValueWithDefault(subContext.valueForKey("isEntityEditable"), !super.isEntityReadOnly(destinationEntity));
    }
View Full Code Here

   * Gives each property its own d2wContext rather than sharing one
   * Necessary for ajax or dyanmic D2W
   */
  @Override
  public void setPropertyKey(String propertyKey) {
    _subContext = new D2WContext(d2wContext());
    _subContext.takeValueForKey(propertyKey, "propertyKey");
  }
View Full Code Here

TOP

Related Classes of com.webobjects.directtoweb.D2WContext

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.