diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-09-07 15:31:41 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-09-07 15:31:41 +0000 |
commit | 153e4d9b9fe357bbf21f5fc2071080f59a6090e4 (patch) | |
tree | e0d0bc58a61059b98ffef8694b647a745f803c20 /solenv/bin/modules | |
parent | 01d8de738d613c16254a88f64150d6d088f243a0 (diff) |
INTEGRATION: CWS testgfxcmp (1.14.216); FILE MERGED
2006/08/21 09:47:59 rt 1.14.216.2: #139644# Re-ordered new functions to match coding convention for this file (public funtion first, pribate one in extra section later on).
2006/08/18 09:58:22 lla 1.14.216.1: #139644# add save_attachment
Diffstat (limited to 'solenv/bin/modules')
-rwxr-xr-x | solenv/bin/modules/Cws.pm | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/solenv/bin/modules/Cws.pm b/solenv/bin/modules/Cws.pm index 2a0e9be7ee05..fa5d58a84726 100755 --- a/solenv/bin/modules/Cws.pm +++ b/solenv/bin/modules/Cws.pm @@ -4,9 +4,9 @@ # # $RCSfile: Cws.pm,v $ # -# $Revision: 1.16 $ +# $Revision: 1.17 $ # -# last change: $Author: ihi $ $Date: 2006-08-29 14:16:10 $ +# last change: $Author: vg $ $Date: 2006-09-07 16:31:41 $ # # The Contents of this file are made available subject to # the terms of GNU Lesser General Public License Version 2.1. @@ -349,6 +349,17 @@ sub get_owner return $self->get_owner_from_eis(); } +# store an Attachment to a given CWS +sub save_attachment +{ + my $self = shift; + my $name = shift; + my $mediatype = shift; + my $data = shift; + + return $self->save_attachment_in_eis($name, $mediatype, $data); +} + # Get child workspace approval status, # return values can be: # 'planned', 'new', 'nominated', 'integrated' @@ -1063,6 +1074,37 @@ sub get_owner_from_eis return $result; } +# store an attachment to a given CWS +# return undef in case of error. +sub save_attachment_in_eis +{ + my $self = shift; + my $name = shift; + my $mediatype = shift; + my $text = shift; + + # check if child workspace is valid + my $eisid = $self->eis_id(); + if ( !$eisid ) + { + carp("ERROR: Childworkspace not (yet) registered with EIS.\n"); + return undef; + } + + my $eisname = Eis::to_string($name); + my $eismediatype = Eis::to_string($mediatype); + my $eistextstring = Eis::to_string($text); + + my $eis = Cws::eis(); + my $result; + + eval { $result = $eis->saveAttachment($eisid, $eisname, $eismediatype, $eistextstring ) }; + if ( $@ ) { + carp("ERROR: save_attachment_in_eis(): EIS database transaction failed. Reason:\n$@\n"); + } + return $result; +} + # Get child workspace approval status from EIS, # return undef in case of error. sub get_status_from_eis |