Mindoo Blog - Cutting edge technologies - About Java, Lotus Notes and iPhone

  • Display all allowed readers of documents in a view column

    Karsten Lehmann  March 6 2018 16:19:03
    By setting the programmatic column name and formula value of a view column to "$C1$", the column automatically displays the content of all reader items in the document.

    If there are any readers, the column also container the author item values, since these are also allowed to see read-restricted documents.

    Image:Display all allowed readers of documents in a view column

    Image:Display all allowed readers of documents in a view column

    "$C1$" is a special column value that the NIF indexer sends to the NSF Search command in the C API to let it compute read access. This information is stored in the view index and compared to the current user's NAMES_LIST (list of name wildcards, groups and roles) on view access (case-insensitive).
    To use this in your own C code, some more work is required. You don't pass a compiled selection formula to NSFSearch, but a view formula, which is the selection formula merged with all view column formulas (NSFFormulaSummaryItem).

    Of course this is not documented anywhere in the C API, that such a view formula can be passed to NSFSearch, same for the special value "$C1$". ;-)

    In addition, you need to pass the constant


    to the NSF Search, which tells it to not return the whole note summary buffer for each search match (ITEM_TABLE structure), but just the values specified as columns in the view formula in their order, which makes the search a lot faster.

    Too difficult? No problem. Domino JNA to the rescue. This NSF search is the base of our incremental Domino data sync.

    So effectively, we do (almost) index Domino data like NIF, but with different target system. If not all information is available via summary items, the sync code can provide access to the document as well.

    There's code to sync Domino data with the CQEngine indexer and an SQLite database. The two projects contain testcases to demonstrate the syntax.