001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.module.cam.businessobject;
017    
018    import java.util.LinkedHashMap;
019    import java.util.List;
020    
021    import org.kuali.kfs.sys.businessobject.Building;
022    import org.kuali.kfs.sys.businessobject.Room;
023    import org.kuali.kfs.sys.context.SpringContext;
024    import org.kuali.rice.kim.bo.Person;
025    import org.kuali.rice.kns.bo.Campus;
026    import org.kuali.rice.kns.bo.Country;
027    import org.kuali.rice.kns.bo.GlobalBusinessObjectDetailBase;
028    import org.kuali.rice.kns.bo.PostalCode;
029    import org.kuali.rice.kns.bo.State;
030    import org.kuali.rice.kns.service.CountryService;
031    import org.kuali.rice.kns.service.KualiModuleService;
032    import org.kuali.rice.kns.service.PostalCodeService;
033    import org.kuali.rice.kns.service.StateService;
034    import org.kuali.rice.kns.util.KualiDecimal;
035    import org.kuali.rice.kns.util.TypedArrayList;
036    
037    /**
038     * @author Kuali Nervous System Team (kualidev@oncourse.iu.edu)
039     */
040    public class AssetGlobalDetail extends GlobalBusinessObjectDetailBase {
041    
042        private String documentNumber;
043        private Long capitalAssetNumber;
044        private String campusCode;
045        private String buildingCode;
046        private String serialNumber;
047        private String buildingRoomNumber;
048        private String buildingSubRoomNumber;
049        private String campusTagNumber;
050        private String organizationInventoryName;
051        private String organizationAssetTypeIdentifier;
052        private String offCampusName;
053        private String offCampusAddress;
054        private String offCampusCityName;
055        private String offCampusStateCode;
056        private String offCampusZipCode;
057        private String offCampusCountryCode;
058        private String governmentTagNumber;
059        private String nationalStockNumber;
060    
061        private Asset asset;
062        private Campus campus;
063        private Building building;
064        private Room buildingRoom;
065        private State offCampusState;
066        private Country offCampusCountry;
067        private PostalCode postalZipCode;
068    
069    
070        private Integer locationQuantity;
071        private String representativeUniversalIdentifier;
072    
073        private String capitalAssetTypeCode;
074        private AssetType capitalAssetType;
075    
076        private String capitalAssetDescription;
077        private String manufacturerName;
078        private String organizationText;
079        private String manufacturerModelNumber;
080        private KualiDecimal separateSourceAmount; 
081    
082        // Non persistent
083        private List<AssetGlobalDetail> assetGlobalUniqueDetails;
084        private Person assetRepresentative;
085        
086        public Person getAssetRepresentative() {
087            assetRepresentative = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(representativeUniversalIdentifier, assetRepresentative);
088            return assetRepresentative;
089        }
090    
091        public void setAssetRepresentative(Person assetRepresentative) {
092            this.assetRepresentative = assetRepresentative;
093        }
094    
095        /**
096         * Gets the locationQuantity attribute.
097         * 
098         * @return Returns the locationQuantity.
099         */
100        public Integer getLocationQuantity() {
101            return locationQuantity;
102        }
103    
104        /**
105         * Sets the locationQuantity attribute value.
106         * 
107         * @param locationQuantity The locationQuantity to set.
108         */
109        public void setLocationQuantity(Integer locationQuantity) {
110            this.locationQuantity = locationQuantity;
111        }
112    
113        /**
114         * Default constructor.
115         */
116        public AssetGlobalDetail() {
117            assetGlobalUniqueDetails = new TypedArrayList(AssetGlobalDetail.class);
118    
119        }
120    
121        /**
122         * Gets the documentNumber attribute.
123         * 
124         * @return Returns the documentNumber
125         */
126        public String getDocumentNumber() {
127            return documentNumber;
128        }
129    
130        /**
131         * Sets the documentNumber attribute.
132         * 
133         * @param documentNumber The documentNumber to set.
134         */
135        public void setDocumentNumber(String documentNumber) {
136            this.documentNumber = documentNumber;
137        }
138    
139        /**
140         * Gets the capitalAssetNumber attribute.
141         * 
142         * @return Returns the capitalAssetNumber
143         */
144        public Long getCapitalAssetNumber() {
145            return capitalAssetNumber;
146        }
147    
148        /**
149         * Sets the capitalAssetNumber attribute.
150         * 
151         * @param capitalAssetNumber The capitalAssetNumber to set.
152         */
153        public void setCapitalAssetNumber(Long capitalAssetNumber) {
154            this.capitalAssetNumber = capitalAssetNumber;
155        }
156    
157        /**
158         * Gets the campusCode attribute.
159         * 
160         * @return Returns the campusCode
161         */
162        public String getCampusCode() {
163            return campusCode;
164        }
165    
166        /**
167         * Sets the campusCode attribute.
168         * 
169         * @param campusCode The campusCode to set.
170         */
171        public void setCampusCode(String campusCode) {
172            this.campusCode = campusCode;
173        }
174    
175    
176        /**
177         * Gets the buildingCode attribute.
178         * 
179         * @return Returns the buildingCode
180         */
181        public String getBuildingCode() {
182            return buildingCode;
183        }
184    
185        /**
186         * Sets the buildingCode attribute.
187         * 
188         * @param buildingCode The buildingCode to set.
189         */
190        public void setBuildingCode(String buildingCode) {
191            this.buildingCode = buildingCode;
192        }
193    
194    
195        /**
196         * Gets the serialNumber attribute.
197         * 
198         * @return Returns the serialNumber
199         */
200        public String getSerialNumber() {
201            return serialNumber;
202        }
203    
204        /**
205         * Sets the serialNumber attribute.
206         * 
207         * @param serialNumber The serialNumber to set.
208         */
209        public void setSerialNumber(String serialNumber) {
210            this.serialNumber = serialNumber;
211        }
212    
213    
214        /**
215         * Gets the buildingRoomNumber attribute.
216         * 
217         * @return Returns the buildingRoomNumber
218         */
219        public String getBuildingRoomNumber() {
220            return buildingRoomNumber;
221        }
222    
223        /**
224         * Sets the buildingRoomNumber attribute.
225         * 
226         * @param buildingRoomNumber The buildingRoomNumber to set.
227         */
228        public void setBuildingRoomNumber(String buildingRoomNumber) {
229            this.buildingRoomNumber = buildingRoomNumber;
230        }
231    
232    
233        /**
234         * Gets the buildingSubRoomNumber attribute.
235         * 
236         * @return Returns the buildingSubRoomNumber
237         */
238        public String getBuildingSubRoomNumber() {
239            return buildingSubRoomNumber;
240        }
241    
242        /**
243         * Sets the buildingSubRoomNumber attribute.
244         * 
245         * @param buildingSubRoomNumber The buildingSubRoomNumber to set.
246         */
247        public void setBuildingSubRoomNumber(String buildingSubRoomNumber) {
248            this.buildingSubRoomNumber = buildingSubRoomNumber;
249        }
250    
251    
252        /**
253         * Gets the campusTagNumber attribute.
254         * 
255         * @return Returns the campusTagNumber
256         */
257        public String getCampusTagNumber() {
258            return campusTagNumber;
259        }
260    
261        /**
262         * Sets the campusTagNumber attribute.
263         * 
264         * @param campusTagNumber The campusTagNumber to set.
265         */
266        public void setCampusTagNumber(String campusTagNumber) {
267            this.campusTagNumber = campusTagNumber;
268        }
269    
270    
271        /**
272         * Gets the organizationInventoryName attribute.
273         * 
274         * @return Returns the organizationInventoryName
275         */
276        public String getOrganizationInventoryName() {
277            return organizationInventoryName;
278        }
279    
280        /**
281         * Sets the organizationInventoryName attribute.
282         * 
283         * @param organizationInventoryName The organizationInventoryName to set.
284         */
285        public void setOrganizationInventoryName(String organizationInventoryName) {
286            this.organizationInventoryName = organizationInventoryName;
287        }
288    
289    
290        /**
291         * Gets the organizationAssetTypeIdentifier attribute.
292         * 
293         * @return Returns the organizationAssetTypeIdentifier
294         */
295        public String getOrganizationAssetTypeIdentifier() {
296            return organizationAssetTypeIdentifier;
297        }
298    
299        /**
300         * Sets the organizationAssetTypeIdentifier attribute.
301         * 
302         * @param organizationAssetTypeIdentifier The organizationAssetTypeIdentifier to set.
303         */
304        public void setOrganizationAssetTypeIdentifier(String organizationAssetTypeIdentifier) {
305            this.organizationAssetTypeIdentifier = organizationAssetTypeIdentifier;
306        }
307    
308    
309        /**
310         * Gets the offCampusAddress attribute.
311         * 
312         * @return Returns the offCampusAddress
313         */
314        public String getOffCampusAddress() {
315            return offCampusAddress;
316        }
317    
318        /**
319         * Sets the offCampusAddress attribute.
320         * 
321         * @param offCampusAddress The offCampusAddress to set.
322         */
323        public void setOffCampusAddress(String offCampusAddress) {
324            this.offCampusAddress = offCampusAddress;
325        }
326    
327    
328        /**
329         * Gets the offCampusCityName attribute.
330         * 
331         * @return Returns the offCampusCityName
332         */
333        public String getOffCampusCityName() {
334            return offCampusCityName;
335        }
336    
337        /**
338         * Sets the offCampusCityName attribute.
339         * 
340         * @param offCampusCityName The offCampusCityName to set.
341         */
342        public void setOffCampusCityName(String offCampusCityName) {
343            this.offCampusCityName = offCampusCityName;
344        }
345    
346    
347        /**
348         * Gets the offCampusStateCode attribute.
349         * 
350         * @return Returns the offCampusStateCode
351         */
352        public String getOffCampusStateCode() {
353            return offCampusStateCode;
354        }
355    
356        /**
357         * Sets the offCampusStateCode attribute.
358         * 
359         * @param offCampusStateCode The offCampusStateCode to set.
360         */
361        public void setOffCampusStateCode(String offCampusStateCode) {
362            this.offCampusStateCode = offCampusStateCode;
363        }
364    
365    
366        /**
367         * Gets the offCampusZipCode attribute.
368         * 
369         * @return Returns the offCampusZipCode
370         */
371        public String getOffCampusZipCode() {
372            return offCampusZipCode;
373        }
374    
375        /**
376         * Sets the offCampusZipCode attribute.
377         * 
378         * @param offCampusZipCode The offCampusZipCode to set.
379         */
380        public void setOffCampusZipCode(String offCampusZipCode) {
381            this.offCampusZipCode = offCampusZipCode;
382        }
383    
384        /**
385         * Gets the offCampusCountryCode attribute.
386         * 
387         * @return Returns the offCampusCountryCode.
388         */
389        public String getOffCampusCountryCode() {
390            return offCampusCountryCode;
391        }
392    
393        /**
394         * Sets the offCampusCountryCode attribute value.
395         * 
396         * @param offCampusCountryCode The offCampusCountryCode to set.
397         */
398        public void setOffCampusCountryCode(String offCampusCountryCode) {
399            this.offCampusCountryCode = offCampusCountryCode;
400        }
401    
402        /**
403         * Gets the offCampusName attribute.
404         * 
405         * @return Returns the offCampusName.
406         */
407        public String getOffCampusName() {
408            return offCampusName;
409        }
410    
411        /**
412         * Sets the offCampusName attribute value.
413         * 
414         * @param offCampusName The offCampusName to set.
415         */
416        public void setOffCampusName(String offCampusName) {
417            this.offCampusName = offCampusName;
418        }
419    
420        /**
421         * Gets the governmentTagNumber attribute.
422         * 
423         * @return Returns the governmentTagNumber
424         */
425        public String getGovernmentTagNumber() {
426            return governmentTagNumber;
427        }
428    
429        /**
430         * Sets the governmentTagNumber attribute.
431         * 
432         * @param governmentTagNumber The governmentTagNumber to set.
433         */
434        public void setGovernmentTagNumber(String governmentTagNumber) {
435            this.governmentTagNumber = governmentTagNumber;
436        }
437    
438    
439        /**
440         * Gets the nationalStockNumber attribute.
441         * 
442         * @return Returns the nationalStockNumber
443         */
444        public String getNationalStockNumber() {
445            return nationalStockNumber;
446        }
447    
448        /**
449         * Sets the nationalStockNumber attribute.
450         * 
451         * @param nationalStockNumber The nationalStockNumber to set.
452         */
453        public void setNationalStockNumber(String nationalStockNumber) {
454            this.nationalStockNumber = nationalStockNumber;
455        }
456    
457        /**
458         * Gets the campus attribute.
459         * 
460         * @return Returns the campus
461         */
462        public Campus getCampus() {
463            return campus = (Campus) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(Campus.class).retrieveExternalizableBusinessObjectIfNecessary(this, campus, "campus");
464        }
465    
466        /**
467         * Sets the campus attribute.
468         * 
469         * @param campus The campus to set.
470         * @deprecated
471         */
472        public void setCampus(Campus campus) {
473            this.campus = campus;
474        }
475    
476        /**
477         * Gets the building attribute.
478         * 
479         * @return Returns the building.
480         */
481        public Building getBuilding() {
482            return building;
483        }
484    
485        /**
486         * Sets the building attribute value.
487         * 
488         * @param building The building to set.
489         * @deprecated
490         */
491        public void setBuilding(Building building) {
492            this.building = building;
493        }
494    
495        /**
496         * Gets the buildingRoom attribute.
497         * 
498         * @return Returns the buildingRoom.
499         */
500        public Room getBuildingRoom() {
501            return buildingRoom;
502        }
503    
504        /**
505         * Sets the buildingRoom attribute value.
506         * 
507         * @param buildingRoom The buildingRoom to set.
508         * @deprecated
509         */
510        public void setBuildingRoom(Room buildingRoom) {
511            this.buildingRoom = buildingRoom;
512        }
513    
514        /**
515         * Gets the offCampusState attribute.
516         * 
517         * @return Returns the offCampusState.
518         */
519        public State getOffCampusState() {
520            offCampusState = SpringContext.getBean(StateService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusStateCode, offCampusState);
521            return offCampusState;
522        }
523    
524        /**
525         * Sets the offCampusState attribute value.
526         * 
527         * @param offCampusState The offCampusState to set.
528         * @deprecated
529         */
530        public void setOffCampusState(State offCampusState) {
531            this.offCampusState = offCampusState;
532        }
533    
534        /**
535         * Gets the postalZipCode attribute.
536         * 
537         * @return Returns the postalZipCode.
538         */
539        public PostalCode getPostalZipCode() {
540            postalZipCode = SpringContext.getBean(PostalCodeService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusZipCode, postalZipCode);
541            return postalZipCode;
542        }
543    
544        /**
545         * Sets the postalZipCode attribute value.
546         * 
547         * @param postalZipCode The postalZipCode to set.
548         * @deprecated
549         */
550        public void setPostalZipCode(PostalCode postalZipCode) {
551            this.postalZipCode = postalZipCode;
552        }
553    
554        /**
555         * Gets the offCampusCountry attribute.
556         * 
557         * @return Returns the offCampusCountry.
558         */
559        public Country getOffCampusCountry() {
560            offCampusCountry = SpringContext.getBean(CountryService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusCountry);
561            return offCampusCountry;
562        }
563    
564        /**
565         * Sets the offCampusCountry attribute value.
566         * 
567         * @param offCampusCountry The offCampusCountry to set.
568         * @deprecated
569         */
570        public void setOffCampusCountry(Country offCampusCountry) {
571            this.offCampusCountry = offCampusCountry;
572        }
573    
574        /**
575         * Gets the asset attribute.
576         * 
577         * @return Returns the asset.
578         */
579        public Asset getAsset() {
580            return asset;
581        }
582    
583        /**
584         * Sets the asset attribute value.
585         * 
586         * @param asset The asset to set.
587         */
588        public void setAsset(Asset asset) {
589            this.asset = asset;
590        }
591    
592    
593        /**
594         * Gets the assetGlobalUniqueDetails attribute.
595         * 
596         * @return Returns the assetGlobalUniqueDetails.
597         */
598        public List<AssetGlobalDetail> getAssetGlobalUniqueDetails() {
599            return assetGlobalUniqueDetails;
600        }
601    
602        /**
603         * Sets the assetGlobalUniqueDetails attribute value.
604         * 
605         * @param assetGlobalUniqueDetails The assetGlobalUniqueDetails to set.
606         */
607        public void setAssetGlobalUniqueDetails(List<AssetGlobalDetail> assetGlobalUniqueDetails) {
608            this.assetGlobalUniqueDetails = assetGlobalUniqueDetails;
609        }
610    
611        /**
612         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
613         */
614        protected LinkedHashMap toStringMapper() {
615            LinkedHashMap m = new LinkedHashMap();
616            m.put("documentNumber", this.documentNumber);
617            if (this.capitalAssetNumber != null) {
618                m.put("capitalAssetNumber", this.capitalAssetNumber.toString());
619            }
620            return m;
621        }
622    
623        public String getCapitalAssetDescription() {
624            return capitalAssetDescription;
625        }
626    
627        public void setCapitalAssetDescription(String capitalAssetDescription) {
628            this.capitalAssetDescription = capitalAssetDescription;
629        }
630    
631        public String getCapitalAssetTypeCode() {
632            return capitalAssetTypeCode;
633        }
634    
635        public void setCapitalAssetTypeCode(String capitalAssetTypeCode) {
636            this.capitalAssetTypeCode = capitalAssetTypeCode;
637        }
638    
639        public String getManufacturerModelNumber() {
640            return manufacturerModelNumber;
641        }
642    
643        public void setManufacturerModelNumber(String manufacturerModelNumber) {
644            this.manufacturerModelNumber = manufacturerModelNumber;
645        }
646    
647        public String getManufacturerName() {
648            return manufacturerName;
649        }
650    
651        public void setManufacturerName(String manufacturerName) {
652            this.manufacturerName = manufacturerName;
653        }
654    
655        public String getOrganizationText() {
656            return organizationText;
657        }
658    
659        public KualiDecimal getSeparateSourceAmount() {
660            return separateSourceAmount;
661        }
662    
663        public void setSeparateSourceAmount(KualiDecimal separateSourceAmount) {
664            this.separateSourceAmount = separateSourceAmount;
665        }
666    
667        public void setOrganizationText(String organizationText) {
668            this.organizationText = organizationText;
669        }
670    
671        public String getRepresentativeUniversalIdentifier() {
672            return representativeUniversalIdentifier;
673        }
674    
675        public void setRepresentativeUniversalIdentifier(String representativeUniversalIdentifier) {
676            this.representativeUniversalIdentifier = representativeUniversalIdentifier;
677        }
678    
679        public AssetType getCapitalAssetType() {
680            return capitalAssetType;
681        }
682    
683        public void setCapitalAssetType(AssetType capitalAssetType) {
684            this.capitalAssetType = capitalAssetType;
685        }
686    
687    }