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
503200dc
Commit
503200dc
authored
Apr 29, 2007
by
Malte Sussdorff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Malte
parent
be9a6b1d
Pipeline
#95
failed with stages
Changes
16
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
967 additions
and
25 deletions
+967
-25
acs-service-contract.info
acs-service-contract.info
+13
-6
acs-sc-msg-types-create.sql
sql/oracle/acs-sc-msg-types-create.sql
+2
-1
acs-sc-object-types-create.sql
sql/oracle/acs-sc-object-types-create.sql
+6
-6
acs-sc-packages-create.sql
sql/oracle/acs-sc-packages-create.sql
+12
-3
acs-sc-tables-create.sql
sql/oracle/acs-sc-tables-create.sql
+2
-2
upgrade-5.1.0d1-5.1.0d2.sql
sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
+603
-0
acs-sc-msg-types-create.sql
sql/postgresql/acs-sc-msg-types-create.sql
+3
-0
acs-sc-packages-create.sql
sql/postgresql/acs-sc-packages-create.sql
+12
-2
acs-sc-tables-create.sql
sql/postgresql/acs-sc-tables-create.sql
+3
-3
upgrade-5.1.0d1-5.1.0d2.sql
sql/postgresql/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
+207
-0
acs-service-contract-procs-postgresql.xql
tcl/acs-service-contract-procs-postgresql.xql
+1
-1
implementation-procs.tcl
tcl/implementation-procs.tcl
+13
-0
binding-display.adp
www/binding-display.adp
+22
-0
binding-display.tcl
www/binding-display.tcl
+60
-0
binding-uninstall-oracle.xql
www/binding-uninstall-oracle.xql
+1
-1
contract-display.tcl
www/contract-display.tcl
+7
-0
No files found.
acs-service-contract.info
View file @
503200dc
...
...
@@ -7,17 +7,20 @@
<initial-install-p>
t
</initial-install-p>
<singleton-p>
t
</singleton-p>
<version
name=
"5.
1.5"
url=
"http://openacs.org/repository/download/apm/acs-service-contract-5.1.5
.apm"
>
<version
name=
"5.
3.1b1"
url=
"http://openacs.org/repository/download/apm/acs-service-contract-5.3.1b1
.apm"
>
<owner
url=
"http://openacs.org"
>
OpenACS
</owner>
<summary>
API and UI for service contracts
</summary>
<release-date>
2005-02-28
</release-date>
<release-date>
2007-04-15
</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.
Examples are the contracts used for search which provide a means to get content on a given object and to translate an object_id to a
<maturity>
3
</maturity>
<license
url=
"http://www.gnu.org/copyleft/gpl.html"
>
GPL version 2
</license>
<description
format=
"text/html"
>
Service contracts defines an API for the creation of interfaces and discovery of interface implementations.
Examples are the contracts used for search which provide a means to get content on a given object and to translate an object_id to a
url or the contracts used by dotlrn and new-portals to allow packages to provide portalized panes.
</description>
<provides
url=
"acs-service-contract"
version=
"5.
1.5
"
/>
<requires
url=
"acs-kernel"
version=
"5.
0.0
"
/>
<provides
url=
"acs-service-contract"
version=
"5.
3.1b1
"
/>
<requires
url=
"acs-kernel"
version=
"5.
3.1b1
"
/>
<callbacks>
</callbacks>
...
...
@@ -27,3 +30,7 @@
</version>
</package>
sql/oracle/acs-sc-msg-types-create.sql
View file @
503200dc
...
...
@@ -95,7 +95,8 @@ as
v_spec_parse_level
integer
;
begin
v_msg_type_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_msg_type'
object_type
=>
'acs_sc_msg_type'
,
title
=>
msg_type_name
);
insert
into
acs_sc_msg_types
(
...
...
sql/oracle/acs-sc-object-types-create.sql
View file @
503200dc
...
...
@@ -5,8 +5,8 @@ begin
pretty_name
=>
'ACS SC Contract'
,
pretty_plural
=>
'ACS SC Contracts'
,
supertype
=>
'acs_object'
,
table_name
=>
'
ACS_SC_CONTRACTS
'
,
id_column
=>
'
CONTRACT_ID
'
table_name
=>
'
acs_sc_contracts
'
,
id_column
=>
'
contract_id
'
);
acs_object_type
.
create_type
(
...
...
@@ -14,8 +14,8 @@ begin
pretty_name
=>
'ACS SC Operation'
,
pretty_plural
=>
'ACS SC Operations'
,
supertype
=>
'acs_object'
,
table_name
=>
'
ACS_SC_OPERATIONS
'
,
id_column
=>
'
OPERATION_ID
'
table_name
=>
'
acs_sc_operations
'
,
id_column
=>
'
operation_id
'
);
acs_object_type
.
create_type
(
...
...
@@ -23,8 +23,8 @@ begin
pretty_name
=>
'ACS SC Implementation'
,
pretty_plural
=>
'ACS SC Implementations'
,
supertype
=>
'acs_object'
,
table_name
=>
'
ACS_SC_IMPLS
'
,
id_column
=>
'
IMPL_ID
'
table_name
=>
'
acs_sc_impls
'
,
id_column
=>
'
impl_id
'
);
end
;
/
...
...
sql/oracle/acs-sc-packages-create.sql
View file @
503200dc
...
...
@@ -152,7 +152,10 @@ as
is
v_contract_id
acs_sc_contracts
.
contract_id
%
TYPE
;
begin
v_contract_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_contract'
);
v_contract_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_contract'
,
title
=>
contract_name
);
insert
into
acs_sc_contracts
(
contract_id
,
...
...
@@ -250,7 +253,10 @@ as
begin
v_contract_id
:
=
acs_sc_contract
.
get_id
(
contract_name
);
v_operation_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_operation'
);
v_operation_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_operation'
,
title
=>
operation_name
);
v_operation_inputtype_id
:
=
acs_sc_msg_type
.
get_id
(
operation_inputtype
);
v_operation_outputtype_id
:
=
acs_sc_msg_type
.
get_id
(
operation_outputtype
);
...
...
@@ -341,7 +347,10 @@ as
is
v_impl_id
acs_sc_impls
.
impl_id
%
TYPE
;
begin
v_impl_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_implementation'
);
v_impl_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_implementation'
,
title
=>
impl_pretty_name
);
insert
into
acs_sc_impls
(
impl_id
,
...
...
sql/oracle/acs-sc-tables-create.sql
View file @
503200dc
...
...
@@ -49,7 +49,7 @@ create table acs_sc_operations (
create
table
acs_sc_impls
(
impl_id
integer
constraint
acs_sc_impl_impl_id_fk
constraint
acs_sc_impl
s
_impl_id_fk
references
acs_objects
(
object_id
)
on
delete
cascade
constraint
acs_sc_impl_pk
...
...
@@ -75,7 +75,7 @@ constraint acs_sc_impl_aliases_un unique(impl_name,impl_contract_name,impl_opera
create
table
acs_sc_bindings
(
contract_id
integer
constraint
acs_sc_binding_cid_fk
constraint
acs_sc_binding_c
ontract_
id_fk
references
acs_sc_contracts
(
contract_id
)
on
delete
cascade
,
impl_id
integer
...
...
sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
0 → 100644
View file @
503200dc
This diff is collapsed.
Click to expand it.
sql/postgresql/acs-sc-msg-types-create.sql
View file @
503200dc
...
...
@@ -54,6 +54,9 @@ begin
now(),
null,
null,
null,
''
t
''
,
p_msg_type_name,
null
);
...
...
sql/postgresql/acs-sc-packages-create.sql
View file @
503200dc
...
...
@@ -12,6 +12,9 @@ begin
now(),
null,
null,
null,
''
t
''
,
p_contract_name,
null
);
...
...
@@ -121,6 +124,9 @@ begin
now(),
null,
null,
null,
''
t
''
,
p_operation_name,
null
);
...
...
@@ -224,6 +230,9 @@ begin
now(),
null,
null,
null,
''
t
''
,
p_impl_pretty_name,
null
);
...
...
@@ -387,12 +396,13 @@ declare
v_contract_name varchar;
v_impl_name varchar;
v_count integer;
v_missing_op varchar;
begin
v_contract_name := acs_sc_contract__get_name(p_contract_id);
v_impl_name := acs_sc_impl__get_name(p_impl_id);
select count(*)
into v_count
select count(*)
,min(operation_name) into v_count, v_missing_op
from acs_sc_operations
where contract_id = p_contract_id
and operation_name not in (select impl_operation_name
...
...
@@ -401,7 +411,7 @@ begin
and impl_id = p_impl_id);
if v_count > 0 then
raise exception
''
Binding of % to % failed since certain operations are not implemented
.
''
, v_contract_name, v_impl_name
;
raise exception
''
Binding of % to % failed since certain operations are not implemented
like: %.
''
, v_contract_name, v_impl_name, v_missing_op
;
end if;
insert into acs_sc_bindings (
...
...
sql/postgresql/acs-sc-tables-create.sql
View file @
503200dc
...
...
@@ -52,7 +52,7 @@ create table acs_sc_impls (
constraint
acs_sc_impls_impl_id_fk
references
acs_objects
(
object_id
)
on
delete
cascade
constraint
acs_sc_impls_pk
constraint
acs_sc_impls_
impl_id_
pk
primary
key
,
impl_name
varchar
(
100
),
impl_pretty_name
varchar
(
200
),
...
...
@@ -64,7 +64,7 @@ create table acs_sc_impls (
create
table
acs_sc_impl_aliases
(
impl_id
integer
constraint
acs_sc_impl_
proc
_impl_id_fk
constraint
acs_sc_impl_
aliases
_impl_id_fk
references
acs_sc_impls
(
impl_id
)
on
delete
cascade
,
impl_name
varchar
(
100
),
...
...
@@ -79,7 +79,7 @@ constraint acs_sc_impl_alias_un unique(impl_name,impl_contract_name,impl_operati
create
table
acs_sc_bindings
(
contract_id
integer
constraint
acs_sc_bindings_cid_fk
constraint
acs_sc_bindings_c
ontract_
id_fk
references
acs_sc_contracts
(
contract_id
)
on
delete
cascade
,
impl_id
integer
...
...
sql/postgresql/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
0 → 100644
View file @
503200dc
update
acs_objects
set
title
=
(
select
msg_type_name
from
acs_sc_msg_types
where
msg_type_id
=
object_id
)
where
object_type
=
'acs_sc_msg_type'
;
update
acs_objects
set
title
=
(
select
contract_name
from
acs_sc_contracts
where
contract_id
=
object_id
)
where
object_type
=
'acs_sc_contract'
;
update
acs_objects
set
title
=
(
select
operation_name
from
acs_sc_operations
where
operation_id
=
object_id
)
where
object_type
=
'acs_sc_operation'
;
update
acs_objects
set
title
=
(
select
impl_pretty_name
from
acs_sc_impls
where
impl_id
=
object_id
)
where
object_type
=
'acs_sc_implementation'
;
drop
function
acs_sc_msg_type__new
(
varchar
,
varchar
);
create
or
replace
function
acs_sc_msg_type__new
(
varchar
,
varchar
)
returns
integer
as
'
declare
p_msg_type_name alias for $1;
p_msg_type_spec alias for $2;
v_msg_type_id integer;
begin
v_msg_type_id := acs_object__new(
null,
''
acs_sc_msg_type
''
,
now(),
null,
null,
null,
''
t
''
,
p_msg_type_name,
null
);
insert into acs_sc_msg_types (
msg_type_id,
msg_type_name
) values (
v_msg_type_id,
p_msg_type_name
);
perform acs_sc_msg_type__parse_spec(p_msg_type_name,p_msg_type_spec);
return v_msg_type_id;
end;'
language
'plpgsql'
;
drop
function
acs_sc_contract__new
(
varchar
,
text
);
create
or
replace
function
acs_sc_contract__new
(
varchar
,
text
)
returns
integer
as
'
declare
p_contract_name alias for $1;
p_contract_desc alias for $2;
v_contract_id integer;
begin
v_contract_id := acs_object__new(
null,
''
acs_sc_contract
''
,
now(),
null,
null,
null,
''
t
''
,
p_contract_name,
null
);
insert into acs_sc_contracts (
contract_id,
contract_name,
contract_desc
) values (
v_contract_id,
p_contract_name,
p_contract_desc
);
return v_contract_id;
end;'
language
'plpgsql'
;
drop
function
acs_sc_operation__new
(
varchar
,
varchar
,
text
,
boolean
,
integer
,
varchar
,
varchar
);
create
or
replace
function
acs_sc_operation__new
(
varchar
,
varchar
,
text
,
boolean
,
integer
,
varchar
,
varchar
)
returns
integer
as
'
declare
p_contract_name alias for $1;
p_operation_name alias for $2;
p_operation_desc alias for $3;
p_operation_iscachable_p alias for $4;
p_operation_nargs alias for $5;
p_operation_inputtype alias for $6;
p_operation_outputtype alias for $7;
v_contract_id integer;
v_operation_id integer;
v_operation_inputtype_id integer;
v_operation_outputtype_id integer;
begin
v_contract_id := acs_sc_contract__get_id(p_contract_name);
v_operation_id := acs_object__new(
null,
''
acs_sc_operation
''
,
now(),
null,
null,
null,
''
t
''
,
p_operation_name,
null
);
v_operation_inputtype_id := acs_sc_msg_type__get_id(p_operation_inputtype);
v_operation_outputtype_id := acs_sc_msg_type__get_id(p_operation_outputtype);
insert into acs_sc_operations (
contract_id,
operation_id,
contract_name,
operation_name,
operation_desc,
operation_iscachable_p,
operation_nargs,
operation_inputtype_id,
operation_outputtype_id
) values (
v_contract_id,
v_operation_id,
p_contract_name,
p_operation_name,
p_operation_desc,
p_operation_iscachable_p,
p_operation_nargs,
v_operation_inputtype_id,
v_operation_outputtype_id
);
return v_operation_id;
end;'
language
'plpgsql'
;
drop
function
acs_sc_impl__new
(
varchar
,
varchar
,
varchar
,
varchar
);
create
or
replace
function
acs_sc_impl__new
(
varchar
,
varchar
,
varchar
,
varchar
)
returns
integer
as
'
declare
p_impl_contract_name alias for $1;
p_impl_name alias for $2;
p_impl_pretty_name alias for $3;
p_impl_owner_name alias for $4;
v_impl_id integer;
begin
v_impl_id := acs_object__new(
null,
''
acs_sc_implementation
''
,
now(),
null,
null,
null,
''
t
''
,
p_impl_pretty_name,
null
);
insert into acs_sc_impls (
impl_id,
impl_name,
impl_pretty_name,
impl_owner_name,
impl_contract_name
) values (
v_impl_id,
p_impl_name,
p_impl_pretty_name,
p_impl_owner_name,
p_impl_contract_name
);
return v_impl_id;
end;'
language
'plpgsql'
;
tcl/acs-service-contract-procs-postgresql.xql
View file @
503200dc
...
...
@@ -22,7 +22,7 @@ select acs_sc_binding__exists_p(:contract,:impl)
<fullquery
name=
"acs_sc_proc.get_operation_definition"
>
<querytext>
select
distinct
select
operation_desc,
coalesce(operation_iscachable_p,'f') as operation_iscachable_p,
operation_nargs,
...
...
tcl/implementation-procs.tcl
View file @
503200dc
...
...
@@ -133,6 +133,19 @@ ad_proc -public acs_sc::impl::get_id {
{
-owner:required
}
{
-name:required
}
-contract
}
{
Retrieves the ID for a service contract. If the contract is specified
then
the ID is retrieved for the specified contract, otherwise all
service contract IDs will be retrieved that match the specified owner
and implementation name.
@param owner Owner of the service contract.
@param name Implementation name.
@param contract Implementation contract name.
@return Returns the ID for a specified service contract, or all IDs for
for service contracts that match the owner and implementation name of
a service contract,
if the contract is not specified.
}
{
if
{[
exists_and_not_null contract
]}
{
return
[
db_string select_impl_id_with_contract
{}]
...
...
www/binding-display.adp
0 → 100644
View file @
503200dc
<master>
<property name="title">Contract @contract_name;noquote@</property>
<property name="context">{@contract_name;noquote@}</property>
<h2>Binding @contract_name@</h2>
<p><listtemplate name="binding"></listtemplate></p>
<h2>Contract details</h2>
<ul>
<multiple name=contract>
<li> <b>@contract.operation_name@</b> -
@contract.operation_desc@
<ul>
<group column="operation_name">
<li>@contract.inout@ @contract.param@
@contract.param_type@ <if @contract.set_p@ eq t>[]</if></li>
</group>
</ul>
</multiple>
</ul>
www/binding-display.tcl
0 → 100644
View file @
503200dc
ad_page_contract
{
Display a given service contract
@author Jeff Davis <davis@xarg.net>
@creation-date 2005-02-05
@cvs-id $Id$
}
{
id
impl_name:trim,notnull
}
set
contract_name
[
db_string contract_name
{
select contract_name from acs_sc_contracts where contract_id = :id
}]
db_multirow contract contract
{
select o.contract_name, o.operation_name, o.operation_desc,
(
case when t.msg_type_id = o.operation_inputtype_id
then
'input'
else
'output' end
)
as inout,
e.element_name as param, e.element_msg_type_isset_p as set_p, et.msg_type_name as param_type
from acs_sc_operations o,
acs_sc_msg_types t,
acs_sc_msg_type_elements e,
acs_sc_msg_types et
where contract_id = :id
and t.msg_type_id in
(
o.operation_inputtype_id, operation_outputtype_id
)
and e.msg_type_id = t.msg_type_id
and et.msg_type_id = e.element_msg_type_id
order by o.contract_name, o.operation_name, t.msg_type_name, e.element_pos
}
template::list::create
\
-name binding
\
-multirow binding
\
-elements
{
impl_operation_name
{
label
"Operation"
}
impl_pl
{
label
"Language"
}
impl_alias
{
label
"Alias"
display_template
{
@binding.impl_alias
;
noquote@
}
}
}
db_multirow -extend
{
check
}
binding binding
{
select impl_operation_name, impl_alias, impl_pl
from acs_sc_impl_aliases
where impl_name = :impl_name and impl_contract_name = :contract_name
order by lower
(
impl_operation_name
)
}
{
if
{[
string
equal
$impl
_pl
"TCL"
]}
{
regsub
{
^::
}
$impl
_alias
{}
impl_alias
if
{[
empty_string_p
[
info
proc ::$impl_alias
]]}
{
append impl_alias
{
</b> - <b style=
"color: red"
>NOT FOUND!</b>
}
}
else
{
append impl_alias
"</b> {
[
info
args ::$impl_alias
]
}"
}
set impl_alias
"<b>
$impl
_alias"
}
}
www/binding-uninstall-oracle.xql
View file @
503200dc
...
...
@@ -6,7 +6,7 @@
<fullquery
name=
"binding_uninstall"
>
<querytext>
begin
select acs_sc_binding.del(:contract_id,:impl_id)
acs_sc_binding.del(contract_id => :contract_id, impl_id => :impl_id);
end;
</querytext>
</fullquery>
...
...
www/contract-display.tcl
View file @
503200dc
...
...
@@ -39,6 +39,13 @@ template::list::create \
display_template
{
Uninstall
}
sub_class narrow
}
display
{
label
{}
link_url_eval
{[
export_vars -base binding-display
{
{
id
$contract
_id
}
impl_name
}]}
link_html
{
title
"View this contracts implementation details"
}
display_template
{
view
}
sub_class narrow
}
}
db_multirow valid_installed_binding valid_installed_binding
{}
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