org.sandev.generator
Class WebServiceShellGenerator

java.lang.Object
  extended byorg.sandev.generator.GeneratorCommon
      extended byorg.sandev.generator.WebShellGeneratorBase
          extended byorg.sandev.generator.WebServiceShellGenerator
All Implemented Interfaces:
org.sandev.sandbuild.SandGenerator

public class WebServiceShellGenerator
extends WebShellGeneratorBase
implements org.sandev.sandbuild.SandGenerator

Create the web services shell servlet that bridges to the main servlet processing. This front-end servlet captures the config parameters needed for the deployment and initializes the main RequestAdaptor.

The source code is written to a directory named after the type of the sandui declaration. So for example if the sandui name is "myname" and the type is "fastXMLWS" then the source will be in

The src directory and everything below it is cleaned up, but the top level directory is not, since it may contain other supporting files for the deployed service. The WEB-INV directory and the web.xml file are removed since they need to match the servlet source which is driven from the sandui build declaration.


Field Summary
static java.lang.String clientName
          The name of the client source file.
static java.lang.String clientPackage
          The name of the client source package.
 
Fields inherited from class org.sandev.generator.GeneratorCommon
CONTEXT_CONFIGURATION, CONTEXT_CONTROL, CONTEXT_FRAMEWORK, CONTEXT_MESSAGING, CONTEXT_PERSISTENCE, CONTEXT_UI, DEFAULT_LINE_LENGTH, MESSAGE_INTERFACES
 
Constructor Summary
WebServiceShellGenerator()
           
 
Method Summary
 void cleanup(org.sandev.sandbuild.SandDecl[] decls, java.io.File baseDir, boolean changed, java.lang.String extra)
          See the SandGenerator interface description and class comments for details.
 void generate(org.sandev.sandbuild.SandDecl[] decls, java.io.File baseDir, boolean changed, java.util.Collection dirtyFiles, java.lang.String extra)
          See the SandGenerator interface description and class comments for details.
protected  org.sandev.sandbuild.SandUIDeployment getWebSvcDeployment(org.sandev.sandbuild.SandProject proj)
          Return the web service SandUIDeployment or null if not found.
protected  void removeServiceClient(java.io.File projDir, java.lang.String clientDir)
          Remove the generated client source files.
protected  void writeServiceClient(java.io.File projDir, java.lang.String clientDirName, boolean changed, java.lang.String serviceDir)
          Make sure we have the specified directory, and write the source for the webservice test client.
 
Methods inherited from class org.sandev.generator.WebShellGeneratorBase
buildFileChanged, removeWebInf, removeWebShellSrc, verifySubProjectDir, verifyWebInf, verifyWebShellSrc
 
Methods inherited from class org.sandev.generator.GeneratorCommon
capitalize, copyfile, deletefile, filterHTMLLine, getDeclaredFields, getFields, getInheritanceHierarchy, getLastAppProject, getLastUtilDir, getLongInstanceName, getPrintStream, getSandProject, getShortInstanceName, getUtilPackage, getVisibleFields, isBasic, isLongReferenceArray, isMessageInterface, isParentAbstract, isPrimitive, isRootStruct, isVowel, log, nextToken, pluralize, rangeEscape, removePlatformDecls, trackFileDelete, trackFileWrite, uncapitalize, writeDefaultCtor, writeDescription, writeHTMLContents, writeMessageImports, writeSectionName, writeStandardCommentID, writeXHTMLFooter, writeXHTMLFooter, writeXHTMLHeader, writeXHTMLHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientPackage

public static final java.lang.String clientPackage
The name of the client source package. This is the name of the subdirectory after org/sandev/ui.

See Also:
Constant Field Values

clientName

public static final java.lang.String clientName
The name of the client source file. This is the .java file name.

See Also:
Constant Field Values
Constructor Detail

WebServiceShellGenerator

public WebServiceShellGenerator()
Method Detail

generate

public void generate(org.sandev.sandbuild.SandDecl[] decls,
                     java.io.File baseDir,
                     boolean changed,
                     java.util.Collection dirtyFiles,
                     java.lang.String extra)
              throws org.sandev.sandbuild.SandGeneratorException
See the SandGenerator interface description and class comments for details.

Specified by:
generate in interface org.sandev.sandbuild.SandGenerator
Throws:
org.sandev.sandbuild.SandGeneratorException

cleanup

public void cleanup(org.sandev.sandbuild.SandDecl[] decls,
                    java.io.File baseDir,
                    boolean changed,
                    java.lang.String extra)
             throws org.sandev.sandbuild.SandGeneratorException
See the SandGenerator interface description and class comments for details.

Specified by:
cleanup in interface org.sandev.sandbuild.SandGenerator
Throws:
org.sandev.sandbuild.SandGeneratorException

writeServiceClient

protected void writeServiceClient(java.io.File projDir,
                                  java.lang.String clientDirName,
                                  boolean changed,
                                  java.lang.String serviceDir)
                           throws org.sandev.sandbuild.SandGeneratorException
Make sure we have the specified directory, and write the source for the webservice test client.

Throws:
org.sandev.sandbuild.SandGeneratorException

removeServiceClient

protected void removeServiceClient(java.io.File projDir,
                                   java.lang.String clientDir)
                            throws org.sandev.sandbuild.SandGeneratorException
Remove the generated client source files. Leave the directories intact so they can be used for other client source.

Throws:
org.sandev.sandbuild.SandGeneratorException

getWebSvcDeployment

protected org.sandev.sandbuild.SandUIDeployment getWebSvcDeployment(org.sandev.sandbuild.SandProject proj)
                                                             throws org.sandev.sandbuild.SandGeneratorException
Return the web service SandUIDeployment or null if not found. Currently recognized web service declarations are: Limit of one web service interface declaration.

Throws:
org.sandev.sandbuild.SandGeneratorException