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
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
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'
;
commit
;
create
or
replace
package
body
acs_sc_msg_type
as
function
new
(
msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
,
msg_type_spec
in
varchar2
)
return
acs_sc_msg_types
.
msg_type_id
%
TYPE
is
v_msg_type_id
integer
;
v_spec_parse_level
integer
;
begin
v_msg_type_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_msg_type'
,
title
=>
msg_type_name
);
insert
into
acs_sc_msg_types
(
msg_type_id
,
msg_type_name
)
values
(
v_msg_type_id
,
msg_type_name
);
v_spec_parse_level
:
=
acs_sc_msg_type
.
parse_spec
(
msg_type_name
,
msg_type_spec
);
return
v_msg_type_id
;
end
new
;
procedure
del
(
msg_type_id
in
acs_sc_msg_types
.
msg_type_id
%
TYPE
default
null
,
msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
default
null
)
is
v_msg_type_id
acs_sc_msg_types
.
msg_type_id
%
TYPE
;
begin
if
msg_type_name
is
not
NULL
then
v_msg_type_id
:
=
acs_sc_msg_type
.
get_id
(
msg_type_name
);
elsif
msg_type_id
is
not
NULL
then
v_msg_type_id
:
=
msg_type_id
;
else
raise_application_error
(
-
20000
,
'no args supplied to sc_msg_type.delete'
);
end
if
;
delete
from
acs_sc_msg_types
where
msg_type_id
=
v_msg_type_id
;
end
del
;
function
get_id
(
msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
)
return
acs_sc_msg_types
.
msg_type_id
%
TYPE
is
v_msg_type_id
acs_sc_msg_types
.
msg_type_id
%
TYPE
;
begin
select
msg_type_id
into
v_msg_type_id
from
acs_sc_msg_types
where
msg_type_name
=
get_id
.
msg_type_name
;
return
v_msg_type_id
;
end
get_id
;
function
get_name
(
msg_type_id
in
acs_sc_msg_types
.
msg_type_id
%
TYPE
)
return
acs_sc_msg_types
.
msg_type_name
%
TYPE
is
v_msg_type_name
acs_sc_msg_types
.
msg_type_name
%
TYPE
;
begin
select
msg_type_name
into
v_msg_type_name
from
acs_sc_msg_types
where
msg_type_id
=
get_name
.
msg_type_id
;
return
v_msg_type_name
;
end
get_name
;
-- string processing in pl/sql is so much fun
-- i'm sure there is a better way to go about this
function
parse_spec
(
msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
,
msg_type_spec
in
varchar2
)
return
integer
is
v_element_pos
integer
;
v_str_s_idx
integer
;
-- spec str pointers
v_str_e_idx
integer
;
v_elem_idx
integer
;
-- element str pointer
v_str_len
integer
;
v_element
varchar
(
200
);
v_element_type
varchar
(
200
);
v_element_name
varchar
(
200
);
v_element_msg_type_name
varchar
(
200
);
v_element_msg_type_isset_p
char
(
1
);
v_junk_msg_type_id
integer
;
begin
-- oracle treats empty strings as nulls
if
msg_type_spec
is
null
then
return
0
;
end
if
;
v_element_pos
:
=
1
;
v_str_e_idx
:
=
1
;
while
TRUE
loop
-- string start check
if
v_element_pos
=
1
then
v_str_s_idx
:
=
1
;
else
v_str_s_idx
:
=
instr
(
msg_type_spec
,
','
,
v_str_e_idx
);
if
v_str_s_idx
>
0
then
v_str_s_idx
:
=
v_str_s_idx
+
1
;
end
if
;
end
if
;
v_str_e_idx
:
=
instr
(
msg_type_spec
,
','
,
v_str_s_idx
+
1
)
-
1
;
-- end of string check
if
v_str_s_idx
>
0
and
v_str_e_idx
<=
0
then
v_str_e_idx
:
=
length
(
msg_type_spec
);
end
if
;
-- dbms_output.put_line(v_str_s_idx || ' '|| v_str_e_idx || ' ' || v_element_pos);
-- dbms_output.new_line();
if
v_str_s_idx
>
0
then
v_element
:
=
substr
(
msg_type_spec
,
v_str_s_idx
,
v_str_e_idx
+
1
-
v_str_s_idx
);
v_elem_idx
:
=
instr
(
v_element
,
':'
);
if
v_elem_idx
>
0
then
v_element_name
:
=
trim
(
substr
(
v_element
,
1
,
v_elem_idx
-
1
));
v_element_type
:
=
trim
(
substr
(
v_element
,
v_elem_idx
+
1
));
if
(
instr
(
v_element_type
,
'['
,
1
,
1
)
=
length
(
v_element_type
)
-
1
)
and
(
instr
(
v_element_type
,
']'
,
1
,
1
)
=
length
(
v_element_type
))
then
v_element_msg_type_isset_p
:
=
't'
;
v_element_msg_type_name
:
=
trim
(
substr
(
v_element_type
,
1
,
length
(
v_element_type
)
-
2
));
if
v_element_msg_type_name
=
''
then
raise_application_error
(
-
20001
,
'Wrong Format: Message Type Specification'
);
end
if
;
else
v_element_msg_type_isset_p
:
=
'f'
;
v_element_msg_type_name
:
=
v_element_type
;
end
if
;
v_junk_msg_type_id
:
=
acs_sc_msg_type
.
new_element
(
msg_type_name
=>
parse_spec
.
msg_type_name
,
element_name
=>
v_element_name
,
element_msg_type_name
=>
v_element_msg_type_name
,
element_msg_type_isset_p
=>
v_element_msg_type_isset_p
,
element_pos
=>
v_element_pos
);
else
raise_application_error
(
-
20001
,
'Wrong Format: Message Type Specification'
);
end
if
;
else
-- yippee we're done
exit
;
end
if
;
v_element_pos
:
=
v_element_pos
+
1
;
end
loop
;
return
v_element_pos
-
1
;
end
parse_spec
;
function
new_element
(
msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
,
element_name
in
acs_sc_msg_type_elements
.
element_name
%
TYPE
,
element_msg_type_name
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
,
element_msg_type_isset_p
in
acs_sc_msg_type_elements
.
element_msg_type_isset_p
%
TYPE
,
element_pos
in
acs_sc_msg_type_elements
.
element_pos
%
TYPE
)
return
acs_sc_msg_types
.
msg_type_id
%
TYPE
is
v_msg_type_id
integer
;
v_element_msg_type_id
integer
;
begin
v_msg_type_id
:
=
acs_sc_msg_type
.
get_id
(
msg_type_name
);
if
v_msg_type_id
is
null
then
raise_application_error
(
-
20001
,
'Unknown Message Type: '
||
msg_type_name
);
end
if
;
v_element_msg_type_id
:
=
acs_sc_msg_type
.
get_id
(
element_msg_type_name
);
if
v_element_msg_type_id
is
null
then
raise_application_error
(
-
20001
,
'Unknown Message Type: '
||
element_msg_type_name
);
end
if
;
insert
into
acs_sc_msg_type_elements
(
msg_type_id
,
element_name
,
element_msg_type_id
,
element_msg_type_isset_p
,
element_pos
)
values
(
v_msg_type_id
,
element_name
,
v_element_msg_type_id
,
element_msg_type_isset_p
,
element_pos
);
return
v_msg_type_id
;
end
new_element
;
end
acs_sc_msg_type
;
/
show
errors
create
or
replace
package
body
acs_sc_contract
as
function
new
(
contract_name
in
acs_sc_contracts
.
contract_name
%
TYPE
,
contract_desc
in
acs_sc_contracts
.
contract_desc
%
TYPE
)
return
acs_sc_contracts
.
contract_id
%
TYPE
is
v_contract_id
acs_sc_contracts
.
contract_id
%
TYPE
;
begin
v_contract_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_contract'
,
title
=>
contract_name
);
insert
into
acs_sc_contracts
(
contract_id
,
contract_name
,
contract_desc
)
values
(
v_contract_id
,
contract_name
,
contract_desc
);
return
v_contract_id
;
end
new
;
function
get_id
(
contract_name
in
acs_sc_contracts
.
contract_name
%
TYPE
)
return
acs_sc_contracts
.
contract_id
%
TYPE
is
v_contract_id
acs_sc_contracts
.
contract_id
%
TYPE
;
begin
select
contract_id
into
v_contract_id
from
acs_sc_contracts
where
contract_name
=
get_id
.
contract_name
;
return
v_contract_id
;
end
get_id
;
function
get_name
(
contract_id
in
acs_sc_contracts
.
contract_id
%
TYPE
)
return
acs_sc_contracts
.
contract_name
%
TYPE
is
v_contract_name
acs_sc_contracts
.
contract_name
%
TYPE
;
begin
select
contract_name
into
v_contract_name
from
acs_sc_contracts
where
contract_id
=
get_name
.
contract_id
;
return
v_contract_name
;
end
get_name
;
procedure
del
(
contract_name
in
acs_sc_contracts
.
contract_name
%
TYPE
default
null
,
contract_id
in
acs_sc_contracts
.
contract_id
%
TYPE
default
null
)
is
v_contract_id
acs_sc_contracts
.
contract_id
%
TYPE
;
begin
if
contract_name
is
not
NULL
then
v_contract_id
:
=
acs_sc_contract
.
get_id
(
contract_name
);
elsif
contract_id
is
not
NULL
then
v_contract_id
:
=
contract_id
;
else
raise_application_error
(
-
20001
,
'Service Contracts: no valid args supplied to delete'
);
end
if
;
delete
from
acs_sc_contracts
where
contract_id
=
v_contract_id
;
acs_object
.
del
(
v_contract_id
);
end
del
;
end
acs_sc_contract
;
/
show
errors
create
or
replace
package
body
acs_sc_operation
as
function
new
(
contract_name
in
acs_sc_contracts
.
contract_name
%
TYPE
,
operation_name
in
acs_sc_operations
.
operation_name
%
TYPE
,
operation_desc
in
acs_sc_operations
.
operation_desc
%
TYPE
,
operation_iscachable_p
in
acs_sc_operations
.
operation_iscachable_p
%
TYPE
,
operation_nargs
in
acs_sc_operations
.
operation_nargs
%
TYPE
,
operation_inputtype
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
,
operation_outputtype
in
acs_sc_msg_types
.
msg_type_name
%
TYPE
)
return
acs_sc_operations
.
operation_id
%
TYPE
is
v_contract_id
acs_sc_contracts
.
contract_id
%
TYPE
;
v_operation_id
acs_sc_operations
.
operation_id
%
TYPE
;
v_operation_inputtype_id
acs_sc_operations
.
operation_inputtype_id
%
TYPE
;
v_operation_outputtype_id
acs_sc_operations
.
operation_outputtype_id
%
TYPE
;
begin
v_contract_id
:
=
acs_sc_contract
.
get_id
(
contract_name
);
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
);
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
,
contract_name
,
operation_name
,
operation_desc
,
operation_iscachable_p
,
operation_nargs
,
v_operation_inputtype_id
,
v_operation_outputtype_id
);
return
v_operation_id
;
end
new
;
function
get_id
(
contract_name
acs_sc_contracts
.
contract_name
%
TYPE
,
operation_name
acs_sc_operations
.
operation_name
%
TYPE
)
return
acs_sc_operations
.
operation_id
%
TYPE
as
v_operation_id
acs_sc_operations
.
operation_id
%
TYPE
;
begin
select
operation_id
into
v_operation_id
from
acs_sc_operations
where
contract_name
=
get_id
.
contract_name
and
operation_name
=
get_id
.
operation_name
;
return
v_operation_id
;
end
get_id
;
procedure
del
(
operation_id
acs_sc_operations
.
operation_id
%
TYPE
default
null
,
operation_name
acs_sc_operations
.
operation_name
%
TYPE
default
null
,
contract_name
acs_sc_contracts
.
contract_name
%
TYPE
default
null
)
is
v_operation_id
acs_sc_operations
.
operation_id
%
TYPE
;
begin
if
(
operation_id
is
NULL
and
operation_name
is
not
NULL
and
contract_name
is
not
NULL
)
then
v_operation_id
:
=
get_id
(
contract_name
,
operation_name
);
elsif
operation_id
is
not
NULL
then
v_operation_id
:
=
operation_id
;
else
raise_application_error
(
-
20001
,
'ACS Contracts: Invalid args to operation delete'
);
end
if
;
delete
from
acs_sc_operations
where
operation_id
=
v_operation_id
;
end
del
;
end
acs_sc_operation
;
/
show
errors
create
or
replace
package
body
acs_sc_impl
as
function
new
(
impl_contract_name
acs_sc_impls
.
impl_contract_name
%
TYPE
,
impl_name
acs_sc_impls
.
impl_name
%
TYPE
,
impl_pretty_name
acs_sc_impls
.
impl_pretty_name
%
TYPE
default
null
,
impl_owner_name
acs_sc_impls
.
impl_owner_name
%
TYPE
)
return
acs_sc_impls
.
impl_id
%
TYPE
is
v_impl_id
acs_sc_impls
.
impl_id
%
TYPE
;
begin
v_impl_id
:
=
acs_object
.
new
(
object_type
=>
'acs_sc_implementation'
,
title
=>
impl_pretty_name
);
insert
into
acs_sc_impls
(
impl_id
,
impl_name
,
impl_pretty_name
,
impl_owner_name
,
impl_contract_name
)
values
(
v_impl_id
,
impl_name
,
impl_pretty_name
,
impl_owner_name
,
impl_contract_name
);
return
v_impl_id
;
end
new
;
function
get_id
(
impl_contract_name
acs_sc_impls
.
impl_contract_name
%
TYPE
,
impl_name
acs_sc_impls
.
impl_name
%
TYPE
)
return
acs_sc_impls
.
impl_id
%
TYPE
as
v_impl_id
acs_sc_impls
.
impl_id
%
TYPE
;
begin
select
impl_id
into
v_impl_id
from
acs_sc_impls
where
impl_name
=
get_id
.
impl_name
and
impl_contract_name
=
get_id
.
impl_contract_name
;
return
v_impl_id
;
end
get_id
;
function
get_name
(
impl_id
acs_sc_impls
.
impl_id
%
TYPE
)
return
acs_sc_impls
.
impl_name
%
TYPE
as
v_impl_name
acs_sc_impls
.
impl_name
%
TYPE
;
begin
select
impl_name
into
v_impl_name
from
acs_sc_impls
where
impl_id
=
get_name
.
impl_id
;
return
v_impl_name
;
end
get_name
;
procedure
del
(
impl_contract_name
acs_sc_impls
.
impl_contract_name
%
TYPE
,
impl_name
acs_sc_impls
.
impl_name
%
TYPE
)
as
begin
delete
from
acs_sc_impls
where
impl_contract_name
=
acs_sc_impl
.
del
.
impl_contract_name
and
impl_name
=
acs_sc_impl
.
del
.
impl_name
;
end
del
;
/* next 2 functions are deprecated. */
function
new_alias
(
impl_contract_name
acs_sc_contracts
.
contract_name
%
TYPE
,
impl_name
acs_sc_impls
.
impl_name
%
TYPE
,
impl_operation_name
acs_sc_operations
.
operation_name
%
TYPE
,
impl_alias
acs_sc_impl_aliases
.
impl_alias
%
TYPE
,
impl_pl
acs_sc_impl_aliases
.
impl_pl
%
TYPE
)
return
acs_sc_impl_aliases
.
impl_id
%
TYPE
is
v_impl_id
acs_sc_impls
.
impl_id
%
TYPE
;
begin
-- FUNCTION DEPRECATED. USE acs_sc_impl_alias.new
dbms_output
.
put_line
(
'acs_sc_impl.new_alias DEPRECATED. Use acs_sc_impl_alias.new'
);
v_impl_id
:
=
acs_sc_impl_alias
.
new
(
impl_contract_name
,
impl_name
,
impl_operation_name
,
impl_alias
,
impl_pl
);
return
v_impl_id
;
end
new_alias
;
function
delete_alias
(
impl_contract_name
acs_sc_contracts
.
contract_name
%
TYPE
,
impl_name
acs_sc_impls
.
impl_name
%
TYPE
,
impl_operation_name
acs_sc_operations
.
operation_name
%
TYPE
)
return
acs_sc_impls
.
impl_id
%
TYPE
is
v_impl_id
acs_sc_impls
.
impl_id
%
TYPE
;
begin
-- FUNCTION DEPRECATED. USE acs_sc_impl_alias.delete
dbms_output
.
put_line
(
'acs_sc_impl.delete_alias DEPRECATED. Use acs_sc_impl_alias.delete'
);
v_impl_id
:
=
acs_sc_impl_alias
.
del
(
impl_contract_name
,
impl_name
,
impl_operation_name
);
return
v_impl_id
;
end
delete_alias
;
end
acs_sc_impl
;
/
show
errors
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