mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.repository.ContentWriter;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.repository.StoreRef;
|
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.ResultSet;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
@@ -219,24 +220,28 @@ public class RepoStore implements Store, TenantDeployer
|
|||||||
{
|
{
|
||||||
public NodeRef execute() throws Exception
|
public NodeRef execute() throws Exception
|
||||||
{
|
{
|
||||||
String query = "PATH:\"" + repoPath + "\"";
|
NodeRef repoStoreRootNodeRef = nodeService.getRootNode(repoStore);
|
||||||
ResultSet resultSet = searchService.query(repoStore, SearchService.LANGUAGE_LUCENE, query);
|
List<NodeRef> nodeRefs = searchService.selectNodes(
|
||||||
try
|
repoStoreRootNodeRef,
|
||||||
|
repoPath,
|
||||||
|
new QueryParameterDefinition[] {},
|
||||||
|
namespaceService,
|
||||||
|
false,
|
||||||
|
SearchService.LANGUAGE_XPATH);
|
||||||
|
if (nodeRefs.size() == 1)
|
||||||
{
|
{
|
||||||
if (resultSet.length() == 1)
|
return nodeRefs.get(0);
|
||||||
{
|
|
||||||
return resultSet.getNodeRef(0);
|
|
||||||
}
|
|
||||||
else if (mustExist)
|
|
||||||
{
|
|
||||||
throw new WebScriptException("Web Script Store " + repoStore.toString() + repoPath + " must exist; it was not found");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
finally
|
else if (nodeRefs.size() > 1)
|
||||||
{
|
{
|
||||||
resultSet.close();
|
throw new WebScriptException(
|
||||||
|
"Web Script Store " + repoStore.toString() + repoPath + " must exist; multiple entries found.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new WebScriptException(
|
||||||
|
"Web Script Store " + repoStore.toString() + repoPath + " must exist; it was not found");
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user