public static boolean invokeVelocimacro(String vmName,String logTag,String params[],Context context,Writer writer){
  if (vmName == null || params == null || context == null || writer == null || logTag == null) {
    RuntimeSingleton.error("Velocity.invokeVelocimacro() : invalid parameter");
    return false;
  }
  if (!RuntimeSingleton.isVelocimacro(vmName,logTag)) {
    RuntimeSingleton.error("Velocity.invokeVelocimacro() : VM '" + vmName + "' not registered.");
    return false;
  }
  StringBuffer construct=new StringBuffer("#");
  construct.append(vmName);
  construct.append("(");
  for (int i=0; i < params.length; i++) {
    construct.append(" $");
    construct.append(params[i]);
  }
  construct.append(" )");
  try {
    boolean retval=evaluate(context,writer,logTag,construct.toString());
    return retval;
  }
 catch (  Exception e) {
    RuntimeSingleton.error("Velocity.invokeVelocimacro() : error " + e);
  }
  return false;
}

public static boolean invokeVelocimacro ( String vmName , String logTag , String params [ ] , Context context , Writer writer ) { if ( vmName == null || params == null || context == null || writer == null || logTag == null ) { RuntimeSingleton . error ( "Velocity.invokeVelocimacro() : invalid parameter" ) ; return false ; } if ( ! RuntimeSingleton . isVelocimacro ( vmName , logTag ) ) { RuntimeSingleton . error ( "Velocity.invokeVelocimacro() : VM '" + vmName + "' not registered." ) ; return false ; } StringBuffer construct = new StringBuffer ( "#" ) ; construct . append ( vmName ) ; construct . append ( "(" ) ; for ( int i = 0 ; i < params . length ; i ++ ) { construct . append ( " $" ) ; construct . append ( params [ i ] ) ; } construct . append ( " )" ) ; try { boolean retval = evaluate ( context , writer , logTag , construct . toString ( ) ) ; return retval ; } catch ( Exception e ) { RuntimeSingleton . error ( "Velocity.invokeVelocimacro() : error " + e ) ; } return false ; }
invokes a currently registered velocimacro with the parms provided and places the rendered stream into the writer . note : currently only accepts args to the vm if they are in the context .
