Thursday, March 22, 2007

How can I find rendered or even non-rendered document of a particular format?

Note: The queries below will help you find documents that have a rendition attached to it.

The i_rendition attribute of dmr_content can have the following values:

i_rendition = 0 --no rendition
i_rendition = 1 --server created
i_rendition = 2 --client created

This DQL returns content which is a rendition of msw8 (word) documents
DQL> select object_name, r_object_id from dm_document where r_object_id in (select parent_id from dmr_content where any i_rendition=2 and full_format = 'pdf');

object_name r_object_id
========================= ================

fed new doc 0904969c8000090f
(1 rows affected)

If I run the query below then you can see this still returns the document msw8. The reason is because you need to keep in mind that the pdf rendition that is created is another object, so you still have original msw8 object and the PDF is linked to it. For this reason the query above uses the full format PDF to check if there is any object of this format linked to a dm_document.

DQL> select object_name,r_object_id from dm_document where a_content_type='msw8'
and r_object_id in (select parent_id from dmr_content where any
i_rendition=0 and full_format = 'msw8');

object_name r_object_id
========================= ================

msw8.doc 0904969c80000145
fed new doc 0904969c8000090f
(2 rows affected)

If you wanted to do the opposite then you can run the following to find documents that do not have renditions linked.

select object_name, r_object_id from dm_document where a_content_type='msw8' and r_object_id not in
(select parent_id from dmr_content where any
i_rendition=2 and full_format = 'pdf');

Remember also that the 1st query will only return renditions (pdf documents) so linked to an msw8. If you would like to search for original documents that are PDF then you need to run the query below,

DQL> select object_name, r_object_id from dm_document where r_object_id in (select parent_id from dmr_content where any
i_rendition=0 and full_format = 'pdf');

object_name r_object_id
========================= ================

pdf template 0904969c8000015a
test 0904969c8000190e
(2 rows affected)

2 comments:

Anonymous said...



Αlѕo νisіt mу page; http://www.hashtags.org/members/karlfanni/activity/92565/

Anonymous said...

In fact, you just go live your life, it doesn't make your body sweat and help to relieve the symptoms of alcohol cleanse your systemification often force the person to resume his usual dose of drinking. With regular use, the sheets will progressively get lighter and lighter, indicating a cleanse your system foot bath. cleanse your systeming our body has caught on like wildfire because of the cleanse your systemification process. But we can eliminate products that contain toxins from our bodies.

my web page - 7 day colon cleanse