source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/XML/Prolog.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 762 bytes
Line 
1package Ocsinventory::Agent::XML::Prolog;
2
3use strict;
4use warnings;
5
6use XML::Simple;
7use Digest::MD5 qw(md5_base64);
8
9sub new {
10  my (undef, $params) = @_;
11
12  my $self = {};
13  $self->{config} = $params->{context}->{config};
14
15  $self->{logger} = $params->{context}->{logger};
16
17  die unless ($self->{config}->{deviceid}); #XXX
18
19  $self->{xmlroot}{QUERY} = ['PROLOG'];
20  $self->{xmlroot}{DEVICEID} = [$self->{config}->{deviceid}];
21
22  bless $self;
23}
24
25sub dump {
26  my $self = shift;
27  eval "use Data::Dumper;";
28  print Dumper($self->{xmlroot});
29
30}
31
32sub getContent {
33  my ($self, $args) = @_;
34
35  my $content=XMLout( $self->{xmlroot}, RootName => 'REQUEST', XMLDecl => '<?xml version="1.0" encoding="UTF-8"?>',
36    SuppressEmpty => undef );
37
38  return $content;
39}
40
411;
Note: See TracBrowser for help on using the repository browser.