Search in sources :

Example 1 with MaintenanceDocumentEntry

use of org.kuali.kfs.kns.datadictionary.MaintenanceDocumentEntry in project cu-kfs by CU-CommunityApps.

the class WebUtils method isDocumentSession.

public static boolean isDocumentSession(Document document, PojoFormBase docForm) {
    boolean sessionDoc = document instanceof SessionDocument;
    boolean dataDictionarySessionDoc = false;
    if (!sessionDoc) {
        DataDictionary dataDictionary = KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary();
        if (docForm instanceof KualiMaintenanceForm) {
            KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) docForm;
            if (dataDictionary != null) {
                if (maintenanceForm.getDocTypeName() != null) {
                    MaintenanceDocumentEntry maintenanceDocumentEntry = (MaintenanceDocumentEntry) dataDictionary.getDocumentEntry(maintenanceForm.getDocTypeName());
                    dataDictionarySessionDoc = maintenanceDocumentEntry.isSessionDocument();
                }
            }
        } else {
            if (document != null && dataDictionary != null) {
                KNSDocumentEntry documentEntry = (KNSDocumentEntry) dataDictionary.getDocumentEntry(document.getClass().getName());
                dataDictionarySessionDoc = documentEntry.isSessionDocument();
            }
        }
    }
    return sessionDoc || dataDictionarySessionDoc;
}
Also used : SessionDocument(org.kuali.kfs.krad.document.SessionDocument) MaintenanceDocumentEntry(org.kuali.kfs.kns.datadictionary.MaintenanceDocumentEntry) KualiMaintenanceForm(org.kuali.kfs.kns.web.struts.form.KualiMaintenanceForm) KNSDocumentEntry(org.kuali.kfs.kns.datadictionary.KNSDocumentEntry) DataDictionary(org.kuali.kfs.krad.datadictionary.DataDictionary)

Aggregations

KNSDocumentEntry (org.kuali.kfs.kns.datadictionary.KNSDocumentEntry)1 MaintenanceDocumentEntry (org.kuali.kfs.kns.datadictionary.MaintenanceDocumentEntry)1 KualiMaintenanceForm (org.kuali.kfs.kns.web.struts.form.KualiMaintenanceForm)1 DataDictionary (org.kuali.kfs.krad.datadictionary.DataDictionary)1 SessionDocument (org.kuali.kfs.krad.document.SessionDocument)1