/** * Implementation of the {@link er.directtoweb.assignments.ERDComputingAssignmentInterface}. This array * of keys is used when constructing the * significant keys for the passed in keyPath. * @param keyPath to compute significant keys for. * @return array of context keys this assignment depends upon. */ @SuppressWarnings("rawtypes") public NSArray dependentKeys(String keyPath) { return (NSArray)keys.valueForKey(keyPath); }
public void _setHostInfo(NSDictionary _hostStats) { Object aValue = null; aValue = _hostStats.valueForKey("runningInstances"); if (aValue != null) runningInstances = aValue.toString(); aValue = _hostStats.valueForKey("operatingSystem"); if (aValue != null) operatingSystem = aValue.toString(); aValue = _hostStats.valueForKey("processorType"); if (aValue != null) processorType = aValue.toString(); }
/** * @return the name of the WOComponent to use to display the value from * currentColumn() */ public String columnComponentName() { String componentName = (String) currentColumn().valueForKey(COMPONENT_NAME); return componentName != null ? componentName : "WOString"; }
/** * @return the keyPath value from currentColumn() */ public String currentKeyPath() { return (String) currentColumn().valueForKey(KEY_PATH); }
public void _takeValueFromApplication(String valueName) { NSDictionary appValues = _application.values; values.takeValueForKey(appValues.valueForKey(valueName), valueName); }
protected int intStatisticsValueForKey(String key, int defaultValue) { NSDictionary aStatsDict = statistics(); if (aStatsDict != null) { try { String aValue = (String) aStatsDict.valueForKey(key); if (aValue != null) { return Integer.parseInt(aValue); } } catch (Throwable ex) { // do nothing } } return defaultValue; }
protected float floatStatisticsValueForKey(String key, float defaultValue) { NSDictionary aStatsDict = statistics(); if (aStatsDict != null) { try { String aValue = (String) aStatsDict.valueForKey(key); if (aValue != null) { return Float.parseFloat(aValue); } } catch (Throwable ex) { // do nothing } } return defaultValue; }
public static void verbosePrint(NSDictionary aDict) { Enumeration allKeys = aDict.keyEnumerator(); while (allKeys.hasMoreElements()) { String key = (String)allKeys.nextElement(); Object value = aDict.valueForKey(key); NSLog.debug.appendln("\tkey = " + key + "\t\tvalue = " + value + " (" + value.getClass().getName() + ")"); } } }
/** * @return the sortPath value from currentColumn() or currentKeyPath() if not found */ public String currentSortPath() { return currentColumn().valueForKey(SORT_PATH) == null ? currentKeyPath() : (String) currentColumn().valueForKey(SORT_PATH); }
public void _takePathFromApplication() { NSDictionary appValues = _application.values; MHost aHost = _host; if (aHost.osType().equals("UNIX")) { values.takeValueForKey(appValues.valueForKey("unixPath"), "path"); } else if (aHost.osType().equals("WINDOWS")) { values.takeValueForKey(appValues.valueForKey("winPath"), "path"); } else if (aHost.osType().equals("MACOSX")) { values.takeValueForKey(appValues.valueForKey("macPath"), "path"); } }
public String resourceFrameworkName() { String fn = (String)stylesheet().valueForKey("framework"); if (fn == null) { fn = ERXProperties.stringForKeyWithDefault("er.modern.look.skinframework", "app"); } return fn; }
public void setStatistics(NSDictionary newStatistics) { _statistics.takeValueForKey(MObject.validatedStats((String) newStatistics.valueForKey("transactions")), "transactions"); _statistics.takeValueForKey(MObject.validatedStats((String) newStatistics.valueForKey("activeSessions")), "activeSessions"); _statistics.takeValueForKey(MObject.validatedStats((String) newStatistics.valueForKey("avgTransactionTime")), "avgTransactionTime"); _statistics.takeValueForKey(MObject.validatedStats((String) newStatistics.valueForKey("averageIdlePeriod")), "averageIdlePeriod"); _statistics.takeValueForKey(MObject.validatedStats((String) newStatistics.valueForKey("startedAt")), "startedAt"); }
/** * The name of the stylsheet framework name. * <p> * Looks for a property named er.modern.look.skinframework (which should be supplied by * the skin framework, otherwise defaults to 'app' */ public String resourceFrameworkName() { String fn = (String)stylesheet().valueForKey("framework"); if (fn == null) { fn = ERXProperties.stringForKeyWithDefault("er.modern.look.skinframework", "app"); } return fn; } }
public boolean shouldShow() { NSDictionary permissions = (NSDictionary)session().valueForKey("permissions"); if (permissions!=null) { return ((Boolean)permissions.valueForKey((String)valueForBinding("key"))).booleanValue(); } return true; } }
public void _takeOutputPathFromApplication() { NSDictionary appValues = _application.values; MHost aHost = _host; if (aHost.osType().equals("UNIX")) { values.takeValueForKey(generateOutputPath((String) appValues.valueForKey("unixOutputPath")), "outputPath"); } else if (aHost.osType().equals("WINDOWS")) { values.takeValueForKey(generateOutputPath((String) appValues.valueForKey("winOutputPath")), "outputPath"); } else if (aHost.osType().equals("MACOSX")) { values.takeValueForKey(generateOutputPath((String) appValues.valueForKey("macOutputPath")), "outputPath"); } }
/** * Called when an {@link ERMDActionButton} changes the related object. */ @SuppressWarnings("unchecked") public void relatedObjectDidChange(NSNotification notif) { NSDictionary<String, Object>userInfo = notif.userInfo(); if (userInfo != null) { Object key = userInfo.valueForKey("propertyKey"); EOEnterpriseObject obj = (EOEnterpriseObject)userInfo.valueForKey("object"); if (propertyKey() != null && propertyKey().equals(key) && ERXEOControlUtilities.eoEquals(object(), obj)) { _currentSelection = null; } } }
public void _takePortFromApplication() { NSDictionary appValues = _application.values; MHost aHost = _host; Integer appPort = (Integer) appValues.valueForKey("startingPort"); if ((port() == null) || ((port() != null) && (port().intValue() < appPort.intValue()))) setPort(aHost.nextAvailablePort(appPort)); }
public static NSDictionary dictionaryForArchive(NSDictionary tempDict) { NSMutableDictionary newDict = new NSMutableDictionary(tempDict.count()); Enumeration allKeys = tempDict.keyEnumerator(); while (allKeys.hasMoreElements()) { String key = (String)allKeys.nextElement(); Object value = tempDict.valueForKey(key); if ((value instanceof String) && (((String)value).equals("true"))) { newDict.takeValueForKey("YES", key); } else if ((value instanceof String) && (((String)value).equals("false"))) { newDict.takeValueForKey("NO", key); } else { newDict.takeValueForKey(value, key); } } return newDict; }
public static NSDictionary dictionaryFromArchive(NSDictionary tempDict) { NSMutableDictionary newDict = new NSMutableDictionary(tempDict.count()); Enumeration allKeys = tempDict.keyEnumerator(); while (allKeys.hasMoreElements()) { String key = (String)allKeys.nextElement(); Object value = tempDict.valueForKey(key); if ((value instanceof String) && (((String)value).equals("YES"))) { newDict.takeValueForKey("true", key); } else if ((value instanceof String) && (((String)value).equals("NO"))) { newDict.takeValueForKey("false", key); } else { newDict.takeValueForKey(value, key); } } return newDict; }
/** * @param context * The d2wContext of the changed property level component * @return a list of property keys to be updated */ @SuppressWarnings("unchecked") public NSArray<String> propertyChanged(D2WContext context) { String prop = context.propertyKey(); NSArray<String> dependants = NSArray.EmptyArray; NSDictionary<String, NSArray<String>> propertyDependencies = PROPERTY_DEPENDENCIES .valueInObject(context); if (propertyDependencies.containsKey(prop)) { dependants = (NSArray<String>) propertyDependencies.valueForKey(prop); } return dependants; }