select label, m.mime_type from cr_mime_types m, cr_content_mime_type_map t
where t.content_type = 'content_template' and t.mime_type = m.mime_type
select mime_type from cr_revisions where revision_id = :edit_revision
select count(revision_id)
from cr_revisions
where item_id = :template_id