mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed ALF-10962. It is not an error for a QName to be missing.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31390 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,7 +21,6 @@ package org.alfresco.repo.security.authority;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.query.AbstractCannedQueryFactory;
|
import org.alfresco.query.AbstractCannedQueryFactory;
|
||||||
import org.alfresco.query.CannedQuery;
|
import org.alfresco.query.CannedQuery;
|
||||||
@@ -103,10 +102,17 @@ public class GetAuthoritiesCannedQueryFactory extends AbstractCannedQueryFactory
|
|||||||
|
|
||||||
Long containerNodeId = nodePair.getFirst();
|
Long containerNodeId = nodePair.getFirst();
|
||||||
|
|
||||||
|
Long qnameAuthDisplayNameId = Long.MIN_VALUE; // We query but using a value that won't return results
|
||||||
|
Pair<Long, QName> qnameAuthDisplayNamePair = qnameDAO.getQName(ContentModel.PROP_AUTHORITY_DISPLAY_NAME);
|
||||||
|
if (qnameAuthDisplayNamePair != null)
|
||||||
|
{
|
||||||
|
qnameAuthDisplayNameId = qnameAuthDisplayNamePair.getFirst();
|
||||||
|
}
|
||||||
|
|
||||||
// specific query params
|
// specific query params
|
||||||
GetAuthoritiesCannedQueryParams paramBean = new GetAuthoritiesCannedQueryParams(type,
|
GetAuthoritiesCannedQueryParams paramBean = new GetAuthoritiesCannedQueryParams(type,
|
||||||
containerNodeId,
|
containerNodeId,
|
||||||
getQNameId(ContentModel.PROP_AUTHORITY_DISPLAY_NAME),
|
qnameAuthDisplayNameId,
|
||||||
displayNameFilter);
|
displayNameFilter);
|
||||||
|
|
||||||
// page details
|
// page details
|
||||||
@@ -128,16 +134,6 @@ public class GetAuthoritiesCannedQueryFactory extends AbstractCannedQueryFactory
|
|||||||
return getCannedQuery(params);
|
return getCannedQuery(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long getQNameId(QName qname)
|
|
||||||
{
|
|
||||||
Pair<Long, QName> qnamePair = qnameDAO.getQName(qname);
|
|
||||||
if (qnamePair == null)
|
|
||||||
{
|
|
||||||
throw new AlfrescoRuntimeException("QName does not exist: " + qname);
|
|
||||||
}
|
|
||||||
return qnamePair.getFirst();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception
|
public void afterPropertiesSet() throws Exception
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user