Пример #1
0
 /**
  * Get the list of all positionTags selected
  *
  * @return the list of all positionTags selected
  */
 public List<SelectItem> getPositionTagsSelected() {
   ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
   List<Position> refs = this.getPositionTags();
   for (Position ref : refs) {
     ret.add(new SelectItem(ref, ref.getName()));
   }
   return ret;
 }
Пример #2
0
  /**
   * Get the list of all positionTagss
   *
   * @return the list of all positionTagss
   */
  public List<SelectItem> getPositionTagss() {
    List<Position> refs =
        PositionManager.getDefault().getAllEntities(null, new SortCriteria("name"));

    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    for (Position ref : refs) {
      ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
  }
Пример #3
0
 public List<SelectItem> getAllPositions() {
   final PositionSearch positionSearch = new PositionSearch();
   positionSearch.setDeleted(false);
   final List<Position> refs =
       PositionManager.getDefault().getAllEntities(positionSearch, new SortCriteria("name"));
   final List<SelectItem> ret = new ArrayList<SelectItem>();
   for (Position ref : refs) {
     ret.add(new SelectItem(ref, ref.getName()));
   }
   return ret;
 }
Пример #4
0
 private void trackPositionChanges(Tag tag) {
   // tracking associated Positions
   for (Position position : tag.getPositionTags()) {
     Position positionDB = PositionManager.getDefault().getEntityById(position.getId());
     if (!positionDB.getTags().contains(tag)) {
       positionDB
           .getHistory()
           .add(
               PositionManager.getDefault()
                   .getChange(positionDB, PositionManager.FIELD_TAGS, "", tag.getName()));
     }
   }
   // tracking deassociated Positions
   if (tag.getId() != null) {
     Tag tagDB = getEntityById(tag.getId());
     for (Position positionDB : tagDB.getPositionTags()) {
       if (!tag.getPositionTags().contains(positionDB)) {
         positionDB
             .getHistory()
             .add(
                 PositionManager.getDefault()
                     .getChange(positionDB, PositionManager.FIELD_TAGS, tag.getName(), ""));
       }
     }
   }
 }