[librecat-dev] unable to import departments using documented methods

Jonathan NORRIS jnorris at ist.ac.at
Wed Jan 31 14:10:11 CET 2018


Hello,

I am trying to import departments into librecat using the methods 
documented here: 
https://github.com/LibreCat/LibreCat/wiki/Import-Departments

First I tried using the 'tree' method but it did not work. My yaml 
syntax looks good and I even tried to do an import of the example in the 
documentation:

|# Tree.yml --- tree: GUK: name: Global Campus Korea display: Global 
Campus Korea (GUK) tree: KR01: name: Department of Environmental 
Technology, Food Technology and Molecular Biotechnology display: 
Department of Environmental Technology, Food Technology and Molecular 
Biotechnology (KR01) KR71: name: Admissions and enrollment office 
display: Admissions and enrollment office (KR71) KR73: name: Recruitment 
office display: Recruitment office (KR73) ... |||

||I added the above to a file called test_import.yml and ran 
'bin/librecat department tree /path/to/test_import.yml', but nothing was 
imported.

Looking into the code, in 'LibreCat/Cmd/department.pm':

     from line 150, in sub _tree_parse:

         my $importer = Catmandu->importer('YAML', file => $file);
         my $HASH     = $importer->first;
         my $helper   = LibreCat::App::Helper::Helpers->new;

         print "$HASH \n";

||

My print statement gives the error: Use of uninitialized value $HASH in 
concatenation (.) or string

So the problem seems to be in the Catmandu importer, but I don't know 
were to begin looking for the problem in there.


Second I tried importing using the other format:

|--- _id: KR73 name: Recruitment office display: Recruitment office 
(KR73) layer: 2 tree: - _id: GUK ...|


I tried this:

     ---
     _id: IST
     name: IST Austria
     display: IST Austria
     layer: 1
     ---
     _id: Barton
     name: Barton
     display: Barton Group
     layer: 2
     tree:
       - _id: IST
     ...

But only the Barton group is inserted and I get this message:

     IST
     ERROR: not a valid department
     /tree: Missing property.
     added Barton

And in the interface Barton is under a node named '0'.

I've tried a lot of different variations of the format above trying to 
have IST as my root node with Barton underneath it but could not achieve 
this, I could only get them to exist at the same level or to both exist 
under two separate nodes called '0'.

I would have thought you would need no 'tree' attribute when defining a 
root note but I get the 'missing property' error whenever it is left out.


Can anyone give me some advice on what to do here? It would be great if 
the 'tree' import worked as I already have a full representation of our 
organization in this format.

Thanks,
Jonathan Norris,
IST Austria


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20180131/d6685f42/attachment.html>


More information about the librecat-dev mailing list