Exemplo n.º 1
0
 public List<Department> getDepartmentTags() {
   List<Department> departmentTags = new ArrayList<Department>();
   if (tag.getDepartmentTags() != null && !tag.getDepartmentTags().isEmpty()) {
     departmentTags.addAll(tag.getDepartmentTags());
   }
   return departmentTags;
 }
Exemplo n.º 2
0
 public List<Position> getPositionTags() {
   List<Position> positionTags = new ArrayList<Position>();
   if (tag.getPositionTags() != null && !tag.getPositionTags().isEmpty()) {
     positionTags.addAll(tag.getPositionTags());
   }
   return positionTags;
 }
Exemplo n.º 3
0
 public List<Contact> getContactTags() {
   List<Contact> contactTags = new ArrayList<Contact>();
   if (tag.getContactTags() != null && !tag.getContactTags().isEmpty()) {
     contactTags.addAll(tag.getContactTags());
   }
   return contactTags;
 }
Exemplo n.º 4
0
 public List<Organization> getOrganizationTags() {
   List<Organization> organizationTags = new ArrayList<Organization>();
   if (tag.getOrganizationTags() != null && !tag.getOrganizationTags().isEmpty()) {
     organizationTags.addAll(tag.getOrganizationTags());
   }
   return organizationTags;
 }
Exemplo n.º 5
0
  /**
   * Create a new empty instance of the one-to-many field
   *
   * @return forward to the same page
   */
  public String editOrganizationTags() {
    Organization item = new Organization();

    if (tag.getOrganizationTags() == null) {
      tag.setOrganizationTags(new HashSet());
    }
    tag.getOrganizationTags().add(item);
    return null;
  }
Exemplo n.º 6
0
  /**
   * Create a new empty instance of the one-to-many field
   *
   * @return forward to the same page
   */
  public String editDepartmentTags() {
    Department item = new Department();

    if (tag.getDepartmentTags() == null) {
      tag.setDepartmentTags(new HashSet());
    }
    tag.getDepartmentTags().add(item);
    return null;
  }
Exemplo n.º 7
0
  /**
   * Create a new empty instance of the one-to-many field
   *
   * @return forward to the same page
   */
  public String editPositionTags() {
    Position item = new Position();

    if (tag.getPositionTags() == null) {
      tag.setPositionTags(new HashSet());
    }
    tag.getPositionTags().add(item);
    return null;
  }
Exemplo n.º 8
0
  /**
   * Create a new empty instance of the one-to-many field
   *
   * @return forward to the same page
   */
  public String editContactTags() {
    Contact item = new Contact();

    if (tag.getContactTags() == null) {
      tag.setContactTags(new HashSet());
    }
    tag.getContactTags().add(item);
    return null;
  }
Exemplo n.º 9
0
  /** Delete tag. */
  public void deleteEntity(Tag tag) {
    // for Position tracking
    tag.getPositionTags().clear();
    tag.getContactTags().clear();
    trackPositionChanges(tag);
    trackContactChanges(tag);

    tagDAO.delete(tag);
  }
Exemplo n.º 10
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(), ""));
       }
     }
   }
 }
Exemplo n.º 11
0
 public void setDepartmentTags(List<Department> departmentTags) {
   Set<Department> result = new HashSet<Department>();
   if (departmentTags != null && !departmentTags.isEmpty()) {
     result.addAll(departmentTags);
   }
   tag.setDepartmentTags(result);
 }
Exemplo n.º 12
0
 public void setOrganizationTags(List<Organization> organizationTags) {
   Set<Organization> result = new HashSet<Organization>();
   if (organizationTags != null && !organizationTags.isEmpty()) {
     result.addAll(organizationTags);
   }
   tag.setOrganizationTags(result);
 }
Exemplo n.º 13
0
 public void setPositionTags(List<Position> positionTags) {
   Set<Position> result = new HashSet<Position>();
   if (positionTags != null && !positionTags.isEmpty()) {
     result.addAll(positionTags);
   }
   tag.setPositionTags(result);
 }
Exemplo n.º 14
0
 public void setContactTags(List<Contact> contactTags) {
   Set<Contact> result = new HashSet<Contact>();
   if (contactTags != null && !contactTags.isEmpty()) {
     result.addAll(contactTags);
   }
   tag.setContactTags(result);
 }
Exemplo n.º 15
0
  /**
   * Save bean and stay on it
   *
   * @return forward to list page
   */
  public String save() {

    doBeforeSave();

    if (tag.getId() == null) {
      manager.insertEntity(tag);
    } else {
      manager.updateEntity(tag);
    }

    // Calls an after save action
    String result = doAfterSave(NavigationResults.LIST);

    // Unselect object
    tag = null;

    return result;
  }
Exemplo n.º 16
0
 public void setContacts(Set<Contact> contacts) {
   tag.setContactTags(contacts);
 }
Exemplo n.º 17
0
 public Set<Contact> getContacts() {
   return tag.getContactTags();
 }
Exemplo n.º 18
0
 public String addContact() {
   tag.getContactTags().add(getSelectedContact());
   return NavigationResults.EDIT;
 }
Exemplo n.º 19
0
 public Date getInsertDate() {
   return tag.getInsertDate();
 }
Exemplo n.º 20
0
 public Set<Position> getPosition() {
   return tag.getPositionTags();
 }
Exemplo n.º 21
0
 public void setOwnerId(Integer ownerId) {
   tag.setOwnerId(ownerId);
 }
Exemplo n.º 22
0
 public Integer getDepartmentId() {
   return tag.getDepartmentId();
 }
Exemplo n.º 23
0
 public void setUpdateDate(Date updateDate) {
   tag.setUpdateDate(updateDate);
 }
Exemplo n.º 24
0
 public Date getUpdateDate() {
   return tag.getUpdateDate();
 }
Exemplo n.º 25
0
 public void setInsertDate(Date insertDate) {
   tag.setInsertDate(insertDate);
 }
Exemplo n.º 26
0
 public String deleteContact() {
   final UIData table = (UIData) FacesUtils.getComponent("tag:contacts");
   final Contact toDelete = (Contact) table.getRowData();
   tag.getContactTags().remove(toDelete);
   return NavigationResults.EDIT;
 }
Exemplo n.º 27
0
 public String addPosition() {
   tag.getPositionTags().add(getSelectedPosition());
   return NavigationResults.EDIT;
 }
Exemplo n.º 28
0
 public Integer getOwnerId() {
   return tag.getOwnerId();
 }
Exemplo n.º 29
0
 public void setPosition(Set<Position> positions) {
   tag.setPositionTags(positions);
 }
Exemplo n.º 30
0
 public void setDepartmentId(Integer departmentId) {
   tag.setDepartmentId(departmentId);
 }