Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acs-service-contract
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
acs-service-contract
Commits
427da4d0
Commit
427da4d0
authored
Dec 04, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- OpenACS 5.9
parent
49b960ae
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
152 additions
and
36 deletions
+152
-36
acs-service-contract.info
acs-service-contract.info
+6
-6
acs-service-contract-init.tcl
tcl/acs-service-contract-init.tcl
+6
-0
acs-service-contract-procs.tcl
tcl/acs-service-contract-procs.tcl
+6
-0
contract-procs.tcl
tcl/contract-procs.tcl
+6
-0
implementation-procs.tcl
tcl/implementation-procs.tcl
+6
-0
msg-type-procs.tcl
tcl/msg-type-procs.tcl
+6
-0
acs-service-contract-procs.tcl
tcl/test/acs-service-contract-procs.tcl
+6
-0
binding-display.tcl
www/binding-display.tcl
+6
-0
binding-install.tcl
www/binding-install.tcl
+6
-0
binding-uninstall.tcl
www/binding-uninstall.tcl
+6
-0
contract-display.tcl
www/contract-display.tcl
+6
-0
index.adp
www/doc/index.adp
+71
-25
index.html
www/doc/index.html
+8
-1
notes.adp
www/doc/notes.adp
+1
-3
index.tcl
www/index.tcl
+6
-1
No files found.
acs-service-contract.info
View file @
427da4d0
...
...
@@ -2,15 +2,15 @@
<!-- 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-name>
Service Contracts
</package-name>
<pretty-plural>
Service Contract Packages
</pretty-plural>
<package-name>
ACS
Service Contracts
</package-name>
<pretty-plural>
ACS
Service Contract Packages
</pretty-plural>
<initial-install-p>
t
</initial-install-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>
<summary>
API and UI for service contracts
</summary>
<release-date>
201
3-09-08
</release-date>
<release-date>
201
5-10-04
</release-date>
<maturity>
3
</maturity>
<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.
...
...
@@ -18,8 +18,8 @@
url or the contracts used by dotlrn and new-portals to allow packages to provide portalized panes.
</description>
<license>
GPL version 2
</license>
<provides
url=
"acs-service-contract"
version=
"5.
10.0d1
"
/>
<requires
url=
"acs-kernel"
version=
"5.
10.0d1
"
/>
<provides
url=
"acs-service-contract"
version=
"5.
9.0
"
/>
<requires
url=
"acs-kernel"
version=
"5.
9.0
"
/>
<callbacks>
</callbacks>
...
...
tcl/acs-service-contract-init.tcl
View file @
427da4d0
...
...
@@ -17,3 +17,9 @@ db_foreach impl_operation {
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:
tcl/acs-service-contract-procs.tcl
View file @
427da4d0
...
...
@@ -278,3 +278,9 @@ proc acs_sc_log {level msg} {
# ns_log Debug
"
$msg
"
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/contract-procs.tcl
View file @
427da4d0
...
...
@@ -317,3 +317,9 @@ ad_proc -public acs_sc::contract::operation::parse_spec {
-is_cachable_p
$attributes
(
is_cachable_p
)
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/implementation-procs.tcl
View file @
427da4d0
...
...
@@ -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:
tcl/msg-type-procs.tcl
View file @
427da4d0
...
...
@@ -122,3 +122,9 @@ ad_proc -public acs_sc::msg_type::element::new {
db_exec_plsql insert_msg_type_element
{}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/test/acs-service-contract-procs.tcl
View file @
427da4d0
...
...
@@ -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"
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/binding-display.tcl
View file @
427da4d0
...
...
@@ -70,3 +70,9 @@ db_multirow -extend {check} binding binding {
set impl_alias
"<b>
$impl
_alias"
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/binding-install.tcl
View file @
427da4d0
...
...
@@ -11,3 +11,9 @@ ad_page_contract {
db_exec_plsql binding_install
"select acs_sc_binding__new(
$contract
_id,
$impl
_id)"
ad_returnredirect
""
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/binding-uninstall.tcl
View file @
427da4d0
...
...
@@ -11,3 +11,9 @@ ad_page_contract {
db_exec_plsql binding_uninstall
"select acs_sc_binding__delete(
$contract
_id,
$impl
_id)"
ad_returnredirect
""
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/contract-display.tcl
View file @
427da4d0
...
...
@@ -49,3 +49,9 @@ template::list::create \
}
db_multirow valid_installed_binding valid_installed_binding
{}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/doc/index.adp
View file @
427da4d0
...
...
@@ -2,26 +2,36 @@
<
property
name
=
"context"
>{/
doc
/
acs
-
service
-
contract
{
Service
Contracts
}}
{
ACS
Service
Contract
Documentation
}</
property
>
<
property
name
=
"doc(title)"
>
ACS
Service
Contract
Documentation
</
property
>
<
master
>
<
body
>
<
h1
>
ACS
Service
Contract
Documentation
</
h1
><
h2
>
Why
</
h2
><
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
of
interfaces
and
discovery
of
interface
implementations
.</
p
><
h2
>
Background
</
h2
><
p
>
Most
component
systems
are
based
on
the
use
of
interfaces
.
<
h1
>
ACS
Service
Contract
Documentation
</
h1
>
<
h2
>
Why
</
h2
>
<
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
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
functional
level
of
reuse
and
customization
.
It
also
provides
the
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
orientedness
by
providing
globally
unique
object
ids
,
object
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
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
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
only
available
through
tcl
.</
p
><
p
>
Interface
Discovery
is
available
programmatically
as
well
as
via
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>
only
available
through
tcl
.</
p
>
<
p
>
Interface
Discovery
is
available
programmatically
as
well
as
via
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
containers for operations.</li><li>operation - a method of an interface. defines a method
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
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
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
extension of the contract after deployment is often not practical.
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
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
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
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
quite
possible
that
an
implementation
for
interface
might
exist
prior
to
the
interface
being
defined
,
ie
the
interface
defining
package
is
not
installed
.
By
retaining
this
information
the
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
emtpy
)
that
defines
the
names
and
types
that
compose
this
type
.
example
<
code
>
ObjectDisplay
.
Name
.
InputType
</
code
>
as
name
<
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
>
acs_sc_contract__new
(
contract_name
,
contract_desc
):
</
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
contract
.</
p
><
ul
><
li
>(
sql
):
contract
.</
p
>
<
ul
><
li
>(
sql
):
<
pre
>
acs_sc_operation__new
(
contract_name
,
operation_name
,
operation_desc
,
operation_iscachable_p
,
operation_inputtype
,
operation_outputtype
):
</
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
implementations
.
??
why
operation
</
li
></
ul
><
h3
>
Discovery
</
h3
><
ul
><
li
>(
tcl
)
acs_sc_binding_exists_p
(
contract
,
impl
):
returns
boolean
</
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
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
implmentation
.</
li
></
ul
><
h3
>
Dispatching
</
h3
><
ul
><
li
>(
tcl
)
acs_sc
::
invoke
(
contract
,
operation
,
[
arguments
,
impl
]):
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
>
Credits
</
h2
><
p
>
Most
content
was
provided
by
Neophytos
Demetriou
.
Most
of
the
implmentation
.</
li
></
ul
>
<
h3
>
Dispatching
</
h3
>
<
ul
><
li
>(
tcl
)
acs_sc
::
invoke
(
contract
,
operation
,
[
arguments
,
impl
]):
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
>
</
body
>
www/doc/index.html
View file @
427da4d0
...
...
@@ -96,7 +96,14 @@
<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>
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
errors were provided by Kapil Thangavelu.
</p></body>
</html>
www/doc/notes.adp
View file @
427da4d0
...
...
@@ -3,9 +3,8 @@
<property name="doc(title)"></property>
<master>
<body>
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
interfaces for interaction. - To increase flexibility by allowing
developers to reimplement an interface for their needs. - To
...
...
@@ -21,4 +20,3 @@ An entity that defines the specification of a contract and
registers it with the repository. Provider - Provides an
implementation of the contract. Dependant - Something that uses a
contract.
</body>
www/index.tcl
View file @
427da4d0
...
...
@@ -128,4 +128,9 @@ template::list::create \
impl_pretty_name
{
label
"Label"
}
}
\ No newline at end of file
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment