| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.actionlist.web; |
| 17 | |
|
| 18 | |
import org.displaytag.decorator.TableDecorator; |
| 19 | |
import org.kuali.rice.kew.actionitem.ActionItemActionListExtension; |
| 20 | |
import org.kuali.rice.kew.api.actionlist.DisplayParameters; |
| 21 | |
import org.kuali.rice.kew.api.KewApiConstants; |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | 0 | public class ActionListDecorator extends TableDecorator { |
| 30 | 0 | private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ActionListDecorator.class); |
| 31 | |
|
| 32 | 0 | private int rowCounter = 0; |
| 33 | |
|
| 34 | |
@Override |
| 35 | |
public String startRow() { |
| 36 | 0 | return ""; |
| 37 | |
} |
| 38 | |
|
| 39 | |
@Override |
| 40 | |
public String finishRow() { |
| 41 | 0 | ActionItemActionListExtension actionItem = (ActionItemActionListExtension) getCurrentRowObject(); |
| 42 | 0 | String returnRow = ""; |
| 43 | |
try { |
| 44 | 0 | DisplayParameters displayParameters = actionItem.getDisplayParameters(); |
| 45 | 0 | if (displayParameters != null) { |
| 46 | 0 | Integer index = actionItem.getActionItemIndex(); |
| 47 | 0 | Integer frameHeight = new Integer(290); |
| 48 | |
try { |
| 49 | 0 | if (displayParameters.getFrameHeight() != null && displayParameters.getFrameHeight() > 0) { |
| 50 | 0 | frameHeight = displayParameters.getFrameHeight(); |
| 51 | |
} |
| 52 | 0 | } catch (Exception ex) { |
| 53 | 0 | LOG.error("Error getting custom action list frame height.", ex); |
| 54 | 0 | } |
| 55 | 0 | StringBuffer newRow = new StringBuffer(); |
| 56 | 0 | newRow.append("<tr id='G"); |
| 57 | 0 | newRow.append(index.toString()); |
| 58 | 0 | newRow.append("' style='display: none;'>"); |
| 59 | 0 | newRow.append("<td class='white' height='0' colspan='11' >"); |
| 60 | 0 | newRow.append("<iframe name='iframeAL_"); |
| 61 | 0 | newRow.append(index.toString()); |
| 62 | 0 | newRow.append("' scrolling='yes' width=100% height="); |
| 63 | 0 | newRow.append(frameHeight.toString()); |
| 64 | 0 | newRow.append(" hspace=0 vspace=0 frameborder=0></iframe>"); |
| 65 | 0 | newRow.append("</td></tr>"); |
| 66 | 0 | returnRow += newRow.toString(); |
| 67 | |
} |
| 68 | 0 | } catch (Exception e) { |
| 69 | 0 | LOG.error("Error with custom action list attribute.", e); |
| 70 | 0 | } |
| 71 | 0 | return returnRow; |
| 72 | |
} |
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
@Override |
| 80 | |
public String addRowClass() { |
| 81 | 0 | ActionItemActionListExtension actionItem = (ActionItemActionListExtension) getCurrentRowObject(); |
| 82 | 0 | return "actionlist_" + KewApiConstants.ACTION_LIST_COLOR_NAMES.get(actionItem.getRowStyleClass()); |
| 83 | |
} |
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
@Override |
| 92 | |
public String addRowId() { |
| 93 | 0 | return "actionlist_tr_" + rowCounter++; |
| 94 | |
} |
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
|
| 101 | |
@Override |
| 102 | |
public void finish() { |
| 103 | 0 | super.finish(); |
| 104 | 0 | rowCounter = 0; |
| 105 | 0 | } |
| 106 | |
|
| 107 | |
} |