Page Properties |
---|
Status | Status |
---|
| |
---|
colour | Yellow |
---|
title | PROGRESS |
---|
|
|
---|
Priority | 2 |
---|
Note |
|
---|
Assignee | Antje |
---|
RessourcesConcept article linking to the respecive tutorials |
...
The following parameters can/have to be defined in the interceptor configuration:
Parameter | Type | Required | Description |
---|
type | String | yes | The type of the interceptor. It defines the position in the process flow where the interceptor can step in. |
predicate | String | yes | The condition that triggers the intervention of the process flow in order to include the project-specific process extension. The string can provide the condition either in Spring Expression Language (SpEL) or Javascript. Thus, the string has to start always with a prefix spel: for SpEL or js: for Javascript. |
url | String | yes | HTTP address of the project-specific process extension. Dynamic components (properties of the processed object) can be included in braces. |
useDirectory useDiscovery | boolean | no | Decides whether to resolve the url string at the Discovery-Service or not. If not specified, default |
Interceptor Types
There are different types of interceptors available, that interrupt the process flow at different positions.
...
The interceptor configuration is part of the the interceptorConfiguration.json file. It is a JSON list of all interceptors, each of them specified by its type
, predicate
, url
and useDirectory
parameters. If there are two or more interceptors of the same type, all of them will be executed in random order.
...
Code Block |
---|
language | js |
---|
title | getContent interceptor with Javascript condition |
---|
linenumbers | true |
---|
|
{
"interceptors" : [
{ "type" : "getContent",
"predicate" : "js:function process(dmsApiObject){return dmsApiObject[\"contentStreams\"][0][\"range\"]!=null && dmsApiObject[\"contentStreams\"][0][\"range\"].startsWith(\"page:\")}",
"url" : "http://localhost<server>:10666<port>/api/dms/objects/{enaiosystem:objectId}",
"useDiscovery" : false
}
]
} |
...
Code Block |
---|
language | yml |
---|
title | getContent interceptor with SpEL condition |
---|
linenumbers | true |
---|
|
{
"interceptors" : [
{ "type" : "getContent",
"predicate" : "spel:contentStreams[0]['range'] != null ? contentStreams[0]['range'] matches '(?i)^page:.*' : false",
"url" : "http://localhost<server>:10666<port>/api/dms/objects/{enaiosystem:objectId}",
"useDiscovery" : false
}
]
} |
...
Code Block |
---|
language | yml |
---|
title | search interceptor with SpEL condition |
---|
linenumbers | true |
---|
|
{
"interceptors" : [
{ "type" : "search",
"predicate" : "spel:!grantedAuthorities.contains('ACCESS_FOREIGN_JOURNAL_OBJECTS')",
"url" : "http://localhost<server>:10777<port>/api/search/dsl",
"useDiscovery" : false
}
]
} |
Code Block |
---|
language | yml |
---|
title | Definition of the SearchInterceptionObject class |
---|
linenumbers | true |
---|
|
public class SearchInterceptionObject
{
private EnaioUserDetails enaioUserDetails;
private List<String> grantedAuthorities; // liste der dem aktuellen Nutzer zugeordneten Authority-Namen
}
public class EnaioUserDetails extends User
{
private String jwtAutorization;
private String id;
private String domain;
private String tenant;
private volatile long expiresAt;
...
} |
Summary
This article gave an overview of the interceptor handling in yuuvis® Momentum. If you want to extend the functionality of your system, also system hooks might be an interesting topic for you.
Info |
---|
|
Read on
Section |
---|
Column |
---|
| Insert excerpt |
---|
| Preprocessing Metadata using Webhooks |
---|
| Preprocessing Metadata using Webhooks |
---|
nopanel | true |
---|
| Keep on reading |
|
|