use of org.kuali.kfs.krad.document.SessionDocument 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;
}
Aggregations