View Javadoc
1   package org.kuali.ole.select.bo;
2   
3   import org.kuali.ole.coa.businessobject.OLECretePOAccountingLine;
4   import org.kuali.ole.coa.businessobject.OleFundCode;
5   import org.kuali.ole.select.document.OlePurchaseOrderDocument;
6   import org.kuali.ole.sys.OLEConstants;
7   import org.kuali.rice.core.api.config.property.ConfigContext;
8   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
9   import org.kuali.rice.krad.service.KRADServiceLocator;
10  import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
11  
12  import java.util.ArrayList;
13  import java.util.HashMap;
14  import java.util.List;
15  import java.util.Map;
16  
17  /**
18   * Created by sambasivam on 19/9/14.
19   *
20   * This class is used for displaying the results for create POs for eResource and instance.
21   */
22  public class OLECreatePO extends PersistableBusinessObjectBase implements Cloneable {
23  
24  
25      private String createPOId;
26      private boolean selectFlag;
27      private String poId;
28      private String gokbId;
29      private String title;
30      private String isbnNIssn;
31      private String price;
32      private String vendorId;
33      private String purposeId;
34      private String orderTypeId;
35      private String instanceId;
36      private String instanceFlag;
37      private String bibId;
38      private String redirectUrl;
39      private String oleERSIdentifier;
40      private String fundCode;
41      private List<OLECretePOAccountingLine> accountingLines = new ArrayList<>();
42      private List<OleFundCode> fundCodes = new ArrayList<>();
43  
44      public String getCreatePOId() {
45          return createPOId;
46      }
47  
48      public void setCreatePOId(String createPOId) {
49          this.createPOId = createPOId;
50      }
51  
52      public boolean isSelectFlag() {
53          return selectFlag;
54      }
55  
56      public void setSelectFlag(boolean selectFlag) {
57          this.selectFlag = selectFlag;
58      }
59  
60      public String getPoId() {
61          return poId;
62      }
63  
64      public void setPoId(String poId) {
65          this.poId = poId;
66      }
67  
68      public String getGokbId() {
69          return gokbId;
70      }
71  
72      public void setGokbId(String gokbId) {
73          this.gokbId = gokbId;
74      }
75  
76      public String getTitle() {
77          return title;
78      }
79  
80      public void setTitle(String title) {
81          this.title = title;
82      }
83  
84      public String getIsbnNIssn() {
85          return isbnNIssn;
86      }
87  
88      public void setIsbnNIssn(String isbnNIssn) {
89          this.isbnNIssn = isbnNIssn;
90      }
91  
92      public String getPrice() {
93          return price;
94      }
95  
96      public void setPrice(String price) {
97          this.price = price;
98      }
99  
100     public String getVendorId() {
101         return vendorId;
102     }
103 
104     public void setVendorId(String vendorId) {
105         this.vendorId = vendorId;
106     }
107 
108     public String getPurposeId() {
109         return purposeId;
110     }
111 
112     public void setPurposeId(String purposeId) {
113         this.purposeId = purposeId;
114     }
115 
116     public String getOrderTypeId() {
117         return orderTypeId;
118     }
119 
120     public void setOrderTypeId(String orderTypeId) {
121         this.orderTypeId = orderTypeId;
122     }
123 
124     @Override
125     public Object clone() throws CloneNotSupportedException {
126         return super.clone();
127     }
128 
129     public String getInstanceId() {
130         return instanceId;
131     }
132 
133     public void setInstanceId(String instanceId) {
134         this.instanceId = instanceId;
135     }
136 
137     public String getInstanceFlag() {
138         return instanceFlag;
139     }
140 
141     public void setInstanceFlag(String instanceFlag) {
142         this.instanceFlag = instanceFlag;
143     }
144 
145     public String getBibId() {
146         return bibId;
147     }
148 
149     public void setBibId(String bibId) {
150         this.bibId = bibId;
151     }
152 
153     public String getRedirectUrl() {
154         String purchaseOrderLineItemIdentifier = this.getPoId().toString();
155         if (purchaseOrderLineItemIdentifier != null && !"".equals(purchaseOrderLineItemIdentifier)) {
156             Map poNumber = new HashMap();
157             poNumber.put(OLEConstants.PUR_DOC_IDENTIFIER, purchaseOrderLineItemIdentifier);
158             List<OlePurchaseOrderDocument> olePurchaseOrderDocumentList = (List) KRADServiceLocator.getBusinessObjectService().findMatching(OlePurchaseOrderDocument.class, poNumber);
159             for (OlePurchaseOrderDocument olePurchaseOrderDocument : olePurchaseOrderDocumentList) {
160                 if (olePurchaseOrderDocument != null) {
161                     boolean validPO = olePurchaseOrderDocument != null ? olePurchaseOrderDocument.getPurchaseOrderCurrentIndicatorForSearching() : false;
162                     if (validPO) {
163                         redirectUrl = ConfigContext.getCurrentContextConfig().getProperty("kew.url") + OLEConstants.PO_LINE_ITEM_URL + olePurchaseOrderDocument.getDocumentNumber();
164                     }
165                 }
166             }
167         }
168         return redirectUrl;
169     }
170 
171     public void setRedirectUrl(String redirectUrl) {
172         this.redirectUrl = redirectUrl;
173     }
174 
175     public String getOleERSIdentifier() {
176         return oleERSIdentifier;
177     }
178 
179     public void setOleERSIdentifier(String oleERSIdentifier) {
180         this.oleERSIdentifier = oleERSIdentifier;
181     }
182 
183     public String getFundCode() {
184         return fundCode;
185     }
186 
187     public void setFundCode(String fundCode) {
188         this.fundCode = fundCode;
189     }
190 
191     public List<OLECretePOAccountingLine> getAccountingLines() {
192         return accountingLines;
193     }
194 
195     public void setAccountingLines(List<OLECretePOAccountingLine> accountingLines) {
196         this.accountingLines = accountingLines;
197     }
198 
199     public List<OleFundCode> getFundCodes() {
200         return fundCodes;
201     }
202 
203     public void setFundCodes(List<OleFundCode> fundCodes) {
204         this.fundCodes = fundCodes;
205     }
206 }