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.web;
017    
018    import java.util.List;
019    import java.util.Map;
020    import java.util.Set;
021    
022    import org.kuali.kfs.sys.businessobject.AccountingLine;
023    import org.kuali.kfs.sys.document.service.AccountingLineFieldRenderingTransformation;
024    
025    /**
026     * An interface which specifies the behaviors needed from layout elements to join tables
027     */
028    public interface TableJoining extends ElementNamable{
029        
030        /**
031         * Requests that this layout element property join a number of rows which will make up a table 
032         * @param rows the rows to join
033         * @param headerRowCount the number of header rows
034         */
035        public abstract void joinTable(List<AccountingLineTableRow> rows);
036        
037        /**
038         * Requests that this element join a table row
039         * @param headerLabelRow the header row which can be joined
040         * @param row the row which can be joined
041         */
042        public abstract void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row);
043        
044        /**
045         * The minimum number of rows this element needs if it is going to join a table
046         * @return the minimum number of rows
047         */
048        public abstract int getRequestedRowCount();
049        
050        /**
051         * Removes any action blocks from the given element
052         */
053        public abstract void removeAllActionBlocks();
054        
055        /**
056         * Removes any unviewable blocks within this this table joining element
057         * @param unviewableBlocks a Set of the names of blocks that should not be rendered
058         */
059        public abstract void removeUnviewableBlocks(Set<String> unviewableBlocks);
060        
061        /**
062         * Instructs the element to make any child readOnlyizable blocks named within the given Set to read only
063         * @param readOnlyBlocks the names of blocks to make read only
064         */
065        public abstract void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks);
066        
067        /**
068         * Instructs the element to make any child readOnlyizable blocks named within the given Set to read only
069         * @param readOnlyBlocks the names of blocks to make read only
070         */
071        public abstract void setEditableBlocks(Set<String> editableBlocks);
072    
073        /**
074         * Performs a transformations on any fields this TableJoining layout element knows about
075         * @param accountingDocument the document the field of the accounting line is associated with
076         * @param fieldTransformation a List of field transformations to perform on this element
077         * @param accountingLine the accounting line which is being rendering during the transformation
078         * @param unconvertedValues any unconverted values from the form
079         */
080        public abstract void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations, AccountingLine accountingLine, Map unconvertedValues);
081    }