Program: 52581
Project: 52581
Buggy source:
protected void doDSPost(Context c,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String button=UIUtil.getSubmitButton(request,"String_Node_Str");
  if (button.equals("String_Node_Str")) {
    Collection[] collections=Collection.findAll(c);
    request.setAttribute("String_Node_Str",collections);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community[] communities=Community.findAll(c);
    request.setAttribute("String_Node_Str",communities);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection[] collections=Collection.findAll(c);
    Group[] groups=Group.findAll(c,Group.NAME);
    request.setAttribute("String_Node_Str",collections);
    request.setAttribute("String_Node_Str",groups);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=null;
    int item_id=UIUtil.getIntParameter(request,"String_Node_Str");
    String handle=request.getParameter("String_Node_Str");
    if (item_id > 0) {
      item=Item.find(c,item_id);
    }
 else     if (handle != null && !handle.equals("String_Node_Str")) {
      DSpaceObject dso=HandleManager.resolveToObject(c,handle);
      if (dso != null && dso.getType() != Constants.ITEM) {
        item=(Item)dso;
      }
    }
    if (item == null) {
      request.setAttribute("String_Node_Str",new Boolean(true));
      JSPManager.showJSP(request,response,"String_Node_Str");
    }
 else {
      List item_policies=AuthorizeManager.getPolicies(c,item);
      request.setAttribute("String_Node_Str",item);
      request.setAttribute("String_Node_Str",item_policies);
      JSPManager.showJSP(request,response,"String_Node_Str");
    }
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=Item.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(item);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + item.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + item.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=Item.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",item);
    List item_policies=AuthorizeManager.getPolicies(c,item);
    request.setAttribute("String_Node_Str",item_policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(collection);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community target=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    List policies=AuthorizeManager.getPolicies(c,target);
    request.setAttribute("String_Node_Str",target);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",collection);
    List policies=AuthorizeManager.getPolicies(c,collection);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",community);
    List policies=AuthorizeManager.getPolicies(c,community);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    ResourcePolicy policy=null;
    if (policy_id == -1) {
      policy=ResourcePolicy.create(c);
      policy.setResource(collection);
      policy.update();
    }
 else {
      policy=ResourcePolicy.find(c,policy_id);
    }
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    ResourcePolicy policy=null;
    if (policy_id == -1) {
      policy=ResourcePolicy.create(c);
      policy.setResource(community);
      policy.update();
    }
 else {
      policy=ResourcePolicy.find(c,policy_id);
    }
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(collection);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(community);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int action_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int group_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int community_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int item_id=UIUtil.getIntParameter(request,"String_Node_Str");
    Item item=null;
    Collection collection=null;
    Community community=null;
    String display_page=null;
    ResourcePolicy policy=ResourcePolicy.find(c,policy_id);
    Group group=Group.find(c,group_id);
    if (collection_id != -1) {
      collection=Collection.find(c,collection_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      if (action_id == Constants.READ) {
        List rps=AuthorizeManager.getPoliciesActionFilter(c,collection,Constants.READ);
        Bitstream bs=collection.getLogo();
        if (bs != null) {
          AuthorizeManager.removeAllPolicies(c,bs);
          AuthorizeManager.addPolicies(c,rps,bs);
        }
      }
      request.setAttribute("String_Node_Str",collection);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,collection));
      display_page="String_Node_Str";
    }
 else     if (community_id != -1) {
      community=Community.find(c,community_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      if (action_id == Constants.READ) {
        List rps=AuthorizeManager.getPoliciesActionFilter(c,community,Constants.READ);
        Bitstream bs=community.getLogo();
        if (bs != null) {
          AuthorizeManager.removeAllPolicies(c,bs);
          AuthorizeManager.addPolicies(c,rps,bs);
        }
      }
      request.setAttribute("String_Node_Str",community);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,community));
      display_page="String_Node_Str";
    }
 else     if (item_id != -1) {
      item=Item.find(c,item_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      request.setAttribute("String_Node_Str",item);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,item));
      display_page="String_Node_Str";
    }
    JSPManager.showJSP(request,response,display_page);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int community_id=UIUtil.getIntParameter(request,"String_Node_Str");
    String display_page=null;
    if (collection_id != -1) {
      Collection t=Collection.find(c,collection_id);
      request.setAttribute("String_Node_Str",t);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,t));
      display_page="String_Node_Str";
    }
 else     if (community_id != -1) {
      Community t=Community.find(c,community_id);
      request.setAttribute("String_Node_Str",t);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,t));
      display_page="String_Node_Str";
    }
    JSPManager.showJSP(request,response,display_page);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int resource_type=UIUtil.getIntParameter(request,"String_Node_Str");
    PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,resource_type,0,0,false,true);
    if (resource_type == Constants.BITSTREAM) {
      PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,Constants.BUNDLE,0,0,false,true);
    }
    showMainPage(c,request,response);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int resource_type=UIUtil.getIntParameter(request,"String_Node_Str");
    int action_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int group_id=UIUtil.getIntParameter(request,"String_Node_Str");
    PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,resource_type,action_id,group_id,false,false);
    if (resource_type == Constants.BITSTREAM) {
      PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,Constants.BUNDLE,action_id,group_id,false,false);
    }
    showMainPage(c,request,response);
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    List policies=AuthorizeManager.getPolicies(c,collection);
    request.setAttribute("String_Node_Str",collection);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    showMainPage(c,request,response);
  }
  c.complete();
}

Fixed version (ground truth):
protected void doDSPost(Context c,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String button=UIUtil.getSubmitButton(request,"String_Node_Str");
  if (button.equals("String_Node_Str")) {
    Collection[] collections=Collection.findAll(c);
    request.setAttribute("String_Node_Str",collections);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community[] communities=Community.findAll(c);
    request.setAttribute("String_Node_Str",communities);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection[] collections=Collection.findAll(c);
    Group[] groups=Group.findAll(c,Group.NAME);
    request.setAttribute("String_Node_Str",collections);
    request.setAttribute("String_Node_Str",groups);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=null;
    int item_id=UIUtil.getIntParameter(request,"String_Node_Str");
    String handle=request.getParameter("String_Node_Str");
    if (item_id > 0) {
      item=Item.find(c,item_id);
    }
 else     if (handle != null && !handle.equals("String_Node_Str")) {
      DSpaceObject dso=HandleManager.resolveToObject(c,handle);
      if (dso != null && dso.getType() == Constants.ITEM) {
        item=(Item)dso;
      }
    }
    if (item == null) {
      request.setAttribute("String_Node_Str",new Boolean(true));
      JSPManager.showJSP(request,response,"String_Node_Str");
    }
 else {
      List item_policies=AuthorizeManager.getPolicies(c,item);
      request.setAttribute("String_Node_Str",item);
      request.setAttribute("String_Node_Str",item_policies);
      JSPManager.showJSP(request,response,"String_Node_Str");
    }
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=Item.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(item);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + item.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + item.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Item item=Item.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",item);
    List item_policies=AuthorizeManager.getPolicies(c,item);
    request.setAttribute("String_Node_Str",item_policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(collection);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community target=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    List policies=AuthorizeManager.getPolicies(c,target);
    request.setAttribute("String_Node_Str",target);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",collection);
    List policies=AuthorizeManager.getPolicies(c,collection);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    policy.delete();
    request.setAttribute("String_Node_Str",community);
    List policies=AuthorizeManager.getPolicies(c,community);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    ResourcePolicy policy=null;
    if (policy_id == -1) {
      policy=ResourcePolicy.create(c);
      policy.setResource(collection);
      policy.update();
    }
 else {
      policy=ResourcePolicy.find(c,policy_id);
    }
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    ResourcePolicy policy=null;
    if (policy_id == -1) {
      policy=ResourcePolicy.create(c);
      policy.setResource(community);
      policy.update();
    }
 else {
      policy=ResourcePolicy.find(c,policy_id);
    }
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(collection);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + collection.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    Community community=Community.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    ResourcePolicy policy=ResourcePolicy.create(c);
    policy.setResource(community);
    policy.update();
    Group[] groups=Group.findAll(c,Group.NAME);
    EPerson[] epeople=EPerson.findAll(c,EPerson.EMAIL);
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    request.setAttribute("String_Node_Str",policy);
    request.setAttribute("String_Node_Str",groups);
    request.setAttribute("String_Node_Str",epeople);
    request.setAttribute("String_Node_Str","String_Node_Str");
    request.setAttribute("String_Node_Str","String_Node_Str" + community.getID());
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else   if (button.equals("String_Node_Str")) {
    int policy_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int action_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int group_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int community_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int item_id=UIUtil.getIntParameter(request,"String_Node_Str");
    Item item=null;
    Collection collection=null;
    Community community=null;
    String display_page=null;
    ResourcePolicy policy=ResourcePolicy.find(c,policy_id);
    Group group=Group.find(c,group_id);
    if (collection_id != -1) {
      collection=Collection.find(c,collection_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      if (action_id == Constants.READ) {
        List rps=AuthorizeManager.getPoliciesActionFilter(c,collection,Constants.READ);
        Bitstream bs=collection.getLogo();
        if (bs != null) {
          AuthorizeManager.removeAllPolicies(c,bs);
          AuthorizeManager.addPolicies(c,rps,bs);
        }
      }
      request.setAttribute("String_Node_Str",collection);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,collection));
      display_page="String_Node_Str";
    }
 else     if (community_id != -1) {
      community=Community.find(c,community_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      if (action_id == Constants.READ) {
        List rps=AuthorizeManager.getPoliciesActionFilter(c,community,Constants.READ);
        Bitstream bs=community.getLogo();
        if (bs != null) {
          AuthorizeManager.removeAllPolicies(c,bs);
          AuthorizeManager.addPolicies(c,rps,bs);
        }
      }
      request.setAttribute("String_Node_Str",community);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,community));
      display_page="String_Node_Str";
    }
 else     if (item_id != -1) {
      item=Item.find(c,item_id);
      policy.setAction(action_id);
      policy.setGroup(group);
      policy.update();
      request.setAttribute("String_Node_Str",item);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,item));
      display_page="String_Node_Str";
    }
    JSPManager.showJSP(request,response,display_page);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int community_id=UIUtil.getIntParameter(request,"String_Node_Str");
    String display_page=null;
    if (collection_id != -1) {
      Collection t=Collection.find(c,collection_id);
      request.setAttribute("String_Node_Str",t);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,t));
      display_page="String_Node_Str";
    }
 else     if (community_id != -1) {
      Community t=Community.find(c,community_id);
      request.setAttribute("String_Node_Str",t);
      request.setAttribute("String_Node_Str",AuthorizeManager.getPolicies(c,t));
      display_page="String_Node_Str";
    }
    JSPManager.showJSP(request,response,display_page);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int resource_type=UIUtil.getIntParameter(request,"String_Node_Str");
    PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,resource_type,0,0,false,true);
    if (resource_type == Constants.BITSTREAM) {
      PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,Constants.BUNDLE,0,0,false,true);
    }
    showMainPage(c,request,response);
  }
 else   if (button.equals("String_Node_Str")) {
    int collection_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int resource_type=UIUtil.getIntParameter(request,"String_Node_Str");
    int action_id=UIUtil.getIntParameter(request,"String_Node_Str");
    int group_id=UIUtil.getIntParameter(request,"String_Node_Str");
    PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,resource_type,action_id,group_id,false,false);
    if (resource_type == Constants.BITSTREAM) {
      PolicySet.setPolicies(c,Constants.COLLECTION,collection_id,Constants.BUNDLE,action_id,group_id,false,false);
    }
    showMainPage(c,request,response);
  }
 else   if (button.equals("String_Node_Str")) {
    Collection collection=Collection.find(c,UIUtil.getIntParameter(request,"String_Node_Str"));
    List policies=AuthorizeManager.getPolicies(c,collection);
    request.setAttribute("String_Node_Str",collection);
    request.setAttribute("String_Node_Str",policies);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    showMainPage(c,request,response);
  }
  c.complete();
}