Siebel::Integration::Com::PropSet - Abstraction of Siebel Property Set
use Siebel::Integration::Com; my $sa = Siebel::Integration::Com->new( ConnectionType=>'Thick', UserName=>$inputs{user}, PassWord=>$inputs{pass}, CFG=>$inputs{cfg}, DataSource=>$inputs{DataSource} ); my $PS = $sa->NewPropertySet(); if($PS->Error ne ''){ die print "Error creating Prop Set: " . $PS->Error; } my $ChildPS = $sa->NewPropertySet(); if($ChildPS->Error ne ''){ die print "Error creating Prop Set: " . $ChildPS->Error; } $PS->SetType('PropSetType'); $PS->SetValue('PropSetValue'); $PS->SetProperty('Prop1', "This is Prop1's value"); $PS->SetProperty('Prop2', "This is Prop2's value"); $ChildPS->SetProperty('ChildProp1', "This is ChildProp1's value"); $ChildPS->SetProperty('ChildProp2', "This is ChildProp2's value"); $PS->AddChild($ChildPS); #Print Prop Set details print "Parent Level PS has " . $PS->GetPropertyCount() . " properties\n"; print "Parent Level PS has " . $PS->GetChildCount() . " child\n"; print "Parent Level PS has a type of " . $PS->GetType() . "\n"; print "Parent Level PS has a value of " . $PS->GetValue() . "\n"; if(my $Prop = $PS->GetFirstProperty()){ do{ print $Prop . '=>' . $PS->GetProperty($Prop) . "\n"; }while($Prop = $PS->GetNextProperty()); }else{ print "No properties found, something is wrong."; } my $PSGetChild = $PS->GetChild(0); if($PSGetChild->Error ne ''){ die print "Error GetChild at index 0: " . $PSGetChild->Error; } if(my $Prop = $PSGetChild->GetFirstProperty()){ do{ print "\t" . $Prop . '=>' . $PSGetChild->GetProperty($Prop) . "\n"; }while($Prop = $PSGetChild->GetNextProperty()); }else{ print "No properties found in child, something is wrong."; } #prints #Parent Level PS has 2 properties #Parent Level PS has 1 child #Parent Level PS has a type of PropSetType #Parent Level PS has a value of PropSetValue #Prop2=>This is Prop2's value #Prop1=>This is Prop1's value # ChildProp1=>This is ChildProp1's value # ChildProp2=>This is ChildProp2's value #a simpler way of dumping property sets is with these 2 methods. These methods will also get all children and grandchildren and so on print $PS->ToXML(); print $PS->ToText(); #remove a property by name $PS->RemoveProperty('Prop1'); #remove a child PS by index $PS->RemoveChild(0);
The Siebel::Integration::Com modules are designed to remove the different method calls and error checking between the COM Data Control and COM Data Server interfaces. Changing between the two interfaces only requires a change in the parameters to Siebel::Integration::Com->new() rather than a rewrite of all calls. Beyond just replicating the base functions of the interfaces it is hoped that additional methods will be added to these modules to extend the functionality provided by the Siebel COM framework.
All methods that have been exposed keep the same names so there is no additional learning curve, you can program in Perl using the same method names as eScript
Returns the error text for the last operation, returns '' if no error.
Returns the number of Properties
Returns the first properties name or ''
Returns the next properties name or ''
Returns the value of the type attribute of a property set or ''
Returns the value of the value attribute of a property set or ''
Returns the value of the property, if property does not exist will return ''
Returns 0 (false) or 1 (true)
Returns 1 for success or undef for failure. A failure will set PS->Error
Returns the number of child property sets
Returns a new Siebel::Integration::Com::PropSet object containing the Siebel property set at the specified index Returns undef on failure and sets PS->Error
Takes a Siebel::Integration::Com::PropSet or a raw Siebel property set Returns the index of the child property set Returns undef on failure and sets PS->Error
Returns a new Siebel::Integration::Com::PropSet object containing a duplicated Siebel propery set. Returns undef on failure and sets PS->Error
Clears all Siebel property set data from the object. Returns 1 for success. Returns undef on failure and sets PS->Error
Sets the value for the type attribute of a property set Returns 1 for success. Returns undef on failure and sets PS->Error
Sets the value for the value attribute of a property set Returns 1 for success. Returns undef on failure and sets PS->Error
Inserts a child property set in a parent property set at a specific location Returns 1 on success Returns undef on failure and sets PS->Error
Removes a child property set from a parent property set Returns 1 on success Returns undef on failure and sets PS->Error
Removes a property from a property set Returns 1 on success Returns undef on failure and sets PS->Error
The current connection type Thin or Thick
Only called internally from Siebel::Integration::Com NewPropertySet() Returns a Siebel::Integration::Com::PropSet Sets PS->Error if an error occurs
Returns the property set in XML Example result: <PropertySet type='PropSetType' value='PropSetValue'> <Prop2>This is Prop2's value</Prop2> <Prop1>This is Prop1's value</Prop1> <PropertySet0> <ChildProp1>This is ChildProp1's value</ChildProp1> <ChildProp2>This is ChildProp2's value</ChildProp2> <PropertySet0> <GChildProp2>This is GChildProp2's value</GChildProp2> <GChildProp3>This is GChildProp3's value</GChildProp3> <GChildProp4>This is GChildProp4's value</GChildProp4> <GChildProp1>This is GChildProp1's value</GChildProp1> </PropertySet0> </PropertySet0> <PropertySet1> <Child2Prop1>This is Child2Prop1's value</Child2Prop1> <Child2Prop2>This is Child2Prop2's value</Child2Prop2> </PropertySet1> </PropertySet>
Returns the property set as text Example result: Property Set Type => PropSetType Property Set Value => PropSetValue -------------------------------------------------- Prop2=>This is Prop2's value Prop1=>This is Prop1's value -------------------------------------------------- ChildProp1=>This is ChildProp1's value ChildProp2=>This is ChildProp2's value -------------------------------------------------- GChildProp2=>This is GChildProp2's value GChildProp3=>This is GChildProp3's value GChildProp4=>This is GChildProp4's value GChildProp1=>This is GChildProp1's value -------------------------------------------------- Child2Prop1=>This is Child2Prop1's value Child2Prop2=>This is Child2Prop2's value
See Siebel::Integration::Com
The documentation for Siebel::Integration::Com contains additional information
Oracle Help Property Set Methods
Kyle Mathers, <kyle.perl at mathersit.com>
<kyle.perl at mathersit.com>
The same as Siebel::Integration::Com
Version 0.02 March 2013
To install Siebel::Integration::Com, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Siebel::Integration::Com
CPAN shell
perl -MCPAN -e shell install Siebel::Integration::Com
For more information on module installation, please visit the detailed CPAN module installation guide.