Ejemplo n.º 1
0
 /**
  * @param accountingDocument
  * @return
  */
 protected FinancialSystemTransactionalDocumentAuthorizerBase getDocumentAuthorizer(
     AccountingDocument accountingDocument) {
   final Class<? extends DocumentAuthorizer> documentAuthorizerClass =
       ((TransactionalDocumentEntry)
               SpringContext.getBean(DataDictionaryService.class)
                   .getDataDictionary()
                   .getDictionaryObjectEntry(accountingDocument.getClass().getName()))
           .getDocumentAuthorizerClass();
   FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer = null;
   try {
     documentAuthorizer =
         (FinancialSystemTransactionalDocumentAuthorizerBase)
             documentAuthorizerClass.newInstance();
   } catch (InstantiationException ie) {
     throw new RuntimeException(
         "Cannot instantiate instance of document authorizer for "
             + accountingDocument.getClass().getName(),
         ie);
   } catch (IllegalAccessException iae) {
     throw new RuntimeException(
         "Cannot instantiate instance of document authorizer for "
             + accountingDocument.getClass().getName(),
         iae);
   }
   return documentAuthorizer;
 }
Ejemplo n.º 2
0
 /**
  * @param accountingDocument
  * @return
  */
 private FinancialSystemTransactionalDocumentPresentationController getPresentationController(
     AccountingDocument accountingDocument) {
   final Class<? extends DocumentPresentationController> presentationControllerClass =
       ((TransactionalDocumentEntry)
               SpringContext.getBean(DataDictionaryService.class)
                   .getDataDictionary()
                   .getDictionaryObjectEntry(accountingDocument.getClass().getName()))
           .getDocumentPresentationControllerClass();
   FinancialSystemTransactionalDocumentPresentationController presentationController = null;
   try {
     presentationController =
         (FinancialSystemTransactionalDocumentPresentationController)
             presentationControllerClass.newInstance();
   } catch (InstantiationException ie) {
     throw new RuntimeException(
         "Cannot instantiate instance of presentation controller for "
             + accountingDocument.getClass().getName(),
         ie);
   } catch (IllegalAccessException iae) {
     throw new RuntimeException(
         "Cannot instantiate instance of presentation controller for "
             + accountingDocument.getClass().getName(),
         iae);
   }
   return presentationController;
 }