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.purap.service.impl;
017    
018    import org.apache.commons.lang.StringUtils;
019    import org.kuali.kfs.module.purap.service.ItemUnitOfMeasureService;
020    import org.kuali.kfs.sys.businessobject.UnitOfMeasure;
021    import org.kuali.rice.kns.service.BusinessObjectService;
022    import org.springframework.transaction.annotation.Transactional;
023    
024    /**
025     * This class is the service implementation for the ItemUnitOfMeasureService. 
026     * This is the default, Kuali delivered implementation. It's currently used for dwr.
027     */
028    @Transactional
029    public class ItemUnitOfMeasureServiceImpl implements ItemUnitOfMeasureService {
030        protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ItemUnitOfMeasureServiceImpl.class);
031    
032        private BusinessObjectService businessObjectService;
033        
034        /**
035         * @see org.kuali.kfs.module.purap.service.ItemUnitOfMeasureService#getByPrimaryId(java.lang.String)
036         */
037        public UnitOfMeasure getByPrimaryId(String itemUnitOfMeasureCode) {
038            UnitOfMeasure toBeRetrieved = new UnitOfMeasure();
039            toBeRetrieved.setItemUnitOfMeasureCode(itemUnitOfMeasureCode.toUpperCase());
040            UnitOfMeasure uom = (UnitOfMeasure)businessObjectService.retrieve( toBeRetrieved );
041            return uom;
042        }
043    
044        public void setBusinessObjectService(BusinessObjectService businessObjectService) {
045            this.businessObjectService = businessObjectService;
046        }
047    
048    }