[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apollo-dev
Subject:    svn commit: r123214 - in incubator/apollo/trunk/src: java/org/apache/ws/resource site/content/tutori
From:       scamp () apache ! org
Date:       2004-12-23 19:07:38
Message-ID: 20041223190738.50408.qmail () minotaur ! apache ! org
[Download RAW message or body]

Author: scamp
Date: Thu Dec 23 11:07:37 2004
New Revision: 123214

URL: http://svn.apache.org/viewcvs?view=rev&rev=123214
Log:
updated /added for code generation
Added:
   incubator/apollo/trunk/src/templates/deploy.vm
   incubator/apollo/trunk/src/templates/jndi.vm
Modified:
   incubator/apollo/trunk/src/java/org/apache/ws/resource/Wsdl2Java.java
   incubator/apollo/trunk/src/site/content/tutorial/   (props changed)
   incubator/apollo/trunk/src/templates/templating.txt

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/Wsdl2Java.java
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resou \
rce/Wsdl2Java.java?view=diff&rev=123214&p1=incubator/apollo/trunk/src/java/org/apache/ \
ws/resource/Wsdl2Java.java&r1=123213&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/Wsdl2Java.java&r2=123214
 ==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/Wsdl2Java.java	(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/Wsdl2Java.java	Thu Dec 23 \
11:07:37 2004 @@ -18,6 +18,11 @@
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.util.WsdlUtils;
@@ -31,6 +36,7 @@
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import java.io.File;
+import java.io.FileWriter;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -46,205 +52,448 @@
  */
 public class Wsdl2Java
 {
-    public static final Messages MSG = MessagesImpl.getInstance();
-    protected static final org.apache.commons.cli.Options CMD_LINE_OPTIONS = new \
                org.apache.commons.cli.Options();
-    protected static final String LONG_OPT_SRC_OUTPUT_DIR = "srcOutputDir";
-    protected static final String LONG_OPT_CLASSES_OUTPUT_DIR = "classesOutputDir";
-    protected static final String LONG_OPT_VERBOSE = "verbose";
-    protected static final String LONG_OPT_DEBUG = "debug";
-    protected static final String LONG_OPT_CLASSPATH = "classpath";
-
-    static
-    {
-        initCmdLineOptions();
-    }
-
-    private static void initCmdLineOptions()
-    {
-        CMD_LINE_OPTIONS.addOption( "s", LONG_OPT_SRC_OUTPUT_DIR, true, \
                MSG.getMessage( Keys.OPT_OUTPUT_DIR_FOR_GEN_SRC ) );
-        CMD_LINE_OPTIONS.addOption( "c", LONG_OPT_CLASSES_OUTPUT_DIR, true, \
                MSG.getMessage( Keys.OPT_OUTPUT_DIR_FOR_GEN_CLASSES ) );
-        CMD_LINE_OPTIONS.addOption( "v", LONG_OPT_VERBOSE, false, MSG.getMessage( \
                Keys.OPT_ENABLE_VERBOSE ) );
-        CMD_LINE_OPTIONS.addOption( "d", LONG_OPT_DEBUG, false, MSG.getMessage( \
                Keys.OPT_ENABLE_DEBUG ) );
-        CMD_LINE_OPTIONS.addOption( "C", LONG_OPT_CLASSPATH, false, MSG.getMessage( \
                Keys.OPT_CLASSPATH_SENT_TO_XMLBEANS ) );
-    }
-
-    private File[] m_wsdlFiles;
-    private File m_srcOutputDir;
-    private File m_classesOutputDir;
-    private Options m_options;
-
-    public Wsdl2Java( File[] wsdlFiles, File srcOutputDir, File classesOutputDir, \
                Options options )
-    {
-        m_wsdlFiles = wsdlFiles;
-        if ( m_wsdlFiles.length == 0 )
-        {
-            System.out.println( MSG.getMessage( Keys.WARN_EMPTY_WSDLS ) );
-        }
-        m_srcOutputDir = srcOutputDir;
-        m_classesOutputDir = classesOutputDir;
-        m_options = options != null ? options : new Options();
-    }
-
-    public void generate() throws Exception
-    {
-        generateXmlBeans();
-        for ( int i = 0; i < m_wsdlFiles.length; i++ )
-        {
-            WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
-            Definition def = wsdlReader.readWSDL( m_wsdlFiles[i].getPath() );
-            Map services = def.getServices();
-            Iterator iter = services.values().iterator();
-            while ( iter.hasNext() )
-            {
-                Service service = (Service) iter.next();
-                Map portTypes = WsdlUtils.getPortTypes( service );
-                Iterator portTypesIter = portTypes.values().iterator();
-                while ( portTypesIter.hasNext() )
-                {
-                    PortType portType = (PortType) portTypesIter.next();
+   /** DOCUMENT_ME */
+   public static final Messages MSG = MessagesImpl.getInstance(  );
 
-                }
-            }
-        }
+   /** DOCUMENT_ME */
+   protected static final org.apache.commons.cli.Options CMD_LINE_OPTIONS = new \
org.apache.commons.cli.Options(  );  
-    }
+   /** DOCUMENT_ME */
+   protected static final String LONG_OPT_SRC_OUTPUT_DIR = "srcOutputDir";
 
-    private void generateXmlBeans()
-            throws Exception
-    {
-        SchemaCompiler.Parameters scompParams = new SchemaCompiler.Parameters();
-        scompParams.setSrcDir( m_srcOutputDir );
-        scompParams.setClassesDir( m_classesOutputDir );
-        scompParams.setWsdlFiles( m_wsdlFiles );
-        scompParams.setDownload( true );
-        scompParams.setClasspath( m_options.getClasspath() );
-        scompParams.setVerbose( m_options.isVerbose() );
-        scompParams.setDebug( m_options.isDebug() );
-        final boolean beNoisy = true;
-        XmlErrorPrinter xErrorListener = new XmlErrorPrinter( beNoisy, null );
-        scompParams.setErrorListener( xErrorListener );
-        m_srcOutputDir.mkdirs(); // necessary?
-        m_classesOutputDir.mkdirs(); // necessary?
-        if ( !SchemaCompiler.compile( scompParams ) )
-        {
-            throw new Exception( xErrorListener.toString() );
-        }
-    }
-
-    public File[] getWsdlFiles()
-    {
-        return m_wsdlFiles;
-    }
-
-    public File getSrcOutputDir()
-    {
-        return m_srcOutputDir;
-    }
-
-    public File getClassesOutputDir()
-    {
-        return m_classesOutputDir;
-    }
-
-    public Options getOptions()
-    {
-        return m_options;
-    }
-
-    public static class Options
-    {
-
-        private boolean m_verbose;
-        private boolean m_debug;
-        private File[] m_classpath;
-
-        public boolean isVerbose()
-        {
-            return m_verbose;
-        }
-
-        public void setVerbose( boolean verbose )
-        {
-            m_verbose = verbose;
-        }
-
-        public boolean isDebug()
-        {
-            return m_debug;
-        }
-
-        public void setDebug( boolean debug )
-        {
-            m_debug = debug;
-        }
-
-        public File[] getClasspath()
-        {
-            return m_classpath;
-        }
-
-        public void setClasspath( File[] classpath )
-        {
-            m_classpath = classpath;
-        }
-
-        public void setClasspath( String classpath )
-        {
-            List classpathItems = new ArrayList();
-            for ( StringTokenizer tokenizer = new StringTokenizer( classpath, \
File.pathSeparator ); tokenizer.hasMoreTokens(); ) +   /** DOCUMENT_ME */
+   protected static final String LONG_OPT_CLASSES_OUTPUT_DIR = "classesOutputDir";
+
+   /** DOCUMENT_ME */
+   protected static final String LONG_OPT_VERBOSE = "verbose";
+
+   /** DOCUMENT_ME */
+   protected static final String LONG_OPT_DEBUG = "debug";
+
+   /** DOCUMENT_ME */
+   protected static final String LONG_OPT_CLASSPATH = "classpath";
+
+   static
+   {
+      initCmdLineOptions(  );
+   }
+
+   private File[]  m_wsdlFiles;
+   private File    m_srcOutputDir;
+   private File    m_classesOutputDir;
+   private Options m_options;
+
+   /**
+    * Creates a new {@link Wsdl2Java} object.
+    *
+    * @param wsdlFiles DOCUMENT_ME
+    * @param srcOutputDir DOCUMENT_ME
+    * @param classesOutputDir DOCUMENT_ME
+    * @param options DOCUMENT_ME
+    */
+   public Wsdl2Java( File[]  wsdlFiles,
+                     File    srcOutputDir,
+                     File    classesOutputDir,
+                     Options options )
+   {
+      m_wsdlFiles = wsdlFiles;
+      if ( m_wsdlFiles.length == 0 )
+      {
+         System.out.println( MSG.getMessage( Keys.WARN_EMPTY_WSDLS ) );
+      }
+
+      m_srcOutputDir        = srcOutputDir;
+      m_classesOutputDir    = classesOutputDir;
+      m_options             = ( options != null ) ? options : new Options(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public File getClassesOutputDir(  )
+   {
+      return m_classesOutputDir;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Options getOptions(  )
+   {
+      return m_options;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public File getSrcOutputDir(  )
+   {
+      return m_srcOutputDir;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public File[] getWsdlFiles(  )
+   {
+      return m_wsdlFiles;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @throws Exception DOCUMENT_ME
+    */
+   public void generate(  )
+   throws Exception
+   {
+      generateXmlBeans(  );
+      for ( int i = 0; i < m_wsdlFiles.length; i++ )
+      {
+         WSDLReader wsdlReader = WSDLFactory.newInstance(  ).newWSDLReader(  );
+         Definition def      = wsdlReader.readWSDL( m_wsdlFiles[i].getPath(  ) );
+         Map        services = def.getServices(  );
+         Iterator   iter     = services.values(  ).iterator(  );
+         while ( iter.hasNext(  ) )
+         {
+            Service  service       = (Service) iter.next(  );
+            Map      portTypes     = WsdlUtils.getPortTypes( service );
+            Iterator portTypesIter = portTypes.values(  ).iterator(  );
+            while ( portTypesIter.hasNext(  ) )
             {
-                classpathItems.add( new File( tokenizer.nextToken() ) );
+               PortType portType = (PortType) portTypesIter.next(  );
             }
-            m_classpath = (File[]) classpathItems.toArray( new File[0] );
-        }
-
-    }
-
-    public static void main( String[] args ) throws ParseException
-    {
-        CommandLine cmdLine = new PosixParser().parse( CMD_LINE_OPTIONS, args, true \
                );
-        checkForRequiredOption( cmdLine, LONG_OPT_SRC_OUTPUT_DIR );
-        checkForRequiredOption( cmdLine, LONG_OPT_CLASSES_OUTPUT_DIR );
-        File srcOutputDir = new File( cmdLine.getOptionValue( \
                LONG_OPT_SRC_OUTPUT_DIR ) );
-        File classesOutputDir = new File( cmdLine.getOptionValue( \
                LONG_OPT_CLASSES_OUTPUT_DIR ) );
-        Options options = new Wsdl2Java.Options();
-        if ( cmdLine.hasOption( LONG_OPT_CLASSPATH ) )
-        {
-            options.setClasspath( cmdLine.getOptionValue( LONG_OPT_CLASSPATH ) );
-        }
-        if ( cmdLine.hasOption( LONG_OPT_VERBOSE ) )
-        {
-            options.setVerbose( Boolean.valueOf( cmdLine.getOptionValue( \
                LONG_OPT_VERBOSE ) ).booleanValue() );
-        }
-        if ( cmdLine.hasOption( LONG_OPT_DEBUG ) )
-        {
-            options.setVerbose( Boolean.valueOf( cmdLine.getOptionValue( \
                LONG_OPT_DEBUG ) ).booleanValue() );
-        }
-        File[] wsdlFiles = new File[cmdLine.getArgs().length];
-        for ( int i = 0; i < cmdLine.getArgs().length; i++ )
-        {
-            wsdlFiles[i] = new File( cmdLine.getArgs()[i] );
-        }
-        try
-        {
-            System.out.println( MSG.getMessage( Keys.WSDL4J_PASSED_ARGUMENTS, \
                Integer.toString( wsdlFiles.length ),
-                    srcOutputDir.toString(), classesOutputDir.toString() ) );
-            new Wsdl2Java( wsdlFiles, srcOutputDir, classesOutputDir, options \
                ).generate();
-        }
-        catch ( Exception e )
-        {
-            e.printStackTrace();
-            System.exit( 1 );
-        }
-    }
-
-    private static void checkForRequiredOption( CommandLine cmdLine, String opt )
-    {
-        if ( !cmdLine.hasOption( opt ) )
-        {
-            System.err.println( MSG.getMessage( Keys.OPT_REQUIRED, opt ) );
-            System.exit( 1 );
-        }
-    }
-
-}
+         }
+         //ResourceDefinition resourceDef = new ResourceDefinitionImpl(def,p);
+         //generateSkeletonCode(resourceDef); todo need Ians object for each service
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param args DOCUMENT_ME
+    *
+    * @throws ParseException DOCUMENT_ME
+    */
+   public static void main( String[] args )
+   throws ParseException
+   {
+      CommandLine cmdLine = new PosixParser(  ).parse( CMD_LINE_OPTIONS, args, true \
); +      checkForRequiredOption( cmdLine, LONG_OPT_SRC_OUTPUT_DIR );
+      checkForRequiredOption( cmdLine, LONG_OPT_CLASSES_OUTPUT_DIR );
+      File    srcOutputDir     = new File( cmdLine.getOptionValue( \
LONG_OPT_SRC_OUTPUT_DIR ) ); +      File    classesOutputDir = new File( \
cmdLine.getOptionValue( LONG_OPT_CLASSES_OUTPUT_DIR ) ); +      Options options       \
= new Wsdl2Java.Options(  ); +      if ( cmdLine.hasOption( LONG_OPT_CLASSPATH ) )
+      {
+         options.setClasspath( cmdLine.getOptionValue( LONG_OPT_CLASSPATH ) );
+      }
+
+      if ( cmdLine.hasOption( LONG_OPT_VERBOSE ) )
+      {
+         options.setVerbose( Boolean.valueOf( cmdLine.getOptionValue( \
LONG_OPT_VERBOSE ) ).booleanValue(  ) ); +      }
+
+      if ( cmdLine.hasOption( LONG_OPT_DEBUG ) )
+      {
+         options.setVerbose( Boolean.valueOf( cmdLine.getOptionValue( LONG_OPT_DEBUG \
) ).booleanValue(  ) ); +      }
+
+      File[] wsdlFiles = new File[cmdLine.getArgs(  ).length];
+      for ( int i = 0; i < cmdLine.getArgs(  ).length; i++ )
+      {
+         wsdlFiles[i] = new File( cmdLine.getArgs(  )[i] );
+      }
+
+      try
+      {
+         System.out.println( MSG.getMessage( Keys.WSDL4J_PASSED_ARGUMENTS,
+                                             Integer.toString( wsdlFiles.length ),
+                                             srcOutputDir.toString(  ),
+                                             classesOutputDir.toString(  ) ) );
+         new Wsdl2Java( wsdlFiles, srcOutputDir, classesOutputDir, options \
).generate(  ); +      }
+      catch ( Exception e )
+      {
+         e.printStackTrace(  );
+         System.exit( 1 );
+      }
+   }
+
+   private static void checkForRequiredOption( CommandLine cmdLine,
+                                               String      opt )
+   {
+      if ( !cmdLine.hasOption( opt ) )
+      {
+         System.err.println( MSG.getMessage( Keys.OPT_REQUIRED, opt ) );
+         System.exit( 1 );
+      }
+   }
+
+   private static void initCmdLineOptions(  )
+   {
+      CMD_LINE_OPTIONS.addOption( "s",
+                                  LONG_OPT_SRC_OUTPUT_DIR,
+                                  true,
+                                  MSG.getMessage( Keys.OPT_OUTPUT_DIR_FOR_GEN_SRC ) \
); +      CMD_LINE_OPTIONS.addOption( "c",
+                                  LONG_OPT_CLASSES_OUTPUT_DIR,
+                                  true,
+                                  MSG.getMessage( \
Keys.OPT_OUTPUT_DIR_FOR_GEN_CLASSES ) ); +      CMD_LINE_OPTIONS.addOption( "v",
+                                  LONG_OPT_VERBOSE,
+                                  false,
+                                  MSG.getMessage( Keys.OPT_ENABLE_VERBOSE ) );
+      CMD_LINE_OPTIONS.addOption( "d",
+                                  LONG_OPT_DEBUG,
+                                  false,
+                                  MSG.getMessage( Keys.OPT_ENABLE_DEBUG ) );
+      CMD_LINE_OPTIONS.addOption( "C",
+                                  LONG_OPT_CLASSPATH,
+                                  false,
+                                  MSG.getMessage( \
Keys.OPT_CLASSPATH_SENT_TO_XMLBEANS ) ); +   }
+
+   private void generateSkeletonCode(ResourceDefinition resourceDef)
+   throws Exception
+   {
+      initVelocityProperties(  );
+      try
+      {
+         VelocityContext context = new VelocityContext(  );
+         context.put( "generated", "ians_obj" );
+
+         File generatedSrc = new File( m_srcOutputDir, "Abstract" + "SERVICE_NAME" + \
"Service.java" ); +         writeGeneratedSrcFile( context,
+                                "templates/AbstractService.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + "Service.java" );
+         writeGeneratedSrcFile( context,
+                                "templates/Service.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "Abstract" + "SERVICE_NAME" + \
"Resource.java" ); +         writeGeneratedSrcFile( context,
+                                "templates/AbstractResource.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + "Resource.java" \
); +         writeGeneratedSrcFile( context,
+                                "templates/Resource.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + "Home.java" );
+         writeGeneratedSrcFile( context,
+                                "templates/Home.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + \
"PropertyQNames.java" ); +         writeGeneratedSrcFile( context,
+                                "templates/PropertyQNames.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + "_deploy.wsdd" );
+         writeGeneratedSrcFile( context,
+                                "templates/deploy.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + \
"_jndi-config.wsdd" ); +         writeGeneratedSrcFile( context,
+                                "templates/jndi.vm",
+                                generatedSrc.getAbsolutePath(  ) );
+
+         //todo determine if custom ops defined
+         if ( true )
+         {
+            generatedSrc = new File( m_srcOutputDir, "SERVICE_NAME" + \
"CustomOperationsPortType.java" ); +            writeGeneratedSrcFile( context,
+                                   "templates/CustomOperationsPortType.vm",
+                                   generatedSrc.getAbsolutePath(  ) );
+         }
+      }
+      catch ( Exception e )
+      {
+         System.out.println( e );
+      }
+   }
+
+   private void generateXmlBeans(  )
+   throws Exception
+   {
+      SchemaCompiler.Parameters scompParams = new SchemaCompiler.Parameters(  );
+      scompParams.setSrcDir( m_srcOutputDir );
+      scompParams.setClassesDir( m_classesOutputDir );
+      scompParams.setWsdlFiles( m_wsdlFiles );
+      scompParams.setDownload( true );
+      scompParams.setClasspath( m_options.getClasspath(  ) );
+      scompParams.setVerbose( m_options.isVerbose(  ) );
+      scompParams.setDebug( m_options.isDebug(  ) );
+      final boolean   beNoisy        = true;
+      XmlErrorPrinter xErrorListener = new XmlErrorPrinter( beNoisy, null );
+      scompParams.setErrorListener( xErrorListener );
+      m_srcOutputDir.mkdirs(  ); // necessary?
+      m_classesOutputDir.mkdirs(  ); // necessary?
+      if ( !SchemaCompiler.compile( scompParams ) )
+      {
+         throw new Exception( xErrorListener.toString(  ) );
+      }
+   }
+
+   private void initVelocityProperties(  )
+   throws Exception
+   {
+      Velocity.addProperty( Velocity.RESOURCE_LOADER, "classpath" );
+      Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + ".class",
+                            \
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" ); +      \
Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + ".cache", "false" ); \
+      Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + \
".modificationCheckInterval", "2" ); +      Velocity.init(  );
+   }
+
+   private void writeGeneratedSrcFile( VelocityContext context,
+                                       String          templateName,
+                                       String          outputSrcPath )
+   throws Exception
+   {
+      /*
+       *  get the Template object.  This is the parsed version of your
+       *  template input file.  Note that getTemplate() can throw
+       *   ResourceNotFoundException : if it doesn't find the template
+       *   ParseErrorException : if there is something wrong with the VTL
+       *   Exception : if something else goes wrong (this is generally
+       *        indicative of as serious problem...)
+       */
+      Template template = null;
+
+      try
+      {
+         template = Velocity.getTemplate( templateName );
+
+         /*
+          *  Now have the template engine process your template using the
+          *  data placed into the context.  Think of it as a  'merge'
+          *  of the template and the data to produce the output stream.
+          */
+         FileWriter writer = writer = new FileWriter( outputSrcPath );
+
+         if ( template != null )
+         {
+            template.merge( context, writer );
+         }
+
+         /*
+          *  flush and cleanup
+          */
+         writer.flush(  );
+         writer.close(  );
+      }
+      catch ( ResourceNotFoundException rnfe )
+      {
+         System.out.println( "Example : error : cannot find template " + \
templateName ); +      }
+      catch ( ParseErrorException pee )
+      {
+         System.out.println( "Example : Syntax error in template " + templateName + \
":" + pee ); +      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @version $Revision: 1.8 $
+    * @author $author$
+    */
+   public static class Options
+   {
+      private boolean m_verbose;
+      private boolean m_debug;
+      private File[]  m_classpath;
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param classpath DOCUMENT_ME
+       */
+      public void setClasspath( File[] classpath )
+      {
+         m_classpath = classpath;
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param classpath DOCUMENT_ME
+       */
+      public void setClasspath( String classpath )
+      {
+         List classpathItems = new ArrayList(  );
+         for ( StringTokenizer tokenizer = new StringTokenizer( classpath, \
File.pathSeparator ); +               tokenizer.hasMoreTokens(  ); )
+         {
+            classpathItems.add( new File( tokenizer.nextToken(  ) ) );
+         }
+
+         m_classpath = (File[]) classpathItems.toArray( new File[0] );
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public File[] getClasspath(  )
+      {
+         return m_classpath;
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param debug DOCUMENT_ME
+       */
+      public void setDebug( boolean debug )
+      {
+         m_debug = debug;
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public boolean isDebug(  )
+      {
+         return m_debug;
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @param verbose DOCUMENT_ME
+       */
+      public void setVerbose( boolean verbose )
+      {
+         m_verbose = verbose;
+      }
+
+      /**
+       * DOCUMENT_ME
+       *
+       * @return DOCUMENT_ME
+       */
+      public boolean isVerbose(  )
+      {
+         return m_verbose;
+      }
+   }
+}
\ No newline at end of file

Added: incubator/apollo/trunk/src/templates/deploy.vm
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/templates/deploy.vm?view=auto&rev=123214
 ==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/templates/deploy.vm	Thu Dec 23 11:07:37 2004
@@ -0,0 +1,29 @@
+#set( $servicename = $generated.servicename)
+#set( $wsdlName = $generated.wsdlname)
+
+<?xml version="1.0"?>
+
+<deployment xmlns="http://xml.apache.org/axis/wsdd/" 
+            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+   <service name="$servicename" provider="java:WSRF" style="document" use="literal">
+      
+      <wsdlFile>/wsdl/$wsdlName</wsdlFile>      
+      
+      <requestFlow>
+         <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+            <parameter name="className" \
value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" /> \
+            <parameter name="referencePropertyNames" value="*" /> +         \
</handler> +      </requestFlow>      
+      
+      <responseFlow>
+         <handler type="java:org.apache.axis.handlers.JAXRPCHandler">
+            <parameter name="className" \
value="org.apache.axis.message.addressing.handler.AxisServerSideAddressingHandler" /> \
+            <parameter name="referencePropertyNames" value="*" /> +         \
</handler> +      </responseFlow>            
+      
+   </service>
+
+</deployment>

Added: incubator/apollo/trunk/src/templates/jndi.vm
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/templates/jndi.vm?view=auto&rev=123214
 ==============================================================================
--- (empty file)
+++ incubator/apollo/trunk/src/templates/jndi.vm	Thu Dec 23 11:07:37 2004
@@ -0,0 +1,37 @@
+#set( $package = $generated.genpackage)
+#set( $servicename = $generated.servicename)
+#set( $namespace = $generated.namespace)
+#set( $resourcekey = $generated.resourcekey)
+
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+   <service name="$servicename">
+      <resource name="home" type="$package.$servicenameHome">
+         <resourceParams>
+            <parameter>
+               <name>serviceClassName</name>
+               <value>$package.$servicenameService</value>
+            </parameter>
+            <parameter>
+               <name>resourceClassName</name>
+               <value>$package.$servicenameResource</value>
+            </parameter>
+            <parameter>
+               <name>wsdlTargetNamespace</name>
+               <value>$namespace</value>
+            </parameter>
+            
+            #if($resourcekey)
+            <parameter>
+               <name>resourceKeyName</name>
+               <value>{$resourcekey.NamespaceURI}$resourcekey.LocalPart</value>
+            </parameter>
+            #end
+         </resourceParams>
+      </resource>
+   </service>
+
+</jndiConfig>
+

Modified: incubator/apollo/trunk/src/templates/templating.txt
Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/templates/templating.txt \
?view=diff&rev=123214&p1=incubator/apollo/trunk/src/templates/templating.txt&r1=123213&p2=incubator/apollo/trunk/src/templates/templating.txt&r2=123214
 ==============================================================================
--- incubator/apollo/trunk/src/templates/templating.txt	(original)
+++ incubator/apollo/trunk/src/templates/templating.txt	Thu Dec 23 11:07:37 2004
@@ -84,4 +84,16 @@
 
 ===========================================================
 13. Is PropertiesResource??
-#set( $PropertiesResource = $generated.IsPropertiesResource)
\ No newline at end of file
+#set( $PropertiesResource = $generated.IsPropertiesResource)
+
+===================================
+
+14. Wsdl Name
+
+#set( $wsdlName = $generated.wsdlname)
+
+=======================================
+
+15. QName (object) of ResourceKey
+
+#set( $resourcekey = $generated.resourcekey)
\ No newline at end of file


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic