libreccm-legacy/ccm-docmgr/pdl-2/com/arsdigita/docmgr/File.pdl

53 lines
1.6 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;
import com.arsdigita.kernel.*;
// Note that content retrieval and insert are factored out as separate
// events to speed up loading the meta-data only.
object type File extends ResourceImpl {
// Doesn't need anything that isn't already in ResourceImpl
}
query getFileRevisionBlob {
Blob content;
do {
select
value
from
vcx_txns tx,
vcx_tags tg,
vcx_obj_changes ch,
vcx_operations op,
vcx_blob_operations bo
where
tx.id = ch.txn_id
and tg.txn_id = tx.id
and ch.id = op.change_id
and op.id = bo.id
and tx.id = (select min(tx2.id)
from vcx_txns tx2
where tx2.id > :transactionID
and exists (select 1
from vcx_tags tg2
where tg2.txn_id = tx2.id
and tg2.tagged_oid = tg.tagged_oid))
and op.attribute = 'content'
} map {
content = value;
}
}