Home » DataWarrior » Functionality » FlyingObjects.dwar's picture and description fields (How to create a visualization like flyingobjects.dwar?)
Re: FlyingObjects.dwar's picture and description fields [message #306 is a reply to message #304] Sun, 04 February 2018 19:54 Go to previous messageGo to previous message
thomas is currently offline  thomas
Messages: 684
Registered: June 2014
Senior Member
There is not official explanation and there is no direct way from DataWarrior to import images or html content.

But you can do that with a little editing of the dwar file in a text editor.

Lets assume you intend to add html and jpeg files to a column named 'Name'. You start with:
-a dwar file without any associated html or jpeg content.
-a folder with html files and one with jpeg files, both to be associated with the rows of the dwar file.

First you need to define one of the dwar's columns to carry the detail information.
This is done by defining column properties. Lets assume you want to add the detail links to
a column called 'Name'. For that you need to extend the column properties section, if there is one.
Otherwise you create a new one just after the </datawarrior-fileinfo> line. For that you add these lines:
<column properties>
<columnProperty="detailCount 2">
<columnProperty="detailType0 image/jpeg">
<columnProperty="detailName0 Picture">
<columnProperty="detailSource0 relPath:images/">
<columnProperty="detailName1 Description">
<columnProperty="detailType1 text/html">
<columnProperty="detailSource1 relPath:html/">
</column properties>

These lines define for the column 'Name' two detail types (indicated by '0' and '1'):
- mime type 'image/jpeg' with the name 'Picture' to be found in a directory 'images'
- mime type 'text/html' with the name 'Description' to be found in a directory 'html'
Likewise you might use 'absPath' to define a complate detail directory path rather than a relative path from the dwar file.

Now you may concatenate detail file references to the respective cell content of the 'Name' column.
For instance you may add to a cell containing the name 'Aermacchi' the following: '|#|0:aermacchi.jpg|#|1:aermacchi.html'.
'|#|' serves as separator. Then comes a number (here 0 or 1) referring to the detail number in the properties section.
After the columns comes the detail file name. It must reflect the defined mime type.

If you open the updated dwar file in DataWarrior, if will show you the detail information. You may
the save the file under a different name and DataWarrior will ask you, whether the detail shall
be imported directly into the dwar file. If you do so, the directories with the individual files are not needed anymore.

I hope, I was clear and this solves your question...


[Updated on: Sun, 04 February 2018 19:55]

Report message to a moderator

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: feature suggest: array cleaning by delete button
Next Topic: Generate Explanation view based on the data from table
Goto Forum:

Current Time: Wed Jul 24 16:51:32 CEST 2024

Total time taken to generate the page: 0.03177 seconds