Skip to content

Commit 843a225

Browse files
committed
Downmerge from "develop" branch
2 parents ac42442 + 561bbf9 commit 843a225

File tree

86 files changed

+1964
-369
lines changed

Some content is hidden

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

86 files changed

+1964
-369
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ DerivedData
1818

1919
# Universal lib build
2020
jaspersoft-sdk-lib
21+
22+
*.xccheckout

Classes/Core/JSConstants.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,
@@ -47,7 +47,7 @@
4747
/**
4848
Get string representation for Boolean value
4949
50-
@param aBool A Boolean value
50+
@param aBOOL A Boolean value
5151
@return A new string @"true" or @"false" depends on provided Boolean value
5252
*/
5353
+ (NSString *)stringFromBOOL:(BOOL)aBOOL;
@@ -262,6 +262,7 @@
262262
@property (nonatomic, readonly) NSString *REST_INPUT_CONTROLS_URI;
263263
@property (nonatomic, readonly) NSString *REST_VALUES_URI;
264264
@property (nonatomic, readonly) NSString *REST_SERVER_INFO_URI;
265+
@property (nonatomic, readonly) NSString *REST_REPORT_EXECUTION_URI;
265266
/** @} */
266267

267268
/**
@@ -270,6 +271,7 @@
270271
*/
271272
@property (nonatomic, readonly) NSInteger VERSION_CODE_UNKNOWN;
272273
@property (nonatomic, readonly) NSInteger VERSION_CODE_EMERALD;
274+
@property (nonatomic, readonly) NSInteger VERSION_CODE_EMERALD_V2;
273275
@property (nonatomic, readonly) NSInteger VERSION_CODE_EMERALD_TWO;
274276
/** @} */
275277

Classes/Core/JSConstants.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,
@@ -151,8 +151,10 @@ @implementation JSConstants
151151
@synthesize REST_INPUT_CONTROLS_URI;
152152
@synthesize REST_VALUES_URI;
153153
@synthesize REST_SERVER_INFO_URI;
154+
@synthesize REST_REPORT_EXECUTION_URI;
154155
@synthesize VERSION_CODE_UNKNOWN;
155156
@synthesize VERSION_CODE_EMERALD;
157+
@synthesize VERSION_CODE_EMERALD_V2;
156158
@synthesize VERSION_CODE_EMERALD_TWO;
157159
@synthesize ICD_TYPE_BOOL;
158160
@synthesize ICD_TYPE_SINGLE_VALUE_TEXT;
@@ -367,13 +369,14 @@ - (void)setRESTURIPrefixes {
367369
REST_INPUT_CONTROLS_URI = @"/inputControls";
368370
REST_VALUES_URI = @"/values";
369371
REST_SERVER_INFO_URI = @"/serverInfo";
372+
REST_REPORT_EXECUTION_URI = @"/reportExecutions";
370373
}
371374

372375
- (void)setUPVersionCodes {
373376
VERSION_CODE_UNKNOWN = 0;
374377
VERSION_CODE_EMERALD = 50000;
378+
VERSION_CODE_EMERALD_V2 = 50200;
375379
VERSION_CODE_EMERALD_TWO = 50500;
376-
377380
}
378381

379382
- (void)setUPInputControlDescriptorTypes {

Classes/Core/JSCore.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Jaspersoft Mobile SDK
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
4+
* http://community.jaspersoft.com/project/mobile-sdk-ios
5+
*
6+
* Unless you have purchased a commercial license agreement from Jaspersoft,
7+
* the following license terms apply:
8+
*
9+
* This program is part of Jaspersoft Mobile SDK for iOS.
10+
*
11+
* Jaspersoft Mobile SDK is free software: you can redistribute it and/or modify
12+
* it under the terms of the GNU Lesser General Public License as published by
13+
* the Free Software Foundation, either version 3 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* Jaspersoft Mobile SDK is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General Public License
22+
* along with Jaspersoft Mobile SDK for iOS. If not, see
23+
* <http://www.gnu.org/licenses/lgpl>.
24+
*/
25+
26+
//
27+
// JSCore.h
28+
// Jaspersoft Corporation
29+
//
30+
31+
#import "JSProfile.h"
32+
#import "JSRESTBase.h"
33+
#import "JSRESTReport.h"
34+
#import "JSRESTResource.h"
35+
#import "JSOperationResult.h"
36+
#import "JSRequest.h"
37+
#import "JSSerializer.h"
38+
#import "JSConstants.h"

Classes/Core/JSOperationResult.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,

Classes/Core/JSOperationResult.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,
@@ -83,9 +83,4 @@ - (BOOL)isError {
8383
return self.statusCode >= 400 && self.statusCode < 600;
8484
}
8585

86-
- (NSString *)description {
87-
return [NSString stringWithFormat:@"Status Code: %lu; AllHeaderFields %@; MIMEType %@; Error: %@",
88-
(unsigned long)self.statusCode, self.allHeaderFields, self.MIMEType, self.error];
89-
}
90-
9186
@end

Classes/Core/JSProfile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,

Classes/Core/JSProfile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,

Classes/Core/JSRESTBase.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,
@@ -87,6 +87,13 @@
8787
@property (nonatomic, assign) JSRequestBackgroundPolicy requestBackgroundPolicy;
8888
#endif
8989

90+
/**
91+
An NSArray of NSHTTPCookie objects
92+
93+
@since 1.8
94+
*/
95+
@property (nonatomic, readonly) NSArray *cookies;
96+
9097
/**
9198
Returns a rest base instance with provided server profile (for authentication)
9299
and list of classes for which mapping rules will be created.

Classes/Core/JSRESTBase.m

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Jaspersoft Mobile SDK
3-
* Copyright (C) 2011 - 2013 Jaspersoft Corporation. All rights reserved.
3+
* Copyright (C) 2011 - 2014 Jaspersoft Corporation. All rights reserved.
44
* http://community.jaspersoft.com/project/mobile-sdk-ios
55
*
66
* Unless you have purchased a commercial license agreement from Jaspersoft,
@@ -137,6 +137,7 @@ - (id)initWithProfile:(JSProfile *)profile classesForMappings:(NSArray *)classes
137137
self.restKitClient.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
138138
self.restKitClient.cachePolicy = RKRequestCachePolicyNone;
139139
self.restKitClient.requestCache.storagePolicy = RKRequestCacheStoragePolicyDisabled;
140+
self.restKitClient.disableCertificateValidation = YES;
140141

141142
// Sets default content-type and charset for RKClient. This is required step or
142143
// there will be an parsing error
@@ -166,9 +167,9 @@ - (id)init {
166167
}
167168

168169
- (void)setServerProfile:(JSProfile *)serverProfile {
169-
// Delete cookies for servers. If don't do this old credentials will be used
170+
// Delete cookies for current server profile. If don't do this old credentials will be used
170171
// instead new one
171-
[self deleteCookiesForServer:_serverProfile];
172+
[self deleteCookies];
172173
_serverProfile = serverProfile;
173174

174175
// Sets authentication. This will also change authentication for
@@ -310,6 +311,22 @@ - (void)cancelAllRequests {
310311
[self.requestCallBacks removeAllObjects];
311312
}
312313

314+
- (NSArray *)cookies {
315+
if (!self.serverProfile.serverUrl) return nil;
316+
317+
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
318+
NSString *host = [[NSURL URLWithString:self.serverProfile.serverUrl] host];
319+
320+
NSMutableArray *cookies = [NSMutableArray array];
321+
for (NSHTTPCookie *cookie in cookieStorage.cookies) {
322+
if ([cookie.domain isEqualToString:host]) {
323+
[cookies addObject:cookie];
324+
}
325+
}
326+
327+
return cookies;
328+
}
329+
313330
#pragma mark -
314331
#pragma mark Private methods
315332

@@ -380,16 +397,10 @@ - (void)callRequestFinishedCallBackForRestKitRequest:(id)restKitRequest result:(
380397
}
381398

382399
// Deletes all cookies for specified server
383-
- (void)deleteCookiesForServer:(JSProfile *)serverProfile {
384-
if (!serverProfile.serverUrl) return;
385-
400+
- (void)deleteCookies {
386401
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
387-
NSString *host = [[NSURL URLWithString:serverProfile.serverUrl] host];
388-
389-
for (NSHTTPCookie *cookie in cookieStorage.cookies) {
390-
if ([cookie.domain isEqualToString:host]) {
391-
[cookieStorage deleteCookie:cookie];
392-
}
402+
for (NSHTTPCookie *cookie in self.cookies) {
403+
[cookieStorage deleteCookie:cookie];
393404
}
394405
}
395406

@@ -409,10 +420,12 @@ - (JSOperationResult *)setServerInfo:(JSOperationResult *)result {
409420
} else {
410421
self.serverProfile.serverInfo = [[JSServerInfo alloc] init];
411422

423+
JSRequest *request = result.request;
412424
result = [[JSOperationResult alloc] initWithStatusCode:203
413425
allHeaderFields:result.allHeaderFields
414426
MIMEType:result.MIMEType
415427
error:nil];
428+
result.request = request;
416429
}
417430

418431
return result;

0 commit comments

Comments
 (0)