postgresql7.1
select ca__get_folder_id (:package_id)
select content_item__get_content_type (:item_id)
select content_folder__register_content_type (:folder_id,
:content_type,
:include_subtypes)
select content_folder__new (:name,
:label,
:description,
:root_folder_id)
select ca__set_package_folder (:new_folder_id,
:package_id)
select content_item__new (:name::varchar,
:parent_id::int4,
:item_id::int4,
null,
now(),
:creation_user,
null,
:creation_ip,
:content_item,
:content_type,
null,
null,
'text/plain',
null,
null,
'text'::varchar)
select content_revision__new (:title,
:description,
now(),
null,
null,
:data,
:item_id,
null,
now(),
:creation_user,
:creation_ip)
$plsql_query
select content_keyword__item_assign (:cr_item_id,
:category_id,
null,
null,
null)
select content_revision__new (:title,
:description,
now(),
null,
null,
:data,
:item_id,
null,
now(),
:creation_user,
:creation_ip)
update cr_revisions
set title = :title,
description = :description,
content = :data
where revision_id = :object_id
$plsql_query
select content_item__is_subclass (:content_type,
:parent_type)
select ca_attributes__add_generic_value (:object_id,
:attribute_id,
:attr_value)
select ca_attributes__edit_generic_value (:object_id,
:attribute_id,
:attr_value)
select content_item__get_latest_revision (:item_id)
select content_revision__get_content (:revision_id)
select site_node__url(n2.node_id) as url,
n2.object_id,
acs_object__name(n2.object_id) as object_name,
tree_level(n2.tree_sortkey) as level
from (select tree_ancestor_keys(site_node_get_tree_sortkey(:node_id)) as tree_sortkey) parents,
site_nodes n2
where n2.tree_sortkey = parents.tree_sortkey
and tree_level(n2.tree_sortkey) > 1
order by level asc
SELECT ca_attributes__create_attribute (
'ca_ad', -- content_type
:attribute_name, -- attribute_name
:datatype, -- datatype
:pretty_name, -- pretty_name
:pretty_plural, -- pretty_plural
null, -- sort_order
:default_value, -- default_value
'type_specific', -- storage
'cr_ca_ads', -- table_name
:column_spec, -- column_spec
:main_keyword_id -- keyword_id
);
SELECT ca_attributes__register_widget (
:attribute_id, -- attribute_id
:widget, -- widget
:pretty_name, -- label
:html_options, -- html_options
:extra_options, -- extra_options
:select_options, -- select_options
:validate, -- validate
:optional_p, -- optional_p
:enabled_p -- enabled_p
);
SELECT
aa.attribute_id,
aa.attribute_name,
aa.pretty_name,
aa.pretty_plural,
aa.default_value,
aa.storage,
aa.datatype,
aa.sort_order,
coalesce(aa.table_name, at.table_name) as table_name,
coalesce(aa.column_name, aa.attribute_name) as column_name,
cawv.widget, cawv.label, cawv.html_options,
cawv.extra_options, cawv.select_options,
cawv.validate, cawv.optional_p, cawv.enabled_p,
keywords.heading AS category_heading
FROM
acs_attributes aa,
ca_attributes ca,
ca_attribute_widget_values cawv,
acs_object_types at,
(
select
subtree.keyword_id,
subtree.heading
from cr_keywords parent, cr_keywords subtree
where parent.keyword_id = :keyword_id
and parent.tree_sortkey between subtree.tree_sortkey and tree_right(subtree.tree_sortkey)
) keywords
WHERE
aa.attribute_id = ca.attribute_id
AND
ca.attribute_id = cawv.attribute_id
AND
ca.keyword_id = keywords.keyword_id
AND
aa.object_type = :content_type
AND
at.object_type = :content_type
$storage_stub
ORDER BY
aa.sort_order asc