Forum OpenACS Development: Response to Is there documentation for acs-service-contract?
6: Response to Is there documentation for acs-service-contract? (response to 1)
Posted by Neophytos Demetriou on 09/27/01 07:25 AM
Can you define what the impl_name and impl_owner_name are in the following sql code?The impl_owner_name is the package key of the package that provides the implementation (in our case
ecommerce). The impl_name should be the object_type of the items that you want to index/search. So, for example
ec_product, if you want to index/search ecommerce products. The sql code is:
Note that for FtsContentProvider to work ok, you might need to write some triggers to update the search_observer_queue table. Unless, your content items are stored in the CR, you need to write the triggers. For examples look at
select acs_sc_impl__new( 'FtsContentProvider', -- impl_contract_name 'ec_product', -- impl_name 'ecommerce' -- impl_owner_name );
Eventually, I would like to get some information on how to write a service contract. Is there any code that I can look at to see how it should be written?So far we have identified two kinds of contract:
impl_nameis an object_type: We decide on which implementation to use by computing the type from an object_id using
acs_object_util__get_object_type. FtsContentProvider is an example of this kind of contract.
impl_nameis a package_key: We decide on which implementation to use by using the value of the parameter in the dependant package (the package that uses the contract). FtsEngineDriver is an example of this kind of contract.
- Decide what the operations are.
- Decide on the message types (input/output). While message types are not being used extensively at this moment, they will soon be used to provide WSDL functionality.
- It is very important to note that once a contract is stabilized/released there is no turning back. At least it will be difficult to update all available implementations -- and probably we won't know all the implementations because people might have independantly developed their own implementations of a contract. Maybe, we should keep track of all implementations of a contract at a repository when the new openacs.org site is released so that we can inform people when something changes (I haven't thought of this very much, so if someone has a different POV please let us know).
search-sc-create.sql for the specification of FtsContentProvider and FtsEngineDriver. If you think your service contract doesn't fit in any of these categories please post more questions.