libreccm-legacy/ccm-ldn-terms/pdl/com/arsdigita/london/terms/indexing/query-getTrainingItems.pdl

41 lines
1.4 KiB
Plaintext

// Copyright (C) 2009 Permeance Technologies Pty Ltd. 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
model com.arsdigita.london.terms.indexing;
query getTrainingItems {
BigDecimal[1..1] id;
do {
SELECT DISTINCT
i.item_id as id, a.last_modified
FROM
cms_bundles b, cat_object_category_map ocm, trm_terms t, cms_items i, acs_auditing a
WHERE
b.bundle_id = ocm.object_id
AND ocm.category_id = t.model_category_id
AND i.parent_id = b.bundle_id
AND i.language = :language
AND t.domain = :domain
AND i.version = 'draft'
AND a.object_id = b.bundle_id
ORDER BY
a.last_modified desc
} map {
id = id;
}
}