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 List<OLECretePOAccountingLine> accountingLines = new ArrayList<>();
41      private List<OleFundCode> fundCodes = new ArrayList<>();
42  
43      public String getCreatePOId() {
44          return createPOId;
45      }
46  
47      public void setCreatePOId(String createPOId) {
48          this.createPOId = createPOId;
49      }
50  
51      public boolean isSelectFlag() {
52          return selectFlag;
53      }
54  
55      public void setSelectFlag(boolean selectFlag) {
56          this.selectFlag = selectFlag;
57      }
58  
59      public String getPoId() {
60          return poId;
61      }
62  
63      public void setPoId(String poId) {
64          this.poId = poId;
65      }
66  
67      public String getGokbId() {
68          return gokbId;
69      }
70  
71      public void setGokbId(String gokbId) {
72          this.gokbId = gokbId;
73      }
74  
75      public String getTitle() {
76          return title;
77      }
78  
79      public void setTitle(String title) {
80          this.title = title;
81      }
82  
83      public String getIsbnNIssn() {
84          return isbnNIssn;
85      }
86  
87      public void setIsbnNIssn(String isbnNIssn) {
88          this.isbnNIssn = isbnNIssn;
89      }
90  
91      public String getPrice() {
92          return price;
93      }
94  
95      public void setPrice(String price) {
96          this.price = price;
97      }
98  
99      public String getVendorId() {
100         return vendorId;
101     }
102 
103     public void setVendorId(String vendorId) {
104         this.vendorId = vendorId;
105     }
106 
107     public String getPurposeId() {
108         return purposeId;
109     }
110 
111     public void setPurposeId(String purposeId) {
112         this.purposeId = purposeId;
113     }
114 
115     public String getOrderTypeId() {
116         return orderTypeId;
117     }
118 
119     public void setOrderTypeId(String orderTypeId) {
120         this.orderTypeId = orderTypeId;
121     }
122 
123     @Override
124     public Object clone() throws CloneNotSupportedException {
125         return super.clone();
126     }
127 
128     public String getInstanceId() {
129         return instanceId;
130     }
131 
132     public void setInstanceId(String instanceId) {
133         this.instanceId = instanceId;
134     }
135 
136     public String getInstanceFlag() {
137         return instanceFlag;
138     }
139 
140     public void setInstanceFlag(String instanceFlag) {
141         this.instanceFlag = instanceFlag;
142     }
143 
144     public String getBibId() {
145         return bibId;
146     }
147 
148     public void setBibId(String bibId) {
149         this.bibId = bibId;
150     }
151 
152     public String getRedirectUrl() {
153         String purchaseOrderLineItemIdentifier = this.getPoId().toString();
154         if (purchaseOrderLineItemIdentifier != null && !"".equals(purchaseOrderLineItemIdentifier)) {
155             Map poNumber = new HashMap();
156             poNumber.put(OLEConstants.PUR_DOC_IDENTIFIER, purchaseOrderLineItemIdentifier);
157             List<OlePurchaseOrderDocument> olePurchaseOrderDocumentList = (List) KRADServiceLocator.getBusinessObjectService().findMatching(OlePurchaseOrderDocument.class, poNumber);
158             for (OlePurchaseOrderDocument olePurchaseOrderDocument : olePurchaseOrderDocumentList) {
159                 if (olePurchaseOrderDocument != null) {
160                     boolean validPO = olePurchaseOrderDocument != null ? olePurchaseOrderDocument.getPurchaseOrderCurrentIndicatorForSearching() : false;
161                     if (validPO) {
162                         redirectUrl = ConfigContext.getCurrentContextConfig().getProperty("kew.url") + OLEConstants.PO_LINE_ITEM_URL + olePurchaseOrderDocument.getDocumentNumber();
163                     }
164                 }
165             }
166         }
167         return redirectUrl;
168     }
169 
170     public void setRedirectUrl(String redirectUrl) {
171         this.redirectUrl = redirectUrl;
172     }
173 
174     public String getOleERSIdentifier() {
175         return oleERSIdentifier;
176     }
177 
178     public void setOleERSIdentifier(String oleERSIdentifier) {
179         this.oleERSIdentifier = oleERSIdentifier;
180     }
181 
182     public List<OLECretePOAccountingLine> getAccountingLines() {
183         return accountingLines;
184     }
185 
186     public void setAccountingLines(List<OLECretePOAccountingLine> accountingLines) {
187         this.accountingLines = accountingLines;
188     }
189 
190     public List<OleFundCode> getFundCodes() {
191         return fundCodes;
192     }
193 
194     public void setFundCodes(List<OleFundCode> fundCodes) {
195         this.fundCodes = fundCodes;
196     }
197 }