use of com.autentia.tnt.dao.search.DocumentSearch in project TNTConcept by autentia.
the class ActivityBean method edit.
/**
* Go to edit page
*
* @return forward to EDIT page
*/
public String edit() {
ScheduleEntry entry = scheduleModel.getSelectedEntry();
String tmpId = entry.getId();
String[] tmpIdParts = tmpId.split("_");
Integer id = Integer.parseInt(tmpIdParts[tmpIdParts.length - 1]);
if (entry instanceof ActivityScheduleEntry) {
activity = manager.getEntityById(id);
selectedProject = activity.getRole().getProject();
selectedOrganization = selectedProject.getClient();
setDefaultBillable(selectedProject.getBillable());
tabsRendered = EDIT_ACTIVITY;
} else if (entry instanceof ExternalActivityScheduleEntry) {
externalActivity = externalActivityManager.getEntityById(id);
ArrayList<DocumentCategory> categories = new ArrayList<DocumentCategory>();
categories.add(externalActivity.getDocumentCategory());
docSearch = new DocumentSearch();
docSearch.setCategories(categories);
documents = docManager.getAllEntities(docSearch, null);
tabsRendered = EDIT_EXTERNAL_ACTIVITY;
} else {
tabsRendered = NO_EDIT_SELECTED;
return NavigationResults.LIST;
}
return NavigationResults.EDIT;
}
Aggregations