1 package org.kuali.ole.select.document;
2
3 import org.joda.time.DateTime;
4 import org.kuali.ole.OLEConstants;
5 import org.kuali.ole.alert.document.OleTransactionalDocumentBase;
6 import org.kuali.ole.describe.bo.OleStatisticalSearchingCodes;
7 import org.kuali.ole.docstore.common.client.DocstoreClientLocator;
8 import org.kuali.ole.docstore.common.document.EHoldings;
9 import org.kuali.ole.docstore.common.document.Holdings;
10 import org.kuali.ole.docstore.common.document.content.instance.Link;
11 import org.kuali.ole.docstore.common.document.content.instance.OleHoldings;
12 import org.kuali.ole.docstore.common.document.content.instance.xstream.HoldingOlemlRecordProcessor;
13 import org.kuali.ole.module.purap.businessobject.PurchaseOrderType;
14 import org.kuali.ole.select.bo.*;
15 import org.kuali.ole.select.businessobject.OleCopy;
16 import org.kuali.ole.select.form.OLEEResourceRecordForm;
17 import org.kuali.ole.service.OLEEResourceHelperService;
18 import org.kuali.ole.service.OLEEResourceSearchService;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.ole.vnd.businessobject.VendorDetail;
21 import org.kuali.rice.core.api.config.property.ConfigContext;
22 import org.kuali.rice.core.api.datetime.DateTimeService;
23 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
24 import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator;
25 import org.kuali.rice.coreservice.api.parameter.Parameter;
26 import org.kuali.rice.coreservice.api.parameter.ParameterKey;
27 import org.kuali.rice.kew.api.document.attribute.DocumentAttribute;
28 import org.kuali.rice.kew.api.document.search.DocumentSearchResult;
29 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
30 import org.kuali.rice.krad.document.TransactionalDocumentBase;
31 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
32 import org.kuali.rice.krad.service.BusinessObjectService;
33 import org.kuali.rice.krad.service.KRADServiceLocator;
34 import org.kuali.rice.krad.util.GlobalVariables;
35 import org.apache.commons.lang.StringUtils;
36
37 import javax.servlet.http.HttpSession;
38 import java.lang.reflect.Method;
39 import java.math.BigDecimal;
40 import java.sql.Date;
41 import java.sql.Timestamp;
42 import java.text.ParseException;
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.List;
46 import java.util.Map;
47
48
49
50
51
52
53
54
55 public class OLEEResourceRecordDocument extends OleTransactionalDocumentBase {
56
57 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OLEEResourceRecordDocument.class);
58 private BusinessObjectService boService;
59 private OLEEResourceSearchService oleEResourceSearchService = null;
60 private OLEEResourceHelperService oleeResourceHelperService = null;
61 private String accessDescription;
62 private String oleERSIdentifier;
63 private String title;
64 private String description;
65 private String publisher;
66 private String publisherId;
67 private Integer gokbIdentifier;
68 private String isbn;
69 private String ISBN;
70 private String oclc;
71 private String platformProvider;
72 private String statusId;
73 private String statusName;
74 private String statusDate;
75 private String fundCode;
76 private String fundId;
77
78
79 private String vendorName;
80 private String vendorId;
81 private String vendorLink;
82 private String estimatedPrice;
83 private BigDecimal orderTypeId;
84 private String paymentTypeId;
85 private String packageTypeId;
86 private String packageScopeId;
87 private boolean breakable;
88 private boolean fixedTitleList;
89 private String noteId;
90 private String publicDisplayNote;
91 private String reqSelComment;
92 private String reqPriority;
93 private String techRequirements;
94 private String accessTypeId;
95 private String accessType;
96 private String accessStatus;
97 private String numOfSimultaneousUsers;
98 private String authenticationTypeId;
99 private String authenticationType;
100 private String accessLocationId;
101 private List<String> accessLocation = new ArrayList<>();
102 private List<String> accessLocationName = new ArrayList<>();
103 private boolean trialNeeded;
104 private String trialStatus;
105 private boolean licenseNeeded;
106 private String licenseReqStatus;
107 private String orderPayStatus;
108 private String activationStatus;
109 private boolean selectFlag;
110 private Integer statisticalSearchingCodeId;
111 private String statisticalSearchingCode;
112 private String selectInstance;
113 private String defaultCoverage;
114 private String defaultCoverageView;
115 private String defaultPerpetualAccess;
116 private String defaultPerpetualAccessView;
117 private OLEEResourceInstance oleERSInstance;
118 private boolean eInstanceFlag;
119 private String dummyDefaultCoverage;
120 private String dummyDefaultPerpetualAccess;
121 private boolean isCovEdited = false;
122 private boolean isPerAccEdited = false;
123 private String covStartDate;
124 private String covEndDate;
125 private String perAccStartDate;
126 private String perAccEndDate;
127 private String gokbId ;
128 private String subscriptionStatus;
129 private Timestamp currentSubscriptionStartDate;
130 private Timestamp currentSubscriptionEndDate;
131 private Timestamp initialSubscriptionStartDate;
132 private Timestamp cancellationDecisionDate;
133 private Timestamp cancellationEffectiveDate;
134 private String cancellationReason;
135 private boolean cancellationCandidate;
136 private boolean renewalAlertEnabled;
137 private String renewalNoticePeriod;
138 private String recipientId;
139 private String eresourceWorkflowIndication;
140 private String relationshipType;
141 private int activeTitlesCount;
142
143 private OLEAccessType oleAccessType;
144 private OLEPackageScope olePackageScope;
145 private OLEPackageType olePackageType;
146 private OLEPaymentType olePaymentType;
147 private OLERequestPriority oleRequestPriority;
148 private OLEAuthenticationType oleAuthenticationType;
149 private OleStatisticalSearchingCodes oleStatisticalCode;
150 private OLEEResourceStatus oleeResourceStatus;
151 private VendorDetail vendorDetail;
152 private PurchaseOrderType orderType;
153
154 private List<OLEMaterialTypeList> oleMaterialTypes = new ArrayList<OLEMaterialTypeList>();
155 private List<OLEContentTypes> oleContentTypes = new ArrayList<OLEContentTypes>();
156 private List<OLEFormatTypeList> oleFormatTypes = new ArrayList<OLEFormatTypeList>();
157 private List<OLEEResourceNotes> eresNotes = new ArrayList<OLEEResourceNotes>();
158 private List<OLEGOKbMappingValue> oleGOKbMappingValueList = new ArrayList<OLEGOKbMappingValue>();
159 private List<OLEPlatformAdminUrl> olePlatformAdminUrlList = new ArrayList<OLEPlatformAdminUrl>();
160 private List<OLEEResourceRequestor> requestors = new ArrayList<OLEEResourceRequestor>();
161 private List<OLEEResourceSelector> selectors = new ArrayList<OLEEResourceSelector>();
162 private List<OLEEResourceReqSelComments> reqSelComments = new ArrayList<OLEEResourceReqSelComments>();
163 private List<OLEEResourceVariantTitle> oleEResourceVariantTitleList = new ArrayList<OLEEResourceVariantTitle>();
164 private List<OLEEResourceEventLog> oleERSEventLogs = new ArrayList<OLEEResourceEventLog>();
165 private List<OLEEResourceLicense> oleERSLicenseRequests = new ArrayList<OLEEResourceLicense>();
166 private List<OLEEResourceInstance> oleERSInstances = new ArrayList<OLEEResourceInstance>();
167 private List<OLEEResourceInstance> eRSInstances = new ArrayList<OLEEResourceInstance>();
168 private List<OLEEResourceInstance> deletedInstances = new ArrayList<OLEEResourceInstance>();
169 private List<OLEEResourceInstance> purchaseOrderInstances = new ArrayList<OLEEResourceInstance>();
170 private List<OLEEResourceInvoices> oleERSInvoices = new ArrayList<>();
171 private List<OLEEResourceInvoices> eRSInvoices = new ArrayList<>();
172 private List<OLEEResourceContacts> oleERSContacts = new ArrayList<OLEEResourceContacts>();
173 private List<OLEEResourceChangeDashBoard> oleEResourceChangeDashBoards= new ArrayList<>();
174 private List<OLELinkedEresource> oleLinkedEresources= new ArrayList<>();
175 private List<OleCopy> copyList = new ArrayList<>();
176 private List<OLEEResourcePO> oleERSPOItems = new ArrayList<>();
177 private List<OLEEResourcePO> linkedERSPOItems = new ArrayList<>();
178 private List<OLEEResourcePO> eRSPOItems = new ArrayList<>();
179 private List<OLEEResourceAccountingLine> accountingLines = new ArrayList<>();
180 private OLEEResourceRecordForm form;
181 private String status=null;
182 private String gokbconfig;
183 private String removeOrRelinkToParent;
184 private DocstoreClientLocator docstoreClientLocator;
185 private String phone;
186 private double fiscalYearCost;
187 private double yearPriceQuote;
188 private double costIncrease;
189 private double percentageIncrease;
190 private String emailText;
191 private Integer gokbPackageId;
192
193 private List<OLEPhoneNumber> phoneNos = new ArrayList<>();
194 public boolean selectEResFlag;
195 private List<OLEStandardIdentifier> standardIdentifiers = new ArrayList<>();
196 private List<OLEGOKbPackage> goKbPackageList = new ArrayList<>();
197 private List<OLEGOKbPlatform> goKbPlatformList = new ArrayList<>();
198 private List<OLEGOKbPlatform> goKbPlatforms = new ArrayList<>();
199 private List<OLEGOKbTIPP> goKbTIPPList = new ArrayList<>();
200 private String profile;
201 private String gokbProfile;
202 private String gokbPackageStatus = "";
203
204 private Timestamp dateAccessConfirmed;
205 private String accessUserName;
206 private String accessPassword;
207 private String proxiedURL;
208 private boolean proxiedResource;
209 private String mobileAccessId;
210 private List<String> mobileAccess = new ArrayList<>();
211 private String mobileAccessNote;
212 private boolean brandingComplete;
213 private boolean platformConfigComplete;
214 private String marcRecordSourceTypeId;
215 private Timestamp lastRecordLoadDate;
216 private String marcRecordSource;
217 private String marcRecordUpdateFreqId;
218 private String marcRecordURL;
219 private String marcRecordUserName;
220 private String marcRecordPasword;
221 private String marcRecordNote;
222 private List<OLEEResourceAccessWorkflow> oleERSAccessWorkflows = new ArrayList<>();
223 private DateTimeService dateTimeService;
224 private String lineActions;
225 private String bannerMessage;
226 private Timestamp gokbLastUpdatedDate;
227 private String workflowConfigurationId;
228 private String oleAccessActivationDocumentNumber;
229 private List<OLEGOKbPlatform> selectedGoKbPlatforms = new ArrayList<>();
230 private boolean accessReadOnly = false;
231
232 public List<OLEGOKbPlatform> getSelectedGoKbPlatforms() {
233 return selectedGoKbPlatforms;
234 }
235
236 private boolean singlePlatform=true;
237 private Integer singlePaltformId;
238 private String workflowStatus;
239
240
241 public String getWorkflowStatus() {
242 return workflowStatus;
243 }
244
245 public void setWorkflowStatus(String workflowStatus) {
246 this.workflowStatus = workflowStatus;
247 }
248
249 public boolean isSinglePlatform() {
250 return singlePlatform;
251 }
252
253 public void setSinglePlatform(boolean singlePlatform) {
254 this.singlePlatform = singlePlatform;
255 }
256
257 public Integer getSinglePaltformId() {
258 return singlePaltformId;
259 }
260
261 public void setSinglePaltformId(Integer singlePaltformId) {
262 this.singlePaltformId = singlePaltformId;
263 }
264
265 public void setSelectedGoKbPlatforms(List<OLEGOKbPlatform> selectedGoKbPlatforms) {
266 this.selectedGoKbPlatforms = selectedGoKbPlatforms;
267 }
268
269 public BusinessObjectService getBoService() {
270 if(null == boService){
271 boService = KRADServiceLocator.getBusinessObjectService();
272 }
273 return boService;
274 }
275
276 public Integer getGokbPackageId() {
277 return gokbPackageId;
278 }
279
280 public void setGokbPackageId(Integer gokbPackageId) {
281 this.gokbPackageId = gokbPackageId;
282 }
283
284 public void setBoService(BusinessObjectService boService) {
285 this.boService = boService;
286 }
287
288 public DateTimeService getDateTimeService() {
289 return (DateTimeService)SpringContext.getService("dateTimeService");
290 }
291
292 public DocstoreClientLocator getDocstoreClientLocator() {
293
294 if (docstoreClientLocator == null) {
295 docstoreClientLocator = SpringContext.getBean(DocstoreClientLocator.class);
296 }
297 return docstoreClientLocator;
298 }
299
300 public OLEEResourceHelperService getOleeResourceHelperService() {
301 if(oleeResourceHelperService == null) {
302 oleeResourceHelperService = new OLEEResourceHelperService();
303 }
304 return oleeResourceHelperService;
305 }
306
307
308 public OLEEResourceRecordDocument() {
309 getOleMaterialTypes().add(new OLEMaterialTypeList());
310 getOleFormatTypes().add(new OLEFormatTypeList());
311 getOleContentTypes().add(new OLEContentTypes());
312 getRequestors().add(new OLEEResourceRequestor());
313 getSelectors().add(new OLEEResourceSelector());
314 getReqSelComments().add(new OLEEResourceReqSelComments());
315 getOleEResourceVariantTitleList().add(new OLEEResourceVariantTitle());
316 getEresNotes().add(new OLEEResourceNotes());
317 getStandardIdentifiers().add(new OLEStandardIdentifier());
318 }
319
320
321
322
323
324
325
326
327 public List<OLEPlatformAdminUrl> getOlePlatformAdminUrlList() {
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404 return olePlatformAdminUrlList;
405 }
406
407 public final String getParameter(String parameterName) {
408 ParameterKey parameterKey = ParameterKey.create(OLEConstants.APPL_ID, OLEConstants.SELECT_NMSPC, OLEConstants.SELECT_CMPNT, parameterName);
409 Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
410 return parameter != null ? parameter.getValue() : null;
411 }
412
413 public List<OLEEResourceVariantTitle> getOleEResourceVariantTitleList() {
414 return oleEResourceVariantTitleList;
415 }
416
417 public void setOleEResourceVariantTitleList(List<OLEEResourceVariantTitle> oleEResourceVariantTitleList) {
418 this.oleEResourceVariantTitleList = oleEResourceVariantTitleList;
419 }
420
421 public void setOlePlatformAdminUrlList(List<OLEPlatformAdminUrl> olePlatformAdminUrlList) {
422 this.olePlatformAdminUrlList = olePlatformAdminUrlList;
423 }
424
425 public String getEresourceWorkflowIndication() {
426 return eresourceWorkflowIndication;
427 }
428
429 public void setEresourceWorkflowIndication(String eresourceWorkflowIndication) {
430 this.eresourceWorkflowIndication = eresourceWorkflowIndication;
431 }
432
433 public String getStatusName() {
434 if (getStatusId() != null) {
435 oleeResourceStatus = getBoService().findBySinglePrimaryKey(OLEEResourceStatus.class, statusId);
436 statusName = oleeResourceStatus.getOleEResourceStatusName();
437 }
438 return statusName;
439 }
440
441 public OLEEResourceSearchService getOleEResourceSearchService() {
442 if (oleEResourceSearchService == null) {
443 oleEResourceSearchService = GlobalResourceLoader.getService(OLEConstants.OLEEResourceRecord.ERESOURSE_SEARCH_SERVICE);
444 }
445 return oleEResourceSearchService;
446 }
447
448
449
450 public String getRecipientId() {
451 return recipientId;
452 }
453
454 public void setRecipientId(String recipientId) {
455 this.recipientId = recipientId;
456 }
457
458 public String getAccessStatus() {
459 return accessStatus;
460 }
461
462 public void setAccessStatus(String accessStatus) {
463 this.accessStatus = accessStatus;
464 }
465
466 public Timestamp getCancellationDecisionDate() {
467 return cancellationDecisionDate;
468 }
469
470 public void setCancellationDecisionDate(Timestamp cancellationDecisionDate) {
471 this.cancellationDecisionDate = cancellationDecisionDate;
472 }
473
474 public Timestamp getCancellationEffectiveDate() {
475 return cancellationEffectiveDate;
476 }
477
478 public void setCancellationEffectiveDate(Timestamp cancellationEffectiveDate) {
479 this.cancellationEffectiveDate = cancellationEffectiveDate;
480 }
481
482 public String getCancellationReason() {
483 return cancellationReason;
484 }
485
486 public void setCancellationReason(String cancellationReason) {
487 this.cancellationReason = cancellationReason;
488 }
489
490 public boolean isCancellationCandidate() {
491 return cancellationCandidate;
492 }
493
494 public void setCancellationCandidate(boolean cancellationCandidate) {
495 this.cancellationCandidate = cancellationCandidate;
496 }
497
498 public boolean isRenewalAlertEnabled() {
499 return renewalAlertEnabled;
500 }
501
502 public void setRenewalAlertEnabled(boolean renewalAlertEnabled) {
503 this.renewalAlertEnabled = renewalAlertEnabled;
504 }
505
506 public String getRenewalNoticePeriod() {
507 return renewalNoticePeriod;
508 }
509
510 public void setRenewalNoticePeriod(String renewalNoticePeriod) {
511 this.renewalNoticePeriod = renewalNoticePeriod;
512 }
513
514 public String getSubscriptionStatus() {
515 return subscriptionStatus;
516 }
517
518 public void setSubscriptionStatus(String subscriptionStatus) {
519 this.subscriptionStatus = subscriptionStatus;
520 }
521
522 public Timestamp getCurrentSubscriptionStartDate() {
523 return currentSubscriptionStartDate;
524 }
525
526 public void setCurrentSubscriptionStartDate(Timestamp currentSubscriptionStartDate) {
527 this.currentSubscriptionStartDate = currentSubscriptionStartDate;
528 }
529
530 public Timestamp getCurrentSubscriptionEndDate() {
531 return currentSubscriptionEndDate;
532 }
533
534 public void setCurrentSubscriptionEndDate(Timestamp currentSubscriptionEndDate) {
535 this.currentSubscriptionEndDate = currentSubscriptionEndDate;
536 }
537
538 public Timestamp getInitialSubscriptionStartDate() {
539 return initialSubscriptionStartDate;
540 }
541
542 public void setInitialSubscriptionStartDate(Timestamp initialSubscriptionStartDate) {
543 this.initialSubscriptionStartDate = initialSubscriptionStartDate;
544 }
545
546 public void setStatusName(String statusName) {
547 this.statusName = statusName;
548 }
549
550 public OLEEResourceRecordForm getForm() {
551 return form;
552 }
553
554 public void setForm(OLEEResourceRecordForm form) {
555 this.form = form;
556 }
557
558 public String getOleERSIdentifier() {
559 return oleERSIdentifier;
560 }
561
562 public String getISBN() {
563 return ISBN;
564 }
565
566 public void setISBN(String ISBN) {
567 this.ISBN = ISBN;
568 }
569
570 public String getOclc() {
571 return oclc;
572 }
573
574 public void setOclc(String oclc) {
575 this.oclc = oclc;
576 }
577
578 public void setOleERSIdentifier(String oleERSIdentifier) {
579 this.oleERSIdentifier = oleERSIdentifier;
580 }
581
582 public String getVendorId() {
583 return vendorId;
584 }
585
586 public void setVendorId(String vendorId) {
587 this.vendorId = vendorId;
588 }
589
590 public String getVendorLink() {
591 if (StringUtils.isNotBlank(this.getVendorId())){
592 String[] vendorDetails = this.getVendorId().split("-");
593 Integer vendorHeaderGeneratedIdentifier = vendorDetails.length > 0 ? Integer.parseInt(vendorDetails[0]) : 0;
594 Integer vendorDetailAssignedIdentifier = vendorDetails.length > 1 ? Integer.parseInt(vendorDetails[1]) : 0;
595 String oleurl = ConfigContext.getCurrentContextConfig().getProperty("ole.url");
596 String url = oleurl + "/kr/inquiry.do?methodToCall=start&businessObjectClassName=org.kuali.ole.vnd.businessobject.VendorDetail&vendorHeaderGeneratedIdentifier=" + vendorHeaderGeneratedIdentifier + "&vendorDetailAssignedIdentifier="
597 + vendorDetailAssignedIdentifier;
598 return url;
599 }
600 return vendorLink;
601 }
602
603 public void setVendorLink(String vendorLink) {
604 this.vendorLink = vendorLink;
605 }
606
607 public String getStatisticalSearchingCode() {
608 return statisticalSearchingCode;
609 }
610
611 public void setStatisticalSearchingCode(String statisticalSearchingCode) {
612 this.statisticalSearchingCode = statisticalSearchingCode;
613 }
614
615 public Integer getStatisticalSearchingCodeId() {
616 return statisticalSearchingCodeId;
617 }
618
619 public void setStatisticalSearchingCodeId(Integer statisticalSearchingCodeId) {
620 this.statisticalSearchingCodeId = statisticalSearchingCodeId;
621 }
622
623 public String getTitle() {
624 return title;
625 }
626
627 public void setTitle(String title) {
628 this.title = title;
629 }
630
631 public String getDescription() {
632 return description;
633 }
634
635 public void setDescription(String description) {
636 this.description = description;
637 }
638
639 public String getPublisher() {
640 if (StringUtils.isNotBlank(publisherId)) {
641 String[] publisherDetails = publisherId.split("-");
642 Map vendorMap = new HashMap<>();
643 vendorMap.put(OLEConstants.OLEEResourceRecord.VENDOR_HEADER_GEN_ID, publisherDetails.length > 0 ? Integer.parseInt(publisherDetails[0]) : 0);
644 vendorMap.put(OLEConstants.OLEEResourceRecord.VENDOR_DETAILED_ASSIGNED_ID, publisherDetails.length > 1 ? Integer.parseInt(publisherDetails[1]) : 0);
645 VendorDetail vendorDetailDoc = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(VendorDetail.class, vendorMap);
646 if (vendorDetailDoc != null) {
647 return vendorDetailDoc.getVendorName();
648 }
649 }
650 return publisher;
651 }
652
653 public void setPublisher(String publisher) {
654 this.publisher = publisher;
655 }
656
657 public String getPublisherId() {
658 return publisherId;
659 }
660
661 public void setPublisherId(String publisherId) {
662 this.publisherId = publisherId;
663 }
664
665 public Integer getGokbIdentifier() {
666 return gokbIdentifier;
667 }
668
669 public void setGokbIdentifier(Integer gokbIdentifier) {
670 this.gokbIdentifier = gokbIdentifier;
671 }
672
673 public String getIsbn() {
674 return isbn;
675 }
676
677 public void setIsbn(String isbn) {
678 this.isbn = isbn;
679 }
680
681 public String getPlatformProvider() {
682 return platformProvider;
683 }
684
685 public void setPlatformProvider(String platformProvider) {
686 this.platformProvider = platformProvider;
687 }
688
689 public String getStatusId() {
690 return statusId;
691 }
692
693 public void setStatusId(String statusId) {
694 this.statusId = statusId;
695 }
696
697 public String getStatusDate() {
698 if (this.statusDate != null) {
699 return statusDate.substring(0, 10);
700 } else
701 return new Date(System.currentTimeMillis()).toString().substring(0, 10);
702 }
703
704 public void setStatusDate(String statusDate) {
705 this.statusDate = statusDate;
706 }
707
708 public String getFundCode() {
709 return fundCode;
710 }
711
712 public void setFundCode(String fundCode) {
713 this.fundCode = fundCode;
714 }
715
716 public String getFundId() {
717 return fundId;
718 }
719
720 public void setFundId(String fundId) {
721 this.fundId = fundId;
722 }
723
724 public String getEstimatedPrice() {
725 return estimatedPrice;
726 }
727
728 public void setEstimatedPrice(String estimatedPrice) {
729 this.estimatedPrice = estimatedPrice;
730 }
731
732 public BigDecimal getOrderTypeId() {
733 return orderTypeId;
734 }
735
736 public void setOrderTypeId(BigDecimal orderTypeId) {
737 this.orderTypeId = orderTypeId;
738 }
739
740 public String getPaymentTypeId() {
741 return paymentTypeId;
742 }
743
744 public void setPaymentTypeId(String paymentTypeId) {
745 this.paymentTypeId = paymentTypeId;
746 }
747
748 public String getPackageTypeId() {
749 return packageTypeId;
750 }
751
752 public void setPackageTypeId(String packageTypeId) {
753 this.packageTypeId = packageTypeId;
754 }
755
756 public String getPackageScopeId() {
757 return packageScopeId;
758 }
759
760 public void setPackageScopeId(String packageScopeId) {
761 this.packageScopeId = packageScopeId;
762 }
763
764 public boolean isBreakable() {
765 return breakable;
766 }
767
768 public void setBreakable(boolean breakable) {
769 this.breakable = breakable;
770 }
771
772 public boolean isFixedTitleList() {
773 return fixedTitleList;
774 }
775
776 public void setFixedTitleList(boolean fixedTitleList) {
777 this.fixedTitleList = fixedTitleList;
778 }
779
780 public String getNoteId() {
781 return noteId;
782 }
783
784 public void setNoteId(String noteId) {
785 this.noteId = noteId;
786 }
787
788 public String getPublicDisplayNote() {
789 return publicDisplayNote;
790 }
791
792 public void setPublicDisplayNote(String publicDisplayNote) {
793 this.publicDisplayNote = publicDisplayNote;
794 }
795
796 public String getReqSelComment() {
797 return reqSelComment;
798 }
799
800 public void setReqSelComment(String reqSelComment) {
801 this.reqSelComment = reqSelComment;
802 }
803
804 public String getReqPriority() {
805 return reqPriority;
806 }
807
808 public void setReqPriority(String reqPriority) {
809 this.reqPriority = reqPriority;
810 }
811
812 public String getTechRequirements() {
813 return techRequirements;
814 }
815
816 public void setTechRequirements(String techRequirements) {
817 this.techRequirements = techRequirements;
818 }
819
820 public String getAccessTypeId() {
821 return accessTypeId;
822 }
823
824 public void setAccessTypeId(String accessTypeId) {
825 this.accessTypeId = accessTypeId;
826 }
827
828 public String getAccessType() {
829 return accessType;
830 }
831
832 public void setAccessType(String accessType) {
833 this.accessType = accessType;
834 }
835
836 public String getNumOfSimultaneousUsers() {
837 return numOfSimultaneousUsers;
838 }
839
840 public void setNumOfSimultaneousUsers(String numOfSimultaneousUsers) {
841 this.numOfSimultaneousUsers = numOfSimultaneousUsers;
842 }
843
844 public String getAuthenticationTypeId() {
845 return authenticationTypeId;
846 }
847
848 public void setAuthenticationTypeId(String authenticationTypeId) {
849 this.authenticationTypeId = authenticationTypeId;
850 }
851
852 public String getAuthenticationType() {
853 return authenticationType;
854 }
855
856 public void setAuthenticationType(String authenticationType) {
857 this.authenticationType = authenticationType;
858 }
859
860 public String getAccessLocationId() {
861 return accessLocationId;
862 }
863
864 public void setAccessLocationId(String accessLocationId) {
865 this.accessLocationId = accessLocationId;
866 }
867
868 public List<String> getAccessLocation() {
869 return accessLocation;
870 }
871
872 public void setAccessLocation(List<String> accessLocation) {
873 this.accessLocation = accessLocation;
874 }
875
876 public List<String> getAccessLocationName() {
877 return accessLocationName;
878 }
879
880 public void setAccessLocationName(List<String> accessLocationName) {
881 this.accessLocationName = accessLocationName;
882 }
883
884 public boolean isTrialNeeded() {
885 return trialNeeded;
886 }
887
888 public void setTrialNeeded(boolean trialNeeded) {
889 this.trialNeeded = trialNeeded;
890 }
891
892 public String getTrialStatus() {
893 return trialStatus;
894 }
895
896 public void setTrialStatus(String trialStatus) {
897 this.trialStatus = trialStatus;
898 }
899
900 public boolean isLicenseNeeded() {
901 return licenseNeeded;
902 }
903
904 public void setLicenseNeeded(boolean licenseNeeded) {
905 this.licenseNeeded = licenseNeeded;
906 }
907
908 public String getLicenseReqStatus() {
909 return licenseReqStatus;
910 }
911
912 public void setLicenseReqStatus(String licenseReqStatus) {
913 this.licenseReqStatus = licenseReqStatus;
914 }
915
916 public String getOrderPayStatus() {
917 return orderPayStatus;
918 }
919
920 public void setOrderPayStatus(String orderPayStatus) {
921 this.orderPayStatus = orderPayStatus;
922 }
923
924 public String getActivationStatus() {
925 return activationStatus;
926 }
927
928 public void setActivationStatus(String activationStatus) {
929 this.activationStatus = activationStatus;
930 }
931
932 public OLEAccessType getOleAccessType() {
933 return oleAccessType;
934 }
935
936 public void setOleAccessType(OLEAccessType oleAccessType) {
937 this.oleAccessType = oleAccessType;
938 }
939
940 public OLEPackageScope getOlePackageScope() {
941 return olePackageScope;
942 }
943
944 public void setOlePackageScope(OLEPackageScope olePackageScope) {
945 this.olePackageScope = olePackageScope;
946 }
947
948 public OLEPackageType getOlePackageType() {
949 return olePackageType;
950 }
951
952 public void setOlePackageType(OLEPackageType olePackageType) {
953 this.olePackageType = olePackageType;
954 }
955
956 public OLEPaymentType getOlePaymentType() {
957 return olePaymentType;
958 }
959
960 public void setOlePaymentType(OLEPaymentType olePaymentType) {
961 this.olePaymentType = olePaymentType;
962 }
963
964 public OLERequestPriority getOleRequestPriority() {
965 return oleRequestPriority;
966 }
967
968 public void setOleRequestPriority(OLERequestPriority oleRequestPriority) {
969 this.oleRequestPriority = oleRequestPriority;
970 }
971
972 public OLEAuthenticationType getOleAuthenticationType() {
973 return oleAuthenticationType;
974 }
975
976 public void setOleAuthenticationType(OLEAuthenticationType oleAuthenticationType) {
977 this.oleAuthenticationType = oleAuthenticationType;
978 }
979
980 public OLEEResourceStatus getOleeResourceStatus() {
981 return oleeResourceStatus;
982 }
983
984 public void setOleeResourceStatus(OLEEResourceStatus oleeResourceStatus) {
985 this.oleeResourceStatus = oleeResourceStatus;
986 }
987
988 public List<OLEFormatTypeList> getOleFormatTypes() {
989 return oleFormatTypes;
990 }
991
992 public void setOleFormatTypes(List<OLEFormatTypeList> oleFormatTypes) {
993 this.oleFormatTypes = oleFormatTypes;
994 }
995
996 public List<OLEMaterialTypeList> getOleMaterialTypes() {
997 return oleMaterialTypes;
998 }
999
1000 public void setOleMaterialTypes(List<OLEMaterialTypeList> oleMaterialTypes) {
1001 this.oleMaterialTypes = oleMaterialTypes;
1002 }
1003
1004 public List<OLEContentTypes> getOleContentTypes() {
1005 return oleContentTypes;
1006 }
1007
1008 public void setOleContentTypes(List<OLEContentTypes> oleContentTypes) {
1009 this.oleContentTypes = oleContentTypes;
1010 }
1011
1012 public List<OLEEResourceNotes> getEresNotes() {
1013 return eresNotes;
1014 }
1015
1016 public void setEresNotes(List<OLEEResourceNotes> eresNotes) {
1017 this.eresNotes = eresNotes;
1018 }
1019
1020 public List<OLEEResourceRequestor> getRequestors() {
1021 return requestors;
1022 }
1023
1024 public void setRequestors(List<OLEEResourceRequestor> requestors) {
1025 this.requestors = requestors;
1026 }
1027
1028 public List<OLEEResourceSelector> getSelectors() {
1029 return selectors;
1030 }
1031
1032 public void setSelectors(List<OLEEResourceSelector> selectors) {
1033 this.selectors = selectors;
1034 }
1035
1036 public List<OLEEResourceReqSelComments> getReqSelComments() {
1037 return reqSelComments;
1038 }
1039
1040 public void setReqSelComments(List<OLEEResourceReqSelComments> reqSelComments) {
1041 this.reqSelComments = reqSelComments;
1042 }
1043
1044 public List<OLEEResourceEventLog> getOleERSEventLogs() {
1045 return oleERSEventLogs;
1046 }
1047
1048 public void setOleERSEventLogs(List<OLEEResourceEventLog> oleERSEventLogs) {
1049 this.oleERSEventLogs = oleERSEventLogs;
1050 }
1051
1052 public List<OLEEResourceLicense> getOleERSLicenseRequests() {
1053 return oleERSLicenseRequests;
1054 }
1055
1056 public void setOleERSLicenseRequests(List<OLEEResourceLicense> oleERSLicenseRequests) {
1057 this.oleERSLicenseRequests = oleERSLicenseRequests;
1058 }
1059
1060 public boolean isSelectFlag() {
1061 return selectFlag;
1062 }
1063
1064 public void setSelectFlag(boolean selectFlag) {
1065 this.selectFlag = selectFlag;
1066 }
1067
1068 public String getSelectInstance() {
1069 return selectInstance;
1070 }
1071
1072 public void setSelectInstance(String selectInstance) {
1073 this.selectInstance = selectInstance;
1074 }
1075
1076 public String getDefaultCoverage() {
1077 return defaultCoverage;
1078 }
1079
1080 public void setDefaultCoverage(String defaultCoverage) {
1081 this.defaultCoverage = defaultCoverage;
1082 }
1083
1084 public String getDefaultPerpetualAccess() {
1085 return defaultPerpetualAccess;
1086 }
1087
1088 public void setDefaultPerpetualAccess(String defaultPerpetualAccess) {
1089 this.defaultPerpetualAccess = defaultPerpetualAccess;
1090 }
1091
1092 public String getDefaultCoverageView() {
1093 return defaultCoverageView;
1094 }
1095
1096 public void setDefaultCoverageView(String defaultCoverageView) {
1097 this.defaultCoverageView = defaultCoverageView;
1098 }
1099
1100 public String getDefaultPerpetualAccessView() {
1101 return defaultPerpetualAccessView;
1102 }
1103
1104 public void setDefaultPerpetualAccessView(String defaultPerpetualAccessView) {
1105 this.defaultPerpetualAccessView = defaultPerpetualAccessView;
1106 }
1107
1108 public List<OLEEResourceInstance> getOleERSInstances() {
1109 return oleERSInstances;
1110 }
1111
1112 public void setOleERSInstances(List<OLEEResourceInstance> oleERSInstances) {
1113 this.oleERSInstances = oleERSInstances;
1114 }
1115
1116 public List<OleCopy> getCopyList() {
1117 return copyList;
1118 }
1119
1120 public void setCopyList(List<OleCopy> copyList) {
1121 this.copyList = copyList;
1122 }
1123
1124 public List<OLEEResourcePO> getOleERSPOItems() {
1125 return oleERSPOItems;
1126 }
1127
1128 public void setOleERSPOItems(List<OLEEResourcePO> oleERSPOItems) {
1129 this.oleERSPOItems = oleERSPOItems;
1130 }
1131
1132 public VendorDetail getVendorDetail() {
1133 return vendorDetail;
1134 }
1135
1136 public void setVendorDetail(VendorDetail vendorDetail) {
1137 this.vendorDetail = vendorDetail;
1138 }
1139
1140 public PurchaseOrderType getOrderType() {
1141 return orderType;
1142 }
1143
1144 public void setOrderType(PurchaseOrderType orderType) {
1145 this.orderType = orderType;
1146 }
1147
1148 public String getVendorName() {
1149 return vendorName;
1150 }
1151
1152 public void setVendorName(String vendorName) {
1153 this.vendorName = vendorName;
1154 }
1155
1156 public OleStatisticalSearchingCodes getOleStatisticalCode() {
1157 return oleStatisticalCode;
1158 }
1159
1160 public void setOleStatisticalCode(OleStatisticalSearchingCodes oleStatisticalCode) {
1161 this.oleStatisticalCode = oleStatisticalCode;
1162 }
1163
1164 public OLEEResourceInstance getOleERSInstance() {
1165 return oleERSInstance;
1166 }
1167
1168 public void setOleERSInstance(OLEEResourceInstance oleERSInstance) {
1169 this.oleERSInstance = oleERSInstance;
1170 }
1171
1172 public List<OLEEResourceInvoices> getOleERSInvoices() {
1173 return oleERSInvoices;
1174 }
1175
1176 public void setOleERSInvoices(List<OLEEResourceInvoices> oleERSInvoices) {
1177 this.oleERSInvoices = oleERSInvoices;
1178 }
1179
1180 public boolean iseInstanceFlag() {
1181 return eInstanceFlag;
1182 }
1183
1184 public void seteInstanceFlag(boolean eInstanceFlag) {
1185 this.eInstanceFlag = eInstanceFlag;
1186 }
1187
1188 public String getDummyDefaultCoverage() {
1189 return dummyDefaultCoverage;
1190 }
1191
1192 public void setDummyDefaultCoverage(String dummyDefaultCoverage) {
1193 this.dummyDefaultCoverage = dummyDefaultCoverage;
1194 }
1195
1196 public String getDummyDefaultPerpetualAccess() {
1197 return dummyDefaultPerpetualAccess;
1198 }
1199
1200 public void setDummyDefaultPerpetualAccess(String dummyDefaultPerpetualAccess) {
1201 this.dummyDefaultPerpetualAccess = dummyDefaultPerpetualAccess;
1202 }
1203
1204 public boolean isCovEdited() {
1205 return isCovEdited;
1206 }
1207
1208 public void setCovEdited(boolean covEdited) {
1209 isCovEdited = covEdited;
1210 }
1211
1212 public boolean isPerAccEdited() {
1213 return isPerAccEdited;
1214 }
1215
1216 public void setPerAccEdited(boolean perAccEdited) {
1217 isPerAccEdited = perAccEdited;
1218 }
1219
1220 public String getCovStartDate() {
1221 return covStartDate;
1222 }
1223
1224 public void setCovStartDate(String covStartDate) {
1225 this.covStartDate = covStartDate;
1226 }
1227
1228 public String getCovEndDate() {
1229 return covEndDate;
1230 }
1231
1232 public void setCovEndDate(String covEndDate) {
1233 this.covEndDate = covEndDate;
1234 }
1235
1236 public String getPerAccStartDate() {
1237 return perAccStartDate;
1238 }
1239
1240 public void setPerAccStartDate(String perAccStartDate) {
1241 this.perAccStartDate = perAccStartDate;
1242 }
1243
1244 public String getPerAccEndDate() {
1245 return perAccEndDate;
1246 }
1247
1248 public void setPerAccEndDate(String perAccEndDate) {
1249 this.perAccEndDate = perAccEndDate;
1250 }
1251
1252 public List<OLEEResourceInvoices> geteRSInvoices() {
1253 return eRSInvoices;
1254 }
1255
1256 public void seteRSInvoices(List<OLEEResourceInvoices> eRSInvoices) {
1257 this.eRSInvoices = eRSInvoices;
1258 }
1259
1260 public List<OLEEResourcePO> geteRSPOItems() {
1261 return eRSPOItems;
1262 }
1263
1264 public void seteRSPOItems(List<OLEEResourcePO> eRSPOItems) {
1265 this.eRSPOItems = eRSPOItems;
1266 }
1267
1268 public List<OLEEResourceAccountingLine> getAccountingLines() {
1269 return accountingLines;
1270 }
1271
1272 public void setAccountingLines(List<OLEEResourceAccountingLine> accountingLines) {
1273 this.accountingLines = accountingLines;
1274 }
1275
1276 public List<OLEEResourceContacts> getOleERSContacts() {
1277 return oleERSContacts;
1278 }
1279
1280 public void setOleERSContacts(List<OLEEResourceContacts> oleERSContacts) {
1281 this.oleERSContacts = oleERSContacts;
1282 }
1283
1284 public String getGokbconfig() {
1285 return gokbconfig;
1286 }
1287
1288 public void setGokbconfig(String gokbconfig) {
1289 this.gokbconfig = gokbconfig;
1290 }
1291
1292 public void setResultDetails(DocumentSearchResult searchResult, List<OLESearchCondition> oleSearchEresources) {
1293 List<DocumentAttribute> documentAttributes = searchResult.getDocumentAttributes();
1294 for (DocumentAttribute docAttribute : documentAttributes) {
1295 String name = docAttribute.getName();
1296 if (OLEConstants.OLEEResourceRecord.ERESOURCE_RESULT_FIELDS.contains(name)) {
1297 if (name.equals(OLEConstants.OLEEResourceRecord.ERESOURCE_TITLE)) {
1298 name = OLEConstants.OLEEResourceRecord.ERESOURCE_TITLE;
1299 }
1300 Method getMethod;
1301 try {
1302 getMethod = getSetMethod(OLEEResourceRecordDocument.class, name, new Class[]{String.class});
1303 getMethod.invoke(this, docAttribute.getValue().toString());
1304 } catch (Exception ex) {
1305 ex.printStackTrace();
1306 }
1307 }
1308 }
1309 }
1310
1311 private Method getSetMethod(Class targetClass, String attr, Class[] objectAttributes) throws Exception {
1312 Method method = targetClass.getMethod("set" + StringUtils.capitalize(attr), objectAttributes);
1313 return method;
1314 }
1315
1316 @Override
1317 public void prepareForSave(KualiDocumentEvent event) {
1318
1319
1320 super.prepareForSave(event);
1321 try {
1322 LOG.debug("###########Inside OLEEResourceRecordDocument " + "prepareForSave###########");
1323 if (this.getStatisticalSearchingCode() != null && (!"".equals(this.getStatisticalSearchingCode().trim()))) {
1324 this.setStatisticalSearchingCodeId(Integer.parseInt(this.getStatisticalSearchingCode()));
1325 Map statisticalCodeMap = new HashMap<>();
1326 statisticalCodeMap.put(OLEConstants.OLEEResourceRecord.STATISTICAL_SEARCH_CD_ID, this.getStatisticalSearchingCodeId());
1327 OleStatisticalSearchingCodes oleStatisticalSearchingCodes = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OleStatisticalSearchingCodes.class, statisticalCodeMap);
1328 if(oleStatisticalSearchingCodes != null) {
1329 this.setOleStatisticalCode(oleStatisticalSearchingCodes);
1330 }
1331 }
1332 String vendorId = this.getVendorId();
1333 if (vendorId != null && !vendorId.isEmpty()) {
1334 String[] vendorDetails = vendorId.split("-");
1335 Integer vendorHeaderGeneratedIdentifier = vendorDetails.length > 0 ? Integer.parseInt(vendorDetails[0]) : 0;
1336 Integer vendorDetailAssignedIdentifier = vendorDetails.length > 1 ? Integer.parseInt(vendorDetails[1]) : 0;
1337 Map vendorMap = new HashMap<>();
1338 vendorMap.put(OLEConstants.OLEEResourceRecord.VENDOR_HEADER_GEN_ID, vendorHeaderGeneratedIdentifier);
1339 vendorMap.put(OLEConstants.OLEEResourceRecord.VENDOR_DETAILED_ASSIGNED_ID, vendorDetailAssignedIdentifier);
1340 VendorDetail vendorDetailDoc = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(VendorDetail.class, vendorMap);
1341 if (vendorDetailDoc != null) {
1342 this.setVendorName(vendorDetailDoc.getVendorName());
1343 }
1344 }
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356 String MobAccessId = "";
1357 if (this.getMobileAccess() != null && this.getMobileAccess().size() > 0) {
1358 List<String> mobileAccessId = this.getMobileAccess();
1359 if (mobileAccessId.size() > 0) {
1360 for (String mobileAccess : mobileAccessId) {
1361 MobAccessId += mobileAccess;
1362 MobAccessId += OLEConstants.OLEEResourceRecord.ACCESS_LOCATION_SEPARATOR;
1363 }
1364 this.setMobileAccessId(MobAccessId.substring(0, (MobAccessId.lastIndexOf(OLEConstants.OLEEResourceRecord.ACCESS_LOCATION_SEPARATOR))));
1365 }
1366 }
1367 this.setLicenseReqStatus("");
1368 List<OLEEResourceLicense> oleERSLicenses = this.getOleERSLicenseRequests();
1369 List<DateTime> modifiedDateList = new ArrayList<>();
1370 DateTime lastModifiedDate = null;
1371 if (oleERSLicenses.size() > 0) {
1372 for (int i = oleERSLicenses.size()-1; i >= 0; i--) {
1373 DateTime appStatus = oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatusDate();
1374 if (!OLEConstants.OLEEResourceRecord.ERESOURCE_STATUSES.contains(appStatus) &&
1375 (!oleERSLicenses.get(i).getDocumentRouteHeaderValue().getAppDocStatus().equalsIgnoreCase(
1376 OLEConstants.OLEEResourceRecord.LICENSE_FINAL_STATUS))) {
1377 modifiedDateList.add(appStatus);
1378 }
1379 DocumentRouteHeaderValue documentRouteHeaderValue = oleERSLicenses.get(i).getDocumentRouteHeaderValue();
1380 if(documentRouteHeaderValue != null) {
1381 String licenceTitle = documentRouteHeaderValue.getDocTitle();
1382 if(licenceTitle != null && !licenceTitle.isEmpty()) {
1383 licenceTitle = licenceTitle.substring(26);
1384 }
1385 oleERSLicenses.get(i).setDocumentDescription(licenceTitle);
1386 }
1387 }
1388 for (int modifiedDate = 0; modifiedDate<modifiedDateList.size(); modifiedDate++) {
1389 DateTime dateTime = modifiedDateList.get(modifiedDate);
1390 if (lastModifiedDate == null) {
1391 lastModifiedDate = dateTime;
1392 } else {
1393 if (dateTime.isAfter(lastModifiedDate)) {
1394 lastModifiedDate = dateTime;
1395 }
1396 }
1397 }
1398 for (int i = oleERSLicenses.size()-1; i >= 0; i--) {
1399 if (lastModifiedDate != null && lastModifiedDate.equals(oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatusDate())) {
1400 this.setLicenseReqStatus(oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatus());
1401 }
1402 }
1403 }
1404 } catch (Exception e) {
1405 LOG.error("Exception during prepareForSave()", e);
1406 throw new RuntimeException(e);
1407 }
1408
1409 List<OLEEResourceInstance> oleERSInstances = this.getOleERSInstances();
1410 if (oleERSInstances.size() > 0) {
1411 for (OLEEResourceInstance oleERSInstance : oleERSInstances) {
1412 if (StringUtils.isBlank(oleERSInstance.getSubscriptionStatus()) && StringUtils.isNotBlank(this.getSubscriptionStatus())) {
1413 oleERSInstance.setSubscriptionStatus(this.getSubscriptionStatus());
1414 }
1415 }
1416 }
1417 Map statusMap = new HashMap<>();
1418 statusMap.put(OLEConstants.OLEEResourceRecord.ERESOURCE_IDENTIFIER, this.getOleERSIdentifier());
1419 OLEEResourceRecordDocument oleERSDoc = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEEResourceRecordDocument.class, statusMap);
1420 if (oleERSDoc != null) {
1421 status = oleERSDoc.getStatusName();
1422 }
1423 OLEEResourceEventLog oleEResourceEventLog = new OLEEResourceEventLog();
1424 if (status == null){
1425 oleEResourceEventLog.setCurrentTimeStamp();
1426 oleEResourceEventLog.setEventUser(GlobalVariables.getUserSession().getPrincipalName());
1427 oleEResourceEventLog.setEventType(OLEConstants.OLEEResourceRecord.SYSTEM);
1428 oleEResourceEventLog.setEventNote(OLEConstants.OLEEResourceRecord.STATUS_IS+getStatusName());
1429 oleEResourceEventLog.setSaveFlag(true);
1430 this.getOleERSEventLogs().add(oleEResourceEventLog);
1431 }
1432 else if (!status.equals(getStatusName())){
1433 oleEResourceEventLog.setCurrentTimeStamp();
1434 oleEResourceEventLog.setEventUser(GlobalVariables.getUserSession().getPrincipalName());
1435 oleEResourceEventLog.setEventType(OLEConstants.OLEEResourceRecord.SYSTEM);
1436 oleEResourceEventLog.setEventNote(OLEConstants.OLEEResourceRecord.STATUS_FROM+ status +OLEConstants.OLEEResourceRecord.STATUS_TO+getStatusName());
1437 oleEResourceEventLog.setSaveFlag(true);
1438 this.getOleERSEventLogs().add(oleEResourceEventLog);
1439 }
1440 status=getStatusName();
1441 String defaultCov = this.getDummyDefaultCoverage();
1442 if(defaultCov != null && !defaultCov.isEmpty() && !this.isCovEdited()) {
1443 this.setCovEdited(true);
1444 getOleEResourceSearchService().getDefaultCovDatesToPopup(this,defaultCov);
1445 }
1446 String defaultPerAcc = this.getDummyDefaultPerpetualAccess();
1447 if(defaultPerAcc != null && !defaultPerAcc.isEmpty() && !this.isPerAccEdited()) {
1448 this.setPerAccEdited(true);
1449 getOleEResourceSearchService().getDefaultPerAccDatesToPopup(this,defaultPerAcc);
1450 }
1451 getOleEResourceSearchService().saveDefaultCoverageDate(this);
1452 getOleEResourceSearchService().saveDefaultPerpetualAccessDate(this);
1453 try {
1454 getOleEResourceSearchService().saveEResourceInstanceToDocstore(this);
1455 } catch (Exception e) {
1456 e.printStackTrace();
1457 }
1458 }
1459
1460 public void processAfterRetrieve() {
1461 super.processAfterRetrieve();
1462 if (this.getStatisticalSearchingCodeId() != null) {
1463 this.setStatisticalSearchingCode(this.getStatisticalSearchingCodeId().toString());
1464 }
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484 String mobileAccessId = this.getMobileAccessId();
1485 if (mobileAccessId != null && !mobileAccessId.isEmpty()) {
1486 String[] mobileAccess = mobileAccessId.split(OLEConstants.OLEEResourceRecord.ACCESS_LOCATION_SEPARATOR);
1487 List<String> mobileAccesses = new ArrayList<>();
1488 for (String mobileAccId : mobileAccess) {
1489 mobileAccesses.add(mobileAccId);
1490 }
1491 this.setMobileAccess(mobileAccesses);
1492 }
1493 if (this.getOleAccessType() != null) {
1494 this.setAccessType(this.getOleAccessType().getOleAccessTypeName());
1495 } else if (this.getAccessTypeId() != null) {
1496 Map accessTpeMap = new HashMap<>();
1497 accessTpeMap.put("oleAccessTypeId", this.getAccessTypeId());
1498 oleAccessType = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEAccessType.class, accessTpeMap);
1499 if (oleAccessType != null) {
1500 this.setAccessType(oleAccessType.getOleAccessTypeName());
1501 }
1502 }
1503 if (this.getOleAuthenticationType() != null) {
1504 this.setAuthenticationType(this.getOleAuthenticationType().getOleAuthenticationTypeName());
1505 } else if (this.getAuthenticationTypeId() != null) {
1506 Map authenticationMap = new HashMap();
1507 authenticationMap.put("oleAuthenticationTypeId", this.getAuthenticationTypeId());
1508 oleAuthenticationType = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEAuthenticationType.class, authenticationMap);
1509 if (oleAuthenticationType != null) {
1510 this.setAuthenticationType(oleAuthenticationType.getOleAuthenticationTypeName());
1511 }
1512 }
1513 this.setLicenseReqStatus("");
1514 List<OLEEResourceLicense> oleERSLicenses = this.getOleERSLicenseRequests();
1515 List<DateTime> modifiedDateList = new ArrayList<>();
1516 DateTime lastModifiedDate = null;
1517 if (oleERSLicenses.size() > 0) {
1518 for (int i = oleERSLicenses.size()-1; i >= 0; i--) {
1519 DateTime appStatus = oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatusDate();
1520 if (!OLEConstants.OLEEResourceRecord.ERESOURCE_STATUSES.contains(appStatus) &&
1521 (!oleERSLicenses.get(i).getDocumentRouteHeaderValue().getAppDocStatus().equalsIgnoreCase(
1522 OLEConstants.OLEEResourceRecord.LICENSE_FINAL_STATUS))) {
1523 modifiedDateList.add(appStatus);
1524 }
1525 DocumentRouteHeaderValue documentRouteHeaderValue = oleERSLicenses.get(i).getDocumentRouteHeaderValue();
1526 if(documentRouteHeaderValue != null) {
1527 String licenceTitle = documentRouteHeaderValue.getDocTitle();
1528 if(licenceTitle != null && !licenceTitle.isEmpty()) {
1529 licenceTitle = licenceTitle.substring(26);
1530 }
1531 oleERSLicenses.get(i).setDocumentDescription(licenceTitle);
1532 }
1533 }
1534 for (int modifiedDate = 0; modifiedDate<modifiedDateList.size(); modifiedDate++) {
1535 DateTime dateTime = modifiedDateList.get(modifiedDate);
1536 if (lastModifiedDate == null) {
1537 lastModifiedDate = dateTime;
1538 } else {
1539 if (dateTime.isAfter(lastModifiedDate)) {
1540 lastModifiedDate = dateTime;
1541 }
1542 }
1543 }
1544 for (int i = oleERSLicenses.size()-1; i >= 0; i--) {
1545 if (lastModifiedDate!=null && lastModifiedDate.equals(oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatusDate())) {
1546 this.setLicenseReqStatus(oleERSLicenses.get(i).getDocumentRouteHeaderValue().getApplicationDocumentStatus());
1547 }
1548 }
1549 }
1550 List<OLEEResourceInstance> oleERSInstances = this.getOleERSInstances();
1551 OLEEResourceInstance oleeResourceInstance = null;
1552 List<Holdings> holdingsList = new ArrayList<Holdings>();
1553 List<String> instanceId = new ArrayList<String>();
1554 if (oleERSInstances.size() > 0) {
1555 for (OLEEResourceInstance oleERSInstance : oleERSInstances) {
1556 instanceId.add(oleERSInstance.getInstanceId());
1557 }
1558 }
1559 if (instanceId.size() > 0) {
1560 for(String id:instanceId){
1561 try {
1562 holdingsList.add(getDocstoreClientLocator().getDocstoreClient().retrieveHoldings(id));
1563 } catch (Exception e) {
1564 e.printStackTrace();
1565 }
1566 }
1567 }
1568 for (Holdings holdings:holdingsList){
1569 if(holdings instanceof EHoldings){
1570 HoldingOlemlRecordProcessor holdingOlemlRecordProcessor=new HoldingOlemlRecordProcessor();
1571 OleHoldings oleHoldings=holdingOlemlRecordProcessor.fromXML(holdings.getContent());
1572 for (OLEEResourceInstance oleERSInstance : oleERSInstances) {
1573 if (holdings.getId().equals(oleERSInstance.getInstanceId())) {
1574 oleeResourceInstance = oleERSInstance;
1575 StringBuffer urls = new StringBuffer();
1576 for(Link link :oleHoldings.getLink()){
1577 urls.append(link.getUrl());
1578 urls.append(",");
1579 }
1580 if (urls != null && urls.length() > 0) {
1581 String url = urls.substring(0, urls.lastIndexOf(","));
1582 oleeResourceInstance.setUrl(url);
1583 }
1584 }
1585 }
1586 }
1587
1588 }
1589 getOleEResourceSearchService().getDefaultCovergeDate(this);
1590 getOleEResourceSearchService().getDefaultPerpetualAccessDate(this);
1591 getOleEResourceSearchService().getPOInvoiceForERS(this);
1592 getOleEResourceSearchService().getBannerMessage(this);
1593 getOleeResourceHelperService().updateVendorInfo(this);
1594 getOleEResourceSearchService().updatePlatformProvider(this);
1595 getOleeResourceHelperService().setAccessInfo(this);
1596
1597 }
1598
1599 public String getPhone() {
1600 return phone;
1601 }
1602
1603 public void setPhone(String phone) {
1604 this.phone = phone;
1605 }
1606
1607 public List<OLEPhoneNumber> getPhoneNos() {
1608 return phoneNos;
1609 }
1610
1611 public void setPhoneNos(List<OLEPhoneNumber> phoneNos) {
1612 this.phoneNos = phoneNos;
1613 }
1614
1615 public List<OLEEResourceChangeDashBoard> getOleEResourceChangeDashBoards() {
1616 return oleEResourceChangeDashBoards;
1617 }
1618
1619 public void setOleEResourceChangeDashBoards(List<OLEEResourceChangeDashBoard> oleEResourceChangeDashBoards) {
1620 this.oleEResourceChangeDashBoards = oleEResourceChangeDashBoards;
1621 }
1622
1623 public String getGokbId() {
1624 return gokbId;
1625 }
1626
1627 public void setGokbId(String gokbId) {
1628 this.gokbId = gokbId;
1629 }
1630
1631 public List<OLELinkedEresource> getOleLinkedEresources() {
1632 return oleLinkedEresources;
1633 }
1634
1635 public void setOleLinkedEresources(List<OLELinkedEresource> oleLinkedEresources) {
1636 this.oleLinkedEresources = oleLinkedEresources;
1637 }
1638
1639 public boolean isSelectEResFlag() {
1640 return selectEResFlag;
1641 }
1642
1643 public void setSelectEResFlag(boolean selectEResFlag) {
1644 this.selectEResFlag = selectEResFlag;
1645 }
1646
1647 public String getRemoveOrRelinkToParent() {
1648 return removeOrRelinkToParent;
1649 }
1650
1651 public void setRemoveOrRelinkToParent(String removeOrRelinkToParent) {
1652 this.removeOrRelinkToParent = removeOrRelinkToParent;
1653 }
1654
1655 public double getFiscalYearCost() {
1656 return fiscalYearCost;
1657 }
1658
1659 public void setFiscalYearCost(double fiscalYearCost) {
1660 this.fiscalYearCost = fiscalYearCost;
1661 }
1662
1663 public double getYearPriceQuote() {
1664 return yearPriceQuote;
1665 }
1666
1667 public void setYearPriceQuote(double yearPriceQuote) {
1668 this.yearPriceQuote = yearPriceQuote;
1669 }
1670
1671 public double getCostIncrease() {
1672 return costIncrease;
1673 }
1674
1675 public void setCostIncrease(double costIncrease) {
1676 this.costIncrease = costIncrease;
1677 }
1678
1679 public double getPercentageIncrease() {
1680 return percentageIncrease;
1681 }
1682
1683 public void setPercentageIncrease(double percentageIncrease) {
1684 this.percentageIncrease = percentageIncrease;
1685 }
1686
1687 public String getEmailText() {
1688 return emailText;
1689 }
1690
1691 public void setEmailText(String emailText) {
1692 this.emailText = emailText;
1693 }
1694
1695 public List<OLEStandardIdentifier> getStandardIdentifiers() {
1696 return standardIdentifiers;
1697 }
1698
1699 public void setStandardIdentifiers(List<OLEStandardIdentifier> standardIdentifiers) {
1700 this.standardIdentifiers = standardIdentifiers;
1701 }
1702
1703 public List<OLEGOKbPackage> getGoKbPackageList() {
1704 return goKbPackageList;
1705 }
1706
1707 public void setGoKbPackageList(List<OLEGOKbPackage> goKbPackageList) {
1708 this.goKbPackageList = goKbPackageList;
1709 }
1710
1711 public List<OLEGOKbPlatform> getGoKbPlatformList() {
1712 return goKbPlatformList;
1713 }
1714
1715 public void setGoKbPlatformList(List<OLEGOKbPlatform> goKbPlatformList) {
1716 this.goKbPlatformList = goKbPlatformList;
1717 }
1718
1719 public List<OLEGOKbTIPP> getGoKbTIPPList() {
1720 return goKbTIPPList;
1721 }
1722
1723 public void setGoKbTIPPList(List<OLEGOKbTIPP> goKbTIPPList) {
1724 this.goKbTIPPList = goKbTIPPList;
1725 }
1726
1727 public String getRelationshipType() {
1728 return relationshipType;
1729 }
1730
1731 public void setRelationshipType(String relationshipType) {
1732 this.relationshipType = relationshipType;
1733 }
1734
1735 public int getActiveTitlesCount() {
1736 return activeTitlesCount;
1737 }
1738
1739 public void setActiveTitlesCount(int activeTitlesCount) {
1740 this.activeTitlesCount = activeTitlesCount;
1741 }
1742
1743 public String getProfile() {
1744 return profile;
1745 }
1746
1747 public void setProfile(String profile) {
1748 this.profile = profile;
1749 }
1750
1751 public List<OLEGOKbPlatform> getGoKbPlatforms() {
1752 return goKbPlatforms;
1753 }
1754
1755 public void setGoKbPlatforms(List<OLEGOKbPlatform> goKbPlatforms) {
1756 this.goKbPlatforms = goKbPlatforms;
1757 }
1758
1759 public List<OLEGOKbMappingValue> getOleGOKbMappingValueList() {
1760 return oleGOKbMappingValueList;
1761 }
1762
1763 public void setOleGOKbMappingValueList(List<OLEGOKbMappingValue> oleGOKbMappingValueList) {
1764 this.oleGOKbMappingValueList = oleGOKbMappingValueList;
1765 }
1766
1767 public Timestamp getDateAccessConfirmed() {
1768 return dateAccessConfirmed;
1769 }
1770
1771 public void setDateAccessConfirmed(Timestamp dateAccessConfirmed) {
1772 this.dateAccessConfirmed = dateAccessConfirmed;
1773 }
1774
1775 public String getAccessUserName() {
1776 return accessUserName;
1777 }
1778
1779 public void setAccessUserName(String accessUserName) {
1780 this.accessUserName = accessUserName;
1781 }
1782
1783 public String getAccessPassword() {
1784 return accessPassword;
1785 }
1786
1787 public void setAccessPassword(String accessPassword) {
1788 this.accessPassword = accessPassword;
1789 }
1790
1791 public String getProxiedURL() {
1792 return proxiedURL;
1793 }
1794
1795 public void setProxiedURL(String proxiedURL) {
1796 this.proxiedURL = proxiedURL;
1797 }
1798
1799 public boolean isProxiedResource() {
1800 return proxiedResource;
1801 }
1802
1803 public void setProxiedResource(boolean proxiedResource) {
1804 this.proxiedResource = proxiedResource;
1805 }
1806
1807 public String getMobileAccessId() {
1808 return mobileAccessId;
1809 }
1810
1811 public void setMobileAccessId(String mobileAccessId) {
1812 this.mobileAccessId = mobileAccessId;
1813 }
1814
1815 public List<String> getMobileAccess() {
1816 return mobileAccess;
1817 }
1818
1819 public void setMobileAccess(List<String> mobileAccess) {
1820 this.mobileAccess = mobileAccess;
1821 }
1822
1823 public String getMobileAccessNote() {
1824 return mobileAccessNote;
1825 }
1826
1827 public void setMobileAccessNote(String mobileAccessNote) {
1828 this.mobileAccessNote = mobileAccessNote;
1829 }
1830
1831 public boolean isBrandingComplete() {
1832 return brandingComplete;
1833 }
1834
1835 public void setBrandingComplete(boolean brandingComplete) {
1836 this.brandingComplete = brandingComplete;
1837 }
1838
1839 public boolean isPlatformConfigComplete() {
1840 return platformConfigComplete;
1841 }
1842
1843 public void setPlatformConfigComplete(boolean platformConfigComplete) {
1844 this.platformConfigComplete = platformConfigComplete;
1845 }
1846
1847 public String getMarcRecordSourceTypeId() {
1848 return marcRecordSourceTypeId;
1849 }
1850
1851 public void setMarcRecordSourceTypeId(String marcRecordSourceTypeId) {
1852 this.marcRecordSourceTypeId = marcRecordSourceTypeId;
1853 }
1854
1855 public Timestamp getLastRecordLoadDate() {
1856 return lastRecordLoadDate;
1857 }
1858
1859 public void setLastRecordLoadDate(Timestamp lastRecordLoadDate) {
1860 this.lastRecordLoadDate = lastRecordLoadDate;
1861 }
1862
1863 public String getMarcRecordSource() {
1864 return marcRecordSource;
1865 }
1866
1867 public void setMarcRecordSource(String marcRecordSource) {
1868 this.marcRecordSource = marcRecordSource;
1869 }
1870
1871 public String getMarcRecordUpdateFreqId() {
1872 return marcRecordUpdateFreqId;
1873 }
1874
1875 public void setMarcRecordUpdateFreqId(String marcRecordUpdateFreqId) {
1876 this.marcRecordUpdateFreqId = marcRecordUpdateFreqId;
1877 }
1878
1879 public String getMarcRecordURL() {
1880 return marcRecordURL;
1881 }
1882
1883 public void setMarcRecordURL(String marcRecordURL) {
1884 this.marcRecordURL = marcRecordURL;
1885 }
1886
1887 public String getMarcRecordUserName() {
1888 return marcRecordUserName;
1889 }
1890
1891 public void setMarcRecordUserName(String marcRecordUserName) {
1892 this.marcRecordUserName = marcRecordUserName;
1893 }
1894
1895 public String getMarcRecordPasword() {
1896 return marcRecordPasword;
1897 }
1898
1899 public void setMarcRecordPasword(String marcRecordPasword) {
1900 this.marcRecordPasword = marcRecordPasword;
1901 }
1902
1903 public String getMarcRecordNote() {
1904 return marcRecordNote;
1905 }
1906
1907 public void setMarcRecordNote(String marcRecordNote) {
1908 this.marcRecordNote = marcRecordNote;
1909 }
1910
1911 public List<OLEEResourceAccessWorkflow> getOleERSAccessWorkflows() {
1912 return oleERSAccessWorkflows;
1913 }
1914
1915 public void setOleERSAccessWorkflows(List<OLEEResourceAccessWorkflow> oleERSAccessWorkflows) {
1916 this.oleERSAccessWorkflows = oleERSAccessWorkflows;
1917 }
1918
1919 public String getLineActions() {
1920 return lineActions;
1921 }
1922
1923 public void setLineActions(String lineActions) {
1924 this.lineActions = lineActions;
1925 }
1926
1927 public List<OLEEResourceInstance> geteRSInstances() {
1928 return eRSInstances;
1929 }
1930
1931 public void seteRSInstances(List<OLEEResourceInstance> eRSInstances) {
1932 this.eRSInstances = eRSInstances;
1933 }
1934
1935 public List<OLEEResourcePO> getLinkedERSPOItems() {
1936 return linkedERSPOItems;
1937 }
1938
1939 public void setLinkedERSPOItems(List<OLEEResourcePO> linkedERSPOItems) {
1940 this.linkedERSPOItems = linkedERSPOItems;
1941 }
1942
1943 public String getBannerMessage() {
1944 return bannerMessage;
1945 }
1946
1947 public void setBannerMessage(String bannerMessage) {
1948 this.bannerMessage = bannerMessage;
1949 }
1950
1951 public Timestamp getGokbLastUpdatedDate() {
1952 return gokbLastUpdatedDate;
1953 }
1954
1955 public void setGokbLastUpdatedDate(Timestamp gokbLastUpdatedDate) {
1956 this.gokbLastUpdatedDate = gokbLastUpdatedDate;
1957 }
1958
1959 public String getAccessDescription() {
1960 return accessDescription;
1961 }
1962
1963 public void setAccessDescription(String accessDescription) {
1964 this.accessDescription = accessDescription;
1965 }
1966
1967 public String getWorkflowConfigurationId() {
1968 return workflowConfigurationId;
1969 }
1970
1971 public void setWorkflowConfigurationId(String workflowConfigurationId) {
1972 this.workflowConfigurationId = workflowConfigurationId;
1973 }
1974
1975 public String getOleAccessActivationDocumentNumber() {
1976 return oleAccessActivationDocumentNumber;
1977 }
1978
1979 public void setOleAccessActivationDocumentNumber(String oleAccessActivationDocumentNumber) {
1980 this.oleAccessActivationDocumentNumber = oleAccessActivationDocumentNumber;
1981 }
1982
1983 public List<OLEEResourceInstance> getDeletedInstances() {
1984 return deletedInstances;
1985 }
1986
1987 public void setDeletedInstances(List<OLEEResourceInstance> deletedInstances) {
1988 this.deletedInstances = deletedInstances;
1989 }
1990
1991 public List<OLEEResourceInstance> getPurchaseOrderInstances() {
1992 return purchaseOrderInstances;
1993 }
1994
1995 public void setPurchaseOrderInstances(List<OLEEResourceInstance> purchaseOrderInstances) {
1996 this.purchaseOrderInstances = purchaseOrderInstances;
1997 }
1998
1999 public String getGokbProfile() {
2000 return gokbProfile;
2001 }
2002
2003 public void setGokbProfile(String gokbProfile) {
2004 this.gokbProfile = gokbProfile;
2005 }
2006
2007 public String getGokbPackageStatus() {
2008 return gokbPackageStatus;
2009 }
2010
2011 public void setGokbPackageStatus(String gokbPackageStatus) {
2012 this.gokbPackageStatus = gokbPackageStatus;
2013 }
2014
2015 public boolean isAccessReadOnly() {
2016 return accessReadOnly;
2017 }
2018
2019 public void setAccessReadOnly(boolean accessReadOnly) {
2020 this.accessReadOnly = accessReadOnly;
2021 }
2022 }