Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acs-messaging
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-messaging
Commits
2fb6ebef
Commit
2fb6ebef
authored
Apr 29, 2007
by
Malte Sussdorff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Malte
parent
c7ee67b1
Pipeline
#87
failed with stages
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
951 additions
and
107 deletions
+951
-107
acs-messaging.info
acs-messaging.info
+7
-5
acs-messaging-create.sql
sql/oracle/acs-messaging-create.sql
+5
-7
acs-messaging-packages.sql
sql/oracle/acs-messaging-packages.sql
+26
-14
upgrade-5.1.0d1-5.1.0d2.sql
sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
+8
-0
upgrade-5.2.1d1-5.2.1d2.sql
sql/oracle/upgrade/upgrade-5.2.1d1-5.2.1d2.sql
+655
-0
upgrade-5.3.0d1-5.3.0d2.sql
sql/oracle/upgrade/upgrade-5.3.0d1-5.3.0d2.sql
+1
-0
acs-messaging-create.sql
sql/postgresql/acs-messaging-create.sql
+7
-7
acs-messaging-drop.sql
sql/postgresql/acs-messaging-drop.sql
+11
-0
acs-messaging-packages.sql
sql/postgresql/acs-messaging-packages.sql
+222
-74
upgrade-5.1.0d1-5.1.0d2.sql
sql/postgresql/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
+8
-0
upgrade-5.3.0d1-5.3.0d2.sql
sql/postgresql/upgrade/upgrade-5.3.0d1-5.3.0d2.sql
+1
-0
No files found.
acs-messaging.info
View file @
2fb6ebef
...
...
@@ -7,20 +7,22 @@
<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-messaging-5.1.5
.apm"
>
<version
name=
"5.
3.1b1"
url=
"http://openacs.org/repository/download/apm/acs-messaging-5.3.1b1
.apm"
>
<owner
url=
"mailto:akk+@cs.cmu.edu"
>
Anukul Kapoor
</owner>
<owner
url=
"mailto:prevost@maya.com"
>
John Prevost
</owner>
<owner
url=
"mailto:vinod@kurup.com"
>
Vinod Kurup
</owner>
<summary>
General messaging for bboard and general comments.
</summary>
<release-date>
200
4-02-28
</release-date>
<release-date>
200
7-04-15
</release-date>
<maturity>
3
</maturity>
<vendor
url=
"http://openacs.org"
>
OpenACS
</vendor>
<license
url=
"http://www.gnu.org/copyleft/gpl.html"
>
GPL
</license>
<maturity>
3
</maturity>
<description
format=
"text/html"
>
Provides generic message services, with email sending. acs-mail-lite and notifications are the
prefered packages for delivering this functionality and it is anticipated that this package will ultimately be deprecated.
</description>
<provides
url=
"acs-messaging"
version=
"5.
1.4
"
/>
<requires
url=
"acs-content-repository"
version=
"5.
0.0
"
/>
<requires
url=
"acs-kernel"
version=
"5.
0.0
"
/>
<provides
url=
"acs-messaging"
version=
"5.
3.1b1
"
/>
<requires
url=
"acs-content-repository"
version=
"5.
3.1b1
"
/>
<requires
url=
"acs-kernel"
version=
"5.
3.1b1
"
/>
<callbacks>
</callbacks>
...
...
sql/oracle/acs-messaging-create.sql
View file @
2fb6ebef
...
...
@@ -17,9 +17,9 @@ begin
object_type
=>
'acs_message'
,
pretty_name
=>
'Message'
,
pretty_plural
=>
'Messages'
,
table_name
=>
'
ACS_MESSAGES
'
,
id_column
=>
'
MESSAGE_ID
'
,
name_method
=>
'
ACS_MESSAGE.NAME
'
table_name
=>
'
acs_messages
'
,
id_column
=>
'
message_id
'
,
name_method
=>
'
acs_message.name
'
);
acs_object_type
.
create_type
(
...
...
@@ -27,9 +27,7 @@ begin
object_type
=>
'acs_message_revision'
,
pretty_name
=>
'Message Revision'
,
pretty_plural
=>
'Message Revisions'
,
table_name
=>
'CR_REVISIONS'
,
id_column
=>
'REVISION_ID'
,
name_method
=>
'ACS_OBJECT.DEFAULT_NAME'
name_method
=>
'acs_object.default_name'
);
end
;
...
...
@@ -42,7 +40,7 @@ create table acs_messages ( -- extends cr_items
message_id
integer
constraint
acs_messages_message_id_fk
references
cr_items
(
item_id
)
on
delete
cascade
constraint
acs_messages_pk
constraint
acs_messages_
message_id_
pk
primary
key
,
-- we will need to find a way to make reply_to go to 0 instead of null
-- to improve scalability
...
...
sql/oracle/acs-messaging-packages.sql
View file @
2fb6ebef
...
...
@@ -21,13 +21,14 @@ as
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
0
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
-
4
,
context_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
object_type
in
acs_objects
.
object_type
%
TYPE
default
'acs_message'
,
is_live
in
char
default
't'
is_live
in
char
default
't'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit
(
...
...
@@ -88,7 +89,8 @@ as
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit_file
(
...
...
@@ -121,7 +123,8 @@ as
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit_image
(
...
...
@@ -151,7 +154,8 @@ as
parent_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
;
function
edit_extlink
(
...
...
@@ -187,13 +191,14 @@ as
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
0
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
-
4
,
context_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
object_type
in
acs_objects
.
object_type
%
TYPE
default
'acs_message'
,
is_live
in
char
default
't'
is_live
in
char
default
't'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_message_id
acs_messages
.
message_id
%
TYPE
;
...
...
@@ -226,7 +231,8 @@ as
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
item_subtype
=>
object_type
item_subtype
=>
object_type
,
package_id
=>
package_id
);
insert
into
acs_messages
...
...
@@ -394,7 +400,8 @@ as
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_file_id
cr_items
.
item_id
%
TYPE
;
...
...
@@ -408,7 +415,8 @@ as
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
storage_type
=>
storage_type
storage_type
=>
storage_type
,
package_id
=>
package_id
);
-- create an initial revision for the new attachment
...
...
@@ -482,7 +490,8 @@ as
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_image_id
cr_items
.
item_id
%
TYPE
;
...
...
@@ -496,7 +505,8 @@ as
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
storage_type
=>
storage_type
storage_type
=>
storage_type
,
package_id
=>
package_id
);
-- create an initial revision for the new attachment
...
...
@@ -580,7 +590,8 @@ as
parent_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
is
v_extlink_id
cr_extlinks
.
extlink_id
%
TYPE
;
...
...
@@ -594,7 +605,8 @@ as
extlink_id
=>
new_extlink
.
extlink_id
,
creation_date
=>
new_extlink
.
creation_date
,
creation_user
=>
new_extlink
.
creation_user
,
creation_ip
=>
new_extlink
.
creation_ip
creation_ip
=>
new_extlink
.
creation_ip
,
package_id
=>
new_extlink
.
package_id
);
end
new_extlink
;
...
...
sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
0 → 100644
View file @
2fb6ebef
update
acs_objects
set
title
=
(
select
name
from
cr_items
where
item_id
=
object_id
),
package_id
=
acs_object__package_id
(
content_item
.
get_root_folder
(
object_id
))
where
object_type
=
'acs_message'
;
@@
..
/
acs
-
messaging
-
packages
.
sql
sql/oracle/upgrade/upgrade-5.2.1d1-5.2.1d2.sql
0 → 100644
View file @
2fb6ebef
--
-- packages/acs-messaging/sql/acs-messaging-packages.sql
--
-- @author John Prevost <jmp@arsdigita.com>
-- @author Phong Nguyen <phong@arsdigita.com>
-- @creation-date 2000-08-27
-- @cvs-id $Id$
--
create
or
replace
package
acs_message
as
function
new
(
message_id
in
acs_messages
.
message_id
%
TYPE
default
null
,
reply_to
in
acs_messages
.
reply_to
%
TYPE
default
null
,
sent_date
in
acs_messages
.
sent_date
%
TYPE
default
sysdate
,
sender
in
acs_messages
.
sender
%
TYPE
default
null
,
rfc822_id
in
acs_messages
.
rfc822_id
%
TYPE
default
null
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
-
4
,
context_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
object_type
in
acs_objects
.
object_type
%
TYPE
default
'acs_message'
,
is_live
in
char
default
't'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
;
procedure
del
(
message_id
in
acs_messages
.
message_id
%
TYPE
);
function
message_p
(
message_id
in
acs_messages
.
message_id
%
TYPE
)
return
char
;
procedure
send
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
recipient_id
in
parties
.
party_id
%
TYPE
,
grouping_id
in
integer
default
null
,
wait_until
in
date
default
sysdate
);
procedure
send
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
to_address
in
varchar2
,
grouping_id
in
integer
default
null
,
wait_until
in
date
default
sysdate
);
function
first_ancestor
(
message_id
in
acs_messages
.
message_id
%
TYPE
)
return
acs_messages
.
message_id
%
TYPE
;
-- ACHTUNG! WARNING! ACHTUNG! WARNING! ACHTUNG! WARNING! --
-- Developers: Please don't depend on the following functionality
-- to remain in the same place. Chances are very good these
-- functions will migrate to another PL/SQL package or be replaced
-- by direct calls to CR code in the near future.
function
new_file
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
file_id
in
cr_items
.
item_id
%
TYPE
default
null
,
file_name
in
cr_items
.
name
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit_file
(
file_id
in
cr_items
.
item_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
;
procedure
delete_file
(
file_id
in
cr_items
.
item_id
%
TYPE
);
function
new_image
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
image_id
in
cr_items
.
item_id
%
TYPE
default
null
,
file_name
in
cr_items
.
name
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
width
in
images
.
width
%
TYPE
default
null
,
height
in
images
.
height
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
;
function
edit_image
(
image_id
in
cr_items
.
item_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
width
in
images
.
width
%
TYPE
default
null
,
height
in
images
.
height
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
;
procedure
delete_image
(
image_id
in
cr_items
.
item_id
%
TYPE
);
function
new_extlink
(
name
in
cr_items
.
name
%
TYPE
default
null
,
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
default
null
,
url
in
cr_extlinks
.
url
%
TYPE
,
label
in
cr_extlinks
.
label
%
TYPE
default
null
,
description
in
cr_extlinks
.
description
%
TYPE
default
null
,
parent_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
;
function
edit_extlink
(
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
,
url
in
cr_extlinks
.
url
%
TYPE
,
label
in
cr_extlinks
.
label
%
TYPE
default
null
,
description
in
cr_extlinks
.
description
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
;
procedure
delete_extlink
(
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
);
function
name
(
message_id
in
acs_objects
.
object_id
%
TYPE
)
return
varchar2
;
end
acs_message
;
/
show
errors
create
or
replace
package
body
acs_message
as
function
new
(
message_id
in
acs_messages
.
message_id
%
TYPE
default
null
,
reply_to
in
acs_messages
.
reply_to
%
TYPE
default
null
,
sent_date
in
acs_messages
.
sent_date
%
TYPE
default
sysdate
,
sender
in
acs_messages
.
sender
%
TYPE
default
null
,
rfc822_id
in
acs_messages
.
rfc822_id
%
TYPE
default
null
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
parent_id
in
cr_items
.
parent_id
%
TYPE
default
-
4
,
context_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
object_type
in
acs_objects
.
object_type
%
TYPE
default
'acs_message'
,
is_live
in
char
default
't'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_message_id
acs_messages
.
message_id
%
TYPE
;
v_rfc822_id
acs_messages
.
rfc822_id
%
TYPE
;
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
-- generate a message id now so we can get an rfc822 message-id
if
message_id
is
null
then
select
acs_object_id_seq
.
nextval
into
v_message_id
from
dual
;
else
v_message_id
:
=
message_id
;
end
if
;
-- this needs to be fixed up, but Oracle doesn't give us a way
-- to get the FQDN
if
rfc822_id
is
null
then
v_rfc822_id
:
=
sysdate
||
'.'
||
v_message_id
||
'@'
||
utl_inaddr
.
get_host_name
||
'.hate'
;
else
v_rfc822_id
:
=
rfc822_id
;
end
if
;
v_message_id
:
=
content_item
.
new
(
name
=>
v_rfc822_id
,
parent_id
=>
parent_id
,
content_type
=>
'acs_message_revision'
,
item_id
=>
message_id
,
context_id
=>
context_id
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
item_subtype
=>
object_type
,
package_id
=>
package_id
);
insert
into
acs_messages
(
message_id
,
reply_to
,
sent_date
,
sender
,
rfc822_id
)
values
(
v_message_id
,
reply_to
,
sent_date
,
sender
,
v_rfc822_id
);
-- create an initial revision for the new message
v_revision_id
:
=
acs_message
.
edit
(
message_id
=>
v_message_id
,
title
=>
title
,
description
=>
description
,
mime_type
=>
mime_type
,
text
=>
text
,
data
=>
data
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
is_live
=>
is_live
);
return
v_message_id
;
end
new
;
function
edit
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
text
in
varchar2
default
null
,
data
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
is
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
-- create a new revision using whichever call is appropriate
if
edit
.
data
is
not
null
then
v_revision_id
:
=
content_revision
.
new
(
item_id
=>
message_id
,
title
=>
title
,
description
=>
description
,
data
=>
data
,
mime_type
=>
mime_type
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
);
elsif
title
is
not
null
or
text
is
not
null
then
v_revision_id
:
=
content_revision
.
new
(
item_id
=>
message_id
,
title
=>
title
,
description
=>
description
,
text
=>
text
,
mime_type
=>
mime_type
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
);
end
if
;
-- test for auto approval of revision
if
edit
.
is_live
=
't'
then
content_item
.
set_live_revision
(
v_revision_id
);
end
if
;
return
v_revision_id
;
end
edit
;
procedure
del
(
message_id
in
acs_messages
.
message_id
%
TYPE
)
is
begin
delete
from
acs_messages
where
message_id
=
acs_message
.
del
.
message_id
;
content_item
.
del
(
message_id
);
end
del
;
function
message_p
(
message_id
in
acs_messages
.
message_id
%
TYPE
)
return
char
is
v_check_message_id
integer
;
begin
select
decode
(
count
(
message_id
),
0
,
0
,
1
)
into
v_check_message_id
from
acs_messages
where
message_id
=
message_p
.
message_id
;
if
v_check_message_id
<>
0
then
return
't'
;
else
return
'f'
;
end
if
;
end
message_p
;
procedure
send
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
to_address
in
varchar2
,
grouping_id
in
integer
default
null
,
wait_until
in
date
default
sysdate
)
is
v_wait_until
date
;
begin
v_wait_until
:
=
nvl
(
wait_until
,
sysdate
);
insert
into
acs_messages_outgoing
(
message_id
,
to_address
,
grouping_id
,
wait_until
)
values
(
message_id
,
to_address
,
grouping_id
,
v_wait_until
);
end
send
;
procedure
send
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
recipient_id
in
parties
.
party_id
%
TYPE
,
grouping_id
in
integer
default
null
,
wait_until
in
date
default
sysdate
)
is
v_wait_until
date
;
begin
v_wait_until
:
=
nvl
(
wait_until
,
sysdate
);
insert
into
acs_messages_outgoing
(
message_id
,
to_address
,
grouping_id
,
wait_until
)
select
send
.
message_id
,
p
.
email
,
send
.
grouping_id
,
v_wait_until
from
parties
p
where
p
.
party_id
=
send
.
recipient_id
;
end
send
;
function
first_ancestor
(
message_id
in
acs_messages
.
message_id
%
TYPE
)
return
acs_messages
.
message_id
%
TYPE
is
v_message_id
acs_messages
.
message_id
%
TYPE
;
begin
select
message_id
into
v_message_id
from
(
select
message_id
,
reply_to
from
acs_messages
connect
by
message_id
=
prior
reply_to
start
with
message_id
=
first_ancestor
.
message_id
)
ancestors
where
reply_to
is
null
;
return
v_message_id
;
end
first_ancestor
;
-- ACHTUNG! WARNING! ACHTUNG! WARNING! ACHTUNG! WARNING! --
-- Developers: Please don't depend on the following functionality
-- to remain in the same place. Chances are very good these
-- functions will migrate to another PL/SQL package or be replaced
-- by direct calls to CR code in the near future.
function
new_file
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
file_id
in
cr_items
.
item_id
%
TYPE
default
null
,
file_name
in
cr_items
.
name
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_file_id
cr_items
.
item_id
%
TYPE
;
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
v_file_id
:
=
content_item
.
new
(
name
=>
file_name
,
parent_id
=>
message_id
,
item_id
=>
file_id
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
storage_type
=>
storage_type
,
package_id
=>
package_id
);
-- create an initial revision for the new attachment
v_revision_id
:
=
edit_file
(
file_id
=>
v_file_id
,
title
=>
title
,
description
=>
description
,
mime_type
=>
mime_type
,
content
=>
content
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
is_live
=>
is_live
);
return
v_file_id
;
end
new_file
;
function
edit_file
(
file_id
in
cr_items
.
item_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
is
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
v_revision_id
:
=
content_revision
.
new
(
title
=>
title
,
mime_type
=>
mime_type
,
data
=>
content
,
item_id
=>
file_id
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
);
-- test for auto approval of revision
if
is_live
=
't'
then
content_item
.
set_live_revision
(
v_revision_id
);
end
if
;
return
v_revision_id
;
end
edit_file
;
procedure
delete_file
(
file_id
in
cr_items
.
item_id
%
TYPE
)
is
begin
content_item
.
del
(
delete_file
.
file_id
);
end
delete_file
;
function
new_image
(
message_id
in
acs_messages
.
message_id
%
TYPE
,
image_id
in
cr_items
.
item_id
%
TYPE
default
null
,
file_name
in
cr_items
.
name
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
width
in
images
.
width
%
TYPE
default
null
,
height
in
images
.
height
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
,
storage_type
in
cr_items
.
storage_type
%
TYPE
default
'file'
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
acs_objects
.
object_id
%
TYPE
is
v_image_id
cr_items
.
item_id
%
TYPE
;
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
v_image_id
:
=
content_item
.
new
(
name
=>
file_name
,
parent_id
=>
message_id
,
item_id
=>
image_id
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
storage_type
=>
storage_type
,
package_id
=>
package_id
);
-- create an initial revision for the new attachment
v_revision_id
:
=
edit_image
(
image_id
=>
v_image_id
,
title
=>
title
,
description
=>
description
,
mime_type
=>
mime_type
,
content
=>
content
,
width
=>
width
,
height
=>
height
,
creation_date
=>
creation_date
,
creation_user
=>
creation_user
,
creation_ip
=>
creation_ip
,
is_live
=>
is_live
);
return
v_image_id
;
end
new_image
;
function
edit_image
(
image_id
in
cr_items
.
item_id
%
TYPE
,
title
in
cr_revisions
.
title
%
TYPE
default
null
,
description
in
cr_revisions
.
description
%
TYPE
default
null
,
mime_type
in
cr_revisions
.
mime_type
%
TYPE
default
'text/plain'
,
content
in
cr_revisions
.
content
%
TYPE
default
null
,
width
in
images
.
width
%
TYPE
default
null
,
height
in
images
.
height
%
TYPE
default
null
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
is_live
in
char
default
't'
)
return
acs_objects
.
object_id
%
TYPE
is
v_revision_id
cr_revisions
.
revision_id
%
TYPE
;
begin
v_revision_id
:
=
content_revision
.
new
(
title
=>
edit_image
.
title
,
mime_type
=>
edit_image
.
mime_type
,
data
=>
edit_image
.
content
,
item_id
=>
edit_image
.
image_id
,
creation_date
=>
edit_image
.
creation_date
,
creation_user
=>
edit_image
.
creation_user
,
creation_ip
=>
edit_image
.
creation_ip
);
-- insert new width and height values
-- XXX fix after image.new exists
insert
into
images
(
image_id
,
width
,
height
)
values
(
v_revision_id
,
width
,
height
);
-- test for auto approval of revision
if
edit_image
.
is_live
=
't'
then
content_item
.
set_live_revision
(
v_revision_id
);
end
if
;
return
v_revision_id
;
end
edit_image
;
procedure
delete_image
(
image_id
in
cr_items
.
item_id
%
TYPE
)
is
begin
-- XXX fix after image.delete exists
delete
from
images
where
image_id
=
delete_image
.
image_id
;
content_item
.
del
(
image_id
);
end
delete_image
;
-- XXX should just call content_extlink.new
function
new_extlink
(
name
in
cr_items
.
name
%
TYPE
default
null
,
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
default
null
,
url
in
cr_extlinks
.
url
%
TYPE
,
label
in
cr_extlinks
.
label
%
TYPE
default
null
,
description
in
cr_extlinks
.
description
%
TYPE
default
null
,
parent_id
in
acs_objects
.
context_id
%
TYPE
,
creation_date
in
acs_objects
.
creation_date
%
TYPE
default
sysdate
,
creation_user
in
acs_objects
.
creation_user
%
TYPE
default
null
,
creation_ip
in
acs_objects
.
creation_ip
%
TYPE
default
null
,
package_id
in
acs_objects
.
package_id
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
is
v_extlink_id
cr_extlinks
.
extlink_id
%
TYPE
;
begin
v_extlink_id
:
=
content_extlink
.
new
(
name
=>
new_extlink
.
name
,
url
=>
new_extlink
.
url
,
label
=>
new_extlink
.
label
,
description
=>
new_extlink
.
description
,
parent_id
=>
new_extlink
.
parent_id
,
extlink_id
=>
new_extlink
.
extlink_id
,
creation_date
=>
new_extlink
.
creation_date
,
creation_user
=>
new_extlink
.
creation_user
,
creation_ip
=>
new_extlink
.
creation_ip
,
package_id
=>
new_extlink
.
package_id
);
end
new_extlink
;
-- XXX should just edit extlink
function
edit_extlink
(
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
,
url
in
cr_extlinks
.
url
%
TYPE
,
label
in
cr_extlinks
.
label
%
TYPE
default
null
,
description
in
cr_extlinks
.
description
%
TYPE
default
null
)
return
cr_extlinks
.
extlink_id
%
TYPE
is
v_is_extlink
char
;
begin
v_is_extlink
:
=
content_extlink
.
is_extlink
(
edit_extlink
.
extlink_id
);
if
v_is_extlink
=
't'
then
update
cr_extlinks
set
url
=
edit_extlink
.
url
,
label
=
edit_extlink
.
label
,
description
=
edit_extlink
.
description
where
extlink_id
=
edit_extlink
.
extlink_id
;
end
if
;
return
v_is_extlink
;
end
edit_extlink
;
procedure
delete_extlink
(
extlink_id
in
cr_extlinks
.
extlink_id
%
TYPE
)
is
begin
content_extlink
.
del
(
extlink_id
=>
delete_extlink
.
extlink_id
);
end
delete_extlink
;
function
name
(
message_id
in
acs_objects
.
object_id
%
TYPE
)
return
varchar2
is
v_message_name
acs_messages_all
.
title
%
TYPE
;
begin
select
title
into
v_message_name
from
acs_messages_all
where
message_id
=
name
.
message_id
;
return
v_message_name
;
end
name
;
end
acs_message
;
/
show
errors
sql/oracle/upgrade/upgrade-5.3.0d1-5.3.0d2.sql
0 → 100644
View file @
2fb6ebef
update
acs_object_types
set
table_name
=
null
,
id_column
=
null
where
object_type
=
'acs_message_revision'
;
sql/postgresql/acs-messaging-create.sql
View file @
2fb6ebef
...
...
@@ -15,12 +15,12 @@ select acs_object_type__create_type (
'Message'
,
'Messages'
,
'content_item'
,
'
ACS_MESSAGES
'
,
'
MESSAGE_ID
'
,
'
acs_messages
'
,
'
message_id
'
,
null
,
'f'
,
null
,
'
ACS_MESSAGE.NAME
'
'
acs_message__name
'
);
select
acs_object_type__create_type
(
...
...
@@ -28,12 +28,12 @@ select acs_object_type__create_type (
'Message Revision'
,
'Message Revisions'
,
'content_revision'
,
'CR_REVISIONS'
,
'REVISION_ID'
,
null
,
null
,
null
,
'f'
,
null
,
'
ACS_OBJECT.DEFAULT_NAME
'
'
acs_object__default_name
'
);
...
...
@@ -43,7 +43,7 @@ create table acs_messages ( -- extends cr_items
message_id
integer
constraint
acs_messages_message_id_fk
references
cr_items
(
item_id
)
on
delete
cascade
constraint
acs_messages_pk
constraint
acs_messages_
message_id_
pk
primary
key
,
-- we will need to find a way to make reply_to go to 0 instead of null
-- to improve scalability
...
...
sql/postgresql/acs-messaging-drop.sql
View file @
2fb6ebef
...
...
@@ -17,6 +17,9 @@ drop function acs_message__edit (integer,varchar,varchar,varchar,
drop
function
acs_message__new
(
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
varchar
,
varchar
,
varchar
,
varchar
,
text
,
integer
,
integer
,
integer
,
varchar
,
varchar
,
boolean
);
drop
function
acs_message__new
(
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
varchar
,
varchar
,
varchar
,
varchar
,
text
,
integer
,
integer
,
integer
,
varchar
,
varchar
,
boolean
,
integer
);
drop
function
acs_message__delete
(
integer
);
drop
function
acs_message__message_p
(
integer
);
drop
function
acs_message__send
(
integer
,
varchar
,
integer
,
timestamptz
);
...
...
@@ -25,18 +28,26 @@ drop function acs_message__first_ancestor (integer);
drop
function
acs_message__new_file
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
text
,
timestamptz
,
integer
,
varchar
,
boolean
);
drop
function
acs_message__new_file
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
text
,
timestamptz
,
integer
,
varchar
,
boolean
,
integer
);
drop
function
acs_message__edit_file
(
integer
,
varchar
,
text
,
varchar
,
text
,
timestamptz
,
integer
,
varchar
,
boolean
);
drop
function
acs_message__delete_file
(
integer
);
drop
function
acs_message__new_image
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
text
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
);
drop
function
acs_message__new_image
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
text
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
integer
);
drop
function
acs_message__edit_image
(
integer
,
varchar
,
text
,
varchar
,
text
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
);
drop
function
acs_message__delete_image
(
integer
);
drop
function
acs_message__new_extlink
(
varchar
,
integer
,
varchar
,
varchar
,
text
,
integer
,
timestamptz
,
integer
,
varchar
);
drop
function
acs_message__new_extlink
(
varchar
,
integer
,
varchar
,
varchar
,
text
,
integer
,
timestamptz
,
integer
,
varchar
,
integer
);
drop
function
acs_message__edit_extlink
(
integer
,
varchar
,
varchar
,
text
);
drop
function
acs_message__delete_extlink
(
integer
);
drop
function
acs_message__name
(
integer
);
...
...
sql/postgresql/acs-messaging-packages.sql
View file @
2fb6ebef
...
...
@@ -29,28 +29,28 @@ begin
if p_data is not null then
-- need to take care of blob?
v_revision_id := content_revision__new (
p_message_id,
-- item_id
p_title,
-- title
p_description,
-- description
p_data,
-- data
p_mime_type,
-- mime_type
p_message_id, -- item_id
p_title, -- title
p_description, -- description
p_data, -- data
p_mime_type, -- mime_type
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip
-- creation_ip
p_creation_ip -- creation_ip
);
else if p_title is not null or p_text is not null then
v_revision_id := content_revision__new (
p_title,
-- title
p_description,
-- description
now(),
-- publish_date
p_mime_type,
-- mime_type
null,
-- nls_language
p_text,
-- text
p_message_id,
-- item_id
null,
-- revision_id
p_title, -- title
p_description, -- description
now(), -- publish_date
p_mime_type, -- mime_type
null, -- nls_language
p_text, -- text
p_message_id, -- item_id
null, -- revision_id
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip
-- creation_ip
p_creation_ip -- creation_ip
);
end if;
end if;
...
...
@@ -75,7 +75,7 @@ end;' language 'plpgsql';
create
or
replace
function
acs_message__new
(
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
varchar
,
varchar
,
varchar
,
text
,
integer
,
integer
,
integer
,
integer
,
varchar
,
varchar
,
boolean
)
varchar
,
varchar
,
boolean
,
integer
)
returns
integer
as
'
declare
p_message_id alias for $1; --default null,
...
...
@@ -95,6 +95,7 @@ declare
p_creation_ip alias for $14; --default null,
p_object_type alias for $15; --default
''
acs_message
''
,
p_is_live alias for $16; --default
''
t
''
p_package_id alias for $17;
v_message_id acs_messages.message_id%TYPE;
v_rfc822_id acs_messages.rfc822_id%TYPE;
v_revision_id cr_revisions.revision_id%TYPE;
...
...
@@ -127,22 +128,23 @@ declare
end if;
v_message_id := content_item__new (
v_rfc822_id,
-- name
p_parent_id,
-- parent_id
p_message_id,
-- item_id
null,
-- locale
v_rfc822_id, -- name
p_parent_id, -- parent_id
p_message_id, -- item_id
null, -- locale
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_context_id, -- context_id
p_creation_ip, -- creation_ip
p_object_type, -- item_subtype
''
acs_message_revision
''
, -- content_type
null, -- title
null, -- description
''
text/plain
''
, -- mime_type
null, -- nls_language
null, -- text
''
text
''
-- storage_type
p_context_id, -- context_id
p_creation_ip, -- creation_ip
p_object_type, -- item_subtype
''
acs_message_revision
''
, -- content_type
null, -- title
null, -- description
''
text/plain
''
, -- mime_type
null, -- nls_language
null, -- text
''
text
''
, -- storage_type
p_package_id
);
insert into acs_messages
...
...
@@ -152,21 +154,64 @@ declare
-- create an initial revision for the new message
v_revision_id := acs_message__edit (
v_message_id,
-- message_id
p_title,
-- title
p_description,
-- description
p_mime_type,
-- mime_type
p_text,
-- text
p_data,
-- data
v_message_id, -- message_id
p_title, -- title
p_description, -- description
p_mime_type, -- mime_type
p_text, -- text
p_data, -- data
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip,
-- creation_ip
p_is_live
-- is_live
p_creation_ip, -- creation_ip
p_is_live -- is_live
);
return v_message_id;
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__new
(
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
varchar
,
varchar
,
varchar
,
text
,
integer
,
integer
,
integer
,
integer
,
varchar
,
varchar
,
boolean
)
returns
integer
as
'
declare
p_message_id alias for $1; --default null,
p_reply_to alias for $2; --default null,
p_sent_date alias for $3; --default sysdate,
p_sender alias for $4; --default null,
p_rfc822_id alias for $5; --default null,
p_title alias for $6; --default null,
p_description alias for $7; --default null,
p_mime_type alias for $8; --default
''
text/plain
''
,
p_text alias for $9; --default null,
p_data alias for $10; --default null,
p_parent_id alias for $11; --default 0,
p_context_id alias for $12;
p_creation_date timestamptz := current_timestamp; -- alias for $13 --default sysdate,
p_creation_user alias for $13; --default null,
p_creation_ip alias for $14; --default null,
p_object_type alias for $15; --default
''
acs_message
''
,
p_is_live alias for $16; --default
''
t
''
begin
return acs_message__new (p_message_id,
p_reply_to,
p_sent_date,
p_sender,
p_rfc822_id,
p_title,
p_description,
p_mime_type,
p_text,
p_data,
p_parent_id,
p_context_id,
p_creation_user,
p_creation_ip,
p_object_type,
p_is_live,
null::integer
);
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__delete
(
integer
)
returns
integer
as
'
declare
...
...
@@ -257,7 +302,7 @@ end;' language 'plpgsql' stable strict;
-- by direct calls to CR code in the near future.
create
or
replace
function
acs_message__new_file
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
)
text
,
varchar
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
,
integer
)
returns
integer
as
'
declare
p_message_id alias for $1;
...
...
@@ -272,44 +317,79 @@ declare
p_creation_ip alias for $10; -- default null
p_is_live alias for $11; -- default
''
t
''
p_storage_type alias for $12; -- default
''
file
''
p_package_id alias for $13; -- default null
v_file_id cr_items.item_id%TYPE;
v_revision_id cr_revisions.revision_id%TYPE;
begin
v_file_id := content_item__new (
p_file_name, -- name
p_message_id, -- parent_id
p_file_id,
-- item_id
null,
-- locale
p_file_id, -- item_id
null, -- locale
p_creation_date, -- creation_date
p_creation_user, -- creation_user
null,
-- context_id
null, -- context_id
p_creation_ip, -- creation_ip
''
content_item
''
, -- item_subtype
''
content_revision
''
, -- content_type
null,
-- title
null,
-- description
null, -- title
null, -- description
''
text/plain
''
, -- mime_type
null, -- nls_language
null, -- text
p_storage_type -- storage_type
null, -- nls_language
null, -- text
p_storage_type, -- storage_type
p_package_id -- package_id
);
-- create an initial revision for the new attachment
v_revision_id := acs_message__edit_file (
v_file_id,
-- file_id
p_title,
-- title
v_file_id, -- file_id
p_title, -- title
p_description, -- description
p_mime_type, -- mime_type
p_data,
-- data
p_data, -- data
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip, -- creation_ip
p_is_live
-- is_live
p_is_live -- is_live
);
return v_file_id;
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__new_file
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
)
returns
integer
as
'
declare
p_message_id alias for $1;
p_file_id alias for $2; -- default null
p_file_name alias for $3;
p_title alias for $4; -- default null
p_description alias for $5; -- default null
p_mime_type alias for $6; -- default
''
text/plain
''
p_data alias for $7; -- default null
p_creation_date alias for $8; -- default sysdate
p_creation_user alias for $9; -- default null
p_creation_ip alias for $10; -- default null
p_is_live alias for $11; -- default
''
t
''
p_storage_type alias for $12; -- default
''
file
''
begin
return acs_message__new_file (p_message_id,
p_file_id,
p_file_name,
p_title,
p_description,
p_mime_type,
p_data,
p_creation_date,
p_creation_user,
p_creation_ip,
p_is_live,
p_storage_type,
null
);
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__edit_file
(
integer
,
varchar
,
text
,
varchar
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
)
returns
integer
as
'
...
...
@@ -326,13 +406,13 @@ declare
v_revision_id cr_revisions.revision_id%TYPE;
begin
v_revision_id := content_revision__new (
p_title,
-- title
p_title, -- title
p_description,
current_timestamp,
p_mime_type, -- mime_type
NULL,
p_data, -- data
p_file_id,
-- item_id
p_file_id, -- item_id
NULL,
p_creation_date, -- creation_date
p_creation_user, -- creation_user
...
...
@@ -357,7 +437,7 @@ begin
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__new_image
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
integer
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
)
text
,
varchar
,
integer
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
,
integer
)
returns
integer
as
'
declare
p_message_id alias for $1;
...
...
@@ -374,6 +454,7 @@ declare
p_creation_ip alias for $12; -- default null
p_is_live alias for $13; -- default
''
t
''
p_storage_type alias for $14; -- default
''
file
''
p_package_id alias for $15; -- default null
v_image_id cr_items.item_id%TYPE;
v_revision_id cr_revisions.revision_id%TYPE;
begin
...
...
@@ -381,39 +462,77 @@ begin
p_file_name, -- name
p_message_id, -- parent_id
p_image_id, -- item_id
null,
-- locale
null, -- locale
p_creation_date, -- creation_date
p_creation_user, -- creation_user
null,
-- context_id
null, -- context_id
p_creation_ip, -- creation_ip
''
content_item
''
, -- item_subtype
''
content_revision
''
, -- content_type
null, -- title
null, -- description
''
text/plain
''
, -- mime_type
null, -- nls_language
null, -- text
''
file
''
-- storage_type
''
content_item
''
, -- item_subtype
''
content_revision
''
, -- content_type
null, -- title
null, -- description
''
text/plain
''
, -- mime_type
null, -- nls_language
null, -- text
''
file
''
, -- storage_type
p_package_id -- package_id
);
-- create an initial revision for the new attachment
v_revision_id := acs_message__edit_image (
v_image_id, -- image_id
p_title,
-- title
p_title, -- title
p_description, -- description
p_mime_type, -- mime_type
p_data,
-- data
p_width,
-- width
p_height,
-- height
p_data, -- data
p_width, -- width
p_height, -- height
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip, -- creation_ip
p_is_live
-- is_live
p_is_live -- is_live
);
return v_image_id;
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__new_image
(
integer
,
integer
,
varchar
,
varchar
,
text
,
varchar
,
integer
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
,
varchar
)
returns
integer
as
'
declare
p_message_id alias for $1;
p_image_id alias for $2; -- default null
p_file_name alias for $3;
p_title alias for $4; -- default null
p_description alias for $5; -- default null
p_mime_type alias for $6; -- default
''
text/plain
''
p_data alias for $7; -- default null
p_width alias for $8; -- default null
p_height alias for $9; -- default null
p_creation_date alias for $10; -- default sysdate
p_creation_user alias for $11; -- default null
p_creation_ip alias for $12; -- default null
p_is_live alias for $13; -- default
''
t
''
p_storage_type alias for $14; -- default
''
file
''
begin
return acs_message__new_image (p_message_id,
p_image_id,
p_file_name,
p_title,
p_description,
p_mime_type,
p_data,
p_width,
p_height,
p_creation_date,
p_creation_user,
p_creation_ip,
p_is_live,
p_storage_type,
null
);
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__edit_image
(
integer
,
varchar
,
text
,
varchar
,
integer
,
integer
,
integer
,
timestamptz
,
integer
,
varchar
,
boolean
)
returns
integer
as
'
...
...
@@ -473,7 +592,7 @@ end;' language 'plpgsql';
-- XXX should just call content_extlink.new
create
or
replace
function
acs_message__new_extlink
(
varchar
,
integer
,
varchar
,
varchar
,
text
,
integer
,
timestamptz
,
integer
,
varchar
)
varchar
,
text
,
integer
,
timestamptz
,
integer
,
varchar
,
integer
)
returns
integer
as
'
declare
p_name alias for $1; -- default null
...
...
@@ -485,23 +604,52 @@ declare
p_creation_date alias for $7; -- default sysdate
p_creation_user alias for $8; -- default null
p_creation_ip alias for $9; -- default null
p_package_id alias for $10; -- default null
v_extlink_id cr_extlinks.extlink_id%TYPE;
begin
v_extlink_id := content_extlink__new (
p_name,
-- name
p_url,
-- url
p_label,
-- label
p_name, -- name
p_url, -- url
p_label, -- label
p_description, -- description
p_parent_id, -- parent_id
p_extlink_id, -- extlink_id
p_creation_date, -- creation_date
p_creation_user, -- creation_user
p_creation_ip -- creation_ip
p_creation_ip, -- creation_ip
p_package_id
);
return v_extlink_id;
end;'
language
'plpgsql'
;
create
or
replace
function
acs_message__new_extlink
(
varchar
,
integer
,
varchar
,
varchar
,
text
,
integer
,
timestamptz
,
integer
,
varchar
)
returns
integer
as
'
declare
p_name alias for $1; -- default null
p_extlink_id alias for $2; -- default null
p_url alias for $3;
p_label alias for $4; -- default null
p_description alias for $5; -- default null
p_parent_id alias for $6;
p_creation_date alias for $7; -- default sysdate
p_creation_user alias for $8; -- default null
p_creation_ip alias for $9; -- default null
begin
return acs_message__new_extlink (p_name,
p_extlink_id,
p_url,
p_label,
p_description,
p_parent_id,
p_creation_date,
p_creation_user,
p_creation_ip,
null
);
end;'
language
'plpgsql'
;
-- XXX should just edit extlink
create
or
replace
function
acs_message__edit_extlink
(
integer
,
varchar
,
varchar
,
text
)
returns
integer
as
'
...
...
sql/postgresql/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
0 → 100644
View file @
2fb6ebef
update
acs_objects
set
title
=
(
select
name
from
cr_items
where
item_id
=
object_id
),
package_id
=
acs_object__package_id
(
content_item__get_root_folder
(
object_id
))
where
object_type
=
'acs_message'
;
\
i
..
/
acs
-
messaging
-
packages
.
sql
sql/postgresql/upgrade/upgrade-5.3.0d1-5.3.0d2.sql
0 → 100644
View file @
2fb6ebef
update
acs_object_types
set
table_name
=
null
,
id_column
=
null
where
object_type
=
'acs_message_revision'
;
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