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