Search in sources :

Example 6 with DocumentCategory

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;
}
Also used : DocumentCategory(com.autentia.tnt.businessobject.DocumentCategory)

Example 7 with DocumentCategory

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;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) DocumentCategory(com.autentia.tnt.businessobject.DocumentCategory)

Aggregations

DocumentCategory (com.autentia.tnt.businessobject.DocumentCategory)7 ArrayList (java.util.ArrayList)3 SortCriteria (com.autentia.tnt.dao.SortCriteria)2 LocalDate (java.time.LocalDate)2 Date (java.util.Date)2 SettingBean (com.autentia.tnt.bean.admin.SettingBean)1 DocumentBean (com.autentia.tnt.bean.document.DocumentBean)1 Activity (com.autentia.tnt.businessobject.Activity)1 Document (com.autentia.tnt.businessobject.Document)1 ExternalActivity (com.autentia.tnt.businessobject.ExternalActivity)1 Project (com.autentia.tnt.businessobject.Project)1 ProjectRole (com.autentia.tnt.businessobject.ProjectRole)1 Setting (com.autentia.tnt.businessobject.Setting)1 User (com.autentia.tnt.businessobject.User)1 ActivitySearch (com.autentia.tnt.dao.search.ActivitySearch)1 DocumentSearch (com.autentia.tnt.dao.search.DocumentSearch)1 ExternalActivitySearch (com.autentia.tnt.dao.search.ExternalActivitySearch)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 HashSet (java.util.HashSet)1