1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.impl.peopleflow;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20 import org.kuali.rice.core.api.uif.RemotableAttributeField;
21 import org.kuali.rice.kew.api.KewApiServiceLocator;
22 import org.kuali.rice.kew.api.repository.type.KewTypeDefinition;
23 import org.kuali.rice.kew.framework.peopleflow.PeopleFlowTypeService;
24 import org.kuali.rice.krad.inquiry.InquirableImpl;
25 import org.kuali.rice.krad.uif.container.Container;
26 import org.kuali.rice.krad.uif.view.View;
27 import org.kuali.rice.krad.web.form.InquiryForm;
28 import org.kuali.rice.krad.web.form.MaintenanceForm;
29
30 import javax.xml.namespace.QName;
31 import java.util.ArrayList;
32 import java.util.List;
33
34
35
36
37
38
39 public class PeopleFlowInquirableImpl extends InquirableImpl {
40 private static final long serialVersionUID = -8392423307944257532L;
41
42
43
44
45
46
47
48
49
50
51 public List<RemotableAttributeField> retrieveTypeAttributes(View view, Object model, Container container) {
52 List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>();
53
54 PeopleFlowBo peopleFlow = (PeopleFlowBo) ((InquiryForm) model).getDataObject();
55
56
57 if (peopleFlow != null && StringUtils.isNotBlank(peopleFlow.getTypeId())) {
58 String typeId = peopleFlow.getTypeId();
59 KewTypeDefinition typeDefinition = KewApiServiceLocator.getKewTypeRepositoryService().getTypeById(typeId);
60 PeopleFlowTypeService peopleFlowTypeService = GlobalResourceLoader.<PeopleFlowTypeService>getService(
61 QName.valueOf(typeDefinition.getServiceName()));
62 remoteFields = peopleFlowTypeService.getAttributeFields(typeId);
63 }
64
65 return remoteFields;
66 }
67 }