use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class TagBean method deletePosition.
public String deletePosition() {
final UIData table = (UIData) FacesUtils.getComponent("tag:positions");
final Position toDelete = (Position) table.getRowData();
tag.getPositionTags().remove(toDelete);
return NavigationResults.EDIT;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class TagBean method getAllPositions.
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;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class TagBean method getPositionTagss.
/**
* 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;
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class ContactPositionManagerTest method testDoAdvancedSearchBusyPosition.
/**
* Buscar por puesto ocupado
*/
@Test
public void testDoAdvancedSearchBusyPosition() {
final PositionDAO positionDAO = (PositionDAO) SpringUtilsForTesting.getSpringBean("daoPosition");
final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
final ContactPositionManager contactPositionManager = new ContactPositionManager(contactDAO, positionDAO);
this.insertInitialData();
this.insertContactData();
final AdvancedSearchContactSearch advancedSearch = new AdvancedSearchContactSearch();
final List<Position> positions = new ArrayList<Position>();
positions.add(becario);
advancedSearch.setPositions(positions);
final List<ContactPosition> contactPositions = contactPositionManager.doAdvancedSearch(advancedSearch, JUST_ACTIVE);
// debe salir un resultado, que es Antonio Ruiz ya que posee el cargo de becario
if (contactPositions.size() != 1) {
fail("Deberia haber salido 1 resultado (1 contacto), pero han salido " + contactPositions.size());
}
if (!contactPositions.get(0).getName().equals("Antonio Ruiz")) {
fail("El resultado debería haber sido 'Antonio Ruiz', pero ha sido " + contactPositions.get(0).getName());
}
}
use of com.autentia.tnt.businessobject.Position in project TNTConcept by autentia.
the class ContactPositionManagerTest method testDoAdvancedSearchEmptyPosition.
/**
* Buscar por puesto libre
*/
@Test
public void testDoAdvancedSearchEmptyPosition() {
final PositionDAO positionDAO = (PositionDAO) SpringUtilsForTesting.getSpringBean("daoPosition");
final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
final ContactPositionManager contactPositionManager = new ContactPositionManager(contactDAO, positionDAO);
this.insertInitialData();
this.insertContactData();
final AdvancedSearchContactSearch advancedSearch = new AdvancedSearchContactSearch();
final List<Position> positions = new ArrayList<Position>();
positions.add(responsableDireccion);
advancedSearch.setPositions(positions);
final List<ContactPosition> contactPositions = contactPositionManager.doAdvancedSearch(advancedSearch, JUST_ACTIVE);
// debe salir un resultado que es el puesto sin ocupantes
if (contactPositions.size() != 1) {
fail("Deberia haber salido 1 resultado (1 puesto), pero han salido " + contactPositions.size());
}
if (!contactPositions.get(0).getPosition().equals("Responsable de Dirección")) {
fail("El resultado debería haber sido 'Responsable de Dirección', pero ha sido " + contactPositions.get(0).getPosition());
}
}
Aggregations