pt.digitalis.maven.ormgenerator
Class ServiceExecutor

java.lang.Object
  extended by pt.digitalis.maven.ormgenerator.BaseExecutor
      extended by pt.digitalis.maven.ormgenerator.ServiceExecutor

public class ServiceExecutor
extends BaseExecutor

Creates the service code, and the IoC contributions for them

Author:
Ant�nio Silva asilva@digitalis.pt, Pedro Viegas pviegas@digitalis.pt

Field Summary
static String DATABASE_DIRECTORY_FILE
          The suffix given to the generated files
static String DATABASE_DIRECTORY_IMPL_TEMPLATE
          The name of the template for the database
static String DATABASE_DIRECTORY_TEMPLATE
          The name of the template for the database
static String MODEL_MODULE_NAME
          The name given to the model class
static String MODULE_PROPERTIES_NAME
          The name given to the model class
static String MODULE_PROPERTIES_TEMPLATE
          The name of the template properties for the service
static String MODULE_TEMPLATE
          The name of the template for the service
static String SERVICE_DIRECTORY_FILE_SUFFIX
          The suffix given to the generated files
static String SERVICE_DIRECTORY_IMPL_TEMPLATE
          The name of the template for the service
static String SERVICE_DIRECTORY_TEMPLATE
          The name of the template for the service
static String SERVICE_FILE_SUFFIX
          The suffix given to the generated files
static String SERVICE_IMPL_TEMPLATE
          The name of the template for the service
static String SERVICE_TEMPLATE
          The name of the template for the service
 
Fields inherited from class pt.digitalis.maven.ormgenerator.BaseExecutor
AUTO_PACKAGE, AUTO_PREFFIX, DAO_PACKAGE, DAO_SUFFIX, IMPL_FILE_SUFFIX, IMPL_PACKAGE_SUFFIX, INTERFACE_PREFFIX, JAVA_EXTENSION, PROPERTIES_EXTENSION
 
Constructor Summary
ServiceExecutor(String packageName, String dataSourceName, String templateDir, String destinationDir, String baseCodeDIR, String serviceConfigurationFileName, Boolean multiInstance, org.apache.maven.plugin.logging.Log logger)
          Class constructor instantiates the ServiceExecutor with the required initializations
 
Method Summary
 boolean execute()
          This method is responsible to generate all the files.
 boolean generateServiceFiles(String generatedDest)
          Generates the files from the templates
 void getServiceConfigurationData()
          Reads the service configuration file and populates the ServiceCfg
 ServiceCfg getServiceData()
           
 
Methods inherited from class pt.digitalis.maven.ormgenerator.BaseExecutor
getDestinationDir, getFreemarkerConfig, getPackageName, getTemplateDir, obtainPath, prepareExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODEL_MODULE_NAME

public static final String MODEL_MODULE_NAME
The name given to the model class

See Also:
Constant Field Values

MODULE_PROPERTIES_NAME

public static final String MODULE_PROPERTIES_NAME
The name given to the model class

See Also:
Constant Field Values

SERVICE_TEMPLATE

public static final String SERVICE_TEMPLATE
The name of the template for the service

See Also:
Constant Field Values

SERVICE_IMPL_TEMPLATE

public static final String SERVICE_IMPL_TEMPLATE
The name of the template for the service

See Also:
Constant Field Values

SERVICE_DIRECTORY_TEMPLATE

public static final String SERVICE_DIRECTORY_TEMPLATE
The name of the template for the service

See Also:
Constant Field Values

SERVICE_DIRECTORY_IMPL_TEMPLATE

public static final String SERVICE_DIRECTORY_IMPL_TEMPLATE
The name of the template for the service

See Also:
Constant Field Values

DATABASE_DIRECTORY_TEMPLATE

public static final String DATABASE_DIRECTORY_TEMPLATE
The name of the template for the database

See Also:
Constant Field Values

DATABASE_DIRECTORY_IMPL_TEMPLATE

public static final String DATABASE_DIRECTORY_IMPL_TEMPLATE
The name of the template for the database

See Also:
Constant Field Values

MODULE_TEMPLATE

public static final String MODULE_TEMPLATE
The name of the template for the service

See Also:
Constant Field Values

MODULE_PROPERTIES_TEMPLATE

public static final String MODULE_PROPERTIES_TEMPLATE
The name of the template properties for the service

See Also:
Constant Field Values

SERVICE_FILE_SUFFIX

public static final String SERVICE_FILE_SUFFIX
The suffix given to the generated files

See Also:
Constant Field Values

SERVICE_DIRECTORY_FILE_SUFFIX

public static final String SERVICE_DIRECTORY_FILE_SUFFIX
The suffix given to the generated files

See Also:
Constant Field Values

DATABASE_DIRECTORY_FILE

public static final String DATABASE_DIRECTORY_FILE
The suffix given to the generated files

See Also:
Constant Field Values
Constructor Detail

ServiceExecutor

public ServiceExecutor(String packageName,
                       String dataSourceName,
                       String templateDir,
                       String destinationDir,
                       String baseCodeDIR,
                       String serviceConfigurationFileName,
                       Boolean multiInstance,
                       org.apache.maven.plugin.logging.Log logger)
Class constructor instantiates the ServiceExecutor with the required initializations

Parameters:
packageName - The base package for the generated files
dataSourceName - the database name
templateDir - Path for the template directory, could be relative or absolute.
destinationDir - directory where the generated files should be inserted.
baseCodeDIR - the project base path
serviceConfigurationFileName - Service configuration file name, this file should read from the resources
multiInstance - Multi instance mode
logger - the Maven Plugin logger
Method Detail

getServiceConfigurationData

public void getServiceConfigurationData()
Reads the service configuration file and populates the ServiceCfg


execute

public boolean execute()
This method is responsible to generate all the files.

Specified by:
execute in class BaseExecutor
Returns:
Returns true if the generation process went well and false otherwise

generateServiceFiles

public boolean generateServiceFiles(String generatedDest)
Generates the files from the templates

Parameters:
generatedDest - generated file destination dir
Returns:
The result is true if the files were correctly generated well and false otherwise

getServiceData

public ServiceCfg getServiceData()
Returns:
the serviceData


Copyright © 2007-2010 Digitalis Informática Lda. All Rights Reserved.