001/*
002 * Copyright 2008 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.document.service;
017
018import org.kuali.ole.sys.businessobject.AccountingLine;
019
020/**
021 * Methods needed by a service which creates non-standard dynamic name labels for accounting line views
022 */
023public interface DynamicNameLabelGenerator {
024    /**
025     * Builds the Javascript that should appear in the onblur attribute of the field associated with this dynamic name label
026     * @param line the accounting line this label is associated with
027     * @param accountingLineProperty the property of the accounting line
028     * @return a Javascript call to be performed onblur from the field
029     */
030    public abstract String getDynamicNameLabelOnBlur(AccountingLine line, String accountingLineProperty);
031
032    /**
033     * Returns the value of the dynamic name label
034     * @param line the accounting line this label is associated with
035     * @param accountingLineProperty the property of the accounting line
036     * @return the value, or an blank String ("" or null) if no value exists 
037     */
038    public abstract String getDynamicNameLabelValue(AccountingLine line, String accountingLineProperty);
039    
040    /**
041     * Returns the field name of the dynamic name label
042     * @param line the accounting line this label is associated with
043     * @param accountingLineProperty the property of the accounting line
044     * @return the field name
045     */
046    public abstract String getDynamicNameLabelFieldName(AccountingLine line, String accountingLineProperty);
047}