I tried several syntaxes to create an index based on file metadata but without success.
The index is always empty. What I do wrong?
{{ document.file_metadata_value_of.FileType }}
The file metadata manager shows the Key "FileType" in all files.
Mayan EDMS Index Reference
Re: Mayan EDMS index reference post
Is 'FileType' your metadata type 'Internal Name'?
Here is one of mine:
{{ document.metadata_value_of.department_en }}
Note no 'file_'
Sim
Here is one of mine:
{{ document.metadata_value_of.department_en }}
Note no 'file_'
Sim
Re: Mayan EDMS index reference post
To access the file metadata you also need to specify the internal name of the driver because multiple drivers can return information for a single document.
To access the FileType value from the EXIFTool driver (the default), use:
{{ document.file_metadata_value_of.exiftool_FileType }}
To access the FileType value from the EXIFTool driver (the default), use:
{{ document.file_metadata_value_of.exiftool_FileType }}
Re: Mayan EDMS index reference post
Oh interesting, didn't know there were different drivers. Are there docs on this?
Re: Mayan EDMS index reference post
@rosarior: Can be so easy...Thanks a lot!
Re: Mayan EDMS index reference post
Is there a way to view Django template errors or get some troubleshooting output when index templates fail to produce the desired results? They aren't in the docker logs output and I cannot find them in the menus...
It's very frustrating to play "guess the problem" with a moderately complex index template.
Example:
Fairly straight forward fiscal year calculation (possibly from metadata *or* file metadata). Produces no documents, but it's not possible to tell why. If there's no errors in the template, then at worst all the documents should show up under "Unknown"...
Is there a better way to test for the existance of optional metadata? Is there another template problem? It's very difficult to track down these sorts of issues.
It's very frustrating to play "guess the problem" with a moderately complex index template.
Example:
Code: Select all
{% if document.metadata_value_of.date_issued %}
{% if document.metadata_value_of.date_issued|slice:"5:7" in '10,11,12' %}
FY{{ document.metadata_value_of.date_issued|slice:":4"|add:"1" }}
{% elif document.metadata_value_of.date_issued|slice:"5:7" in '01,02,03,04,05,06,07,08,09' %}
FY{{ document.metadata_value_of.date_issued|slice:":4" }}
{% else %}
Unknown
{% endif %}
{% elif document.file_metadata_value_of.ModifyDate %}
{% if document.file_metadata_value_of.ModifyDate|slice:"5:7" in '10,11,12' %}
FY{{ document.file_metadata_value_of.exiftool_ModifyDate|slice:":4"|add:"1" }}
{% elif document.file_metadata_value_of.exiftool_ModifyDate|slice:"5:7" in '01,02,03,04,05,06,07,08,09' %}
FY{{ document.file_metadata_value_of.exiftool_ModifyDate|slice:":4" }}
{% else %}
Unknown
{% endif %}
{% else %}
Unknown
{% endif %}
Is there a better way to test for the existance of optional metadata? Is there another template problem? It's very difficult to track down these sorts of issues.
Re: Mayan EDMS index reference post
Hi, thanks for making this great software. I am quite new to it and i only try to use if for a small amount of private documents, but i have already learned a lot.
However one thing that i could not figure out yet but which would be very helpful for me:
Is it possible to index documents which are in sub-cabinets of a certain cabinet?
example cabinet Structure:
|
--- Insurance
------Type 1
---------Vendor A
---------Vendor B
------Type 2
---------Vendor A
---------Vendor B
--- other cabinets
Is it possible to get an index of all the documents from the sub-cabinets of only Type 1 ? Or even all documents in sub-sub-cabinets of Insurance?
I hope my question is clear enough.
Kind Regards,
Ralf
However one thing that i could not figure out yet but which would be very helpful for me:
Is it possible to index documents which are in sub-cabinets of a certain cabinet?
example cabinet Structure:
|
--- Insurance
------Type 1
---------Vendor A
---------Vendor B
------Type 2
---------Vendor A
---------Vendor B
--- other cabinets
Is it possible to get an index of all the documents from the sub-cabinets of only Type 1 ? Or even all documents in sub-sub-cabinets of Insurance?
I hope my question is clear enough.
Kind Regards,
Ralf
-
- 50 Posts
- Posts: 89
- Joined: Wed Aug 22, 2018 2:52 pm
Re: Mayan EDMS index reference post
Hi Ralf,
you might be able to use the "document.cabinets" function in conjunction with this code:
The above creates a nested cabinets kind of index, maybe in the initial "if" statement you can pick out the Insurance cabinet.
I shall have a play with this and see if I can work out how this would work and get back to you... if you found a solution, then let me know
Kevin
you might be able to use the "document.cabinets" function in conjunction with this code:
Code: Select all
{% if document.cabinets.count == 0 %} None
{% else %}
{% for cab in document.cabinets.all %}
{{ cab.label }}
{% endfor %}
{% endif %}
I shall have a play with this and see if I can work out how this would work and get back to you... if you found a solution, then let me know

Kevin
Running Mayan-EDMS on: OpenMediaVault, (Docker plugin), on x86 dual-core
Re: Mayan EDMS index reference post
Hi Kevin,
unfortunately i could not figure out how to get informations about the parent cabinets or full cabinet path using document.cabinets for indexing.
My workaround at the moment: I use the rest api to write the cabinet path into a meta data field, and that meta data field is then used for the indexing.
But i am still interested if there is a better solution.
Ralf
unfortunately i could not figure out how to get informations about the parent cabinets or full cabinet path using document.cabinets for indexing.
My workaround at the moment: I use the rest api to write the cabinet path into a meta data field, and that meta data field is then used for the indexing.
But i am still interested if there is a better solution.
Ralf
Re: Mayan EDMS Index Reference
Dear Kevin
THANKS! THANKS! THANKS!
Your first posts with the reference are what I was looking for. Now I have a first index that is working. Thank you so much!
THANKS! THANKS! THANKS!
Your first posts with the reference are what I was looking for. Now I have a first index that is working. Thank you so much!