libreccm-legacy/ccm-docrepo/pdl/com/arsdigita/docrepo/query-getRepositoriesView.o...

47 lines
1.9 KiB
Plaintext

//
// Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// $Id: docrepo/query-getRepositoriesView.ora.pdl pboy $
model com.arsdigita.docrepo;
query getRepositoriesView {
BigDecimal repositoryID;
BigDecimal isMounted;
BigDecimal numFiles;
do {
select distinct
dr_repositories.repository_id,
decode(dm.repository_id, null, 0, 1) mounted,
dr_repository_num_files(dr_repositories.root_id) num_files
from (select repository_id from docs_mounted where party_id = :userID) dm,
dr_repositories,
users,
group_member_map
where dm.repository_id(+) = docs_repositories.repository_id
and dr_repositories.owner_id = users.user_id
and users.user_id = group_member_map.member_id
and group_member_map.group_id in (select
group_id
from group_member_map
where member_id = :userID)
} map {
repositoryID = dr_repositories.repository_id;
isMounted = mounted;
numFiles = num_files;
}
}