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).
@@ -149,6 +151,12 @@ TrustManager[] trustManagers = new TrustManager[1];
149
151
trustManagers[0] = x509TrustManager;
150
152
configuration.setTrustManagers(trustManagers);
151
153
```
154
+
####X-HTTP-Method override
155
+
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.
152
160
####Client instantiation:
153
161
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.
168
181
```java
@@ -190,6 +203,19 @@ OperationResult<InputStream> result = client
190
203
.run();
191
204
InputStream report = result.getEntity();
192
205
```
206
+
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.
194
220
195
221
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:
@@ -390,7 +416,8 @@ To create an organization, put all information in an organization descriptor, an
390
416
```java
391
417
Organization organization =newOrganization();
392
418
organization.setAlias("myOrg1");
393
-
419
+
```
420
+
``java
394
421
OperationResult<Organization> result = session
395
422
.organizationsService()
396
423
.organizations()
@@ -830,18 +857,25 @@ Settings Service
830
857
831
858
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.
832
859
833
-
####Getting settings
834
-
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.
835
-
860
+
####Getting server specific settings
861
+
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:
836
862
```java
837
863
finalMap settings = session
838
864
.settingsService()
839
865
.settings()
840
-
.group(group)
866
+
.group(group, Map.class)
841
867
.getEntity();
842
868
843
869
```
844
-
Supported groups are:
870
+
Please notice, you can get settings of user’s time zones in this way as List only:
871
+
```java
872
+
finalList settings = session
873
+
.settingsService()
874
+
.settings()
875
+
.group("userTimeZones", List.class)
876
+
.getEntity();
877
+
```
878
+
Supported groups of settings are:
845
879
846
880
1. “request”. Settings related to current AJAX request configuration. Returned settings are: maxInactiveInterval, contextPath;
847
881
@@ -865,6 +899,42 @@ Supported groups are:
865
899
866
900
11. “adhocview”. Different configuration dictionary values and lists for ad hoc. Configuration of settings depends on configuration of Jaspersoft server.
867
901
902
+
There is another way to get settings using specified methods for groups of settings that return specific object of settings:
903
+
```java
904
+
FinalRequestSettings settings = session
905
+
.settingsService()
906
+
.settings()
907
+
.ofRequestGroup()
908
+
.getEntity();
909
+
```
910
+
Pleace notice, you should use List interface to get user’s time zones setting in this way:
911
+
```java
912
+
finalList<UserTimeZone> settings = session
913
+
.settingsService()
914
+
.settings()
915
+
.ofUserTimeZonesGroup()
916
+
.getEntity();
917
+
```
918
+
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