Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo n.º 3
0
 public void fillPosition(String title, Person hire) {
   for (Position position : this)
     if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) {
       position.setPerson(hire);
       return;
     }
   throw new RuntimeException("Position " + title + " not available");
 }
Ejemplo n.º 4
0
 public Position getPositionByLabel(String label) {
   for (Position p : positionMap.values()) {
     if (p.getTitle().equals(label)) {
       return p;
     }
   }
   return null;
 }
Ejemplo n.º 5
0
 public boolean positionAvailable(String title) {
   for (Position position : this)
     if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) return true;
   return false;
 }