1 17 package org.apache.forrest.log; 18 19 import org.apache.avalon.framework.context.Context; 20 import org.apache.avalon.framework.context.ContextException; 21 import org.apache.avalon.framework.context.DefaultContext; 22 import org.apache.cocoon.util.log.CocoonTargetFactory; 23 import org.apache.forrest.conf.ForrestConfUtils; 24 29 public class ForrestLogTargetFactory 30 extends CocoonTargetFactory { 31 32 35 public void contextualize( Context context ) 36 throws ContextException 37 { 38 Context currentContext = context; 39 40 try { 41 String projectHome = ForrestConfUtils.getProjectHome(); 42 43 if(!projectHome.startsWith(ForrestConfUtils.defaultHome)){ 44 DefaultContext newContext = new DefaultContext(context); 45 newContext.put("context-root",projectHome + "/build/webapp"); 46 currentContext = newContext; 47 } 48 } catch (Exception e) { 49 throw new ContextException("Error getting forrest.home java property.",e); 50 } 51 super.contextualize( currentContext ); 52 } 53 } 54 | Popular Tags |