Package com.webobjects.directtoweb

Examples of com.webobjects.directtoweb.D2WContext.valueForKey()


            D2WContext d2wContext = d2wContext();
            String propertyKey = propertyKeyFromDisplayGroupKey(key);
            d2wContext().setPropertyKey(propertyKey);

            if (null == value && !ERXValueUtilities.booleanValueWithDefault(d2wContext.valueForKey(ValidationKeys.AllowsEmptyQueryValue), true)) {
                throw ERXValidationFactory.defaultFactory().createCustomException(null, propertyKey, value, "QueryValueRequired");
            }

            EOAttribute attribute = null;
            if (ERXValueUtilities.booleanValue(d2wContext.valueForKey("isAttribute"))) {
View Full Code Here


            if (null == value && !ERXValueUtilities.booleanValueWithDefault(d2wContext.valueForKey(ValidationKeys.AllowsEmptyQueryValue), true)) {
                throw ERXValidationFactory.defaultFactory().createCustomException(null, propertyKey, value, "QueryValueRequired");
            }

            EOAttribute attribute = null;
            if (ERXValueUtilities.booleanValue(d2wContext.valueForKey("isAttribute"))) {
                attribute = d2wContext.attribute();
            } else {
                EORelationship relationship = d2wContext.relationship();
                if (relationship != null && !(value instanceof EOEnterpriseObject)) {
                    String keyWhenRelationship = (String)d2wContext.valueForKey("keyWhenRelationship");
View Full Code Here

            if (ERXValueUtilities.booleanValue(d2wContext.valueForKey("isAttribute"))) {
                attribute = d2wContext.attribute();
            } else {
                EORelationship relationship = d2wContext.relationship();
                if (relationship != null && !(value instanceof EOEnterpriseObject)) {
                    String keyWhenRelationship = (String)d2wContext.valueForKey("keyWhenRelationship");
                    if (keyWhenRelationship != null) {
                        EOEntity destinationEntity = relationship.destinationEntity();
                        attribute = destinationEntity.attributeNamed(keyWhenRelationship);
                    }
                }
View Full Code Here

    D2WContext d2w = (D2WContext) valueForBinding("d2wContext");

    StringBuilder sb = new StringBuilder();
    sb.append("Hint.");

    Object o = d2w.valueForKey("hint");
    if(ERXStringUtilities.stringIsNullOrEmpty(String.valueOf(o))) {
      sb.append("SampleText");
    } else {
      sb.append(String.valueOf(o));
    }   
View Full Code Here

    public Object sectionTitle() {
        D2WContext c=(D2WContext)valueForBinding("d2wContext");
        Object result=object();
        if (result!=null) {
            if (c!=null) {
                String k=(String)c.valueForKey("keyWhenGrouping");
                if (k!=null) {
                    result=NSKeyValueCodingAdditions.Utility.valueForKeyPath(result,k);
                }
                String templateString=(String)c.valueForKey("templateString");
                if (templateString!=null) {
View Full Code Here

            if (c!=null) {
                String k=(String)c.valueForKey("keyWhenGrouping");
                if (k!=null) {
                    result=NSKeyValueCodingAdditions.Utility.valueForKeyPath(result,k);
                }
                String templateString=(String)c.valueForKey("templateString");
                if (templateString!=null) {
                    result=ERXLocalizer.currentLocalizer().localizedTemplateStringForKeyWithObjectOtherObject(templateString, object(), c);
                }
            }
        }
View Full Code Here

            D2WContext d2wContext = d2wContext();
            for (Enumeration keysEnum = displayPropertyKeys().objectEnumerator(); keysEnum.hasMoreElements();) {
                String key = (String)keysEnum.nextElement();
                setPropertyKey(key);

                Object isMandatory = d2wContext.valueForKey("isMandatory");
                if (isMandatory != null && !ERXValueUtilities.booleanValue(isMandatory)) {
                    array.addObject(key);
                }
            }
            _nullablePropertyKeys = array;
View Full Code Here

        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
        NSArray dpk=(NSArray)editContext.valueForKey("displayPropertyKeys");
        cb.displayPropertyKeys=dpk;
        for (Enumeration e=dpk.objectEnumerator(); e.hasMoreElements();) {
            String key=(String)e.nextElement();
            if(key.matches("^((\\w+).?)+$")) {
                newEO.takeValueForKey(null,key);
View Full Code Here

    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));
    }
   
    public boolean canDeleteObject(EOEntity entity, EOEnterpriseObject eo, ERXRestContext context) {
        return booleanValueForKey("restCanDelete", null, eo);
    }
View Full Code Here

      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));
    }
   
    @Override
    public void setLocalContext(D2WContext aContext) {
      if (aContext != null)
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.