Document Navigation/Views

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
sam.jenkins
Posts: 4
Joined: Fri May 31, 2019 1:13 pm

Document Navigation/Views

Post by sam.jenkins » Tue Jun 04, 2019 8:35 am

Hi All,

I'm trialing Mayan for hosting project documents for a number of teams in our office.

I'd like to give general (non-technical) users an easy to use interface to browse and find documents. Ideally i'd like a tree view, so either Cabinets or Indexes but neither have the option to search or filter.

Has anyone had any experience implementing Mayan in this kind of environment? Did you just use the APIs to create your own custom front end?

Thanks

Krzysztof
Posts: 11
Joined: Wed Aug 22, 2018 11:28 am

Re: Document Navigation/Views

Post by Krzysztof » Wed Jun 05, 2019 1:01 pm

Sam,

I've made some modifications in the Cabinets view that may interest you:
/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/cabinets/templates/cabinets/cabinet_details.html
  • added the 'Search' jsTree plugin
  • more space for the folder tree on a screen
  • the description of the tree changed to 'Filing Structure'

Code: Select all

{% extends 'appearance/base.html' %}

{% load i18n %}
{% load static %}

{% load navigation_tags %}

{% block title %}{% include 'appearance/calculate_form_title.html' with non_html_title=True %}{% endblock %}

{% block stylesheets %}
    <link rel="stylesheet" href="{% static 'cabinets/packages/jstree/dist/themes/default/style.min.css' %}" />
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
            <h4>{% trans 'Filing Structure:' %}</h4>
            <input class="search-input form-control">
            <div class="jstree"></div>
        </div>

        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-8">
            {% if list_as_items %}
                {% include 'appearance/generic_list_items_subtemplate.html' %}
            {% else %}
                {% include 'appearance/generic_list_subtemplate.html' %}
            {% endif %}
        </div>
    </div>
{% endblock %}

{% block javascript %}
    <script>
        $.getScript( "{% static 'cabinets/packages/jstree/dist/jstree.min.js' %}" )
            .done(function( script, textStatus ) {
            $(function () {
                var jstreeElement = $('.jstree');

                jstreeElement
                    .on('select_node.jstree', function (e, data) {
                        if(data.selected.length) {
                            partialNavigation.setLocation(data.instance.get_node(data.selected[0]).data.href);
                        }
                    })
                    .jstree({
                        "plugins" : ["search"],
                        "search": {
                            "case_insensitive": true,
                            "show_only_matches" : true
                        },
                        'core' : {
                            "check_callback" : true,
                            'data' : [
                                {{ jstree_data|safe }}

                            ],
                            'themes' : {
                                'responsive' : true,
                            }
                        },
                    });

                    $(".search-input").keyup(function() {
                        var searchString = $(this).val();
                        console.log(searchString);
                        $('.jstree').jstree('search', searchString);
                    });
                    
                });
            });
    </script>listlij
{% endblock %}
/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/cabinets/widgets.py
  • close the folders tree at the beginning

Code: Select all

    result.append(
        '"state": {{ "closed": true, "selected": {} }},'.format(
            'true' if node == selected_node else 'false'
        )
    )
/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/cabinets/views.py
  • displaying the contents of folders in rows

Code: Select all

'list_as_items': False,
For me, the automatic Indexing is definitely a better solution for cataloging than the Cabinets.

Regards,
Krzysztof

User avatar
rosarior
Posts: 340
Joined: Tue Aug 21, 2018 3:28 am

Re: Document Navigation/Views

Post by rosarior » Wed Jun 05, 2019 5:12 pm

As @Krzysztof shows, you can customize the templates easily in-place or you can write a skeleton app that only overrides the templates. This last method allows keeping you changes even if when you upgrade (https://docs.mayan-edms.com/topics/deve ... p-creation).

An API client is the way to if you want a 100% custom UI: https://docs.mayan-edms.com/topics/integration.html

Index mirroring was created for your use case. It allows experienced users to craft indexes and then these are exported as a filesystem which can be shared over the network as a network drive for less experienced user. As a mounted drive, all the OS features are available like search and filtering: https://docs.mayan-edms.com/topics/cate ... #mirroring

We are discussing adding mirroring to cabinets too in a future version.

User avatar
rosarior
Posts: 340
Joined: Tue Aug 21, 2018 3:28 am

Re: Document Navigation/Views

Post by rosarior » Wed Jun 05, 2019 5:14 pm

Cabinets and Indexes are almost the same. The main difference is that Indexes are automatically build based on a template system. Cabinet are completely manual. Cabinets were added by user request for those looking to replicate a file explorer setup but in the long run are not feasible as document count increases. That is why we emphasize on learning to make your own Indexes and smart links, they will save you a lot of time in the later stages of your project.

sam.jenkins
Posts: 4
Joined: Fri May 31, 2019 1:13 pm

Re: Document Navigation/Views

Post by sam.jenkins » Thu Jun 06, 2019 8:33 am

Thanks both for your reply's.

I'm on board with Indexing and trying to derive a process that will allow us to Index correctly. I've tried creating a top level Index based on Cabinets but I've come across an issue that I reported in GitLab here: https://gitlab.com/mayan-edms/mayan-edms/issues/596

If I cant use Cabinets for this purpose then i suppose the other way would be to tag each document and use tags to generate the Indexes? This could mean lots of tags for each document but I don't suppose this is an issue.

I've also taken a look at the FUSE file system, i'm running in Docker so i'll need to give this a bit more time. Can you confirm where any user permissions are applied to the FUSE file systems? Or can anyone access the mirrored Index files?

Post Reply