Kaydet (Commit) 153e4d9b authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

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
üst 01d8de73
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
# #
# $RCSfile: Cws.pm,v $ # $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 Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1. # the terms of GNU Lesser General Public License Version 2.1.
...@@ -349,6 +349,17 @@ sub get_owner ...@@ -349,6 +349,17 @@ sub get_owner
return $self->get_owner_from_eis(); 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, # Get child workspace approval status,
# return values can be: # return values can be:
# 'planned', 'new', 'nominated', 'integrated' # 'planned', 'new', 'nominated', 'integrated'
...@@ -1063,6 +1074,37 @@ sub get_owner_from_eis ...@@ -1063,6 +1074,37 @@ sub get_owner_from_eis
return $result; 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, # Get child workspace approval status from EIS,
# return undef in case of error. # return undef in case of error.
sub get_status_from_eis sub get_status_from_eis
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment