See ChangeLog.

Monotone-Parent: fdc663e746cda0a1106c97d2d9af95b6eb0d1b40
Monotone-Revision: 56738c967d1f191a027f45f12a017405441e69ca

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-05-27T17:09:02
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2010-05-27 17:09:02 +00:00
parent 4b63a768c4
commit 0176350dbc
6 changed files with 76 additions and 11 deletions

View File

@ -7,12 +7,16 @@
2010-05-27 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailerUI/UIxMailListActions.m: renamed from
UIxMailListview.m. Associated .wox was removed.
UIxMailListview.m. Associated .wox was removed and converted to a
WODirectAction.
(-getSortedUIDsAction): new method that returns a JSON
array with all the messages UIDs of the mailbox, sorted as requested.
(-getHeadersAction): new method that returns a JSON dictionary of
the headers of requested messages UIDs.
* UI/Common/WODirectAction+SOGo.m (-pageResourceManager,
-urlForResourceFilename): methods copied from UIxComponent.
* UI/WebServerResources/SOGoDataTable.js: new interface to add
"live loading" to a table.

View File

@ -26,7 +26,7 @@
#import <NGObjWeb/WODirectAction.h>
@class NSString;
@class WOResponse;
@class WOResponse, WOResourceManager;
@interface WODirectAction (SOGoExtension)
@ -40,6 +40,9 @@
- (NSString *) labelForKey: (NSString *) _str;
- (WOResourceManager *) pageResourceManager;
- (NSString *) urlForResourceFilename: (NSString *) filename;
@end
#endif /* WODIRECTACTION_SOGO_H */

View File

@ -22,11 +22,13 @@
#import <Foundation/NSBundle.h>
#import <NGObjWeb/SoObjects.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOResponse.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import <SoObjects/SOGo/SOGoUserDefaults.h>
@ -119,4 +121,54 @@
return label;
}
- (WOResourceManager *) pageResourceManager
{
WOResourceManager *rm;
if ((rm = [[context page] resourceManager]) == nil)
rm = [[WOApplication application] resourceManager];
return rm;
}
- (NSString *) urlForResourceFilename: (NSString *) filename
{
static NSMutableDictionary *pageToURL = nil;
NSString *url;
WOComponent *page;
WOResourceManager *rm;
NSBundle *pageBundle;
if (filename)
{
if (!pageToURL)
pageToURL = [[NSMutableDictionary alloc] initWithCapacity: 32];
url = [pageToURL objectForKey: filename];
if (!url)
{
rm = [self pageResourceManager];
page = [context page];
pageBundle = [NSBundle bundleForClass: [page class]];
url = [rm urlForResourceNamed: filename
inFramework: [pageBundle bundlePath]
languages: nil
request: [context request]];
if (!url)
url = @"";
else
if ([url hasPrefix: @"http"])
url = [url hostlessURL];
[pageToURL setObject: url forKey: filename];
}
// NSLog (@"url for '%@': '%@'", filename, url);
}
else
url = @"";
return url;
}
@end

View File

@ -22,13 +22,13 @@
#ifndef UIXMAILLISTACTIONS_H
#define UIXMAILLISTACTIONS_H
#import <SOGoUI/UIxComponent.h>
#import <NGObjWeb/WODirectAction.h>
@class NSDictionary;
@class EOQualifier;
@class SOGoDateFormatter;
@interface UIxMailListActions : UIxComponent
@interface UIxMailListActions : WODirectAction
{
NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
NSArray *messages;
@ -45,6 +45,10 @@
- (EOQualifier *) searchQualifier;
- (NSString *) msgLabels;
- (id) getMailAction;
- (id <WOActionResults>) getSortedUIDsAction;
- (id <WOActionResults>) getHeadersAction;
@end
#endif /* UIXMAILLISTACTIONS_H */

View File

@ -34,6 +34,7 @@
#import <Foundation/NSTimeZone.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/SoObject+SoDAV.h>
@ -56,19 +57,20 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import "WOContext+UIxMailer.h"
#import <UI/Common/WODirectAction+SOGo.h>
#import "WOContext+UIxMailer.h"
#import "UIxMailListActions.h"
@implementation UIxMailListActions
- (id) init
- (id) initWithRequest: (WORequest *) newRequest
{
SOGoUser *user;
if ((self = [super init]))
if ((self = [super initWithRequest: newRequest]))
{
user = [context activeUser];
user = [[self context] activeUser];
ASSIGN (dateFormatter, [user dateFormatterInContext: context]);
ASSIGN (userTimeZone, [[user userDefaults] timeZone]);
folderType = 0;

View File

@ -79,17 +79,17 @@
methods = {
getMail = {
protectedBy = "View";
pageName = "UIxMailListActions";
actionClass = "UIxMailListActions";
actionName = "getMail";
};
uids = {
protectedBy = "<public>";
pageName = "UIxMailListActions";
actionClass = "UIxMailListActions";
actionName = "getSortedUIDs";
};
headers = {
protectedBy = "<public>";
pageName = "UIxMailListActions";
actionClass = "UIxMailListActions";
actionName = "getHeaders";
};
subscribe = {