use of org.mifos.customers.office.exceptions.OfficeException in project head by mifos.
the class OffAction method get.
@TransactionDemarcate(saveToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
OffActionForm actionForm = (OffActionForm) form;
if (StringUtils.isBlank(actionForm.getOfficeId())) {
throw new OfficeException(OfficeConstants.KEYGETFAILED);
}
OfficeDto officeDto = this.officeServiceFacade.retrieveOfficeById(Short.valueOf(actionForm.getOfficeId()));
actionForm.clear();
List<CustomFieldDefinitionEntity> customFieldDefs = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, customFieldDefs, request);
actionForm.populate(officeDto);
SessionUtils.setAttribute(OfficeConstants.OFFICE_DTO, officeDto, request);
setCurrentPageUrl(request, officeDto);
return mapping.findForward(ActionForwards.get_success.toString());
}
use of org.mifos.customers.office.exceptions.OfficeException in project head by mifos.
the class TestObjectFactory method generateSearchId.
private static String generateSearchId(OfficeBO parentOffice) throws OfficeException {
Integer noOfChildern;
try {
noOfChildern = new OfficePersistence().getChildCount(parentOffice.getOfficeId());
} catch (PersistenceException e) {
throw new OfficeException(e);
}
String parentSearchId = HierarchyManager.getInstance().getSearchId(parentOffice.getOfficeId());
parentSearchId += ++noOfChildern;
parentSearchId += ".";
return parentSearchId;
}
Aggregations