1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.mock.utilities;
17
18
19 import java.util.Date;
20
21 import org.kuali.student.r2.common.dto.ContextInfo;
22 import org.kuali.student.r2.common.dto.MetaInfo;
23 import org.kuali.student.r2.common.infc.*;
24
25
26
27
28
29
30 public class MockHelper {
31
32
33
34
35
36
37
38 public MetaInfo createMeta(Context context) {
39 MetaInfo mInfo = MetaInfo.newInstance();
40 Date now = new Date();
41 mInfo.setCreateId(context.getPrincipalId());
42 mInfo.setCreateTime(now);
43 mInfo.setUpdateId(context.getPrincipalId());
44 mInfo.setUpdateTime(now);
45 mInfo.setVersionInd("1");
46 return mInfo;
47 }
48
49
50
51
52
53
54
55
56 public MetaInfo updateMeta(Meta orig, Context context) {
57 Date now = new Date();
58 int oldVersionInd = Integer.parseInt(orig.getVersionInd());
59 MetaInfo mInfo = MetaInfo.getInstance(orig);
60 mInfo.setUpdateId(context.getPrincipalId());
61 mInfo.setUpdateTime(now);
62 mInfo.setVersionInd("" + (oldVersionInd + 1));
63 return mInfo;
64 }
65
66
67
68 }
69