@Override
 public <T> Collection<T> findMatchingOrderBy(
     Class<T> clazz, Map<String, ?> fieldValues, String sortField, boolean sortAscending) {
   return (Collection<T>)
       businessObjectService.findMatchingOrderBy(
           (Class<BusinessObject>) clazz, fieldValues, sortField, sortAscending);
 }
Example #2
0
 @Override
 @Cacheable(value = Chart.CACHE_NAME, key = "'AllActiveCharts'")
 public Collection<Chart> getAllActiveCharts() {
   return businessObjectService.findMatchingOrderBy(
       Chart.class,
       Collections.singletonMap(KFSPropertyConstants.ACTIVE, true),
       KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
       true);
 }
 /*
  * get the appropriate protocol as printable.
  * need further work for requestion submission correspondence printables
  * which should be retrieved from protocolsubmission ?
  */
 protected ProtocolBase getProtocolPrintable(CorrespondencePrintOption printOption) {
   if (CoeusSubModule.PROTOCOL_SUBMISSION.equals(printOption.getSubItemCode())) {
     Map keyValues = new HashMap();
     keyValues.put("protocolNumber", printOption.getItemKey());
     keyValues.put("submissionNumber", printOption.getSubItemKey());
     return ((List<ProtocolSubmissionBase>)
             businessObjectService.findMatchingOrderBy(
                 getProtocolSubmissionBOClassHook(), keyValues, "submissionId", false))
         .get(0)
         .getProtocol();
   } else {
     Map keyValues = new HashMap();
     keyValues.put("protocolNumber", printOption.getItemKey());
     keyValues.put("sequenceNumber", printOption.getSubItemKey());
     return ((List<ProtocolBase>)
             businessObjectService.findMatching(getProtocolBOClassHook(), keyValues))
         .get(0);
   }
 }
 /*
  * get the appropriate protocol as printable.
  * need further work for requestion submission questionnaire printables
  * which should be retrieved from protocolsubmission ?
  */
 private Protocol getProtocolPrintable(QuestionnairePrintOption printOption) {
   if (CoeusSubModule.PROTOCOL_SUBMISSION.equals(printOption.getSubItemCode())) {
     Map keyValues = new HashMap();
     keyValues.put("protocolNumber", printOption.getItemKey());
     keyValues.put("submissionNumber", printOption.getSubItemKey());
     return (Protocol)
         ((List<ProtocolSubmission>)
                 businessObjectService.findMatchingOrderBy(
                     ProtocolSubmission.class, keyValues, "submissionId", false))
             .get(0)
             .getProtocol();
   } else {
     Map keyValues = new HashMap();
     keyValues.put("protocolNumber", printOption.getItemKey());
     keyValues.put("sequenceNumber", printOption.getSubItemKey());
     return ((List<Protocol>) businessObjectService.findMatching(Protocol.class, keyValues))
         .get(0);
   }
 }