postgresql7.1
select file_storage__new_root_folder (
:package_id,
:pretty_name, -- label
:name, -- name
:description
)
select file_storage__get_root_folder(:package_id);
select file_storage__new_folder(
:name,
:pretty_name,
:parent_id,
:creation_user,
:creation_ip
);
select content_folder__edit_name(
:folder_id,
null,
:name,
null
);
select fs_objects.object_id,
fs_objects.name,
fs_objects.title,
fs_objects.live_revision,
fs_objects.type,
to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi,
fs_objects.content_size,
fs_objects.url,
fs_objects.key,
fs_objects.sort_key,
fs_objects.file_upload_name,
fs_objects.title,
case when fs_objects.last_modified >= (now() - interval '$n_past_days days') then 1 else 0 end as new_p,
acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p,
acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p,
acs_permission__permission_p(fs_objects.object_id, :user_id, 'write') as write_p
from fs_objects
where fs_objects.parent_id = :folder_id
and exists (select 1
from acs_object_party_privilege_map m
where m.object_id = fs_objects.object_id
and m.party_id = :user_id
and m.privilege = 'read')
order by fs_objects.sort_key, fs_objects.name
select file_storage__get_folder_name(:folder_id);
select count(*)
from cr_items c1, cr_items c2
where c2.item_id = :item_id
and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey)
and not acs_permission__permission_p(c1.item_id, :user_id, :privilege)
select c1.item_id as child_item_id
from cr_items c1, cr_items c2
where c2.item_id = :item_id
and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey)
order by c1.tree_sortkey
select count(*)
from cr_revisions
where item_id = :child_item_id
and acs_permission__permission_p(revision_id, :user_id, :privilege) = 'f'
select file_storage__get_title(:item_id)
select (case when file_storage__get_content_type(i.item_id) = 'content_folder'
then :folder_url || '?folder_id='
else :file_url || '?file_id='
end) || i.item_id,
file_storage__get_title(i.item_id)
from (select tree_ancestor_keys(cr_items_get_tree_sortkey(:start_id)) as tree_sortkey) parents,
(select tree_sortkey from cr_items where item_id = :root_folder_id) root,
cr_items i
where i.tree_sortkey = parents.tree_sortkey
and i.tree_sortkey > root.tree_sortkey
order by i.tree_sortkey asc
select person__name(o.creation_user) as owner from
acs_objects o where o.object_id = :item_id
select site_node__url(node_id) as path1 from site_nodes
where object_id = (select package_id
from fs_root_folders where
fs_root_folders.folder_id = :root_folder)
select lob
from cr_revisions
where revision_id = $live_revision
select content
from cr_revisions
where revision_id = :live_revision
select content_item__get_id ( :name, :folder_id, 'f' )
select file_storage__new_file (
:name,
:parent_id,
:creation_user,
:creation_ip,
:indbp,
:item_id
)
select file_storage__delete_version(
:item_id,
:version_id
);
select file_storage__delete_file(
:item_id
);
select file_storage__delete_folder (
:folder_id,
:cascade_p
)
begin
perform acs_object__update_last_modified
(:parent_id,:creation_user,:creation_ip);
perform
acs_object__update_last_modified(:item_id,:creation_user,:creation_ip);
return null;
end;
select r.package_id,
r.folder_id as root_folder_id
from fs_root_folders r,
(select parent.item_id as folder_id
from cr_items parent,
cr_items children
where children.item_id = :folder_id
and children.tree_sortkey
between parent.tree_sortkey
and tree_right(parent.tree_sortkey)) t
where r.folder_id = t.folder_id
select site_node__url(node_id)
from site_nodes
where object_id = (select package_id
from fs_root_folders r,
(select parent.item_id as folder_id
from cr_items parent,
cr_items children
where children.item_id = :folder_id
and children.tree_sortkey
between parent.tree_sortkey
and tree_right(parent.tree_sortkey)) t
where r.folder_id = t.folder_id)
select content_revision__new (
:title, -- title
:description, -- description
now(), -- publish_date
:mime_type, -- mime_type
null, -- ns_language
:content_body, -- text
:item_id, -- item_id
null,
now(), -- creation_date
:creation_user, -- creation_user
:creation_ip, -- creation_ip
null,
:package_id -- package_id
)
select content_revision__new (
:title, -- title
:description, -- description
now(), -- publish_date
:mime_type, -- mime_type
null, -- ns_language
:content_body, -- text
:item_id, -- item_id
null,
now(), -- creation_date
:creation_user, -- creation_user
:creation_ip, -- creation_ip
null,
:package_id -- package_id
)
select content_revision__new (
/* title => */ :title,
/* description => */ :description,
/* publish_date => */ current_timestamp,
/* mime_type => */ :mime_type,
/* nls_language => */ null,
/* data => */ null,
/* item_id => */ :item_id,
/* revision_id => */ :revision_id,
/* creation_date => */ current_timestamp,
/* creation_user => */ :creation_user,
/* creation_ip => */ :creation_ip,
/* package_id => */ :package_id
)
update cr_revisions
set mime_type = :mime_type,
lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]]
where revision_id = :revision_id
update cr_revisions
set content_length = lob_length(lob)
where revision_id = :revision_id
begin
perform acs_object__update_last_modified
(:parent_id,:creation_user,:creation_ip);
perform
acs_object__update_last_modified(:item_id,:creation_user,:creation_ip);
return null;
end;
select file_storage__new_file (
:name,
:parent_id,
:creation_user,
:creation_ip,
:indbp,
:item_id
)