Search in sources :

Example 1 with DocumentDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DocumentDictionaryService in project cu-kfs by CU-CommunityApps.

the class CUFinancialSystemDocumentServiceImpl method getDocumentAuthorizer.

protected FinancialSystemTransactionalDocumentAuthorizerBase getDocumentAuthorizer(Document doc) {
    DocumentDictionaryService documentDictionaryService = SpringContext.getBean(DocumentDictionaryService.class);
    Class<? extends DocumentAuthorizer> documentAuthorizerClass = (Class<? extends DocumentAuthorizer>) documentDictionaryService.getDocumentEntryByClass(doc.getClass()).getDocumentAuthorizerClass();
    FinancialSystemTransactionalDocumentAuthorizerBase documentAuthorizer = null;
    try {
        documentAuthorizer = (FinancialSystemTransactionalDocumentAuthorizerBase) documentAuthorizerClass.newInstance();
    } catch (InstantiationException ie) {
        throw new RuntimeException("Could not construct document authorizer: " + documentAuthorizerClass.getName(), ie);
    } catch (IllegalAccessException iae) {
        throw new RuntimeException("Could not construct document authorizer: " + documentAuthorizerClass.getName(), iae);
    }
    return documentAuthorizer;
}
Also used : DocumentDictionaryService(org.kuali.kfs.datadictionary.legacy.DocumentDictionaryService) FinancialSystemTransactionalDocumentAuthorizerBase(org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase) DocumentAuthorizer(org.kuali.kfs.kns.document.authorization.DocumentAuthorizer)

Aggregations

DocumentDictionaryService (org.kuali.kfs.datadictionary.legacy.DocumentDictionaryService)1 DocumentAuthorizer (org.kuali.kfs.kns.document.authorization.DocumentAuthorizer)1 FinancialSystemTransactionalDocumentAuthorizerBase (org.kuali.kfs.sys.document.authorization.FinancialSystemTransactionalDocumentAuthorizerBase)1