/
AuditDetailsFragmentController.java
29 lines (22 loc) · 1.17 KB
/
AuditDetailsFragmentController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.openmrs.module.sync2.fragment.controller;
import org.openmrs.annotation.OpenmrsProfile;
import org.openmrs.module.sync2.api.model.audit.AuditMessage;
import org.openmrs.module.sync2.api.service.SyncAuditService;
import org.openmrs.module.sync2.api.utils.SyncUtils;
import org.openmrs.ui.framework.annotation.FragmentParam;
import org.openmrs.ui.framework.annotation.SpringBean;
import org.openmrs.ui.framework.fragment.FragmentModel;
import org.springframework.stereotype.Controller;
@Controller
@OpenmrsProfile(modules = { "uicommons:*.*" })
public class AuditDetailsFragmentController {
private static final String AUDIT_LOG = "auditLog";
private static final String LOCAL_INSTANCE_ID = "localInstanceId";
public void controller(FragmentModel model,
@SpringBean("syncAuditService") SyncAuditService syncAuditService,
@FragmentParam(value = "messageUuid", required = true) String messageUuid){
AuditMessage message = syncAuditService.getMessageByUuid(messageUuid);
model.addAttribute(AUDIT_LOG, message);
model.addAttribute(LOCAL_INSTANCE_ID, SyncUtils.getLocalInstanceId());
}
}