Example #1
0
 public Map<String, String> getRoleIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (Role r : getRoles()) {
     idMap.put(r.getID(), r.getName());
   }
   return idMap;
 }
Example #2
0
 public Map<String, String> getOrgGroupIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (OrgGroup o : getOrgGroups()) {
     idMap.put(o.getID(), o.getGroupName());
   }
   return idMap;
 }
Example #3
0
 public Map<String, String> getNonHumanCategoryIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (NonHumanCategory r : getNonHumanCategories()) {
     idMap.put(r.getID(), r.getName());
   }
   return idMap;
 }
Example #4
0
 public Map<String, String> getNonHumanResourceIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (NonHumanResource r : getNonHumanResources()) {
     idMap.put(r.getID(), r.getName());
   }
   return idMap;
 }
Example #5
0
 private void initUnitMaps(DataSource source) {
   long now = System.currentTimeMillis();
   for (ResUnit unit : ResUnit.values()) {
     _sources.put(unit, source);
     _changeStamp.put(unit, now);
   }
 }
Example #6
0
 public Map<String, String> getPositionIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (Position p : getPositions()) {
     idMap.put(p.getID(), p.getTitle());
   }
   return idMap;
 }
Example #7
0
 public Map<String, String> getCapabilityIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (Capability c : getCapabilities()) {
     idMap.put(c.getID(), c.getCapability());
   }
   return idMap;
 }
Example #8
0
 public String getNonHumanResourceNames() {
   XNode node = new XNode("nonHumanResourceNames");
   for (NonHumanResource r : nonHumanMap.values()) {
     node.addChild("name", r.getName());
   }
   return node.toString();
 }
Example #9
0
 public Set<NonHumanSubCategory> getNonHumanSubCategories() {
   Set<NonHumanSubCategory> set = new HashSet<NonHumanSubCategory>();
   for (NonHumanCategory c : nonHumanCategoryMap.values()) {
     set.addAll(c.getSubCategories());
   }
   return set;
 }
Example #10
0
 public long getLastChangeStamp() {
   long lastChange = 0;
   for (Long stamp : _changeStamp.values()) {
     if (stamp > lastChange) lastChange = stamp;
   }
   return lastChange;
 }
Example #11
0
 public Set<Participant> getOrgGroupMembers(OrgGroup o) {
   Set<Participant> result = new HashSet<Participant>();
   for (Participant p : participantMap.values()) {
     if (p.isOrgGroupMember(o)) result.add(p);
   }
   return result;
 }
Example #12
0
 public String getNonHumanCategoryNames() {
   XNode node = new XNode("nonHumanCategoryNames");
   for (NonHumanCategory r : nonHumanCategoryMap.values()) {
     node.addChild("name", r.getName());
   }
   return node.toString();
 }
Example #13
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();
  }
Example #14
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();
  }
Example #15
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();
 }
Example #16
0
 public Capability getCapabilityByLabel(String label) {
   for (Capability c : capabilityMap.values()) {
     if (c.getCapability().equals(label)) {
       return c;
     }
   }
   return null;
 }
Example #17
0
 public Position getPositionByLabel(String label) {
   for (Position p : positionMap.values()) {
     if (p.getTitle().equals(label)) {
       return p;
     }
   }
   return null;
 }
Example #18
0
 public OrgGroup getOrgGroupByLabel(String label) {
   for (OrgGroup o : orgGroupMap.values()) {
     if (o.getGroupName().equals(label)) {
       return o;
     }
   }
   return null;
 }
Example #19
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();
  }
Example #20
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();
  }
Example #21
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();
  }
Example #22
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();
  }
Example #23
0
 public String getNonHumanCategorySet() {
   XNode node = new XNode("nonHumanCategorySet");
   for (NonHumanCategory category : nonHumanCategoryMap.values()) {
     XNode categoryNode = node.addChild("category");
     categoryNode.addAttribute("name", category.getName());
     for (String subcategory : category.getSubCategoryNames()) {
       categoryNode.addChild("subcategory", subcategory);
     }
   }
   return node.toString();
 }
Example #24
0
 public Map<String, String> getParticipantIdentifiers(Identifier idType) {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (Participant p : getParticipants()) {
     String nameValue;
     switch (idType) {
       case FullName:
         nameValue = p.getFullName();
         break;
       case ReverseFullName:
         nameValue = p.getLastName() + ", " + p.getFirstName();
         break;
       case LastName:
         nameValue = p.getLastName();
         break;
       default:
         nameValue = p.getUserID();
     }
     idMap.put(p.getID(), nameValue);
   }
   return idMap;
 }
Example #25
0
 public boolean isKnownNonHumanCategory(String rid) {
   return nonHumanCategoryMap.containsKey(rid);
 }
Example #26
0
 public boolean isKnownNonHumanResource(String rid) {
   return nonHumanMap.containsKey(rid);
 }
Example #27
0
 private void setChangeStamp(ResUnit unit) {
   _changeStamp.put(unit, System.currentTimeMillis());
 }
Example #28
0
 public boolean isKnownOrgGroup(String oid) {
   return orgGroupMap.containsKey(oid);
 }
Example #29
0
 public boolean isKnownPosition(String pid) {
   return positionMap.containsKey(pid);
 }
Example #30
0
 public boolean isKnownCapability(String cid) {
   return capabilityMap.containsKey(cid);
 }