View Javadoc
1   /*
2    * Copyright 2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.sys.document.service;
17  
18  import org.kuali.ole.sys.businessobject.AccountingLine;
19  
20  /**
21   * Methods needed by a service which creates non-standard dynamic name labels for accounting line views
22   */
23  public interface DynamicNameLabelGenerator {
24      /**
25       * Builds the Javascript that should appear in the onblur attribute of the field associated with this dynamic name label
26       * @param line the accounting line this label is associated with
27       * @param accountingLineProperty the property of the accounting line
28       * @return a Javascript call to be performed onblur from the field
29       */
30      public abstract String getDynamicNameLabelOnBlur(AccountingLine line, String accountingLineProperty);
31  
32      /**
33       * Returns the value of the dynamic name label
34       * @param line the accounting line this label is associated with
35       * @param accountingLineProperty the property of the accounting line
36       * @return the value, or an blank String ("" or null) if no value exists 
37       */
38      public abstract String getDynamicNameLabelValue(AccountingLine line, String accountingLineProperty);
39      
40      /**
41       * Returns the field name of the dynamic name label
42       * @param line the accounting line this label is associated with
43       * @param accountingLineProperty the property of the accounting line
44       * @return the field name
45       */
46      public abstract String getDynamicNameLabelFieldName(AccountingLine line, String accountingLineProperty);
47  }