Merged V2.2 to HEAD

11008: FileFolderService no longer uses Lucene
   11014: Fixed ETWOTWO-569: Regression after ContentStoreCleaner overhaul
   11021: Fixed HibernateSessionHelperTest
   11028: Fixed unit test's expected values
   11035: Made cm:auditable optional and fixed 64K limit on property list sizes
   11038: IncompleteNodeTagger handles aspects that are not in the dictionary
   11039: Added tests to ensure that QName caching is case-insensitive
   11040: Fixed use of mixed-case QNames for aspects
   11044: Allow background AND in-transaction indexing to be disabled at the same time.
   11046: Removed Lucene use from RegistryServiceImpl
   11050: Removal of Lucene usage
          - ML services finding root using XPath moved to path query
          - RepoStore now uses simple path query
          - Remove unused imports on PersonServiceImpl


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11215 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-10-06 15:03:24 +00:00
parent a1a59aee27
commit 33082eb631

View File

@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.QueryParameterDefinition;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.PermissionService;
@@ -219,25 +220,29 @@ public class RepoStore implements Store, TenantDeployer
{
public NodeRef execute() throws Exception
{
String query = "PATH:\"" + repoPath + "\"";
ResultSet resultSet = searchService.query(repoStore, SearchService.LANGUAGE_LUCENE, query);
try
NodeRef repoStoreRootNodeRef = nodeService.getRootNode(repoStore);
List<NodeRef> nodeRefs = searchService.selectNodes(
repoStoreRootNodeRef,
repoPath,
new QueryParameterDefinition[] {},
namespaceService,
false,
SearchService.LANGUAGE_XPATH);
if (nodeRefs.size() == 1)
{
if (resultSet.length() == 1)
return nodeRefs.get(0);
}
else if (nodeRefs.size() > 1)
{
return resultSet.getNodeRef(0);
throw new WebScriptException(
"Web Script Store " + repoStore.toString() + repoPath + " must exist; multiple entries found.");
}
else if (mustExist)
else
{
throw new WebScriptException("Web Script Store " + repoStore.toString() + repoPath + " must exist; it was not found");
throw new WebScriptException(
"Web Script Store " + repoStore.toString() + repoPath + " must exist; it was not found");
}
}
finally
{
resultSet.close();
}
return null;
}
});
}
}, AuthenticationUtil.getSystemUserName());