43 lines
1.7 KiB
Plaintext
Executable File
43 lines
1.7 KiB
Plaintext
Executable File
//
|
|
// Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved.
|
|
//
|
|
// The contents of this file are subject to the ArsDigita Public
|
|
// License (the "License"); you may not use this file except in
|
|
// compliance with the License. You may obtain a copy of
|
|
// the License at http://www.arsdigita.com/ADPL.txt
|
|
//
|
|
// Software distributed under the License is distributed on an "AS
|
|
// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
// implied. See the License for the specific language governing
|
|
// rights and limitations under the License.
|
|
//
|
|
|
|
model com.arsdigita.docs;
|
|
|
|
query getRepositoriesView {
|
|
BigDecimal repositoryID;
|
|
BigDecimal isMounted;
|
|
BigDecimal numFiles;
|
|
do {
|
|
select distinct
|
|
docs_repositories.repository_id,
|
|
decode(dm.repository_id, null, 0, 1) mounted,
|
|
docs_repository_num_files(docs_repositories.root_id) num_files
|
|
from (select repository_id from docs_mounted where party_id = :userID) dm,
|
|
docs_repositories,
|
|
users,
|
|
group_member_map
|
|
where dm.repository_id(+) = docs_repositories.repository_id
|
|
and docs_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 = docs_repositories.repository_id;
|
|
isMounted = mounted;
|
|
numFiles = num_files;
|
|
}
|
|
}
|