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.web;
17
18 import java.util.List;
19 import java.util.Map;
20 import java.util.Set;
21
22 import org.kuali.ole.sys.businessobject.AccountingLine;
23 import org.kuali.ole.sys.document.service.AccountingLineFieldRenderingTransformation;
24
25 /**
26 * An interface which specifies the behaviors needed from layout elements to join tables
27 */
28 public interface TableJoining extends ElementNamable{
29
30 /**
31 * Requests that this layout element property join a number of rows which will make up a table
32 * @param rows the rows to join
33 * @param headerRowCount the number of header rows
34 */
35 public abstract void joinTable(List<AccountingLineTableRow> rows);
36
37 /**
38 * Requests that this element join a table row
39 * @param headerLabelRow the header row which can be joined
40 * @param row the row which can be joined
41 */
42 public abstract void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row);
43
44 /**
45 * The minimum number of rows this element needs if it is going to join a table
46 * @return the minimum number of rows
47 */
48 public abstract int getRequestedRowCount();
49
50 /**
51 * Removes any action blocks from the given element
52 */
53 public abstract void removeAllActionBlocks();
54
55 /**
56 * Removes any unviewable blocks within this this table joining element
57 * @param unviewableBlocks a Set of the names of blocks that should not be rendered
58 */
59 public abstract void removeUnviewableBlocks(Set<String> unviewableBlocks);
60
61 /**
62 * Instructs the element to make any child readOnlyizable blocks named within the given Set to read only
63 * @param readOnlyBlocks the names of blocks to make read only
64 */
65 public abstract void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks);
66
67 /**
68 * Instructs the element to make any child readOnlyizable blocks named within the given Set to read only
69 * @param readOnlyBlocks the names of blocks to make read only
70 */
71 public abstract void setEditableBlocks(Set<String> editableBlocks);
72
73 /**
74 * Performs a transformations on any fields this TableJoining layout element knows about
75 * @param accountingDocument the document the field of the accounting line is associated with
76 * @param fieldTransformation a List of field transformations to perform on this element
77 * @param accountingLine the accounting line which is being rendering during the transformation
78 * @param unconvertedValues any unconverted values from the form
79 */
80 public abstract void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations, AccountingLine accountingLine, Map unconvertedValues);
81 }