Package org.openbravo.dal.core
Class DalInitializingTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.openbravo.dal.core.DalInitializingTask
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ActivationTask
,ApplyModuleTask
,CheckLocalConsistency
,ExtractModuleTask
,SystemValidationTask
public class DalInitializingTask extends org.apache.tools.ant.Task
This class can be sub-classed by java ant tasks which need to make use of the Data Access Layer. This class reads the Openbravo.properties and initializes the Dal. The user context is set using the userid. Then the doExecute method is called. This method should be implemented by the subclass.- Author:
- mtaal
-
-
Field Summary
Fields Modifier and Type Field Description protected String
propertiesFile
protected String
userId
-
Constructor Summary
Constructors Constructor Description DalInitializingTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
The method which should be implemented by the subclassvoid
execute()
Performs Dal layer initialization and then calls the doExecute method.String
getPropertiesFile()
String
getProviderConfigDirectory()
String
getUserId()
The user used to run the task.boolean
isAdminMode()
boolean
isReInitializeModel()
void
setAdminMode(boolean adminMode)
void
setPropertiesFile(String propertiesFile)
Sets the path to the Openbravo.properties file.void
setProviderConfigDirectory(String providerConfigDirectory)
void
setReInitializeModel(boolean reInitializeModel)
void
setUserId(String userId)
Sets the user which will be used to run the task.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
getPropertiesFile
public String getPropertiesFile()
-
setPropertiesFile
public void setPropertiesFile(String propertiesFile)
Sets the path to the Openbravo.properties file.- Parameters:
propertiesFile
- the full filesystem path to the Openbravo.properties file
-
getUserId
public String getUserId()
The user used to run the task.- Returns:
- the id of the user
-
setUserId
public void setUserId(String userId)
Sets the user which will be used to run the task.- Parameters:
userId
- the id of the user which will be used to run the task
-
execute
public void execute()
Performs Dal layer initialization and then calls the doExecute method.- Overrides:
execute
in classorg.apache.tools.ant.Task
-
doExecute
protected void doExecute()
The method which should be implemented by the subclass
-
getProviderConfigDirectory
public String getProviderConfigDirectory()
-
setProviderConfigDirectory
public void setProviderConfigDirectory(String providerConfigDirectory)
-
isReInitializeModel
public boolean isReInitializeModel()
-
setReInitializeModel
public void setReInitializeModel(boolean reInitializeModel)
-
isAdminMode
public boolean isAdminMode()
-
setAdminMode
public void setAdminMode(boolean adminMode)
-
-