01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.purap.bo;
17:
18: import java.util.List;
19:
20: import org.kuali.core.bo.Note;
21: import org.kuali.core.util.TypedArrayList;
22: import org.kuali.kfs.context.SpringContext;
23: import org.kuali.module.purap.service.PurchaseOrderService;
24:
25: /**
26: * Purchase Order View Business Object.
27: */
28: public class PurchaseOrderView extends AbstractRelatedView {
29:
30: private Boolean purchaseOrderCurrentIndicator;
31: private List<Note> notes;
32:
33: public boolean isPurchaseOrderCurrentIndicator() {
34: return purchaseOrderCurrentIndicator;
35: }
36:
37: public boolean getPurchaseOrderCurrentIndicator() {
38: return purchaseOrderCurrentIndicator;
39: }
40:
41: public void setPurchaseOrderCurrentIndicator(
42: boolean purchaseOrderCurrentIndicator) {
43: this .purchaseOrderCurrentIndicator = purchaseOrderCurrentIndicator;
44: }
45:
46: /**
47: * The next four methods are overridden but shouldnt be! If they arent overridden, they dont show up in the tag, not sure why at
48: * this point! (AAP)
49: *
50: * @see org.kuali.module.purap.bo.AbstractRelatedView#getPurapDocumentIdentifier()
51: */
52: @Override
53: public Integer getPurapDocumentIdentifier() {
54: return super .getPurapDocumentIdentifier();
55: }
56:
57: /**
58: * @see org.kuali.module.purap.bo.AbstractRelatedView#getDocumentNumber()
59: */
60: @Override
61: public String getDocumentNumber() {
62: return super .getDocumentNumber();
63: }
64:
65: /**
66: * @see org.kuali.module.purap.bo.AbstractRelatedView#getNotes()
67: */
68: @Override
69: public List<Note> getNotes() {
70: if (this .isPurchaseOrderCurrentIndicator()) {
71: if (notes == null) {
72: notes = new TypedArrayList(Note.class);
73: List<Note> tmpNotes = SpringContext.getBean(
74: PurchaseOrderService.class)
75: .getPurchaseOrderNotes(
76: this .getPurapDocumentIdentifier());
77: for (Note note : tmpNotes) {
78: notes.add(note);
79: }
80: }
81: } else {
82: notes = null;
83: }
84: return notes;
85: }
86:
87: /**
88: * @see org.kuali.module.purap.bo.AbstractRelatedView#getUrl()
89: */
90: @Override
91: public String getUrl() {
92: return super.getUrl();
93: }
94: }
|