(activityName.equals(org.getActivityName())))) { showOrg = org;
(activityName.equals(orgActivity.getActivityName())))) { showOrg = orgActivity;
  public void execute(      PrintStream out,      HttpInput query_parameters,      PlanServiceContext psc,      PlanServiceUtilities psu) throws Exception   {System.out.println("begin oplan edit");    String URLname = null;    try {      int port = psc.getLocalPort();      String loc;       try {        loc = psc.getLocalAddress().getLocalHost().getHostAddress();      } catch (Exception e) {        System.err.println("UNABLE TO FIND HOST!");        loc = "UNKNOWN";      }      String base_url = "http://"+loc+":"+port+"/";      String clusterID =         psc.getServerPlugInSupport().getClusterIDAsString();      String cluster_url = base_url+"$"+clusterID;      String path = query_parameters.getGETUrlString();      if (path.endsWith("/")) {        path = path.substring(0, path.length()-1);      }      URLname = cluster_url+path;    } catch (Exception nourl) {      System.err.println("Unable to get PSP's URL: "+nourl);    }System.out.println("url: "+URLname);    // get the oplan and cdate    Oplan plan = PSPOplanUtilities.getOplan(psc);    if (plan == null) {      displayOPlanNotFound(out);      return;    }    Date cDate = plan.getCday();    try {      Vector orgID_Info =         query_parameters.getParameterTokens("ORGID",'=');      if ((orgID_Info != null) &&          (orgID_Info.size() != 0)) {System.out.println("is orgid");        // display orgActivity info        // take parameters        String orgID = null;        String activityType = null;        String activityName = null;        int n = orgID_Info.size();        if (n > 0) {          orgID = (String)orgID_Info.get(0);          if (n > 1) {            activityType = (String)orgID_Info.get(1);            if (n > 2) {              activityName = (String)orgID_Info.get(2);            }          }        }        // find matching orgAct in oplan        OrgActivity showOrg = null;        Enumeration org_activities = plan.getOrgActivities();        while (org_activities.hasMoreElements()) {          OrgActivity org = (OrgActivity)org_activities.nextElement();          if (((orgID == null) ||               orgID.equals(org.getOrgID())) &&               ((activityType == null) ||                activityType.equals(org.getActivityType())) &&              ((activityName == null) ||               (activityName.equals(org.getActivityName())))) {            showOrg = org;            break;          }        }        // display it        if (showOrg != null) {          displayOrgActivity(out, showOrg, cDate);        } else {          displayOrgNotFound(out, orgID, activityType, activityName);        }      } else {        Vector postOrgID_Info = query_parameters.getParameterTokens("POST",'=');        if ((postOrgID_Info != null) &&            (postOrgID_Info.size() != 0)) {System.out.println("is post");          // take post data          String postData = query_parameters.getBodyAsString();          String postOrgID = (String) postOrgID_Info.get(0);          String postActivityType = (String) postOrgID_Info.get(1);          // get list of orgActs with matching orgID          Vector orgActivityVector = new Vector();          Enumeration org_activities = plan.getOrgActivities();          while (org_activities.hasMoreElements()) {            OrgActivity org = (OrgActivity)org_activities.nextElement();            if (org.getOrgID().equals(postOrgID))              orgActivityVector.addElement(org);          }          // make array -- dumb?          OrgActivity[] orgActivityArray =            new OrgActivity[orgActivityVector.size()];          orgActivityVector.copyInto(orgActivityArray);          PlugInDelegate delegate = psc.getServerPlugInSupport().getDirectDelegate();          delegate.openTransaction();                    // post           if (doPost(orgActivityArray, cDate,                     postActivityType, postData)) {            delegate.publishChange(plan);            displayPostSuccess(out, URLname);          } else {            displayPostFailure(out, URLname);          }          delegate.closeTransaction();        } else {          System.out.println("is usage");          displayOPlanEdit(out, psc, URLname, plan, cDate);        }      }    } catch (Exception topLevelException) {      displayExceptionFailure(out, topLevelException);    }  }