Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSDictionary


    public void getHostStatusForHosts(NSArray<MHost> hostArray) {
        WOResponse[] responses = sendQueryToWotaskds("HOST", hostArray);

        NSMutableArray errorArray = new NSMutableArray();
        NSDictionary responseDict = null;
        for (int i = 0; i < responses.length; i++) {
            MHost aHost = siteConfig().hostArray().objectAtIndex(i);

            if ((responses[i] == null) || (responses[i].content() == null)) {
                responseDict = emptyResponse;
            } else {
                try {
                    responseDict = (NSDictionary) new _JavaMonitorDecoder().decodeRootObject(responses[i].content());
                } catch (WOXMLException wxe) {
                    NSLog.err.appendln("MonitorComponent pageWithName(HostsPage) Error decoding response: "
                            + responses[i].contentString());
                    responseDict = responseParsingFailed;
                }
            }
            getGlobalErrorFromResponse(responseDict, errorArray);

            NSDictionary queryResponse = (NSDictionary) responseDict.valueForKey("queryWotaskdResponse");
            if (queryResponse != null) {
                NSDictionary hostResponse = (NSDictionary) queryResponse.valueForKey("hostResponse");
                aHost._setHostInfo(hostResponse);
                aHost.isAvailable = true;
            } else {
                aHost.isAvailable = false;
            }
View Full Code Here


    public void getApplicationStatusForHosts(NSArray<MHost> hostArray) {

        WOResponse[] responses = sendQueryToWotaskds("APPLICATION", hostArray);

        NSMutableArray errorArray = new NSMutableArray();
        NSDictionary applicationResponseDictionary;
        NSDictionary queryResponseDictionary;
        NSArray responseArray = null;
        NSDictionary responseDictionary = null;
        for (int i = 0; i < responses.length; i++) {
            if ((responses[i] == null) || (responses[i].content() == null)) {
                queryResponseDictionary = emptyResponse;
            } else {
                try {
                    queryResponseDictionary = (NSDictionary) new _JavaMonitorDecoder().decodeRootObject(responses[i]
                            .content());
                } catch (WOXMLException wxe) {
                    NSLog.err.appendln("MonitorComponent pageWithName(ApplicationsPage) Error decoding response: "
                            + responses[i].contentString());
                    queryResponseDictionary = responseParsingFailed;
                }
            }
            getGlobalErrorFromResponse(queryResponseDictionary, errorArray);

            applicationResponseDictionary = (NSDictionary) queryResponseDictionary.valueForKey("queryWotaskdResponse");
            if (applicationResponseDictionary != null) {
                responseArray = (NSArray) applicationResponseDictionary.valueForKey("applicationResponse");
                if (responseArray != null) {
                    for (int j = 0; j < responseArray.count(); j++) {
                        responseDictionary = (NSDictionary) responseArray.objectAtIndex(j);
                        String appName = (String) responseDictionary.valueForKey("name");
                        Integer runningInstances = (Integer) responseDictionary.valueForKey("runningInstances");
                        MApplication anApplication = siteConfig().applicationWithName(appName);
                        if (anApplication != null) {
                            anApplication.setRunningInstancesCount(anApplication.runningInstancesCount() + runningInstances.intValue());
                        }
                    }
View Full Code Here

        if (fault.faultHandler() instanceof EOAccessArrayFaultHandler) {
            EOAccessArrayFaultHandler handler = (EOAccessArrayFaultHandler) fault.faultHandler();
            EOKeyGlobalID sourceGid = handler.sourceGlobalID();
            EOEditingContext ec = handler.editingContext();
            synchronized (cache) {
                NSDictionary entries = relationshipCacheEntriesForEntity(sourceGid.entityName(), handler.relationshipName());
                if(entries != null) {
                    NSArray gids = (NSArray) entries.objectForKey(sourceGid);
                    if(gids != null) {
                        NSMutableArray eos = new NSMutableArray(gids.count());
                        for (Enumeration enumerator = gids.objectEnumerator(); enumerator.hasMoreElements();) {
                            EOGlobalID gid = (EOGlobalID) enumerator.nextElement();
                            EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
View Full Code Here

    _url = (String) valueForBinding("href", component);
    if(_url == null) {
      String directActionName = stringValueForBinding("directActionName", component);

      if(directActionName != null) {
        NSDictionary queryDictionary = (NSDictionary)valueForBinding("queryDictionary", component);
        boolean secure = booleanValueForBinding("secure", ERXRequest.isRequestSecure(context.request()), component);
        if(secure) {
          boolean generatingCompleteURLs = context.doesGenerateCompleteURLs();
          if(!generatingCompleteURLs) {
            context.generateCompleteURLs();
View Full Code Here

  static public NSDictionary fileListForStartingPathHost(String aString, MHost aHost, boolean showFiles)
  throws MonitorException {
    if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))
      NSLog.debug.appendln("!@#$!@#$ fileListForStartingPathHost creates a WOHTTPConnection");
    NSDictionary aFileListDictionary = null;
    try {
      Application theApplication = (Application) WOApplication.application();
      WOHTTPConnection anHTTPConnection = new WOHTTPConnection(aHost.name(), theApplication.lifebeatDestinationPort());
      @SuppressWarnings("cast")
      NSMutableDictionary<String, NSMutableArray<String>> aHeadersDict = (NSMutableDictionary<String, NSMutableArray<String>>) WOTaskdHandler.siteConfig().passwordDictionary().mutableClone();
View Full Code Here

        return currentSectionKeys().count();
    }

    /** Should return an array of arrays denoting actions */
    public NSDictionary actions() {
        NSDictionary actions = (NSDictionary)valueForBinding("actions");
        return actions == null ? NO_ACTIONS : actions;
    }
View Full Code Here

    return _formTargetJavaScriptUrl;
  }

  public String targetString() {
    String result = "";
    NSDictionary targetDictionary = (NSDictionary) d2wContext().valueForKey("targetDictionary");
    if (targetDictionary != null) {
      StringBuilder buffer = new StringBuilder();
      buffer.append(targetDictionary.valueForKey("targetName") != null ? targetDictionary.valueForKey("targetName") : "foobar");
      buffer.append(":width=");
      buffer.append(targetDictionary.valueForKey("width") != null ? targetDictionary.valueForKey("width") : "{window.screen.width/2}");
      buffer.append(", height=");
      buffer.append(targetDictionary.valueForKey("height") != null ? targetDictionary.valueForKey("height") : "{myHeight}");
      buffer.append(',');
      buffer.append((targetDictionary.valueForKey("scrollbars") != null && targetDictionary.valueForKey("scrollbars") == "NO") ? " " : "scrollbars");
      buffer.append(", {(isResizable)?'resizable':''}, status");
      result = buffer.toString();
    } else {
      result = "foobar:width={window.screen.width/2}, height={myHeight}, scrollbars, {(isResizable)?'resizable':''}, status";
    }
View Full Code Here

      }
    }
    // HACK: ak these methods are protected, so we call them via KVC
    if (dbOp.databaseOperator() == 2 && ((Boolean) NSKeyValueCoding.Utility.valueForKey(entity, "_hasNonUpdateableAttributes")).booleanValue()) {
      NSArray keys = (NSArray) NSKeyValueCoding.Utility.valueForKey(entity, "dbSnapshotKeys");
      NSDictionary dbSnapshot = dbOp.dbSnapshot();
      NSDictionary newRow = dbOp.newRow();
      for (int i = keys.count() - 1; i >= 0; i--) {
        String key = (String) keys.objectAtIndex(i);
        EOAttribute att = entity.attributeNamed(key);
        // FIX: ak when you have single-table inheritance and in the
        // child there are foreign keys that are not in the parent
        // THEN, if the entity _hasNonUpdateableAttributes (public PK or
        // read only props) the DB op is checked
        // against the attributes. BUT this dictionary has all entries,
        // even from the child (most likely NULL values)
        // and the current implementation doesn't check against the case
        // when the attribute isn't present in the first place.
        // SO we add this check and live happily ever after
        if (att != null && att._isNonUpdateable() && !dbSnapshot.objectForKey(key).equals(newRow.objectForKey(key))) {
          if (att.isReadOnly()) {
            throw new IllegalStateException("cannot update read-only key '" + key + "' on object:" + dbOp.object() + " of entity: " + entity.name() + " in databaseContext " + this);
          }
          throw new IllegalStateException("cannot update primary-key '" + key + "' from '" + dbSnapshot.objectForKey(key) + "' to '" + newRow.objectForKey(key) + "' on object:" + dbOp.object() + " of entity: " + entity.name() + " in databaseContext " + this);
        }
      }

    }
  }
View Full Code Here

            handler.startReading();
            try {
                NSMutableArray stats = new NSMutableArray();
                for (MApplication app : siteConfig().applicationArray()) {
                    handler.getInstanceStatusForHosts(app.hostArray());
                    NSDictionary appStats = historyEntry(app);
                    stats.addObject(appStats);
                }
                response.appendContentString(NSPropertyListSerialization.stringFromPropertyList(stats));
            } finally {
                handler.endReading();
View Full Code Here

                                // value =
                                // ec.arrayFaultWithSourceGlobalID(sourceGlobalID,
                                // rel.name(), ec);
                                EOFetchSpecification fs = new EOFetchSpecification(rel.destinationEntity().name(), null, null);
                                NSMutableArray<EOQualifier> qualifiers = new NSMutableArray(rel.joins().count());
                                NSDictionary pk = source.primaryKeyForGlobalID(sourceGlobalID);
                                for (Iterator iterator = rel.joins().iterator(); iterator.hasNext();) {
                                    EOJoin join = (EOJoin) iterator.next();
                                    Object pkValue = pk.objectForKey(join.sourceAttribute().name());
                                    EOKeyValueQualifier qualifier = new EOKeyValueQualifier(join.destinationAttribute().name(), EOQualifier.QualifierOperatorEqual, pkValue);
                                    qualifiers.addObject(qualifier);
                                }
                                fs.setQualifier(qualifiers.count() == 1 ? qualifiers.lastObject() : new EOAndQualifier(qualifiers));
                                value = ec.objectsWithFetchSpecification(fs);
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSDictionary

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.