Example #1
0
 public synchronized void removePosition(Position p) {
   if (isDataEditable(ResUnit.Position)) {
     disconnectResources(p);
     for (Position position : getPositions()) {
       Position boss = position.getReportsTo();
       if ((boss != null) && boss.getID().equals(p.getID())) {
         position.setReportsTo((Position) null);
         getDataSource(ResUnit.Position).update(position);
       }
     }
     delPosition(p);
     getDataSource(ResUnit.Position).delete(p);
   }
 }
Example #2
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 #3
0
 public Set<Participant> resolveParticipantsFromResourceName(String anyName) {
   Set<Participant> pSet = new HashSet<Participant>();
   Participant p = getParticipantFromUserID(anyName);
   if (p != null) {
     pSet.add(p);
     return pSet;
   }
   Role r = getRoleByName(anyName);
   if (r != null) {
     pSet.addAll(getRoleParticipants(r.getID()));
     return pSet;
   }
   Position pos = getPositionByLabel(anyName);
   if (pos != null) {
     pSet.addAll(getPositionParticipants(pos.getID()));
     return pSet;
   }
   OrgGroup o = getOrgGroupByLabel(anyName);
   if (o != null) {
     pSet.addAll(getOrgGroupParticipants(o.getID()));
     return pSet;
   }
   Capability c = getCapabilityByLabel(anyName);
   if (c != null) {
     pSet.addAll(getCapabilityParticipants(c.getID()));
   }
   return pSet;
 }
Example #4
0
 public String getParticpantsWithPositionAsXML(String positionName) {
   String result = "<participants/>";
   if (positionName != null) {
     Position p = getPositionByLabel(positionName);
     if (p != null) {
       result = getPositionParticipantsAsXML(p.getID());
     }
   }
   return result;
 }
Example #5
0
 public Set<Participant> getParticipantsWithPosition(String positionName) {
   Set<Participant> result = null;
   if (positionName != null) {
     Position p = getPositionByLabel(positionName);
     if (p != null) {
       result = getPositionParticipants(p.getID());
     }
   }
   return result;
 }
Example #6
0
 public void delPosition(Position p) {
   positionMap.remove(p.getID());
   setChangeStamp(ResUnit.Position);
 }
Example #7
0
 public void putPosition(Position p) {
   positionMap.put(p.getID(), p);
   setChangeStamp(ResUnit.Position);
 }