Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page Properties


Status

Status
colourYellow
titlePROGRESS

Priority2
Note
AssigneeAntje

Ressources

Remarks

Concept article linking to the respecive tutorials

  • Antje: writing started

...

Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Another TutorialSystem Hooks|Another Concept Article|Another interesting Tutorial)


...

The interceptor configuration is part of the (question). 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.

The following two code examples show the configuration of a getContent interceptor. In the first case, the predicate contains the condition in JavaScript. In contrast, the second code example makes use of SpEL.

Code Block
languagejavajs
titleFor Loop in Java (brief, concise title)
linenumberstrue
for (int i = 0; i < 10; i++)
{
	System.out.println("Hello World " + i);
}

Summary

...

iconfalse

Read on

...

Column
width25%

Another Tutorial

Brief summary of the article linked.

Column
width25%

Another Concept Article

Brief summary of the article linked.

...

width25%

Another interesting Tutorial

...

getContent interceptor with Javascript condition
linenumberstrue
{
  "interceptors" : [
    { "type" : "getContent",
      "predicate" : "js:function process(dmsApiObject){return dmsApiObject[\"contentStreams\"][0][\"range\"]!=null && dmsApiObject[\"contentStreams\"][0][\"range\"].startsWith(\"page:\")}",
      "url" : "http://localhost:10666/api/dms/objects/{enaio:objectId}",
      "useDiscovery" : false     
    }
  ]
}


Code Block
languageyml
titlegetContent interceptor with SpEL condition
linenumberstrue
{
  "interceptors" : [
    { "type" : "getContent",
      "predicate" : "spel:contentStreams[0]['range'] != null ? contentStreams[0]['range'] matches '(?i)^page:.*' : false",
      "url" : "http://localhost:10666/api/dms/objects/{enaio:objectId}",
      "useDiscovery" : false     
    }
  ]
}

A search interceptor can have a SpEL or a JavaScript statement in the predicate as well. In the example code below, only the SpEL variant is shown. In addition to the actual search interceptor configuration, the class SearchInterceptionObject has to be defined.

Code Block
languageyml
titlesearch interceptor with SpEL condition
linenumberstrue
{
  "interceptors" : [
    { "type" : "search",
      "predicate" : "spel:!grantedAuthorities.contains('ACCESS_FOREIGN_JOURNAL_OBJECTS')",
      "url" : "http://localhost:10777/api/search/dsl",
      "useDiscovery" : false
    }
  ]
}


Code Block
languageyml
titleDefinition of the SearchInterceptionObject class
linenumberstrue
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
iconfalse

Read on

Section


Column
width25%

System Hooks

Insert excerpt
System Hooks
System Hooks
 Keep on reading