001/* 002 * Copyright 2009 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 1.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/ecl1.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 */ 016package org.kuali.ole.sec.document.web; 017 018import java.util.Iterator; 019import java.util.List; 020 021import javax.servlet.jsp.JspException; 022import javax.servlet.jsp.PageContext; 023import javax.servlet.jsp.tagext.Tag; 024 025import org.kuali.ole.sys.document.web.renderers.GroupErrorsRenderer; 026 027 028/** 029 * Integrates with access security module to check security on accounting lines before rendering 030 */ 031public class CollectionSecAccountingLineGroupImpl extends SecAccountingLineGroupImpl { 032 033 /** 034 * Constructs a SecAccountingLineGroupImpl 035 */ 036 public CollectionSecAccountingLineGroupImpl() { 037 super(); 038 } 039 040 /** 041 * Adds info message if we have restricted view of any accounting lines and matches only messages for collection 042 * 043 * @see org.kuali.ole.sys.document.web.DefaultAccountingLineGroupImpl#renderErrors(javax.servlet.jsp.PageContext, 044 * javax.servlet.jsp.tagext.Tag) 045 */ 046 @Override 047 protected void renderErrors(PageContext pageContext, Tag parentTag) throws JspException { 048 renderSecurityMessage(pageContext, parentTag); 049 050 GroupErrorsRenderer errorRenderer = new GroupErrorsRenderer(); 051 List errors = errorRenderer.getErrorPropertyList(pageContext); 052 if (errors != null && !errors.isEmpty()) { 053 for (Iterator itr = errors.iterator(); itr.hasNext();) { 054 String error = (String) itr.next(); 055 if (error.startsWith(collectionItemPropertyName)) { 056 renderMessages(pageContext, parentTag, error); 057 } 058 } 059 } 060 } 061 062}