Commit 427da4d0 authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.9

parent 49b960ae
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
<!-- Generated by the OpenACS Package Manager --> <!-- Generated by the OpenACS Package Manager -->
<package key="acs-service-contract" url="http://openacs.org/repository/apm/packages/acs-service-contract" type="apm_service"> <package key="acs-service-contract" url="http://openacs.org/repository/apm/packages/acs-service-contract" type="apm_service">
<package-name>Service Contracts</package-name> <package-name>ACS Service Contracts</package-name>
<pretty-plural>Service Contract Packages</pretty-plural> <pretty-plural>ACS Service Contract Packages</pretty-plural>
<initial-install-p>t</initial-install-p> <initial-install-p>t</initial-install-p>
<singleton-p>t</singleton-p> <singleton-p>t</singleton-p>
<version name="5.10.0d1" url="http://openacs.org/repository/download/apm/acs-service-contract-5.10.0d1.apm"> <version name="5.9.0" url="http://openacs.org/repository/download/apm/acs-service-contract-5.9.0.apm">
<owner url="http://openacs.org">OpenACS</owner> <owner url="http://openacs.org">OpenACS</owner>
<summary>API and UI for service contracts</summary> <summary>API and UI for service contracts</summary>
<release-date>2013-09-08</release-date> <release-date>2015-10-04</release-date>
<maturity>3</maturity> <maturity>3</maturity>
<vendor url="http://openacs.org">OpenACS</vendor> <vendor url="http://openacs.org">OpenACS</vendor>
<description format="text/html">Service contracts defines an API for the creation of interfaces and discovery of interface implementations. <description format="text/html">Service contracts defines an API for the creation of interfaces and discovery of interface implementations.
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
url or the contracts used by dotlrn and new-portals to allow packages to provide portalized panes.</description> url or the contracts used by dotlrn and new-portals to allow packages to provide portalized panes.</description>
<license>GPL version 2</license> <license>GPL version 2</license>
<provides url="acs-service-contract" version="5.10.0d1"/> <provides url="acs-service-contract" version="5.9.0"/>
<requires url="acs-kernel" version="5.10.0d1"/> <requires url="acs-kernel" version="5.9.0"/>
<callbacks> <callbacks>
</callbacks> </callbacks>
......
...@@ -17,3 +17,9 @@ db_foreach impl_operation { ...@@ -17,3 +17,9 @@ db_foreach impl_operation {
acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl" acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl"
} }
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -278,3 +278,9 @@ proc acs_sc_log {level msg} { ...@@ -278,3 +278,9 @@ proc acs_sc_log {level msg} {
# ns_log Debug "$msg" # ns_log Debug "$msg"
} }
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -317,3 +317,9 @@ ad_proc -public acs_sc::contract::operation::parse_spec { ...@@ -317,3 +317,9 @@ ad_proc -public acs_sc::contract::operation::parse_spec {
-is_cachable_p $attributes(is_cachable_p) -is_cachable_p $attributes(is_cachable_p)
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -355,3 +355,9 @@ ad_proc -private acs_sc::impl::binding::init_procs { ...@@ -355,3 +355,9 @@ ad_proc -private acs_sc::impl::binding::init_procs {
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -122,3 +122,9 @@ ad_proc -public acs_sc::msg_type::element::new { ...@@ -122,3 +122,9 @@ ad_proc -public acs_sc::msg_type::element::new {
db_exec_plsql insert_msg_type_element {} db_exec_plsql insert_msg_type_element {}
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -71,3 +71,9 @@ aa_register_case acs_sc_impl_new_from_spec { ...@@ -71,3 +71,9 @@ aa_register_case acs_sc_impl_new_from_spec {
aa_equals "pretty_name dit not get inserted correctly" $impl(impl_pretty_name) "Foo Driver" aa_equals "pretty_name dit not get inserted correctly" $impl(impl_pretty_name) "Foo Driver"
} }
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -70,3 +70,9 @@ db_multirow -extend {check} binding binding { ...@@ -70,3 +70,9 @@ db_multirow -extend {check} binding binding {
set impl_alias "<b>$impl_alias" set impl_alias "<b>$impl_alias"
} }
} }
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -11,3 +11,9 @@ ad_page_contract { ...@@ -11,3 +11,9 @@ ad_page_contract {
db_exec_plsql binding_install "select acs_sc_binding__new($contract_id,$impl_id)" db_exec_plsql binding_install "select acs_sc_binding__new($contract_id,$impl_id)"
ad_returnredirect "" ad_returnredirect ""
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -11,3 +11,9 @@ ad_page_contract { ...@@ -11,3 +11,9 @@ ad_page_contract {
db_exec_plsql binding_uninstall "select acs_sc_binding__delete($contract_id,$impl_id)" db_exec_plsql binding_uninstall "select acs_sc_binding__delete($contract_id,$impl_id)"
ad_returnredirect "" ad_returnredirect ""
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -49,3 +49,9 @@ template::list::create \ ...@@ -49,3 +49,9 @@ template::list::create \
} }
db_multirow valid_installed_binding valid_installed_binding {} db_multirow valid_installed_binding valid_installed_binding {}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
...@@ -2,26 +2,36 @@ ...@@ -2,26 +2,36 @@
<property name="context">{/doc/acs-service-contract {Service Contracts}} {ACS Service Contract Documentation}</property> <property name="context">{/doc/acs-service-contract {Service Contracts}} {ACS Service Contract Documentation}</property>
<property name="doc(title)">ACS Service Contract Documentation</property> <property name="doc(title)">ACS Service Contract Documentation</property>
<master> <master>
<h1>ACS Service Contract Documentation</h1>
<body> <h2>Why</h2>
<h1>ACS Service Contract Documentation</h1><h2>Why</h2><p>To facilitate greater code reuse, application integration, and <p>To facilitate greater code reuse, application integration, and
package extensibility within the OpenACS.</p><p>To do this acs-service-contract defines an api for the creation package extensibility within the OpenACS.</p>
of interfaces and discovery of interface implementations.</p><h2>Background</h2><p>Most component systems are based on the use of interfaces. <p>To do this acs-service-contract defines an api for the creation
of interfaces and discovery of interface implementations.</p>
<h2>Background</h2>
<p>Most component systems are based on the use of interfaces.
Interfaces allow components to create contracts which define their Interfaces allow components to create contracts which define their
functional level of reuse and customization. It also provides the functional level of reuse and customization. It also provides the
infrastructure for runtime discovery of which implemented infrastructure for runtime discovery of which implemented
interfaces are available.</p><p>The ACS4 is based on a thin object system, that is primarily interfaces are available.</p>
<p>The ACS4 is based on a thin object system, that is primarily
relational but the acs_objects system allows a veneer of object relational but the acs_objects system allows a veneer of object
orientedness by providing globally unique object ids, object orientedness by providing globally unique object ids, object
metadata, and bundling of data and methods as an object. While this metadata, and bundling of data and methods as an object. While this
permits a level of reuse on an object or package basis, it requires permits a level of reuse on an object or package basis, it requires
hardcoding the unit of reuse.</p><p>ACS Service contract allows these objects and packages to also hardcoding the unit of reuse.</p>
<p>ACS Service contract allows these objects and packages to also
define and register their implementation of interfaces, so the define and register their implementation of interfaces, so the
level of reuse is defined at the contract level.</p><p>In addition ACS Service contract provides mean to dispatch level of reuse is defined at the contract level.</p>
<p>In addition ACS Service contract provides mean to dispatch
method calls on an interface implementation. The dispatch means is method calls on an interface implementation. The dispatch means is
only available through tcl.</p><p>Interface Discovery is available programmatically as well as via only available through tcl.</p>
documentation through ad_proc.</p><p>The Service Contract interface specification was inspired by <p>Interface Discovery is available programmatically as well as via
WDSL, the interface specfication for web services.</p><h2>Hitchiker's Guide to Service Contract Definitions</h2><ul> documentation through ad_proc.</p>
<p>The Service Contract interface specification was inspired by
WDSL, the interface specfication for web services.</p>
<h2>Hitchiker's Guide to Service Contract Definitions</h2>
<ul>
<li>contract - analagous to interface, contracts serve as logical <li>contract - analagous to interface, contracts serve as logical
containers for operations.</li><li>operation - a method of an interface. defines a method containers for operations.</li><li>operation - a method of an interface. defines a method
signature, including both input and outputs as well as metadata signature, including both input and outputs as well as metadata
...@@ -30,41 +40,77 @@ functions that fufills an interface.</li><li>implementation alias - is the metho ...@@ -30,41 +40,77 @@ functions that fufills an interface.</li><li>implementation alias - is the metho
fufills a given operation of the contract.</li><li>bindings - association between an interface and an fufills a given operation of the contract.</li><li>bindings - association between an interface and an
implementation.</li><li>types - define the kind of input and outputs a operation implementation.</li><li>types - define the kind of input and outputs a operation
recieves.</li> recieves.</li>
</ul><h2>Usage</h2><h3>Design the Contract</h3><p>First Off design the interface for your contract, keeping in </ul>
<h2>Usage</h2>
<h3>Design the Contract</h3>
<p>First Off design the interface for your contract, keeping in
mind that all implementations need to implement it and that mind that all implementations need to implement it and that
extension of the contract after deployment is often not practical. extension of the contract after deployment is often not practical.
In other words take the time to do a little future proofing and In other words take the time to do a little future proofing and
thinking about possible uses that you weren't planning on.</p><h3>Defining Operations</h3><p>Next define the logical operations that will make up your thinking about possible uses that you weren't planning on.</p>
contract</p><h3>Register the Contract</h3><p>with acs contracts.</p><p>Implement the Contract</p><h2>FAQ</h2><h3>Why Does an implementation reference an interface?</h3><p>This might seem a little strange since a binding is the official <h3>Defining Operations</h3>
<p>Next define the logical operations that will make up your
contract</p>
<h3>Register the Contract</h3>
<p>with acs contracts.</p>
<p>Implement the Contract</p>
<h2>FAQ</h2>
<h3>Why Does an implementation reference an interface?</h3>
<p>This might seem a little strange since a binding is the official
reference between an implementation and an interface. However it is reference between an implementation and an interface. However it is
quite possible that an implementation for interface might exist quite possible that an implementation for interface might exist
prior to the interface being defined, ie the interface defining prior to the interface being defined, ie the interface defining
package is not installed. By retaining this information the package is not installed. By retaining this information the
interface defining package can be installed and the implementations interface defining package can be installed and the implementations
already installed on the system can be bound to it.</p><h2>Api Reference</h2><p>[for oracle please syntax replace __ with .]</p><h3>Creating Message Types</h3><ul><li>(sql):: acs_sc_msg_type__new (name, spec): already installed on the system can be bound to it.</p>
<h2>Api Reference</h2>
<p>[for oracle please syntax replace __ with .]</p>
<h3>Creating Message Types</h3>
<ul><li>(sql):: acs_sc_msg_type__new (name, spec):
<p>defines a type based on spec. Spec should be a string (possibly <p>defines a type based on spec. Spec should be a string (possibly
emtpy) that defines the names and types that compose this type. emtpy) that defines the names and types that compose this type.
example <code>ObjectDisplay.Name.InputType</code> as name example <code>ObjectDisplay.Name.InputType</code> as name
<code>object_id:integer</code> as spec.</p> <code>object_id:integer</code> as spec.</p>
</li></ul><h3>Creating Interfaces</h3><ul><li>(sql): </li></ul>
<h3>Creating Interfaces</h3>
<ul><li>(sql):
<pre> <pre>
acs_sc_contract__new (contract_name, contract_desc): acs_sc_contract__new (contract_name, contract_desc):
</pre> </pre>
</li></ul><p>creates a new contract to serve as a logical container for </li></ul>
<p>creates a new contract to serve as a logical container for
operations. contract_desc is a text description of the operations. contract_desc is a text description of the
contract.</p><ul><li>(sql): contract.</p>
<ul><li>(sql):
<pre> <pre>
acs_sc_operation__new (contract_name, operation_name, acs_sc_operation__new (contract_name, operation_name,
operation_desc, operation_iscachable_p, operation_desc, operation_iscachable_p,
operation_inputtype, operation_outputtype operation_inputtype, operation_outputtype
): ):
</pre> </pre>
</li></ul><p>creates a new operation as part of a contract.</p><h3>Creating Implementations</h3><ul><li>(tcl) acs_sc_proc (contract, operation, impl): registers an </li></ul>
implementations. ?? why operation</li></ul><h3>Discovery</h3><ul><li>(tcl) acs_sc_binding_exists_p (contract, impl): returns boolean <p>creates a new operation as part of a contract.</p>
<h3>Creating Implementations</h3>
<ul><li>(tcl) acs_sc_proc (contract, operation, impl): registers an
implementations. ?? why operation</li></ul>
<h3>Discovery</h3>
<ul><li>(tcl) acs_sc_binding_exists_p (contract, impl): returns boolean
whether a binding exists between a given contract name and whether a binding exists between a given contract name and
implmentation.</li></ul><h3>Dispatching</h3><ul><li>(tcl) acs_sc::invoke (contract, operation, [arguments, impl]): implmentation.</li></ul>
calls an operation</li></ul><h2>Examples</h2><p>Included in the service contract package are examples for oracle <h3>Dispatching</h3>
and postgresql of a trivial contract.</p><p>Also the search contract functions as a non-trivial core <ul><li>(tcl) acs_sc::invoke (contract, operation, [arguments, impl]):
contract used by openacs4.</p><h2>Further Reading</h2><p>Abstract Factory Pattern - GOF</p><p>Component Systems - Clemens Syzperski</p><p>WSDL Spec</p><h2>Credits</h2><p>Most content was provided by Neophytos Demetriou. Most of the calls an operation</li></ul>
<h2>Examples</h2>
<p>Included in the service contract package are examples for oracle
and postgresql of a trivial contract.</p>
<p>Also the search contract functions as a non-trivial core
contract used by openacs4.</p>
<h2>Further Reading</h2>
<p>Abstract Factory Pattern - GOF</p>
<p>Component Systems - Clemens Syzperski</p>
<p>WSDL Spec</p>
<h2>Release Notes</h2>
<p>Please file bugs in the <a href="http://openacs.org/bugtracker/openacs/">Bug Tracker</a>.</p>
<h2>Credits</h2>
<p>Most content was provided by Neophytos Demetriou. Most of the
errors were provided by Kapil Thangavelu.</p> errors were provided by Kapil Thangavelu.</p>
</body>
...@@ -96,7 +96,14 @@ ...@@ -96,7 +96,14 @@
<p> Included in the service contract package are examples for oracle <p> Included in the service contract package are examples for oracle
and postgresql of a trivial contract.</p><p> Also the search contract functions as a non-trivial core contract and postgresql of a trivial contract.</p><p> Also the search contract functions as a non-trivial core contract
used by openacs4.</p><h2> Further Reading</h2> used by openacs4.</p><h2> Further Reading</h2>
<p> Abstract Factory Pattern - GOF </p><p> Component Systems - Clemens Syzperski</p><p> WSDL Spec</p><h2> Credits</h2> <p> Abstract Factory Pattern - GOF </p><p> Component Systems -
Clemens Syzperski</p><p> WSDL Spec</p>
<h2>Release Notes</h2>
<p>Please file bugs in the <a href="http://openacs.org/bugtracker/openacs/">Bug Tracker</a>.</p>
<h2> Credits</h2>
<p> Most content was provided by Neophytos Demetriou. Most of the <p> Most content was provided by Neophytos Demetriou. Most of the
errors were provided by Kapil Thangavelu.</p></body> errors were provided by Kapil Thangavelu.</p></body>
</html> </html>
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<property name="doc(title)"></property> <property name="doc(title)"></property>
<master> <master>
<body>
ACS Service Contract Overview by Neophytos Demetriou ACS Service Contract Overview by Neophytos Demetriou
(k2pts@yahoo.com) and Kapil Thangavelu (k_vertigo@yahoo.com) Goals (k2pts\@yahoo.com) and Kapil Thangavelu (k_vertigo\@yahoo.com) Goals
- To increase inter-application code reuse by designating - To increase inter-application code reuse by designating
interfaces for interaction. - To increase flexibility by allowing interfaces for interaction. - To increase flexibility by allowing
developers to reimplement an interface for their needs. - To developers to reimplement an interface for their needs. - To
...@@ -21,4 +20,3 @@ An entity that defines the specification of a contract and ...@@ -21,4 +20,3 @@ An entity that defines the specification of a contract and
registers it with the repository. Provider - Provides an registers it with the repository. Provider - Provides an
implementation of the contract. Dependant - Something that uses a implementation of the contract. Dependant - Something that uses a
contract. contract.
</body>
...@@ -128,4 +128,9 @@ template::list::create \ ...@@ -128,4 +128,9 @@ template::list::create \
impl_pretty_name { impl_pretty_name {
label "Label" label "Label"
} }
} }
\ No newline at end of file # Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment