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.document.service;
017    
018    import java.util.Map;
019    
020    import org.kuali.kfs.module.cam.businessobject.Asset;
021    import org.kuali.kfs.module.cam.businessobject.AssetLocation;
022    import org.kuali.kfs.module.cam.businessobject.AssetType;
023    import org.kuali.rice.kns.bo.BusinessObject;
024    
025    public interface AssetLocationService {
026    
027        public static enum LocationField {
028            CAMPUS_CODE, BUILDING_CODE, ROOM_NUMBER, SUB_ROOM_NUMBER, CONTACT_NAME, STREET_ADDRESS, CITY_NAME, STATE_CODE, ZIP_CODE, COUNTRY_CODE; 
029        }
030    
031        /**
032         * The method will set Off Campus Location from the assetLocations collection
033         */
034        public void setOffCampusLocation(Asset asset);
035    
036        /**
037         * Update user input into reference of Asset Location
038         */
039        public void updateOffCampusLocation(Asset newAsset);
040    
041        boolean validateLocation(Map<LocationField, String> fieldMap, BusinessObject businessObject, boolean isCapital, AssetType assetType);
042    
043        /** 
044         * check if offCampusLocation is holding any location information.
045         * 
046         * @param offCampusLocation
047         */
048        public boolean isOffCampusLocationExists(AssetLocation offCampusLocation);
049        
050        /**
051         * check if offCampusLocation is empty
052         * 
053         * @param offCampusLocation
054         */
055        public boolean isOffCampusLocationEmpty(AssetLocation offCampusLocation);
056    }