1 package org.kuali.ole.select.bo;
2
3 import org.kuali.ole.module.purap.PurapConstants;
4 import org.kuali.rice.kew.api.KewApiConstants;
5 import org.kuali.rice.kew.api.KewApiServiceLocator;
6 import org.kuali.rice.kew.api.doctype.DocumentType;
7 import org.kuali.rice.krad.util.KRADConstants;
8
9
10
11
12
13
14
15
16 public class OLESerialRelatedPODocument {
17
18 private boolean selectPO;
19 private String poId;
20 private String poIdLink;
21 private String vendorId;
22 private String vendorAliasName;
23 private String vendorName;
24 private String actionInterval;
25
26 public String getActionInterval() {
27 return actionInterval;
28 }
29
30 public void setActionInterval(String actionInterval) {
31 this.actionInterval = actionInterval;
32 }
33
34 public String getVendorId() {
35 return vendorId;
36 }
37
38 public void setVendorId(String vendorId) {
39 this.vendorId = vendorId;
40 }
41
42 public String getVendorAliasName() {
43 return vendorAliasName;
44 }
45
46 public void setVendorAliasName(String vendorAliasName) {
47 this.vendorAliasName = vendorAliasName;
48 }
49
50 public String getVendorName() {
51 return vendorName;
52 }
53
54 public void setVendorName(String vendorName) {
55 this.vendorName = vendorName;
56 }
57
58 public boolean isSelectPO() {
59 return selectPO;
60 }
61
62 public void setSelectPO(boolean selectPO) {
63 this.selectPO = selectPO;
64 }
65
66 public String getPoIdLink() {
67 return poIdLink;
68 }
69
70 public void setPoIdLink(String poDocNumber) {
71 String documentTypeName = PurapConstants.PurchaseOrderDocTypes.PURCHASE_ORDER_DOCUMENT;
72 DocumentType docType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(documentTypeName);
73 String docHandlerUrl = docType.getResolvedDocumentHandlerUrl();
74 int endSubString = docHandlerUrl.lastIndexOf("/");
75 String serverName = docHandlerUrl.substring(0, endSubString);
76 String handler = docHandlerUrl.substring(endSubString + 1, docHandlerUrl.lastIndexOf("?"));
77 this.poIdLink = serverName + "/" + KRADConstants.PORTAL_ACTION + "?channelTitle=" + docType.getName() + "&channelUrl=" + handler + "?" + KRADConstants.DISPATCH_REQUEST_PARAMETER + "=" + KRADConstants.DOC_HANDLER_METHOD + "&" + KRADConstants.PARAMETER_DOC_ID + "=" + poDocNumber + "&" + KRADConstants.PARAMETER_COMMAND + "=" + KewApiConstants.DOCSEARCH_COMMAND;
78 }
79
80 public String getPoId() {
81 return poId;
82 }
83
84 public void setPoId(String poId) {
85 this.poId = poId;
86 }
87 }