You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Setting Role Membership](#setting-role-membership).
59
61
*[Deleting a Role](#deleting-a-role).
60
62
5.[The Settings Service](#settings-service).
61
-
*[Getting server specific settings](#getting-settings).
63
+
*[Getting server specific settings](#getting-server-specific-settings).
62
64
7.[Repository Services](#repository-services).
63
65
1.[Resources Service](#resources-service).
64
66
*[Searching the Repository](#searching-the-repository).
@@ -150,6 +152,12 @@ TrustManager[] trustManagers = new TrustManager[1];
150
152
trustManagers[0] = x509TrustManager;
151
153
configuration.setTrustManagers(trustManagers);
152
154
```
155
+
####X-HTTP-Method override
156
+
To avoid situation, when your proxies or web services do not support arbitrary HTTP methods or newer HTTP methods, you can use “restricted mode”. In this mode `JaperserverRestClient` sends requests through POST method and set the `X-HTTP-Method-Override` header with value of intended HTTP method. To use this mode you should set flag `RestrictedHttpMethods`:
If you do not use the "restricted mode", POST or GET methods and server returns the response with 411 error code, `JaperserverRestClient` resend this request through POST method with the X-HTTP-Method-Override header automatically.
153
161
####Client instantiation:
154
162
Here everything is easy, you need just to pass `configuration` to `JasperserverRestClient` constructor.
For some Jasperserver services authentication is not required (for example, settings service and server info service), so you can use anonymous session:
Not to store session on server you can invalidate it with `logout()` method.
169
182
```java
@@ -191,6 +204,19 @@ OperationResult<InputStream> result = client
191
204
.run();
192
205
InputStream report = result.getEntity();
193
206
```
207
+
Also you can use this method to run report with several values for the same parameter. In this case new values of the parameter are added to the previous ones (new values do not replace previous values of the parameter):
In this mode you don't need to work in one session. In the above code we specified report URI, format in which we want to get a report and some report parameters. As we a result we got `InputStream` instance. In synchronous mode as a response you get a report itself while in asynchronous you get just a descriptor with report ID which you can use to download report afer it will be ready.
195
221
196
222
In order to run a report in asynchronous mode, you need firstly build `ReportExecutionRequest` instance and specify all the parameters needed to launch a report. The response from the server is the `ReportExecutionDescriptor` instance which contains the request ID needed to track the execution until completion and others report parameters. Here's the code to run a report:
@@ -391,7 +417,8 @@ To create an organization, put all information in an organization descriptor, an
391
417
```java
392
418
Organization organization =newOrganization();
393
419
organization.setAlias("myOrg1");
394
-
420
+
```
421
+
``java
395
422
OperationResult<Organization> result = session
396
423
.organizationsService()
397
424
.organizations()
@@ -831,18 +858,25 @@ Settings Service
831
858
832
859
It provides method that allow you to get server specific settings, required by UI to work with the server in sync. There can be formats and patterns, modes for some modules etc.
833
860
834
-
####Getting settings
835
-
To get settings, use the `getEntity()` method and specify the group of settings in the `group()` method. The method `getEntity()` returns map of settings where the keys in the map are names of the settings and values can be any objects.
836
-
861
+
####Getting server specific settings
862
+
To get settings, use the `getEntity()` method and specify the group of settings in the `group()` method and class of entity as shown below. The method `getEntity()` returns instance of specified class:
837
863
```java
838
864
finalMap settings = session
839
865
.settingsService()
840
866
.settings()
841
-
.group(group)
867
+
.group(group, Map.class)
842
868
.getEntity();
843
869
844
870
```
845
-
Supported groups are:
871
+
Please notice, you can get settings of user’s time zones in this way as List only:
872
+
```java
873
+
finalList settings = session
874
+
.settingsService()
875
+
.settings()
876
+
.group("userTimeZones", List.class)
877
+
.getEntity();
878
+
```
879
+
Supported groups of settings are:
846
880
847
881
1. “request”. Settings related to current AJAX request configuration. Returned settings are: maxInactiveInterval, contextPath;
848
882
@@ -866,6 +900,42 @@ Supported groups are:
866
900
867
901
11. “adhocview”. Different configuration dictionary values and lists for ad hoc. Configuration of settings depends on configuration of Jaspersoft server.
868
902
903
+
There is another way to get settings using specified methods for groups of settings that return specific object of settings:
904
+
```java
905
+
FinalRequestSettings settings = session
906
+
.settingsService()
907
+
.settings()
908
+
.ofRequestGroup()
909
+
.getEntity();
910
+
```
911
+
Pleace notice, you should use List interface to get user’s time zones setting in this way:
912
+
```java
913
+
finalList<UserTimeZone> settings = session
914
+
.settingsService()
915
+
.settings()
916
+
.ofUserTimeZonesGroup()
917
+
.getEntity();
918
+
```
919
+
Or you can get List of specified DTO for user’s time zones using GenericType class:
Copy file name to clipboardExpand all lines: src/integration-test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/authority/users/UsersServiceIT.java
Copy file name to clipboardExpand all lines: src/integration-test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/ReportingServiceIT.java
Copy file name to clipboardExpand all lines: src/integration-test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/ResourcesServiceIT.java
Copy file name to clipboardExpand all lines: src/integration-test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/settings/SettingsServiceIT.java
0 commit comments