Skip to content

Commit b7c1ad6

Browse files
committed
Merge 2.2 to Master branch
2 parents 8576cc9 + 830efd3 commit b7c1ad6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+952
-1017
lines changed

Classes/Core/JSConstants.h

Lines changed: 128 additions & 129 deletions
Large diffs are not rendered by default.

Classes/Core/JSConstants.m

Lines changed: 151 additions & 296 deletions
Large diffs are not rendered by default.

Classes/Core/JSOperationResult.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
// Jaspersoft Corporation
2929
//
3030

31-
#import <Foundation/Foundation.h>
3231
#import "JSErrors.h"
3332

34-
3533
@class JSRequest;
3634

3735
/**
@@ -49,23 +47,23 @@
4947
/**
5048
A list of objects coming from the call
5149
*/
52-
@property (nonatomic, strong) NSArray *objects;
50+
@property (nonatomic, strong, null_unspecified) NSArray *objects;
5351

5452
/**
5553
The downloaded response as binary data
5654
*/
57-
@property (nonatomic, strong) NSData *body;
55+
@property (nonatomic, strong, null_unspecified) NSData *body;
5856

5957
/**
6058
The sent request associated with this result. This is an additional parameter
6159
which helps to determine which request was sent (because all they are asynchronous).
6260
*/
63-
@property (nonatomic, strong) JSRequest *request;
61+
@property (nonatomic, strong, nonnull) JSRequest *request;
6462

6563
/**
6664
The error returned from the request call, if any.
6765
*/
68-
@property (nonatomic, strong) NSError *error;
66+
@property (nonatomic, strong, nullable) NSError *error;
6967

7068
/**
7169
The response HTTP code. This is a standard HTTP protocol code. Codes like 2xx are all ok.
@@ -77,17 +75,17 @@
7775
/**
7876
A dictionary of the response's headers.
7977
*/
80-
@property (nonatomic, readonly) NSDictionary *allHeaderFields;
78+
@property (nonatomic, readonly, nonnull) NSDictionary *allHeaderFields;
8179

8280
/**
8381
The MIME Type of the response body
8482
*/
85-
@property (nonatomic, readonly) NSString *MIMEType;
83+
@property (nonatomic, readonly, nonnull) NSString *MIMEType;
8684

8785
/**
8886
The downloaded response as string
8987
*/
90-
@property (nonatomic, strong, readonly) NSString *bodyAsString;
88+
@property (nonatomic, strong, readonly, null_unspecified) NSString *bodyAsString;
9189

9290
/**
9391
Returns a result with the specified request parameters
@@ -98,7 +96,7 @@
9896
@param error The error returned from the request call, if any.
9997
@return A configured JSOperationResult instance
10098
*/
101-
- (id)initWithStatusCode:(NSInteger)statusCode allHeaderFields:(NSDictionary *)allHeaderFields MIMEType:(NSString *)MIMEType;
99+
- (nonnull instancetype)initWithStatusCode:(NSInteger)statusCode allHeaderFields:(nonnull NSDictionary *)allHeaderFields MIMEType:(nonnull NSString *)MIMEType;
102100

103101
/**
104102
Indicates an HTTP response code between 200 and 299

Classes/Core/JSOperationResult.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ @interface JSOperationResult()
3838

3939
@implementation JSOperationResult
4040

41-
- (id)initWithStatusCode:(NSInteger)statusCode allHeaderFields:(NSDictionary *)allHeaderFields
42-
MIMEType:(NSString *)MIMEType{
41+
- (nonnull instancetype)initWithStatusCode:(NSInteger)statusCode
42+
allHeaderFields:(nonnull NSDictionary *)allHeaderFields
43+
MIMEType:(nonnull NSString *)MIMEType{
4344
if (self = [super init]) {
4445
_statusCode = statusCode;
4546
_allHeaderFields = allHeaderFields;

Classes/Core/JSProfile.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
// Jaspersoft Corporation
2929
//
3030

31-
#import <Foundation/Foundation.h>
32-
3331
/**
3432
Uses to store connection details for JasperReports server
3533
@@ -48,35 +46,35 @@
4846
The alias is mainly used to display profile's name in UI (i.e. when displays
4947
a list of available servers)
5048
*/
51-
@property (nonatomic, readonly) NSString *alias;
49+
@property (nonatomic, readonly, nonnull) NSString *alias;
5250

5351
/**
5452
The URL of JasperReports Server.
5553
URL should match next pattern http://hostname:port/jasperserver
5654
port parameter is not required (i.e. http://mobiledemo.jaspersoft.com/jasperserver-pro)
5755
*/
58-
@property (nonatomic, readonly) NSString *serverUrl;
56+
@property (nonatomic, readonly, nonnull) NSString *serverUrl;
5957

6058
/**
6159
The username, must be a valid account on JasperReports Server
6260
*/
63-
@property (nonatomic, readonly) NSString *username;
61+
@property (nonatomic, readonly, nullable) NSString *username;
6462

6563
/**
6664
The account password
6765
*/
68-
@property (nonatomic, readonly) NSString *password;
66+
@property (nonatomic, readonly, nullable) NSString *password;
6967

7068
/**
7169
The name of an organization. Used in JasperReport Server Professional
7270
which supports multi-tenancy. May be <code>nil</code> or empty
7371
*/
74-
@property (nonatomic, readonly) NSString *organization;
72+
@property (nonatomic, readonly, nullable) NSString *organization;
7573

7674
/**
7775
The version of JasperReports server
7876
*/
79-
@property (nonatomic, strong) JSServerInfo *serverInfo;
77+
@property (nonatomic, strong, nonnull) JSServerInfo *serverInfo;
8078

8179
/**
8280
Returns a profile with the specified parameters
@@ -88,7 +86,7 @@
8886
@param password The account password
8987
@return A configured JSProfile instance
9088
*/
91-
- (id)initWithAlias:(NSString *)alias serverUrl:(NSString *)serverUrl organization:(NSString *)organization
92-
username:(NSString *)username password:(NSString *)password;
89+
- (nonnull instancetype)initWithAlias:(nonnull NSString *)alias serverUrl:(nonnull NSString *)serverUrl organization:(nullable NSString *)organization
90+
username:(nullable nullable NSString *)username password:(nullable NSString *)password;
9391

9492
@end

Classes/Core/JSProfile.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
@implementation JSProfile
4444

4545

46-
- (id)initWithAlias:(NSString *)alias serverUrl:(NSString *)serverUrl organization:(NSString *)organization
47-
username:(NSString *)username password:(NSString *)password {
46+
- (nonnull instancetype)initWithAlias:(nonnull NSString *)alias serverUrl:(nonnull NSString *)serverUrl organization:(nullable NSString *)organization
47+
username:(nullable nullable NSString *)username password:(nullable NSString *)password {
4848
if (self = [super init]) {
4949
_alias = alias;
5050
_organization = organization;

Classes/Core/JSRESTBase+JSRESTReport.h

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
//
3030

3131
#import "JSRESTBase.h"
32-
#import "JSResourceDescriptor.h"
33-
#import "JSReportDescriptor.h"
3432
#import "JSInputControlDescriptor.h"
35-
#import <Foundation/Foundation.h>
33+
#import "JSReportOption.h"
34+
#import "JSReportParameter.h"
35+
3636

3737
/**
3838
Extention to <code>JSRESTBase</code> class for working with reports by REST calls.
@@ -49,7 +49,7 @@
4949
//---------------------------------------------------------------------
5050

5151
/**
52-
Generates the report url to receive all pages report output in HTML format.
52+
Generates the report url to receive all pages report output in selected format.
5353
5454
@param uri The resource descriptor uri
5555
@param reportParams list of report parameter/input control values
@@ -59,7 +59,7 @@
5959
6060
@since 1.4
6161
*/
62-
- (NSString *)generateReportUrl:(NSString *)uri reportParams:(NSDictionary *)reportParams page:(NSInteger)page format:(NSString *)format;
62+
- (nonnull NSString *)generateReportUrl:(nonnull NSString *)uri reportParams:(nullable NSArray <JSReportParameter *> *)reportParams page:(NSInteger)page format:(nonnull NSString *)format;
6363

6464
/**
6565
Gets the list of states of input controls with specified IDs for the report with specified URI and according to selected values
@@ -71,7 +71,7 @@
7171
7272
@since 1.6
7373
*/
74-
- (void)inputControlsForReport:(NSString *)reportUri ids:(NSArray /*<NSString>*/ *)ids selectedValues:(NSArray /*<JSReportParameter>*/ *)selectedValues completionBlock:(JSRequestCompletionBlock)block;
74+
- (void)inputControlsForReport:(nonnull NSString *)reportUri ids:(nullable NSArray <NSString *> *)ids selectedValues:(nullable NSArray <JSReportParameter *> *)selectedValues completionBlock:(nullable JSRequestCompletionBlock)block;
7575

7676
/**
7777
Gets the states with updated values for input controls with specified IDs and according to selected values
@@ -83,8 +83,8 @@
8383
8484
@since 1.4
8585
*/
86-
- (void)updatedInputControlsValues:(NSString *)reportUri ids:(NSArray /*<NSString>*/ *)ids
87-
selectedValues:(NSArray /*<JSReportParameter>*/ *)selectedValues completionBlock:(JSRequestCompletionBlock)block;
86+
- (void)updatedInputControlsValues:(nonnull NSString *)reportUri ids:(nonnull NSArray <NSString *> *)ids
87+
selectedValues:(nonnull NSArray <JSReportParameter *> *)selectedValues completionBlock:(nullable JSRequestCompletionBlock)block;
8888

8989
/**
9090
Executes report
@@ -104,10 +104,10 @@
104104
105105
@since 1.8
106106
*/
107-
- (void)runReportExecution:(NSString *)reportUnitUri async:(BOOL)async outputFormat:(NSString *)outputFormat
107+
- (void)runReportExecution:(nonnull NSString *)reportUnitUri async:(BOOL)async outputFormat:(nonnull NSString *)outputFormat
108108
interactive:(BOOL)interactive freshData:(BOOL)freshData saveDataSnapshot:(BOOL)saveDataSnapshot
109-
ignorePagination:(BOOL)ignorePagination transformerKey:(NSString *)transformerKey pages:(NSString *)pages
110-
attachmentsPrefix:(NSString *)attachmentsPrefix parameters:(NSArray /*<JSReportParameter>*/ *)parameters completionBlock:(JSRequestCompletionBlock)block;
109+
ignorePagination:(BOOL)ignorePagination transformerKey:(nullable NSString *)transformerKey pages:(nullable NSString *)pages
110+
attachmentsPrefix:(nullable NSString *)attachmentsPrefix parameters:(nullable NSArray <JSReportParameter *> *)parameters completionBlock:(nullable JSRequestCompletionBlock)block;
111111

112112
/**
113113
Cancel Report Execution
@@ -117,7 +117,7 @@
117117
118118
@since 1.9
119119
*/
120-
- (void)cancelReportExecution:(NSString *)requestId completionBlock:(JSRequestCompletionBlock)block;
120+
- (void)cancelReportExecution:(nonnull NSString *)requestId completionBlock:(nullable JSRequestCompletionBlock)block;
121121

122122
/**
123123
Run Export Execution
@@ -130,8 +130,8 @@
130130
131131
@since 1.9
132132
*/
133-
- (void)runExportExecution:(NSString *)requestId outputFormat:(NSString *)outputFormat pages:(NSString *)pages
134-
attachmentsPrefix:(NSString *)attachmentsPrefix completionBlock:(JSRequestCompletionBlock)block;
133+
- (void)runExportExecution:(nonnull NSString *)requestId outputFormat:(nonnull NSString *)outputFormat pages:(nullable NSString *)pages
134+
attachmentsPrefix:(nullable NSString *)attachmentsPrefix completionBlock:(nullable JSRequestCompletionBlock)block;
135135

136136
/**
137137
Generates the report output url
@@ -142,7 +142,7 @@
142142
143143
@since 1.8
144144
*/
145-
- (NSString *)generateReportOutputUrl:(NSString *)requestId exportOutput:(NSString *)exportOutput;
145+
- (nonnull NSString *)generateReportOutputUrl:(nonnull NSString *)requestId exportOutput:(nonnull NSString *)exportOutput;
146146

147147
/**
148148
Gets report execution metadata by request id
@@ -152,7 +152,7 @@
152152
153153
@since 1.8
154154
*/
155-
- (void)reportExecutionMetadataForRequestId:(NSString *)requestId completionBlock:(JSRequestCompletionBlock)block;
155+
- (void)reportExecutionMetadataForRequestId:(nonnull NSString *)requestId completionBlock:(nullable JSRequestCompletionBlock)block;
156156

157157
/**
158158
Gets report execution status by request id
@@ -162,7 +162,7 @@
162162
163163
@since 1.8
164164
*/
165-
- (void)reportExecutionStatusForRequestId:(NSString *)requestId completionBlock:(JSRequestCompletionBlock)block;
165+
- (void)reportExecutionStatusForRequestId:(nonnull NSString *)requestId completionBlock:(nullable JSRequestCompletionBlock)block;
166166

167167
/**
168168
Gets report export status by execution id and export output id.
@@ -172,9 +172,9 @@
172172
173173
@since 2.1
174174
*/
175-
- (void)exportExecutionStatusWithExecutionID:(NSString *)executionID
176-
exportOutput:(NSString *)exportOutput
177-
completion:(JSRequestCompletionBlock)block;
175+
- (void)exportExecutionStatusWithExecutionID:(nonnull NSString *)executionID
176+
exportOutput:(nonnull NSString *)exportOutput
177+
completion:(nullable JSRequestCompletionBlock)block;
178178

179179
/**
180180
Loads report output and saves it by specified path if needed
@@ -189,8 +189,8 @@
189189
190190
@since 1.9
191191
*/
192-
- (void)loadReportOutput:(NSString *)requestId exportOutput:(NSString *)exportOutput
193-
loadForSaving:(BOOL)loadForSaving path:(NSString *)path completionBlock:(JSRequestCompletionBlock)block;
192+
- (void)loadReportOutput:(nonnull NSString *)requestId exportOutput:(nonnull NSString *)exportOutput
193+
loadForSaving:(BOOL)loadForSaving path:(nullable NSString *)path completionBlock:(nullable JSRequestCompletionBlock)block;
194194

195195

196196
/**
@@ -204,6 +204,41 @@
204204
205205
@since 1.8
206206
*/
207-
- (void)saveReportAttachment:(NSString *)requestId exportOutput:(NSString *)exportOutput attachmentName:(NSString *)attachmentName path:(NSString *)path completionBlock:(JSRequestCompletionBlock)block;
207+
- (void)saveReportAttachment:(nonnull NSString *)requestId exportOutput:(nonnull NSString *)exportOutput attachmentName:(nonnull NSString *)attachmentName path:(nonnull NSString *)path completionBlock:(nullable JSRequestCompletionBlock)block;
208+
209+
/**
210+
Gets the report options array for report
211+
212+
@param reportUri repository URI of the report
213+
@param block The block to inform of the results
214+
215+
@since 2.2
216+
*/
217+
- (void)reportOptionsForReportURI:(nonnull NSString *)reportURI completion:(nullable JSRequestCompletionBlock)block;
218+
219+
/**
220+
Delete existed report option
221+
222+
@param reportOption the report option for deleting
223+
@param reportUri repository URI of the report
224+
@param block The block to inform of the results
225+
226+
@since 2.2
227+
*/
228+
229+
- (void)deleteReportOption:(nonnull JSReportOption *)reportOption withReportURI:(nonnull NSString *)reportURI completion:(nullable JSRequestCompletionBlock)completion;
230+
231+
/**
232+
Create new report option
233+
234+
@param reportUri repository URI of the report
235+
@param optionLabel the name for new report option
236+
@param reportParameters parameters for new report option creating
237+
@param block The block to inform of the results
238+
239+
@since 2.2
240+
*/
241+
242+
- (void)createReportOptionWithReportURI:(nonnull NSString *)reportURI optionLabel:(nonnull NSString *)optionLabel reportParameters:(nonnull NSArray <JSReportParameter *> *)reportParameters completion:(nullable JSRequestCompletionBlock)completion;
208243

209244
@end

0 commit comments

Comments
 (0)