001/*
002 * Copyright 2009 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 */
016package org.kuali.ole.sys.service.impl;
017
018import java.util.List;
019
020import org.kuali.ole.sys.OLEConstants;
021import org.kuali.ole.sys.businessobject.ElectronicPaymentClaim;
022import org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy;
023import org.kuali.ole.sys.service.ElectronicPaymentClaimingService;
024import org.kuali.rice.kim.api.identity.Person;
025
026/**
027 * for those cases when admins claim a payment without an associated document
028 */
029public class ElectronicPaymentClaimingDocumentGenerationStrategyImpl implements ElectronicPaymentClaimingDocumentGenerationStrategy {
030    private org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ElectronicPaymentClaimingDocumentGenerationStrategyImpl.class);
031    
032    private ElectronicPaymentClaimingService electronicPaymentClaimingService;
033
034    /**
035     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#createDocumentFromElectronicPayments(java.util.List, org.kuali.rice.kim.api.identity.Person)
036     */
037    public String createDocumentFromElectronicPayments(List<ElectronicPaymentClaim> electronicPayments, Person user) {
038        return null;
039    }
040
041    /**
042     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#getDocumentCode()
043     */
044    public String getDocumentCode() {
045        return null;
046    }
047
048    /**
049     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#getDocumentLabel()
050     */
051    public String getDocumentLabel() {
052        return "No Document";
053    }
054    
055    /**
056     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#getClaimingDocumentWorkflowDocumentType()
057     * 
058     * return null in the case of no document available
059     */
060    public String getClaimingDocumentWorkflowDocumentType() {
061        return OLEConstants.EMPTY_STRING;
062    }
063
064    /**
065     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#isDocumentReferenceValid(java.lang.String)
066     */
067    public boolean isDocumentReferenceValid(String referenceDocumentNumber) {
068        return false;
069    }
070
071    /**
072     * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingDocumentGenerationStrategy#userMayUseToClaim(org.kuali.rice.kim.api.identity.Person)
073     */
074    public boolean userMayUseToClaim(Person claimingUser) {
075        return electronicPaymentClaimingService.isAuthorizedForClaimingElectronicPayment(claimingUser, null);
076    }
077
078    /**
079     * Sets the electronicPaymentClaimingService attribute value.
080     * @param electronicPaymentClaimingService The electronicPaymentClaimingService to set.
081     */
082    public void setElectronicPaymentClaimingService(ElectronicPaymentClaimingService electronicPaymentClaimingService) {
083        this.electronicPaymentClaimingService = electronicPaymentClaimingService;
084    }
085}