public void executeTask( Task t )
throws TaskExecutionException
{
log.info( "Checkout task executor.." );
CheckOutTask task = (CheckOutTask) t;
int projectId = task.getProjectId();
Project project;
try
{
project = projectDao.getProjectWithBuildDetails( projectId );
}
catch ( ContinuumStoreException ex )
{
log.error( "Internal error while getting the project.", ex );
return;
}
String workingDirectory = task.getWorkingDirectory().getAbsolutePath();
Map<String, Object> context = new HashMap<String, Object>();
AbstractContinuumAction.setProjectId( context, projectId );
AbstractContinuumAction.setProject( context, project );
AbstractContinuumAction.setWorkingDirectory( context, workingDirectory );
CheckoutProjectContinuumAction.setScmUsername( context, task.getScmUserName() );
CheckoutProjectContinuumAction.setScmPassword( context, task.getScmPassword() );
AbstractContinuumAction.setProjectScmRootUrl( context, task.getScmRootUrl() );
AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context,
task.getProjectsWithCommonScmRoot() );
try
{
actionManager.lookup( "checkout-project" ).execute( context );