public AjaxOptions(String name, NSDictionary<String, WOAssociation> bindings, WOElement children) { super(name, bindings, children); _associations = bindings.mutableClone(); _children = children; }
private NSDictionary optionsWithPrimaryKeySupportDiabled(NSDictionary options) { NSMutableDictionary mutableOptions = options.mutableClone(); mutableOptions.setObjectForKey("NO", EOSchemaGeneration.CreatePrimaryKeySupportKey); return mutableOptions.immutableClone(); }
public static NSDictionary removeDefaultOptions(NSDictionary options) { // PROTOTYPE OPTIONS NSMutableDictionary mutableOptions = options.mutableClone(); if ("'get'".equals(mutableOptions.objectForKey("method"))) { mutableOptions.removeObjectForKey("method"); } if ("true".equals(mutableOptions.objectForKey("evalScripts"))) { mutableOptions.removeObjectForKey("evalScripts"); } if ("true".equals(mutableOptions.objectForKey("asynchronous"))) { mutableOptions.removeObjectForKey("asynchronous"); } return mutableOptions; }
/** * Creates a new {@link IndexAttribute} and adds it to the attributes dictionary of this Index * * @param propertyName * @param propertyDefinition * @return the new {@link IndexAttribute} */ protected IndexAttribute createAttribute(String propertyName, NSDictionary propertyDefinition) { IndexAttribute attribute = new IndexAttribute(this, propertyName, propertyDefinition); NSMutableDictionary attributes = _attributes.mutableClone(); attributes.setObjectForKey(attribute, propertyName); _attributes = attributes.immutableClone(); return attribute; }
/** * @param key the name of the index * @param indexDef the dictionary containing the index definition (usually deserialized from the indexModel file) */ private void addIndex(String key, NSDictionary indexDef) { // Classname for the class that will create the lucene index String className = (String) indexDef.objectForKey("index"); NSMutableDictionary dict = indexDef.mutableClone(); // If index store not defined, default to index named the dsame as the indexModel file in the indexRoot directory if(!dict.containsKey("store")) { try { dict.setObjectForKey(new File(indexRoot(), key).toURI().toURL().toString(), "store"); } catch (MalformedURLException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } // Create the class that will create the index. Defaults to ERAutoIndex ERIndex index; if (className != null) { Class c = ERXPatcher.classForName(className); index = (ERIndex) _NSUtilities.instantiateObject(c, new Class[] { String.class, NSDictionary.class }, new Object[] { key, dict }, true, false); } else { index = new ERAutoIndex(key, dict); } // Add the index addIndex(key, index); }
@Override public void appendToResponse(WOResponse response, WOContext context) { response.appendContentCharacter('{'); NSMutableDictionary options = _associations; WOAssociation optionsBinding = _associations.objectForKey("options"); if (optionsBinding != null) { NSDictionary passedInOptions = (NSDictionary) optionsBinding.valueInComponent(context.component()); if (passedInOptions != null) { options = passedInOptions.mutableClone(); options.addEntriesFromDictionary(_associations); } } AjaxOptions._appendToResponse(options, response, context); if (_children != null) { _children.appendToResponse(response, context); } response.appendContentCharacter('}'); }
public void _initIvars() { statsDict = WOApplication.application().statistics(); pagesDict = (NSDictionary)statsDict.objectForKey("Pages"); directActionsDict = (NSDictionary)statsDict.objectForKey("DirectActions"); detailsDict = (NSDictionary)statsDict.objectForKey("Details"); transactions = (NSDictionary)statsDict.objectForKey("Transactions"); memoryDict = (NSDictionary)statsDict.objectForKey("Memory"); sessionsDict = ((NSDictionary)statsDict.objectForKey("Sessions")).mutableClone(); sessionMemoryDict = new NSDictionary((Map)sessionsDict.removeObjectForKey("Avg. Memory Per Session"), true); sessionStats = (NSArray)sessionsDict.removeObjectForKey("Last Session's Statistics"); maxSessionsDate = (NSTimestamp) sessionsDict.removeObjectForKey("Peak Active Sessions Date"); maxPageCount = 0; maxActionCount = 0; maxPageCount = _maxServedForDictionary(pagesDict); maxActionCount = _maxServedForDictionary(directActionsDict); }
NSMutableDictionary userInfo = entity.userInfo().mutableClone(); userInfo.setObjectForKey(Boolean.TRUE, ERTaggableEntity.ERTAGGABLE_KEY); userInfo.setObjectForKey(tagsRelationship.name(), ERTaggableEntity.ERTAGGABLE_TAG_RELATIONSHIP_KEY);