use of com.autentia.tnt.businessobject.Tag in project TNTConcept by autentia.
the class DepartmentBean method deleteTag.
public String deleteTag() {
final UIData table = (UIData) FacesUtils.getComponent("department:tags");
final Tag toDelete = (Tag) table.getRowData();
department.getTags().remove(toDelete);
return NavigationResults.EDIT;
}
use of com.autentia.tnt.businessobject.Tag in project TNTConcept by autentia.
the class TagManager method trackContactChanges.
private void trackContactChanges(Tag tag) {
// tracking associated Contacts
for (Contact contact : tag.getContactTags()) {
final Contact contactBD = ContactManager.getDefault().getEntityById(contact.getId());
if (!contactBD.getTags().contains(tag)) {
// FIXME aqui debería bastar con añadir el cambio o el tag al contacto y salvar el contacto
// para que se actualizase con los listener de hibernate. Por algún motivo, sólo cuando se da de alta
// una nueva clave y se asocia a un contacto antes de guardar no funciona correctamente.
EntityChange entityChange = contactBD.getEntityChange(Contact.FIELD_TAGS, "", tag.getName(), tag.getId().toString());
contactBD.addEntityChange(Contact.FIELD_TAGS, "", tag.getName(), tag.getId().toString());
if (entityChange != null) {
entityChangeDAO.insert(entityChange);
}
}
}
// tracking deassociated Contacts
if (tag.getId() != null) {
Tag tagDB = getEntityById(tag.getId());
for (Contact contactDB : tagDB.getContactTags()) {
if (!tag.getContactTags().contains(contactDB)) {
contactDB.addEntityChange(Contact.FIELD_TAGS, tag.getName(), "", tag.getId().toString());
contactDAO.update(contactDB);
}
}
}
}
use of com.autentia.tnt.businessobject.Tag in project TNTConcept by autentia.
the class ContactBean method getAllTags.
public List<SelectItem> getAllTags() {
final List<Tag> refs = TagManager.getDefault().getAllEntities(null, new SortCriteria("id"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
for (Tag ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Tag in project TNTConcept by autentia.
the class ContactBean method deleteTag.
// public void setTags(Set<Tag> tags) {
// contact.setTags(tags);
// }
public String deleteTag() {
final UIData table = (UIData) FacesUtils.getComponent("contact:tags");
final Tag toDelete = (Tag) table.getRowData();
contact.removeTag(toDelete);
return NavigationResults.EDIT;
}
use of com.autentia.tnt.businessobject.Tag in project TNTConcept by autentia.
the class PositionBean method deleteTag.
public String deleteTag() {
final UIData table = (UIData) FacesUtils.getComponent("position:tags");
final Tag toDelete = (Tag) table.getRowData();
position.getTags().remove(toDelete);
return NavigationResults.EDIT;
}
Aggregations