summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd4b0c9)
raw | patch | inline | side by side (parent: fd4b0c9)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Jul 2008 13:41:23 +0000 (13:41 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Jul 2008 13:41:23 +0000 (13:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11545 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/client/events/opsi.pm | patch | blob | history |
index 04473295c6c95226f076e87235414cce2c32cb31..3ce4cb33a45ded8ddba50930d739faaf891ac4f4 100644 (file)
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $hostId;
- # Get hostID if defined
- if (defined @{$msg_hash->{'hostId'}}[0]){
- $hostId = @{$msg_hash->{'hostId'}}[0];
- }
-
# build return message with twisted target and source
my $out_hash = &main::create_xml_hash("answer_$header", $target, $source);
&add_content2xml_hash($out_hash, "session_id", $session_id);
+ # Get hostID if defined
+ if (defined @{$msg_hash->{'hostId'}}[0]){
+ $hostId = @{$msg_hash->{'hostId'}}[0];
+ &add_content2xml_hash($out_hash, "hostId", $hostId);
+ }
+
if (defined $forward_to_gosa) {
&add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
}
my $productId = @{$msg_hash->{'ProductId'}}[0];
my $hostId;
- # Get hostID if defined
- if (defined @{$msg_hash->{'hostId'}}[0]){
- $hostId = @{$msg_hash->{'hostId'}}[0];
- }
-
# build return message with twisted target and source
my $out_hash = &main::create_xml_hash("answer_$header", $target, $source);
&add_content2xml_hash($out_hash, "session_id", $session_id);
+ # Get hostID if defined
+ if (defined @{$msg_hash->{'hostId'}}[0]){
+ $hostId = @{$msg_hash->{'hostId'}}[0];
+ &add_content2xml_hash($out_hash, "hostId", $hostId);
+ }
+
if (defined $forward_to_gosa) {
&add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
}
my $xml_msg= &create_xml_string($out_hash);
-# Move to getProductProperties_hash prod + objectid
-
# JSON Query
my $callobj = {
- method => 'getProductPropertyDefinitions_listOfHashes',
+ method => 'getProductProperties_hash',
params => [ $productId ],
id => 1,
};
my $res = $client->call($opsi_url, $callobj);
- if (check_res($res)){
- foreach my $r (@{$res->result}) {
- my $item= "<item>";
+ if (check_res($res)){
+ my $r= $res->result;
foreach my $key (keys %{$r}) {
- my $value = $r->{$key};
+ my $item= "<item>";
+ my $value= $r->{$key};
if (UNIVERSAL::isa( $value, "ARRAY" )){
foreach my $subval (@{$value}){
$item.= "<$key>".xml_quote($subval)."</$key>";
} else {
$item.= "<$key>".xml_quote($value)."</$key>";
}
+ $item.= "</item>";
+ $xml_msg=~ s/<xxx><\/xxx>/$item<xxx><\/xxx>/;
}
- $item.= "</item>";
- $xml_msg=~ s/<xxx><\/xxx>/$item<xxx><\/xxx>/;
- }
}
$xml_msg=~ s/<xxx><\/xxx>//;