Commit Graph

391 Commits

Author SHA1 Message Date
eikek
c21b2cdd29 Update scalafmt to 3.0.8 2021-12-11 22:46:55 +01:00
eikek
4ffc8d1f14 Add support for more generic notification
This is a start to have different kinds of notifications. It is
possible to be notified via e-mail, matrix or gotify. It also extends
the current "periodic query" for due items by allowing notification
over different channels. A "generic periodic query" variant is added
as well.
2021-12-11 18:57:32 +01:00
eikek
b79ac5fbad Add missing db migrations for h2 and mariadb 2021-11-20 15:24:23 +01:00
eikek
501c6f2988 Updating stanford corenlp to 4.3.2; adding more languages
There are models for Spanish, that have been added now. Also the
Hungarian language has been added to the list of supported
languages (for tesseract mainly, no nlp models)
2021-11-20 14:31:39 +01:00
eikek
20fc9955ba Fix reprocessing to lookup the last used language 2021-11-20 01:34:16 +01:00
eikek
fcb25637d3 Improve new job count bubble 2021-11-13 20:39:40 +01:00
eikek
7a8527f821 Indicate number of running jobs in tob nav
Issue: #1069
2021-11-12 22:01:30 +01:00
eikek
cf933b60a7 Encode ws messages as JSON 2021-11-11 23:54:37 +01:00
eikek
7b8afe8371 Make internal endpoints available to nodes only 2021-11-08 00:13:02 +01:00
eikek
f38d520a1d Hooking the new pubsub impl into the application 2021-11-06 01:44:06 +01:00
eikek
d483d9f176 Initial naive pubsub impl generalising from current setup 2021-11-05 01:05:24 +01:00
eikek
6696aba481 Show user shares when asking to delete user 2021-10-24 01:41:18 +02:00
eikek
2ac0b84e52 Link shares to the user, not the collective
The user is required when searching because of folders (sadly), so the
share is connected to the user.
2021-10-24 01:41:18 +02:00
eikek
9eb2f9c6fe Implement binary routes for shares 2021-10-23 14:33:24 +02:00
eikek
813797756c Extend search stats to fully populate search menu
Refs: #856
2021-10-23 14:33:24 +02:00
eikek
e961a5ac10 Use search stats to populate search menu 2021-10-23 14:33:24 +02:00
eikek
f4596db63d Authorize share access 2021-10-23 14:33:24 +02:00
eikek
4ef9d6c3ff Add expired flag to share details 2021-10-23 14:33:24 +02:00
eikek
c7d587bea4 Basic management of shares 2021-10-23 14:33:24 +02:00
eikek
de1baf725f Generate a query string given an expression
Initialize share record and improve tests.
2021-10-23 14:33:24 +02:00
eikek
aa8f3b82fc Use passwords when reading PDFs 2021-09-30 11:48:59 +02:00
eikek
f74624485f Allow to manage passwords for a collective 2021-09-30 10:35:38 +02:00
eikek
071f4067bf Use existing mimetype detection when storing files 2021-09-23 14:10:24 +02:00
eikek
1761526e20 Simplify MimeType class and parse mimetypes in a more lenient way 2021-09-23 14:10:24 +02:00
eikek
9013f2de5b Update scalafmt settings 2021-09-22 17:23:24 +02:00
eikek
20a829cf7a Refactoring for migrating to binny library 2021-09-22 14:18:43 +02:00
eikek
9785db0683 Change license header of all files 2021-09-21 22:35:38 +02:00
eikek
506e9a0c36 Move sent mails when merging items
Fixes: 1055
2021-09-08 22:29:34 +02:00
eikek
736968b049 Fix adding a new user and don't allow to add non-local users
The user structure must provide the correct account source now.
2021-09-08 20:57:10 +02:00
eikek
8df235e9db Delete the user along its data 2021-09-08 20:57:10 +02:00
eikek
3650a7d20c Make sure DML statements use the correct logger
It also seems to be necessary now to add the space in the `WHERE`.
Normally, the `fr` interpolator would add spaces….
2021-09-08 20:56:18 +02:00
eikek
7edb96a297 Register external accounts
This creates the account if it doesn't exist yet; otherwise it's a
noop. Only valid for non-local accounts.
2021-09-05 21:38:14 +02:00
eikek
aef56233a5 Add a new column to distinguish local from external users 2021-09-05 21:38:14 +02:00
eikek
3a5ef62715 Add missing sql changesets 2021-09-01 00:57:03 +02:00
eikek
1afc005a6c Adopt login process for two-factor auth 2021-08-31 21:29:07 +02:00
eikek
309a52393a Initial impl for totp 2021-08-31 16:45:39 +02:00
eikek
733096f979 Improve querying item results
The join to retrieve the attachment count per item turned out to be
very expensive. And it is not used anymore for the result, only to
support fulltext search. It is now removed from the query. The
DISTINCT keyword is also removed, because it is not necessary and it
is expensive. With the DISTINCT removed, a new index (provided in the
previous commit) can now be used to avoid sorting items.
2021-08-29 11:09:06 +02:00
eikek
a5a8c2553b Add indexes to better support certain queries 2021-08-29 00:38:12 +02:00
mergify[bot]
3520a2ec26
Merge pull request #1037 from eikek/small-list-improvements
Allow to specify ordering when retrieving meta data
2021-08-27 21:18:47 +00:00
eikek
cf88f5c2de Allow to specify ordering when retrieving meta data
The query now searches in more fields. For example, when getting a
list of tags, the query is applied to the tag name *and* category.
When listing persons, the query now also looks in the associated
organization name.

This has been used to make some headers in the meta data tables
clickable to sort the list accordingly.

Refs: #965, #538
2021-08-27 23:04:54 +02:00
eikek
7b2fb70c04 Add missing data to insert statement
Closes: #1032
2021-08-27 22:51:34 +02:00
eikek
6bb6cad39d Test db migrations for all supported databases 2021-08-23 23:41:03 +02:00
eikek
993a391c13 Add the attachment-only option to a source
The upload request can now contain a boolean for importing only
attachments when e-mails are uploaded. This option is now also added
to a source url.

Refs: #983
2021-08-23 14:19:11 +02:00
eikek
d5022f883e Enhance search mode to search in all items 2021-08-21 15:45:14 +02:00
eikek
90421599ea Fix storing empty-trash task
It was wrongly stored using RPeriodicTask directly, but the higher
level `UserTask` must be used instead, because this ensures a
correctly scoped periodic task using the `updateOneTask` method. Since
this is a system task, it can be given a fixed ID which makes it now
safe even if stored using RPeriodicTask directly.

The bug resulted in multiple empty-trash tasks to be inserted (on each
restart).

Refs: #347
2021-08-20 00:25:25 +02:00
Scala Steward
e4fecefaea
Reformat with scalafmt 3.0.0 2021-08-19 08:50:30 +02:00
eikek
c7c488f0cc Fix position of merged attachments 2021-08-16 15:05:26 +02:00
eikek
a923351b09 Fix item merge when merging tags and text fields
Also hard delete the remaining items. They are empty (have no
attachments), because data is moved if possible. Doesn't make much
sense to keep them, because restoring them isn't much useful.
2021-08-16 14:40:52 +02:00
eikek
85085ec173 Implement item merge 2021-08-16 12:32:54 +02:00
eikek
14e4a8f792 Fixup for deleting items
First, when checking for existence of a file, deleted items are not
conisdered.

The working with fulltext search has been changed: deleted items are
removed from fulltext index and are re-added when they are restored.
The fulltext index currently doesn't hold the item state and it would
mean much more work to introduce it into the index (or, worse, to
reprocess the results from the index). Thus, deleted items can only be
searched using database queries. It is probably a very rare use case
when fulltext search should be applied to deleted items. They have
been deleted for a reason and the most likely case is that they are
simply removed.

Refs: #347
2021-08-15 16:00:30 +02:00
eikek
f4a2b86ea8 Use a minimum age of items to remove
In order to keep deleted items for a while, the periodic task can now
use a duration to only remove items with a certain age. This can be
used to ensure that a deleted item stays at least X days before it
will be removed from the database.

Refs: #347
2021-08-15 12:32:50 +02:00
eikek
ef31c90e34 Fix submitter column of a collective-scoped periodic job 2021-08-14 22:07:56 +02:00
eikek
4562c77152 Fix migration changeset name for h2 2021-08-14 22:07:56 +02:00
eikek
31d885ed79 Refactor user tasks to support collective and user scopes
Before, there were periodic tasks run per collective and not user by
making sure that submitter + group are the same value. This is now
encoded in `UserTaskScope` so it is now obvious and errors can be
reduced when using this.
2021-08-14 22:07:56 +02:00
eikek
27fd7a5867 Make sure the empty-trash task is started for all collectives 2021-08-14 20:40:04 +02:00
eikek
50706c3d6d Add a task implementation to delete items 2021-08-14 19:33:18 +02:00
eikek
4901276c66 Change "empty trash" settings for a collective and submit the job 2021-08-14 19:33:15 +02:00
eikek
f999662905 Add routes to restore deleted items 2021-08-14 16:48:03 +02:00
eikek
a7b74bd5ae Allow to search in soft-deleted items
A new query/request parameter can be used to apply a search to only
soft-deleted items.

The query expression `Trashed` has been introduced which selects only
items with state `Deleted`. This is another option an analog to
`ValidItemStates` (both cannot be used together as they would select
no items). This new query node is not added to the parser, because
users may not use it in their own queries - it must be part of the
"fixed" query so the application can control in which subset to search
(it would otherwise be possible to select any items).
2021-08-14 14:53:05 +02:00
eikek
cb777e30c0 Delete items by introducing a deleted state
When deleting items via the http api, they are not deleted anymore but
a new status "Deleted" is set. The collective insights contains now a
count separately for deleted items.
2021-08-14 14:18:03 +02:00
eikek
48d13a35fc Fix search summary to restrict on valid items 2021-08-14 14:09:07 +02:00
eikek
1256a6e8cf Allo wildcards when searching by attachment ids 2021-07-31 01:23:37 +02:00
eikek
15b15666bf Allow to use the created timestamp in item queries
Refs: 925
2021-07-27 17:33:13 +02:00
eikek
d95a78f495 Allow to set folder by id or name 2021-07-17 15:10:19 +02:00
eikek
8e5c88fd32 Add copyright header to source files 2021-07-04 10:57:53 +02:00
eikek
ce6f53cc29 Fix next-job query to do round-robin through job groups 2021-06-27 00:04:56 +02:00
eikek
988367a281 Extend query builder to compare results from subselects 2021-06-26 21:12:02 +02:00
eikek
bd791b4593 Upgrade code base to CE3 2021-06-22 22:53:34 +02:00
eikek
3ee0846e19 Remove fts_migration table
It is now stored it SOLR instead.
2021-06-07 17:53:47 +02:00
eikek
c2170d2daf Fix tag category search being case insensitive 2021-06-03 21:44:55 +02:00
Eike Kettner
25788a0b23 Add routes for storing/retrieving client settings 2021-05-27 21:34:05 +02:00
Eike Kettner
a1a93e5ca6 Fixes searching items with fulltext
When using fulltext only search, then only the index must be searched.
This wasn't working anymore, because the routes added a query to
always select valid items (those not being processed). But this lead
to the downstream code to always consult the database, too. Since the
routes are using a "simple-search" interface, this is now adding the
valid-state condition if applicable. There are still more low-level
interfaces that can be used when searching should be done differently.

Closes: #823
2021-05-23 14:14:25 +02:00
Stefan Scheidewig
6149a2ab89 Restored unused imports to make it compile again 2021-04-15 18:34:54 +02:00
Stefan Scheidewig
fa34312020 Implemented endpoint to delete multiple attachments 2021-04-15 18:05:01 +02:00
Eike Kettner
994e3df597 Fix query for getting tag categoy summary 2021-04-12 13:40:22 +02:00
Eike Kettner
3e0914ece7 Correctly count tag categories
If multiple tags of the same category are applied to the same item,
just summing tag counts will produce the wrong results as now items
are counted multiple times.
2021-04-11 14:34:44 +02:00
Eike Kettner
4041018c47 Reduce not expressions
Fixes queries containing macros inside a "not".
2021-04-11 12:57:42 +02:00
Eike Kettner
e1bbc2edf5 Apply autoformat 2021-04-10 16:31:58 +02:00
Scala Steward
144ea852bf Update fs2-core, fs2-io to 2.5.4 2021-03-31 21:10:42 +02:00
Eike Kettner
c36073b852 Allow to give human readable summary to user tasks 2021-03-27 22:13:13 +01:00
Eike Kettner
cc38b850a6 Remove deprecated search routes and some refactoring 2021-03-27 22:13:13 +01:00
Eike Kettner
177488817d Fix h2 migration
Using java source code obviously requires `javac` during migration.
2021-03-13 16:38:48 +01:00
Eike Kettner
2e443bc9b9 Fix mariadb migration 2021-03-13 15:52:38 +01:00
Eike Kettner
0229a867af Add a use colum to metadata entities 2021-03-10 23:55:18 +01:00
Eike Kettner
6a63694a3e Convert unit tests to munit 2021-03-10 19:48:56 +01:00
Eike Kettner
77a87782b7 Refactoring parser
- put all used strings in one place to have it easier to track
- don't use `$` for shortcuts, it's a detail not interesting to a
  user; now names must not clash (which is a good idea anyways)
- Added two more shortcuts `conc` and `corr`
2021-03-08 22:51:14 +01:00
Eike Kettner
e681ffa96f Extend query builder allowing more conditions
Before only a column or a dbfunction could be used in a condition. It
is now allowed for all `SelectExpr`.
2021-03-08 22:51:08 +01:00
Eike Kettner
30c901ddf1 Add more ways to query for attachments
- find items with a specified attachment count
- find items by attachment id
2021-03-08 09:49:38 +01:00
Eike Kettner
2b2f913e85 Add checksum query expr 2021-03-08 01:53:21 +01:00
Eike Kettner
1c834cbb77 Correctly compare numeric field values 2021-03-03 22:54:55 +01:00
Eike Kettner
71985244f1 Use a better representation for macros 2021-03-03 00:44:49 +01:00
Eike Kettner
a48504debb Specificly search for field id vs name 2021-03-02 21:09:31 +01:00
Eike Kettner
168f5a1a98 Fix like search for custom fields 2021-03-01 20:56:23 +01:00
Eike Kettner
f8307f77c6 Search by field id or name 2021-03-01 20:56:23 +01:00
Eike Kettner
698ff58aa3 Provide a more convenient interface to search 2021-03-01 11:50:07 +01:00
Eike Kettner
d737da768e Move to munit in query module 2021-03-01 00:51:01 +01:00
Eike Kettner
9013d9264e Add more convenient date parsers and some basic macros 2021-03-01 00:51:01 +01:00
Eike Kettner
af73b59ec2 Parser improvements
- default expressions into a and node
- fix parsing string lists that end in whitespace
- fix package names of internal classes
2021-03-01 00:51:01 +01:00
Eike Kettner
a80d73d5d2 Optimize imports 2021-03-01 00:51:01 +01:00
Eike Kettner
e9ed998e3a Basic poc to search via custom query 2021-03-01 00:51:01 +01:00