mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
This commit is contained in:
@@ -15,6 +15,13 @@
|
||||
<parameter property="end" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_NodeIdsWhichReferenceContentUrl" type="map">
|
||||
<parameter property="contentUrlShort" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="contentUrlCrc" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<parameter property="localName" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
<parameter property="uri" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
</parameterMap>
|
||||
|
||||
<resultMap id="result_NodeRefEntity" type="org.alfresco.module.org_alfresco_module_rm.query.NodeRefEntity">
|
||||
<result property="row" column="row" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||
<result property="protocol" column="protocol" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
||||
@@ -55,18 +62,21 @@
|
||||
|
||||
<!-- Get list of node ids which reference given content url -->
|
||||
<select id="select_NodeIdsWhichReferenceContentUrl"
|
||||
parameterType="ContentUrl"
|
||||
parameterMap="parameter_NodeIdsWhichReferenceContentUrl"
|
||||
resultMap="result_NodeIds">
|
||||
select
|
||||
p.node_id
|
||||
from
|
||||
alf_content_url cu
|
||||
LEFT OUTER JOIN alf_content_data cd ON (cd.content_url_id = cu.id)
|
||||
LEFT OUTER JOIN alf_node_properties p ON (p.long_value = cd.id)
|
||||
WHERE
|
||||
content_url_short = #{contentUrlShort} and
|
||||
content_url_crc = #{contentUrlCrc}
|
||||
|
||||
left outer join alf_content_data cd ON (cd.content_url_id = cu.id)
|
||||
left outer join alf_node_properties p ON (p.long_value = cd.id)
|
||||
left outer join alf_qname q ON (q.id = p.qname_id)
|
||||
left outer join alf_namespace n ON (n.id = q.ns_id)
|
||||
where
|
||||
cu.content_url_short = ? and
|
||||
cu.content_url_crc = ? and
|
||||
q.local_name = ? and
|
||||
n.uri = ?
|
||||
</select>
|
||||
|
||||
<select id="select_RecordFoldersWithSchedules"
|
||||
|
@@ -27,7 +27,6 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.query;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -36,6 +35,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.domain.contentdata.ContentUrlEntity;
|
||||
import org.alfresco.repo.domain.node.NodeDAO;
|
||||
@@ -47,9 +51,6 @@ import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
|
||||
/**
|
||||
* Records management query DAO implementation
|
||||
@@ -89,7 +90,8 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
protected TenantService tenantService;
|
||||
|
||||
/**
|
||||
* @param sqlSessionTemplate SQL session template
|
||||
* @param sqlSessionTemplate
|
||||
* SQL session template
|
||||
*/
|
||||
public final void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
|
||||
{
|
||||
@@ -97,7 +99,8 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param qnameDAO qname DAO
|
||||
* @param qnameDAO
|
||||
* qname DAO
|
||||
*/
|
||||
public final void setQnameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
@@ -173,8 +176,9 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
/**
|
||||
* Get a set of node reference which reference the provided content URL
|
||||
*
|
||||
* @param String contentUrl content URL
|
||||
* @return Set<NodeRef> set of nodes that reference the provided content URL
|
||||
* @param String
|
||||
* contentUrl content URL
|
||||
* @return Set<NodeRef> set of nodes that reference the provided content URL
|
||||
*/
|
||||
@Override
|
||||
public Set<NodeRef> getNodeRefsWhichReferenceContentUrl(String contentUrl)
|
||||
@@ -188,13 +192,19 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
ContentUrlEntity contentUrlEntity = new ContentUrlEntity();
|
||||
contentUrlEntity.setContentUrl(contentUrl.toLowerCase());
|
||||
|
||||
Map<String, Object> params = new HashMap<>(4);
|
||||
params.put("contentUrlShort", contentUrlEntity.getContentUrlShort());
|
||||
params.put("contentUrlCrc", contentUrlEntity.getContentUrlCrc());
|
||||
params.put("localName", ContentModel.PROP_CONTENT.getLocalName());
|
||||
params.put("uri", ContentModel.PROP_CONTENT.getNamespaceURI());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Executing query " + SELECT_NODE_IDS_WHICH_REFERENCE_CONTENT_URL);
|
||||
}
|
||||
|
||||
// Get all the node ids which reference the given content url
|
||||
List<Long> nodeIds = template.selectList(SELECT_NODE_IDS_WHICH_REFERENCE_CONTENT_URL, contentUrlEntity);
|
||||
List<Long> nodeIds = template.selectList(SELECT_NODE_IDS_WHICH_REFERENCE_CONTENT_URL, params);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
@@ -224,7 +234,7 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logMessage.append(nodeRefToAdd)
|
||||
.append(" (from version)");
|
||||
.append(" (from version)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +242,7 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
else
|
||||
{
|
||||
nodeRefToAdd = nodeDAO.getNodeIdStatus(nodeId)
|
||||
.getNodeRef();
|
||||
.getNodeRef();
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logMessage.append(nodeRefToAdd);
|
||||
@@ -266,9 +276,9 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
{
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
params.put("processed", qnameDAO.getQName(ASPECT_DISPOSITION_PROCESSED)
|
||||
.getFirst());
|
||||
.getFirst());
|
||||
params.put("folderQnameId", qnameDAO.getQName(TYPE_RECORD_FOLDER)
|
||||
.getFirst());
|
||||
.getFirst());
|
||||
params.put("start", start);
|
||||
params.put("end", end);
|
||||
|
||||
@@ -280,7 +290,7 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
for (NodeRefEntity nodeRefEntity : entities)
|
||||
{
|
||||
results.add(
|
||||
new NodeRef(nodeRefEntity.getProtocol(), nodeRefEntity.getIdentifier(), nodeRefEntity.getUuid()));
|
||||
new NodeRef(nodeRefEntity.getProtocol(), nodeRefEntity.getIdentifier(), nodeRefEntity.getUuid()));
|
||||
}
|
||||
|
||||
return results;
|
||||
@@ -289,7 +299,8 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.query.RecordsManagementQueryDAO#getPropertyStringValueEntity(String stringValue)
|
||||
*/
|
||||
public PropertyStringValueEntity getPropertyStringValueEntity(String stringValue){
|
||||
public PropertyStringValueEntity getPropertyStringValueEntity(String stringValue)
|
||||
{
|
||||
|
||||
PropertyStringValueEntity propertyStringValueEntity = new PropertyStringValueEntity();
|
||||
propertyStringValueEntity.setValue(stringValue);
|
||||
|
Reference in New Issue
Block a user