Page 2 of 2

Re: Mayan EDMS index reference post

Posted: Sun Aug 04, 2019 6:24 pm
by ulli
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.

Re: Mayan EDMS index reference post

Posted: Mon Aug 05, 2019 7:54 am
by simeon
Is 'FileType' your metadata type 'Internal Name'?

Here is one of mine:

{{ document.metadata_value_of.department_en }}

Note no 'file_'

Sim

Re: Mayan EDMS index reference post

Posted: Tue Aug 06, 2019 5:19 am
by rosarior
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 }}

Re: Mayan EDMS index reference post

Posted: Tue Aug 06, 2019 8:02 am
by simeon
Oh interesting, didn't know there were different drivers. Are there docs on this?

Re: Mayan EDMS index reference post

Posted: Tue Aug 06, 2019 7:39 pm
by ulli
@rosarior: Can be so easy...Thanks a lot!

Re: Mayan EDMS index reference post

Posted: Thu Aug 08, 2019 7:53 pm
by monadnock
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:

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 %}
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.

Re: Mayan EDMS index reference post

Posted: Thu Sep 12, 2019 9:56 am
by Ralf
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

Re: Mayan EDMS index reference post

Posted: Thu Sep 26, 2019 10:04 am
by KevinPawsey
Hi Ralf,

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 %}
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

Re: Mayan EDMS index reference post

Posted: Sat Sep 28, 2019 1:18 pm
by Ralf
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