ARS 7.1 Patch 2
ARSPerl 1.90
ActivePerl-5.8.8.819
Windows 2003

Ok...what I decided to do in this case was basically what the example
showed...just take my existing PL and in all essence do a save as...so I got
the create working the way I want...I even successfully took the contents of
one PL and added it to another PL...but I'm having trouble manually adding
one packing list (not the contents...just the PL) to another...here is my
code

        my $c_dailyPL = ars_GetContainer($c,$dailyPL);

        push @{$c_dailyPL->{referenceList}}, {
                dataType => 0,
                name => $pl_name,
                type => 6,
                description => "",
                label => ""
              };

        ars_SetContainer( $c, $dailyPL, $c_dailyPL ) || die $ars_errstr;

This generates no errors....but when I look in the admin tool...the PL isn't
in the PL....so I played around a bit with the Data dumper.  Here is the
output of the container when I add the PL through the admin tool

$packingList = {
                 'owner' => 'longwing.lj',
                 'ownerObjList' => [],
                 'numReferences' => 6,
                 'name' => '20080918-DailyMaster',
                 'lastChanged' => 'longwing.lj',
                 'objPropList' => [
                                    {
                                      'prop' => 60020,
                                      'value' => '',
                                      'valueType' => 'char'
                                    }
                                  ],
                 'timestamp' => 1221755866,
                 'adminList' => [],
                 'type' => 'pack',
                 'groupList' => {},
                 'referenceList' => [
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32783,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32793,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32784,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32785,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'dataType' => 0,
                                        'name' =>
'20080527-CherylConversionFormChanges',
                                        'type' => 6,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32801,
                                        'label' => '',
                                        'description' => ''
                                      }
                                    ]
               };

here is the output when I add the PL through my script

$packingList = {
                 'owner' => 'longwing.lj',
                 'ownerObjList' => [],
                 'numReferences' => 6,
                 'name' => '20080918-DailyMaster',
                 'lastChanged' => 'Webservice',
                 'objPropList' => [
                                    {
                                      'prop' => 60020,
                                      'value' => '',
                                      'valueType' => 'char'
                                    }
                                  ],
                 'timestamp' => 1221756118,
                 'adminList' => [],
                 'type' => 'pack',
                 'groupList' => {},
                 'referenceList' => [
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32783,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32793,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32784,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32785,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'permittedGroups' => [],
                                        'value_dataType' => 'null',
                                        'value' => undef,
                                        'dataType' => 1,
                                        'type' => 32801,
                                        'label' => '',
                                        'description' => ''
                                      },
                                      {
                                        'dataType' => 0,
                                        'name' =>
'20080527-CherylConversionFormChanges',
                                        'type' => 6,
                                        'label' => '',
                                        'description' => ''
                                      }
                                    ]
               };

The only difference I can see is the order of the last two elements...I
don't see why that would be important, but it may be.  Your assistance is
appreciated.

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thilo Stapff
Sent: Thursday, September 18, 2008 3:20 AM
To: ARSperl User Discussion
Subject: Re: [Arsperl-users] ars_CreateContainer

You might try the following:

- create a packing list in the Admin Tool
- read the Object via ars_GetContainer
- print the resulting data structure with Data::Dumper
- use the output as a template for your packing list

This should work because usually the structure for the ars_Create... 
functions is the same as returned from the ars_Get... functions.

Here's a code snippet:


my $packingList = ars_GetContainer( $ctrl, $packingListName );

die "ars_GetContainer($packingListName): $ars_errstr\n" if $ars_errstr;


use Data::Dumper;
print Data::Dumper->Dump( [$packingList], ['packingList'] );



Regards,
Thilo Stapff



LJ Longwing wrote:
> Hey...I'm new to this list...so please go easy on me.
> 
> ARS 7.1 Patch 2
> ARSPerl 1.90
> ActivePerl-5.8.8.819
> Windows 2003
> 
> I've been using ARSPerl for quite some time, but mainly the client 
> functions.  I'm writing a script with the intention of taking 2 
> packing list names, determining if one of them exists, if not, create 
> it, if it does I want to add the contents of pl1 to pl2 and update to the
server.
> I've been using the Java 7.1 API and have done this there...but I 
> don't want to write an entire program and hafta call it from my perl 
> script to get this done.  I have successfully used ars_GetContainer, 
> and determined if pl2 exists on the server, I'm at the point where I'm 
> trying to create a new container and can't find ANY good documentation 
> about how to create the hash in question.  Any and all help is 
> appreciated, most preferable of course would be a snippet of code that 
> would create a 'blank' packing list.
> 
> Thanks for your time.
> 
> 
> ----------------------------------------------------------------------
> --
> 
> ----------------------------------------------------------------------
> --- This SF.Net email is sponsored by the Moblin Your Move Developer's 
> challenge Build the coolest Linux based applications with Moblin SDK & 
> win great prizes Grand prize is a trip for two to an Open Source event 
> anywhere in the world 
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ----------------------------------------------------------------------
> --
> 
> 
> 
> --
> Arsperl-users mailing list
> Arsperl-users@arsperl.org
> https://lists.sourceforge.net/lists/listinfo/arsperl-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes Grand prize is a trip for two to an Open Source event anywhere in the
world http://moblin-contest.org/redirect.php?banner_id=100&url=/


--
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


--
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users

Reply via email to