Exemplo n.º 1
0
  public String getParticipantsAsXML() {
    List<Participant> pList = sortFullParticipantListByName();

    StringBuilder xml = new StringBuilder("<participants>");
    for (Participant p : pList) xml.append(p.toXML());
    xml.append("</participants>");
    return xml.toString();
  }
Exemplo n.º 2
0
  public String getNonHumanCategoriesAsXML() {
    Set<NonHumanCategory> rList = new TreeSet<NonHumanCategory>(nonHumanCategoryMap.values());

    StringBuilder xml = new StringBuilder("<nonhumancategories>");
    for (NonHumanCategory r : rList) xml.append(r.toXML());
    xml.append("</nonhumancategories>");
    return xml.toString();
  }
Exemplo n.º 3
0
  public String getNonHumanResourcesAsXML() {
    Set<NonHumanResource> rList = new TreeSet<NonHumanResource>(nonHumanMap.values());

    StringBuilder xml = new StringBuilder("<nonhumanresources>");
    for (NonHumanResource r : rList) xml.append(r.toXML());
    xml.append("</nonhumanresources>");
    return xml.toString();
  }
Exemplo n.º 4
0
 // @return a csv listing of the full name of each role
 public String getRoleNames() {
   StringBuilder csvList = new StringBuilder();
   for (Role r : roleMap.values()) {
     if (csvList.length() > 0) csvList.append(",");
     csvList.append(r.getName());
   }
   return csvList.toString();
 }
Exemplo n.º 5
0
  public String getOrgGroupsAsXML() {
    ArrayList<OrgGroup> oList = new ArrayList<OrgGroup>(orgGroupMap.values());
    Collections.sort(oList);

    StringBuilder xml = new StringBuilder("<orggroups>");
    for (OrgGroup o : oList) xml.append(o.toXML());
    xml.append("</orggroups>");
    return xml.toString();
  }
Exemplo n.º 6
0
  public String getPositionsAsXML() {
    ArrayList<Position> pList = new ArrayList<Position>(positionMap.values());
    Collections.sort(pList);

    StringBuilder xml = new StringBuilder("<positions>");
    for (Position p : pList) xml.append(p.toXML());
    xml.append("</positions>");
    return xml.toString();
  }
Exemplo n.º 7
0
  public String getCapabilitiesAsXML() {
    ArrayList<Capability> cList = new ArrayList<Capability>(capabilityMap.values());
    Collections.sort(cList);

    StringBuilder xml = new StringBuilder("<capabilities>");
    for (Capability c : cList) xml.append(c.toXML());
    xml.append("</capabilities>");
    return xml.toString();
  }
Exemplo n.º 8
0
  public String getRolesAsXML() {
    ArrayList<Role> rList = new ArrayList<Role>(roleMap.values());
    Collections.sort(rList);

    StringBuilder xml = new StringBuilder("<roles>");
    for (Role r : rList) xml.append(r.toXML());
    xml.append("</roles>");
    return xml.toString();
  }
Exemplo n.º 9
0
 // @return a csv listing of the full name of each participant
 public String getParticipantNames() {
   List<Participant> pList = sortFullParticipantListByName();
   StringBuilder csvList = new StringBuilder();
   for (Participant p : pList) {
     if (csvList.length() > 0) csvList.append(",");
     csvList.append(p.getFullName());
   }
   return csvList.toString();
 }
Exemplo n.º 10
0
 public String getParticipantCapabilitiesAsXML(String pid) {
   Set<Capability> capSet = getParticipantCapabilities(pid);
   if (capSet != null) {
     String header = String.format("<capabilities participantid=\"%s\">", pid);
     StringBuilder xml = new StringBuilder(header);
     for (Capability c : capSet) xml.append(c.toXML());
     xml.append("</capabilities>");
     return xml.toString();
   } else return ("<capabilities/>");
 }
Exemplo n.º 11
0
 public String getParticipantPositionsAsXML(String pid) {
   Set<Position> posSet = getParticipantPositions(pid);
   if (posSet != null) {
     String header = String.format("<positions participantid=\"%s\">", pid);
     StringBuilder xml = new StringBuilder(header);
     for (Position p : posSet) xml.append(p.toXML());
     xml.append("</positions>");
     return xml.toString();
   } else return ("<positions/>");
 }
Exemplo n.º 12
0
 public String getParticipantRolesAsXML(String pid) {
   Set<Role> roles = getParticipantRoles(pid);
   if (roles != null) {
     String header = String.format("<roles participantid=\"%s\">", pid);
     StringBuilder xml = new StringBuilder(header);
     for (Role r : roles) xml.append(r.toXML());
     xml.append("</roles>");
     return xml.toString();
   } else return ("<roles/>");
 }
Exemplo n.º 13
0
  private String constructCyclicAttributeErrorMessage(
      List<String> chain, String type, String refName) {
    String templateMsg =
        "Cyclic Reference Error: The selected %s cannot %s to %s "
            + "'%s' because it references itself in the hierarchy '%s'.";
    String refType = (type.equals("position")) ? "report" : "belong";

    StringBuilder chainStr = new StringBuilder(chain.get(0));
    for (int i = 1; i < chain.size(); i++) {
      chainStr.append(" --> ").append(chain.get(i));
    }
    return String.format(templateMsg, type, refType, type, refName, chainStr.toString());
  }
Exemplo n.º 14
0
 public String getNonHumanSubCategoriesAsXML() {
   StringBuilder xml = new StringBuilder("<nonhumansubcategories>");
   for (NonHumanSubCategory n : getNonHumanSubCategories()) xml.append(n.toXML());
   xml.append("</nonhumansubcategories>");
   return xml.toString();
 }
Exemplo n.º 15
0
 private String participantSetToXML(Set<Participant> pSet, String header) {
   StringBuilder xml = new StringBuilder(header);
   for (Participant p : pSet) xml.append(p.toXML());
   xml.append("</participants>");
   return xml.toString();
 }