Files
alfresco-community-repo/config/alfresco/ibatis/org.hibernate.dialect.Dialect/query-authorities-common-SqlMap.xml
Dave Ward c21a3d2740 Merged V4.1-BUG-FIX to HEAD
44765: ALF-17164: Fix failing build in case build is not run in continuous mode
   44769: ALF-17097 60k Site Performance: Admin Console | Groups | Browse Groups (include sys groups): Results isn't appeared.
      - Group page now supports search and browse of large volumes of groups. Tested up to 300,000 sites (60k sites).
        Previously this would not return.
      - In order to support large volumes of groups it is not practical to search for all root groups.
        A functional change has taken place to fix this issue.
        [Browse] (which initially displayed only root groups) now uses the search value entered by the user and the same
        query as [Search]. It could be argued that the browse functionality was not very practical anyway if there were
        a large number of root groups as the user would have to page through all the pages one at a time to get to the
        required group in order to add a new sub group. As a result of this change it is now possible to get to the
        required group much faster. As the 'browse' function uses the search value and Include System Groups checkbox
        (it already used the checkbox value) it made little sense to revert to the Search results when either of these
        is changed. As this was taking place, this has now been changed too. The [Search] and [Browse] options both now
        use the authority canned query which has been enhanced to use the sortBy field supplied by the UI.
      - Uses the authority canned query for [Search] and [Browse] searches on the Groups page.
      - Canned query may sort on "shortName", "displayName" or "authorityName"
      - Filter on displayName uses regular expressions to support ? and * wildcards
      - Canned query returns fewer (unused) columns to speed up fetch time.
      - Canned query no longer joins to alf_store as none of the values were used.
   44772: CIFS Gedit support - rename open files.
   44776: ALF-17164: Fix failing build in case build is not run in continuous mode - move generation of version.properties out of continuous mode


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@44790 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2012-12-18 14:43:45 +00:00

75 lines
3.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--
Queries related to authorities
-->
<mapper namespace="alfresco.query.authorities">
<!-- -->
<!-- Result Maps -->
<!-- -->
<resultMap id="result_AuthorityInfo" type="AuthorityInfo">
<id property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
<result property="authorityDisplayName" column="authority_display_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
<result property="authorityName" column="authority_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
</resultMap>
<resultMap id="result_AuthorityBridgeLink" type="AuthorityBridgeLink">
<result property="childName" column="child_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
<result property="parentName" column="parent_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
</resultMap>
<!-- -->
<!-- Parameter Maps -->
<!-- -->
<!-- -->
<!-- Statements -->
<!-- -->
<!-- GetAuthorities - note: take advantage of fact that authority name is also on child assoc (including "username" for users, eg. getAllAuthoritiesInZone) -->
<select id="select_GetAuthoritiesCannedQuery" parameterType="AuthorityInfo" resultMap="result_AuthorityInfo">
select
childNode.id as id,
adn.string_value as authority_display_name,
assoc.qname_localname as authority_name <!-- see note -->
from
alf_child_assoc assoc
join alf_node childNode on (childNode.id = assoc.child_node_id)
left join alf_node_properties adn on (adn.node_id = childNode.id and adn.qname_id = #{authorityDisplayNameQNameId})
where
assoc.parent_node_id = #{parentNodeId}
</select>
<!-- Get all relationships between authorities -->
<select id="select_GetAuthorityBridgeEntries" parameterType="AuthorityBridgeParameters" resultMap="result_AuthorityBridgeLink">
select
ca.qname_localname as child_name,
parentName.string_value as parent_name
from
alf_child_assoc ca
join alf_node childNode on ((childNode.id = ca.child_node_id) and (childNode.type_qname_id = #{typeQNameId} )and (childNode.store_id = #{storeId}))
join alf_node parentNode on ((parentNode.id = ca.parent_node_id) and (parentNode.type_qname_id = #{typeQNameId}) and (parentNode.store_id = #{storeId}))
join alf_node_properties parentName on (parentName.node_id = parentNode.id and parentName.qname_id = #{authorityNameQNameId})
where
ca.type_qname_id = #{childAssocTypeQNameId}
</select>
<!-- Get direct parent authorities -->
<select id="select_GetDirectAuthoritiesForUser" parameterType="AuthorityBridgeParameters" resultMap="result_AuthorityBridgeLink">
select
'' as child_name,
parentName.string_value as parent_name
from
alf_child_assoc ca
join alf_node childNode on ((childNode.id = ca.child_node_id) and (childNode.store_id = #{storeId}))
join alf_node parentNode on ((parentNode.id = ca.parent_node_id) and (parentNode.type_qname_id = #{typeQNameId}) and (parentNode.store_id = #{storeId}))
join alf_node_properties parentName on (parentName.node_id = parentNode.id and parentName.qname_id = #{authorityNameQNameId})
where
ca.type_qname_id = #{childAssocTypeQNameId}
and childNode.id = #{nodeId}
</select>
</mapper>