Importer - allow imported node references/paths to be searched for within committed repository only or committed repository and current import transaction.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2202 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-01-25 15:41:19 +00:00
parent 68ae6ef330
commit b7aec4a280
4 changed files with 24 additions and 2 deletions

View File

@@ -197,6 +197,11 @@ public class ExportSourceImporter implements ImporterJobSPI
return null;
}
public boolean allowReferenceWithinTransaction()
{
return false;
}
};
}

View File

@@ -439,6 +439,15 @@ public class ImporterBootstrap
// always use create new strategy for bootstrap import
return UUID_BINDING.CREATE_NEW;
}
/*
* (non-Javadoc)
* @see org.alfresco.service.cmr.view.ImporterBinding#searchWithinTransaction()
*/
public boolean allowReferenceWithinTransaction()
{
return true;
}
}
/**

View File

@@ -632,7 +632,7 @@ public class ImporterComponent
searchParameters.addStore(importedRef.context.getNodeRef().getStoreRef());
searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
searchParameters.setQuery("PATH:\"" + importedRef.value + "\"");
searchParameters.excludeDataInTheCurrentTransaction(false);
searchParameters.excludeDataInTheCurrentTransaction((binding == null) ? true : !binding.allowReferenceWithinTransaction());
ResultSet resultSet = searchService.query(searchParameters);
try
{

View File

@@ -41,7 +41,15 @@ public interface ImporterBinding
public UUID_BINDING getUUIDBinding();
/**
* Gets a value for the specified name - to support simple name / value binding
* Gets whether the search for imported node references should search within the import
* transaction or not.
*
* @return true => search within import transaction; false => only search existing committed items
*/
public boolean allowReferenceWithinTransaction();
/**
* Gets a value for the specified name - to support simple name / value substitution
*
* @param key the value name
* @return the value