- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Updating or Deleting Column Headings in a List with Perl doesn't appear to be possible
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-16-2018 01:23 AM
I have successfully created a Perl script to work with Configuration Lists that link network services to VLANS (via VRF).
I can successfully create a List using Perl using $broker->create({'name'=> 'list name', 'description'=> 'list description;});
However this creates 2 default columns, 'New Column 1' and 'New Column 2'.
Looking at the Perl API - both the document and the ConfigList.pm file - there doesn't appear to be any way of deleting the default columns or at least updating the column headings - either of which will work for me.
Does anyone have any ideas on this? Is this an omission from the API or is there any other way of doing this?
The purpose of the script is to run automatically with no intervention - so dont want the users getting involved.
I guess that, since the creation of the list is a one off task, I can live with the manual deletion task for now, but would be good if I can resolve this.
Thanks
Russ
Solved! Go to Solution.
Re: Updating or Deleting Column Headings in a List with Perl doesn't appear to be possible
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-16-2018 05:58 AM
Let's open a ticket for it so they can file it as an RFE/BUG.
You can use the Import method for now
$broker->import( \%inputs ) This method will create or replace a list with input from a CSV file. INPUTS file: Required String The file with the list data to be imported overwrite_ind: Optional Integer An indicator to overwrite an existing list file with the same name. Overwrite if set to 1. Do not overwrite if set to 0
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Updating or Deleting Column Headings in a List with Perl doesn't appear to be possible
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-16-2018 12:08 PM
Thanks Sif,
Will give this import a go - not used this one yet. Fairly easy to do - well creating the file is. I assume the file to import includes a path to the file stored on the Sandbox on the collector that that is responsible for the device.
With regards to the RFE/Bug, do you want me to raise it as part of my support contract? Happy to do.
Regards
Russ
Re: Updating or Deleting Column Headings in a List with Perl doesn't appear to be possible
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-16-2018 01:28 PM
Yes please open a Ticket, the list will live on the OC, not the Collectors, so you should be good.
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Updating or Deleting Column Headings in a List with Perl doesn't appear to be possible
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-21-2018 05:41 AM
<?php // no direct access defined ('_JEXEC') or die; class plgContentExample extends JPlugin { /** * Load the language file on instantiation. * Note this is only available in Joomla 3.1 and higher. * If you want to support 3.0 series you must override the constructor * * @var boolean * @since <your version> */ protected $autoloadLanguage = true; /** * Prepare form and add my field. * * @param JForm $form The form to be altered. * @param mixed $data The associated data for the form. * * @return boolean * * @since <your version> */ function onContentPrepareForm($form, $data) { $app = JFactory::getApplication(); $option = $app->input->get('option'); switch($option) { case 'com_contact' : if ($app->isAdmin()) { JForm::addFormPath(__DIR__ . '/forms'); $form->loadFile('contact', false); } return true; } return true; } } ?>
Try this code.
Best regards,
Denise D Walker