Skip to content

Instantly share code, notes, and snippets.

View klehmann's full-sized avatar

Karsten Lehmann klehmann

View GitHub Profile
@klehmann
klehmann / virtualviews_features.md
Last active July 11, 2024 10:44
Domino JNA Virtual Views - Feature list

Domino JNA Virtual Views - Feature List

  • multi-DB views
  • view structure similar to Domino (multi level categorization, sorted columns)
  • support for sums / average values
  • compute column values via formula or Java code
  • incremental view updates, so no rebuilt required
  • full control when the view is updated, optional read locks to have exclusive access
  • view is populated by the server, shared across users
  • for each user we check which view entries the user is allowed to see (checks DB ACL level and compares user names list for each DB with computed list of document readers list)
  • for category entries we accumulate the readers of all descendant docs to quickly skip categories that would be empty for a user
package com.mindoo.domino.virtualviewtest;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@klehmann
klehmann / ViewLookupExample.java
Created April 29, 2024 11:37
View lookup and conversion of column values
package com.mindoo.domino.jna.test;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import org.junit.Test;
import com.mindoo.domino.jna.NotesCollection;
import com.mindoo.domino.jna.NotesCollection.ViewLookupCallback;
@klehmann
klehmann / createQRPViewPersons1.lss
Last active August 5, 2022 14:59
createQRPViewPersons1.lss
%REM
Sub createQRPViewPersons
Description: Comments for Sub
%END REM
function createQRPViewPersons1(qrpViewReaders As Variant, expirationHours As Integer) As String
On Error GoTo errHandler
Dim session As New NotesSession
Dim db As NotesDatabase
Dim viewName As String
@klehmann
klehmann / PhoneNumberMatcher.java
Last active May 5, 2022 08:47
Regular expression to find German phone numbers
/*
* ==========================================================================
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
@klehmann
klehmann / test.md
Created September 6, 2021 15:29
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@klehmann
klehmann / test.html
Created September 6, 2021 15:29
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@klehmann
klehmann / GeoHashUtils.java
Created June 13, 2019 14:55
GeoHash utilities in Java
/*
* Copyright (c) 2013 Mindoo GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@klehmann
klehmann / gist:88df7b6c991c9dc487d5
Created May 8, 2014 11:00
PouchDB view cleanup test
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="pouchdb-2.2.0.js"></script>
<script type="text/javascript">
var db;
function setupDb() {
try {
db = new PouchDB('testdb');