Most of the value of a relational database is in the relations and much of the value of iTop resides in the relationships between objects, many of which are managed through LinketSets and LinketSetsIndirect. I load much data via CLI and have noted the way to load some of the linked sets from CSV using the Key->Name:value | etc. format in Excel CSV columns. This works on import but I have the following two major issues:
Imports do not work on blobs. Filenames are loaded as strings and the referenced files are not accessed nor is file data loaded into the database. It seems like pages/csvimport.php needs to be modified to support blob imports.
There is no way I can find to export (either as XLS or CSV) linked sets. Looking at a object presentation detail clicking on the tab for a linked set (e.g. fci_list) gives the list of class objects linked and the icon for export options appears; however clicking on export as Excel or CSV is a NOP - nothing occurs. Likewise you can execute a OQL Query to SELECT lnkWhatever and obtain a list with the same export icon but again clicking on Export Excel or CSV does nothing. So I assume that the export functions for linked sets are not coded.
I consider this a serious defect in iTop and would like to see it fixed, or if a fix exists would appreciate someone pointing me to the proper location.
Last edit: APO 2018-01-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello APO,
It is supposed to be possible to export Linkedset.
Nevertheless there is a known issue with that feature, it does not work when one side of the relationship is an abstract class with no reconciliation key defined. In version 2.3.x d'iTop, any relationship with Documents class for eg cannot be exported, unless fixing that Datamodel issue with a customization or directly patching that part of the XML. This issue is fixed in the standard datamodel 2.4.0.
There might be an existing Ticket or discussion about this already.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you vdumas. I have looked at that particular reference multiple times. IT says that the URL must be provided in the CSV in the appropriate column but gives not guidance whatsoever as to how to structure the 'appropirate column'. I have tried multiple aproaches. For a DocumentFile object there is a File column so I structure a column named FIle with entries such as
File->mimetype:application/PDF|File->filename:"some part/filename.pdf". Clearly I can't place data in the third specification: File->filedata.
What happens is that the File->filename is loaded as [ text/plain, size: 65 byte(s) ] with no reference to the actual path/filename and wrong minetype. I haven;t found a permutation which works yet. I haven't tried to load pictures yet for Person objects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tested this for uploading an AttributeImage and you just need to provide a URL.
I have not tried to load Document, but I would try the same logic, just provide a url in the column called File of your CSV import file of FileDocument
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes vdumas,
I have exported in both CSV and Excel formats and the resultant spreadsheets do not have ANY colum headers related to File (mimetype, filename or filedata). I will try a URL to the same host as iTop running on. I actually have the documents stored there for notional import into the database.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Vdumas,
Placed filename as "/home/name/source/pdffiles/specific.pdf" in File column and imported. Mapping places data in correct field in interactive CSV load. After load, detail shows File as [ text/plain, size: 49 byte(s) ] and in preview tab area, shows "/home/name/source/pdffiles/specific.pdf". Going to try without " but I think that I have done this before. Thanks for responding.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the CSV column header File, the result is the same as above. With the CSV column header as File->filename, the simulation column header shows File with same result as above. I.e. File is replaced by [text/plain, size:49]. Never loads file. Permissions are all ok on file directory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Most of the value of a relational database is in the relations and much of the value of iTop resides in the relationships between objects, many of which are managed through LinketSets and LinketSetsIndirect. I load much data via CLI and have noted the way to load some of the linked sets from CSV using the Key->Name:value | etc. format in Excel CSV columns. This works on import but I have the following two major issues:
Imports do not work on blobs. Filenames are loaded as strings and the referenced files are not accessed nor is file data loaded into the database. It seems like pages/csvimport.php needs to be modified to support blob imports.
There is no way I can find to export (either as XLS or CSV) linked sets. Looking at a object presentation detail clicking on the tab for a linked set (e.g. fci_list) gives the list of class objects linked and the icon for export options appears; however clicking on export as Excel or CSV is a NOP - nothing occurs. Likewise you can execute a OQL Query to SELECT lnkWhatever and obtain a list with the same export icon but again clicking on Export Excel or CSV does nothing. So I assume that the export functions for linked sets are not coded.
I consider this a serious defect in iTop and would like to see it fixed, or if a fix exists would appreciate someone pointing me to the proper location.
Last edit: APO 2018-01-20
Hello APO,
It is supposed to be possible to export Linkedset.
Nevertheless there is a known issue with that feature, it does not work when one side of the relationship is an abstract class with no reconciliation key defined. In version 2.3.x d'iTop, any relationship with Documents class for eg cannot be exported, unless fixing that Datamodel issue with a customization or directly patching that part of the XML. This issue is fixed in the standard datamodel 2.4.0.
There might be an existing Ticket or discussion about this already.
By the way the 2.4.0 version also introduce the possibility to CSV import files and images:
https://wiki.openitop.org/doku.php?id=2_4_0:advancedtopics:importcli#importing_images_and_files
Thank you vdumas. I have looked at that particular reference multiple times. IT says that the URL must be provided in the CSV in the appropriate column but gives not guidance whatsoever as to how to structure the 'appropirate column'. I have tried multiple aproaches. For a DocumentFile object there is a File column so I structure a column named FIle with entries such as
File->mimetype:application/PDF|File->filename:"some part/filename.pdf". Clearly I can't place data in the third specification: File->filedata.
What happens is that the File->filename is loaded as [ text/plain, size: 65 byte(s) ] with no reference to the actual path/filename and wrong minetype. I haven;t found a permutation which works yet. I haven't tried to load pictures yet for Person objects.
Have you tried a CSV export, that's the best way to see what the import is expecting in terms of format.
I have tested this for uploading an AttributeImage and you just need to provide a URL.
I have not tried to load Document, but I would try the same logic, just provide a url in the column called File of your CSV import file of FileDocument
Yes vdumas,
I have exported in both CSV and Excel formats and the resultant spreadsheets do not have ANY colum headers related to File (mimetype, filename or filedata). I will try a URL to the same host as iTop running on. I actually have the documents stored there for notional import into the database.
Vdumas,
Placed filename as "/home/name/source/pdffiles/specific.pdf" in File column and imported. Mapping places data in correct field in interactive CSV load. After load, detail shows File as [ text/plain, size: 49 byte(s) ] and in preview tab area, shows "/home/name/source/pdffiles/specific.pdf". Going to try without " but I think that I have done this before. Thanks for responding.
There is a column called "File" which contain a url (its not selected by default), on my itop this returns for a DocumentFile:
http://192.168.56.102/pro2.4.1-3645/pages/ajax.document.php?operation=download_document&class=DocumentFile&id=1&field=file&s=4f280d91c8b295646cbfd371d417fa5f&cache=86400
that url is internal to iTop, but for importing, it does not have to be an iTop internal url, as long as the url is accessible from the iTop webserveur and not password protected.
Vdumas,
With the CSV column header File, the result is the same as above. With the CSV column header as File->filename, the simulation column header shows File with same result as above. I.e. File is replaced by [text/plain, size:49]. Never loads file. Permissions are all ok on file directory.