Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
$URL: https://source.sakaiproject.org/svn/portal/tags/portal-base-2.9.0-b03/portal-render-engine-impl/impl/src/java/org/sakaiproject/portal/charon/velocity/VelocityPortalRenderContext.java $ $Id: VelocityPortalRenderContext.java 84287 2010-11-04 16:37:11Z ottenhoff@longsight.com $ Copyright (c) 2005, 2006, 2007, 2008 The Sakai Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.osedu.org/licenses/ECL-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 
 package org.sakaiproject.portal.charon.velocity;
 
 import java.util.Map;
 
A render context based on the velocity context

Author(s):
ieb
Version:
$Rev: 84287 $
Since:
Sakai 2.4
 
 
 {
 	private static final Log log = LogFactory.getLog(VelocityPortalRenderContext.class);
 
 	private Context vcontext = new VelocityContext();
 
 	private boolean debug = false;
 
 	private Map options = null;
 
 	private PortalRenderEngine renderEngine = null;
 
 	public boolean isDebug()
 	{
 		return ;
 	}
 
 	public void setDebug(boolean debug)
 	{
 		this. = debug;
 	}
 
 	public void put(String keyObject value)
 	{
 		.put(keyvalue);
 	}
 
 	{
 		return ;
 	}
 
 	public String dump()
 	{
 		if ()
 		{
 			Object[] keys = .getKeys();
 			StringBuilder sb = new StringBuilder();
 			for (int i = 0; i < keys.lengthi++)
 			{
 				Object o = .get((Stringkeys[i]);
 				dumpObject(sbkeys[i], o);
 			}
 			return sb.toString();
 		}
 		else
 		{
 			return "";
 		}
 	}
 
 	private void dumpObject(StringBuilder sbObject keyObject o)
 	{
 		if (o instanceof Map)
 		{
 			sb.append("Property ").append(key).append(":").append(o).append("\n");
			dumpMap(sbkey, (Mapo);
		}
		else if (o instanceof Collection)
		{
			sb.append("Property ").append(key).append(":").append(o).append("\n");
			dumpCollection(sbkey, (Collectiono);
		}
		else
		{
			sb.append("Property ").append(key).append(":").append(o).append("\n");
		}
	}
	private void dumpCollection(StringBuilder sbObject keyCollection collection)
	{
		int n = 0;
		for (Iterator i = collection.iterator(); i.hasNext();)
		{
			String keyn = key.toString() + "." + String.valueOf(n);
			dumpObject(sbkeyni.next());
			n++;
		}
	}
	private void dumpMap(StringBuilder sbObject keyMap map)
	{
		for (Iterator<Entry<ObjectObject>> mapIter = map.entrySet().iterator(); mapIter.hasNext();)
		{
			Entry<ObjectObjectentry = mapIter.next();
			Object keyn = entry.getKey();
			dumpObject(sbkey + "." + keynentry.getValue());
		}
	}
	public boolean uses(String includeOption)
	{
		if ( == null || includeOption == null)
		{
			return true;
		}
		return "true".equals(.get(includeOption));
	}
	public Map getOptions()
	{
		return ;
	}
	public void setOptions(Map options)
	{
		this. = options;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.sakaiproject.portal.api.PortalRenderContext#getRenderEngine()
	 */
	{
		return ;
	}
	public void setRenderEngine(PortalRenderEngine renderEngine)
	{
		this. = renderEngine;
	}
New to GrepCode? Check out our FAQ X