href | pageName | action | (directActionName & actionClass)
fragmentIdentifier
disabled
- timeout
+ timeout/seconds
*/
@interface WOMetaRefresh : WOHTMLDynamicElement
? [sidInUrlAssoc boolValueInComponent:nil]
: YES;
+ if (self->timeout == nil)
+ self->timeout = OWGetProperty(_config, @"seconds");
+ else if ([OWGetProperty(_config, @"seconds") autorelease] != nil) {
+ [self logWithFormat:
+ @"WARNING: got both, 'timeout' and 'seconds' bindings!"];
+ }
+
self->queryDictionary = OWGetProperty(_config, @"queryDictionary");
self->queryParameters = OWExtractQueryParameters(_config);
}
[super dealloc];
}
-/* ******************** responder ******************** */
+/* handling requests */
- (id)invokeActionForRequest:(WORequest *)_request
inContext:(WOContext *)_ctx
return nil;
}
+/* generating response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
- WOComponent *sComponent = [_ctx component];
+ WOComponent *sComponent;
int to;
NSString *url;
NSString *queryString = nil;
if ([[_ctx request] isFromClientComponent])
return;
+ sComponent = [_ctx component];
to = [self->timeout intValueInComponent:sComponent];
WOResponse_AddCString(_response, "<meta http-equiv=\"refresh\" content=\"");
WOResponse_AddInt(_response, to);
WOResponse_AddCString(_response, " />");
}
-// description
+/* description */
- (NSString *)associationDescription {
NSMutableString *str = [NSMutableString stringWithCapacity:256];
-
+
if (self->action) [str appendFormat:@" action=%@", self->action];
if (self->href) [str appendFormat:@" href=%@", self->href];
if (self->pageName) [str appendFormat:@" pageName=%@", self->pageName];