Monotone-Parent: e94c8ae67d2887b188febc57c064c3e5be325bc9

Monotone-Revision: 3a52f24d5383740ac373578b476831142dd2d359

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-12-13T19:25:01
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-12-13 19:25:01 +00:00
parent 7f19ee2036
commit 8d0a42abef
5 changed files with 75 additions and 2 deletions

View File

@ -1,5 +1,15 @@
2007-12-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/SOGoUI/UIxComponent.m ([UIxComponent -responseWithStatus:status])
([UIxComponent -responseWithStatus:statusandString:contentString])
([UIxComponent -responseWithStatus:statusandJSONRepresentation:contentObject])
([UIxComponent -responseWith204]): new utility methods.
* UI/Common/WODirectAction+SOGo.m ([WODirectAction -responseWithStatus:statusandString:contentString])
([WODirectAction
-responseWithStatus:statusandJSONRepresentation:contentObject]):
new utility methods.
* SoObjects/SOGo/NSScanner+BSJSONAdditions.m ([NSScanner
-scanJSONStringDelimiterString]): new category module taken from
BSJSONAdditions 1.3.

View File

@ -31,6 +31,10 @@
@interface WODirectAction (SOGoExtension)
- (WOResponse *) responseWithStatus: (unsigned int) status;
- (WOResponse *) responseWithStatus: (unsigned int) status
andString: (NSString *) contentString;
- (WOResponse *) responseWithStatus: (unsigned int) status
andJSONRepresentation: (NSObject *) contentObject;
- (WOResponse *) responseWith204;
- (WOResponse *) redirectToLocation: (NSString *) newLocation;

View File

@ -25,6 +25,7 @@
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOResponse.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
@ -42,6 +43,24 @@
return response;
}
- (WOResponse *) responseWithStatus: (unsigned int) status
andString: (NSString *) contentString
{
WOResponse *response;
response = [self responseWithStatus: status];
[response appendContentString: contentString];
return response;
}
- (WOResponse *) responseWithStatus: (unsigned int) status
andJSONRepresentation: (NSObject *) contentObject;
{
return [self responseWithStatus: status
andString: [contentObject jsonRepresentation]];
}
- (WOResponse *) responseWith204
{
return [self responseWithStatus: 204];

View File

@ -95,7 +95,13 @@
- (WOResourceManager *) pageResourceManager;
- (NSString *) urlForResourceFilename: (NSString *) filename;
- (WOResponse *) responseWithStatus: (unsigned int) status;
- (WOResponse *) responseWithStatus: (unsigned int) status
andString: (NSString *) contentString;
- (WOResponse *) responseWithStatus: (unsigned int) status
andJSONRepresentation: (NSObject *) contentObject;
- (WOResponse *) responseWith204;
- (WOResponse *) redirectToLocation: (NSString *) newLocation;
/* Debugging */
- (BOOL)isUIxDebugEnabled;

View File

@ -36,6 +36,7 @@
#import <NGExtensions/NSURL+misc.h>
#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import <SoObjects/SOGo/SOGoObject.h>
@ -584,12 +585,45 @@ static BOOL uixDebugEnabled = NO;
return url;
}
- (WOResponse *) responseWith204
- (WOResponse *) responseWithStatus: (unsigned int) status
{
WOResponse *response;
response = [context response];
[response setStatus: 204];
[response setStatus: status];
return response;
}
- (WOResponse *) responseWithStatus: (unsigned int) status
andString: (NSString *) contentString
{
WOResponse *response;
response = [self responseWithStatus: status];
[response appendContentString: contentString];
return response;
}
- (WOResponse *) responseWithStatus: (unsigned int) status
andJSONRepresentation: (NSObject *) contentObject;
{
return [self responseWithStatus: status
andString: [contentObject jsonRepresentation]];
}
- (WOResponse *) responseWith204
{
return [self responseWithStatus: 204];
}
- (WOResponse *) redirectToLocation: (NSString *) newLocation
{
WOResponse *response;
response = [self responseWithStatus: 302];
[response setHeader: newLocation forKey: @"location"];
return response;
}