Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 public String checkCyclicPositionReference(Position position, String refID) {
   String result = null;
   List<String> hierarchy = new ArrayList<String>();
   hierarchy.add(position.getTitle());
   Position owner = getPosition(refID);
   String refName = owner.getTitle(); // title of posn attempting to add to
   while (owner != null) {
     hierarchy.add(owner.getTitle());
     if (owner.equals(position)) {
       result = constructCyclicAttributeErrorMessage(hierarchy, "position", refName);
       break;
     }
     owner = owner.getReportsTo();
   }
   return result;
 }
Exemplo n.º 3
0
 public Position getPositionByLabel(String label) {
   for (Position p : positionMap.values()) {
     if (p.getTitle().equals(label)) {
       return p;
     }
   }
   return null;
 }