use of com.autentia.tnt.businessobject.DocumentCategory in project TNTConcept by autentia.
the class ActivityBean method doBeforeSaveExternalActivity.
public String doBeforeSaveExternalActivity() {
String result = super.doBeforeSave();
// if the user not has a category
if (externalActivity.getDocumentCategory() == null || externalActivity.getDocumentCategory().getId() == null) {
DocumentCategory padre = dcManager.getDocumentCategoryParent();
// User category
DocumentCategory extActDocCategory = new DocumentCategory();
extActDocCategory.setName(externalActivity.getName());
extActDocCategory.setDescription(externalActivity.getName());
extActDocCategory.setPadre(padre);
externalActivity.setDocumentCategory(extActDocCategory);
} else {
// Updates the category name
externalActivity.getDocumentCategory().setName(externalActivity.getName());
externalActivity.getDocumentCategory().setDescription(externalActivity.getName());
}
return result;
}
use of com.autentia.tnt.businessobject.DocumentCategory in project TNTConcept by autentia.
the class UserBean method getDocumentCategorys.
/**
* Get the list of all documentCategorys
*
* @return the list of all documentCategorys
*/
public List<SelectItem> getDocumentCategorys() {
List<DocumentCategory> refs = DocumentCategoryManager.getDefault().getAllEntities(null, new SortCriteria("name"));
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
for (DocumentCategory ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
Aggregations