Sorry for bothering you with this again, I am trying to write a
service contract for the bboard module.
Therefore I wrote a bboard-sc-create.sql that looks like the
following:
select acs_sc_impl__new(
'FtsContentProvider', -- impl_contract_name
'apm_package', -- impl_name
'bboard' -- impl_owner_name
);
select acs_sc_impl_alias__new(
'FtsContentProvider', -- impl_contract_name
'apm_package', -- impl_name
'datasource', -- impl_operation_name
'bboard__datasource', -- impl_alias
'TCL' -- impl_pl
);
select acs_sc_impl_alias__new(
'FtsContentProvider', -- impl_contract_name
'apm_package' -- impl_name
'url', -- impl_operation_name
'bboard__url', -- impl_alias
'TCL' -- impl_pl
);
I then loaded the functions via the command:
psql unido-dev -f bboard-sc-create.sql
and got the following output:
NOTICE: Adding missing FROM-clause entry for
table "acs_object_id_seq"
psql:bboard-sc-create.sql:5: NOTICE:
identifier "acs_object__initialize_attributes" will be truncated
to "acs_object__initialize_attribut"
acs_sc_impl__new
------------------
36549
(1 row)
acs_sc_impl_alias__new
------------------------
36549
(1 row)
psql:bboard-sc-create.sql:21: ERROR: Function 'acs_sc_impl_alias__new
(unknown, unknown, unknown, unknown)' does not exist
Unable to identify a function that satisfies the given
argument types
You may need to add explicit typecasts
Under the tcl directory in a file called bboard-procs.tcl I defined
the two procs:
ad_proc bboard__datasource {
object_id
} {
@author Gregor Obernosterer
@creation-date 20-08-2002
} {
db_0or1row bboard_datasource {
SELECT
b.message_id,
b.forum_id,
c.item_id as object_id,
c.title as title,
c.content as content,
c.mime_type as mime,
'' as keywords,
'text' as storage_type
FROM
bboard_forum_message_map b,
cr_revisions c
WHERE
b.message_id = c.item_id
AND
item_id = :object_id
ORDER BY
c.item_id DESC
LIMIT ALL
} -column_array datasource
return [array get datasource]
}
ad_proc bboard__url {
object_id
forum_id # I also need the forum_id since the search result
# page is built up via the message_id that
# corresponds to a forum_id ... or not?
} {
@author Gregor Obernosterer
@creation-date 20-08-2002
} {
set package_id [apm_package_id_from_key bboard]
db_1row get_url_stub "
SELECT
site_node__url(node_id) as url_stub
FROM
site_nodes
WHERE
object_id = :package_id
"
set url "${url_stub}message?
message_id=$object_id&forum_id=$forum_id" #not sure how to built this.
return $url
}
I suppoes they are not correct - I am a rookie to that at all so I
hope not to bother you too much with that. Maybe Neophytos or Dave
can give me a hand after looking over this ...
Before I forget, under the search module I found a doc with the title
called "How to make an object type searchable?" This doc comprises an
example on writing a datasource proc, but misses out the url proc.
Beside all the mistakes I have made in the code above, is there
anything else missing (except to bind the impl_name via the service-
contract web interface... that's how it is done or...)?