View Javadoc
1   package org.kuali.ole.select.document;
2   
3   import org.apache.commons.lang3.StringUtils;
4   import org.kuali.ole.sys.OLEConstants;
5   import org.kuali.rice.core.api.config.property.ConfigContext;
6   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
7   import org.kuali.rice.krad.service.KRADServiceLocator;
8   import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
9   
10  import java.util.HashMap;
11  import java.util.List;
12  import java.util.Map;
13  
14  /**
15   * Created with IntelliJ IDEA.
16   * User: srinivasane
17   * Date: 6/27/13
18   * Time: 11:25 AM
19   * To change this template use File | Settings | File Templates.
20   */
21  public class OLEEResourceInstance extends PersistableBusinessObjectBase {
22  
23      private String oleEResourceInstanceId;
24      private String oleERSIdentifier;
25      private String instanceId;
26      private String holdingsId;
27      private String instanceFlag;
28      private String bibId;
29      private String instanceTitle;
30      private String isbn;
31      private String instanceHoldings;
32      private String publicDisplayNote;
33      private String instancePublisher;
34      private String platformId;
35      private String platformName;
36      private String status;
37      private String tippStatus;
38      private String subscriptionStatus;
39      private String autoAddTitlesFromGOKb;
40      private String autoRemoveTitlesFromGOKb;
41      private String autoUpdateMetaDataFromGOKb;
42      private String autoArcInstanceRec;
43      private String covStartDate;
44      private String covStartVolume;
45      private String covStartIssue;
46      private String covEndDate;
47      private String covEndVolume;
48      private String covEndIssue;
49      private String perpetualAccStartDate;
50      private String perpetualAccStartVolume;
51      private String perpetualAccStartIssue;
52      private String perpetualAccEndDate;
53      private String perpetualAccEndVolume;
54      private String perpetualAccEndIssue;
55      private String url;
56      private OLEEResourceRecordDocument oleERSDocument;
57      private boolean select;
58      private String redirectUrl;
59      private String eResourceName;
60      private String eResourceDocNum;
61      private Integer gokbId;
62  
63      // private List<OLEEResourceCopy> oleCopyList = new ArrayList<OLEEResourceCopy>();
64      public String getOleEResourceInstanceId() {
65          return oleEResourceInstanceId;
66      }
67  
68      public void setOleEResourceInstanceId(String oleEResourceInstanceId) {
69          this.oleEResourceInstanceId = oleEResourceInstanceId;
70      }
71  
72      public String getOleERSIdentifier() {
73          return oleERSIdentifier;
74      }
75  
76      public void setOleERSIdentifier(String oleERSIdentifier) {
77          this.oleERSIdentifier = oleERSIdentifier;
78      }
79  
80      public String getHoldingsId() {
81          return holdingsId;
82      }
83  
84      public void setHoldingsId(String holdingsId) {
85          this.holdingsId = holdingsId;
86      }
87  
88      public String getInstanceFlag() {
89          return instanceFlag;
90      }
91  
92      public void setInstanceFlag(String instanceFlag) {
93          this.instanceFlag = instanceFlag;
94      }
95  
96      public String getInstanceId() {
97          return instanceId;
98      }
99  
100     public void setInstanceId(String instanceId) {
101         this.instanceId = instanceId;
102     }
103 
104     public String getBibId() {
105         return bibId;
106     }
107 
108     public void setBibId(String bibId) {
109         this.bibId = bibId;
110     }
111 
112     public String getInstanceTitle() {
113         return instanceTitle;
114     }
115 
116     public void setInstanceTitle(String instanceTitle) {
117         this.instanceTitle = instanceTitle;
118     }
119 
120     public String getIsbn() {
121         return isbn;
122     }
123 
124     public void setIsbn(String isbn) {
125         this.isbn = isbn;
126     }
127 
128     public String getInstanceHoldings() {
129         return instanceHoldings;
130     }
131 
132     public void setInstanceHoldings(String instanceHoldings) {
133         this.instanceHoldings = instanceHoldings;
134     }
135 
136     public String getPublicDisplayNote() {
137         return publicDisplayNote;
138     }
139 
140     public void setPublicDisplayNote(String publicDisplayNote) {
141         this.publicDisplayNote = publicDisplayNote;
142     }
143 
144     public String getInstancePublisher() {
145         return instancePublisher;
146     }
147 
148     public void setInstancePublisher(String instancePublisher) {
149         this.instancePublisher = instancePublisher;
150     }
151 
152     public String getPlatformId() {
153         return platformId;
154     }
155 
156     public void setPlatformId(String platformId) {
157         this.platformId = platformId;
158     }
159 
160     public String getPlatformName() {
161         if (this.platformId != null) {
162             Map platformMap = new HashMap();
163             platformMap.put(org.kuali.ole.OLEConstants.OLE_PLATFORM_ID, this.platformId);
164             OLEPlatformRecordDocument olePlatformRecordDocument = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEPlatformRecordDocument.class, platformMap);
165             if (olePlatformRecordDocument != null) {
166                 return olePlatformRecordDocument.getName();
167             }
168         }
169         return platformName;
170     }
171 
172     public void setPlatformName(String platformName) {
173         this.platformName = platformName;
174     }
175 
176     public String getStatus() {
177         return status;
178     }
179 
180     public void setStatus(String status) {
181         this.status = status;
182     }
183 
184     public String getSubscriptionStatus() {
185         return subscriptionStatus;
186     }
187 
188     public void setSubscriptionStatus(String subscriptionStatus) {
189         this.subscriptionStatus = subscriptionStatus;
190     }
191 
192     public String getAutoAddTitlesFromGOKb() {
193         return autoAddTitlesFromGOKb;
194     }
195 
196     public void setAutoAddTitlesFromGOKb(String autoAddTitlesFromGOKb) {
197         this.autoAddTitlesFromGOKb = autoAddTitlesFromGOKb;
198     }
199 
200     public String getAutoRemoveTitlesFromGOKb() {
201         return autoRemoveTitlesFromGOKb;
202     }
203 
204     public void setAutoRemoveTitlesFromGOKb(String autoRemoveTitlesFromGOKb) {
205         this.autoRemoveTitlesFromGOKb = autoRemoveTitlesFromGOKb;
206     }
207 
208     public String getAutoUpdateMetaDataFromGOKb() {
209         return autoUpdateMetaDataFromGOKb;
210     }
211 
212     public void setAutoUpdateMetaDataFromGOKb(String autoUpdateMetaDataFromGOKb) {
213         this.autoUpdateMetaDataFromGOKb = autoUpdateMetaDataFromGOKb;
214     }
215 
216     public String getAutoArcInstanceRec() {
217         return autoArcInstanceRec;
218     }
219 
220     public void setAutoArcInstanceRec(String autoArcInstanceRec) {
221         this.autoArcInstanceRec = autoArcInstanceRec;
222     }
223 
224     public String getCovStartDate() {
225         return covStartDate;
226     }
227 
228     public void setCovStartDate(String covStartDate) {
229         this.covStartDate = covStartDate;
230     }
231 
232     public String getCovStartVolume() {
233         return covStartVolume;
234     }
235 
236     public void setCovStartVolume(String covStartVolume) {
237         this.covStartVolume = covStartVolume;
238     }
239 
240     public String getCovStartIssue() {
241         return covStartIssue;
242     }
243 
244     public void setCovStartIssue(String covStartIssue) {
245         this.covStartIssue = covStartIssue;
246     }
247 
248     public String getCovEndDate() {
249         return covEndDate;
250     }
251 
252     public void setCovEndDate(String covEndDate) {
253         this.covEndDate = covEndDate;
254     }
255 
256     public String getCovEndVolume() {
257         return covEndVolume;
258     }
259 
260     public void setCovEndVolume(String covEndVolume) {
261         this.covEndVolume = covEndVolume;
262     }
263 
264     public String getCovEndIssue() {
265         return covEndIssue;
266     }
267 
268     public void setCovEndIssue(String covEndIssue) {
269         this.covEndIssue = covEndIssue;
270     }
271 
272     public String getPerpetualAccStartDate() {
273         return perpetualAccStartDate;
274     }
275 
276     public void setPerpetualAccStartDate(String perpetualAccStartDate) {
277         this.perpetualAccStartDate = perpetualAccStartDate;
278     }
279 
280     public String getPerpetualAccStartVolume() {
281         return perpetualAccStartVolume;
282     }
283 
284     public void setPerpetualAccStartVolume(String perpetualAccStartVolume) {
285         this.perpetualAccStartVolume = perpetualAccStartVolume;
286     }
287 
288     public String getPerpetualAccStartIssue() {
289         return perpetualAccStartIssue;
290     }
291 
292     public void setPerpetualAccStartIssue(String perpetualAccStartIssue) {
293         this.perpetualAccStartIssue = perpetualAccStartIssue;
294     }
295 
296     public String getPerpetualAccEndDate() {
297         return perpetualAccEndDate;
298     }
299 
300     public void setPerpetualAccEndDate(String perpetualAccEndDate) {
301         this.perpetualAccEndDate = perpetualAccEndDate;
302     }
303 
304     public String getPerpetualAccEndVolume() {
305         return perpetualAccEndVolume;
306     }
307 
308     public void setPerpetualAccEndVolume(String perpetualAccEndVolume) {
309         this.perpetualAccEndVolume = perpetualAccEndVolume;
310     }
311 
312     public String getPerpetualAccEndIssue() {
313         return perpetualAccEndIssue;
314     }
315 
316     public void setPerpetualAccEndIssue(String perpetualAccEndIssue) {
317         this.perpetualAccEndIssue = perpetualAccEndIssue;
318     }
319 
320     public OLEEResourceRecordDocument getOleERSDocument() {
321         return oleERSDocument;
322     }
323 
324     public void setOleERSDocument(OLEEResourceRecordDocument oleERSDocument) {
325         this.oleERSDocument = oleERSDocument;
326     }
327 
328     public String getUrl() {
329         return url;
330     }
331 
332     public void setUrl(String url) {
333         this.url = url;
334     }
335 
336     public String geteResourceName() {
337         eResourceName = this.oleERSDocument.getTitle();
338         return eResourceName;
339     }
340 
341     public void seteResourceName(String eResourceName) {
342         this.eResourceName = eResourceName;
343     }
344 
345     public String geteResourceDocNum() {
346         this.eResourceDocNum = this.oleERSDocument.getDocumentNumber();
347         return eResourceDocNum;
348     }
349 
350     public void seteResourceDocNum(String eResourceDocNum) {
351         this.eResourceDocNum = eResourceDocNum;
352     }
353 
354     /*
355     public List<OLEEResourceCopy> getOleCopyList() {
356         return oleCopyList;
357     }
358 
359     public void setOleCopyList(List<OLEEResourceCopy> oleCopyList) {
360         this.oleCopyList = oleCopyList;
361     }*/
362 
363     public boolean isSelect() {
364         return select;
365     }
366 
367     public void setSelect(boolean select) {
368         this.select = select;
369     }
370 
371     public String getRedirectUrl() {
372         if (StringUtils.isNotBlank(this.getPlatformId())) {
373             Map map = new HashMap<>();
374             map.put(org.kuali.ole.OLEConstants.OLE_PLATFORM_ID, this.getPlatformId());
375             List<OLEPlatformRecordDocument> olePlatformRecordDocumentList = (List<OLEPlatformRecordDocument>) KRADServiceLocator.getBusinessObjectService().findMatching(OLEPlatformRecordDocument.class, map);
376             if (olePlatformRecordDocumentList != null && olePlatformRecordDocumentList.size() == 1) {
377                 redirectUrl = ConfigContext.getCurrentContextConfig().getProperty("ole.platform.url") + "platformRecordController?viewId=OLEPlatformRecordView&methodToCall=docHandler&docId=" + olePlatformRecordDocumentList.get(0).getDocumentNumber()+"&command=displayDocSearchView";
378 
379             }
380         }
381         return redirectUrl;
382     }
383 
384     public void setRedirectUrl(String redirectUrl) {
385         this.redirectUrl = redirectUrl;
386     }
387 
388     public Integer getGokbId() {
389         return gokbId;
390     }
391 
392     public void setGokbId(Integer gokbId) {
393         this.gokbId = gokbId;
394     }
395 
396     public String getTippStatus() {
397         return tippStatus;
398     }
399 
400     public void setTippStatus(String tippStatus) {
401         this.tippStatus = tippStatus;
402     }
403 }