+2005-06-23 Stephane Corthesy <stephane@sente.ch>
+
+ * v4.5.165
+
+ * WOComponent.m: -synchronizesVariablesWithBindings now returns NO if
+ the component is stateless (-isStateless returns YES)
+
+ * WOComponent.m: -frameworkName now returns 'nil' if the component is
+ located in the main bundle (this might affect resource lookups)
+
+ * WOComponent.m: +templateWithHTMLString:declarationString:languages:
+ is now a class method like in WO
+
+ * WOComponent.m: -pathForResourceNamed: now checks whether a session
+ is available and otherwise uses the browserLanguages array to
+ perform a languages lookup
+
+2005-06-10 Helge Hess <helge.hess@opengroupware.org>
+
+ * WEClientCapabilities.m: fixed a typo (v4.5.164)
+
2005-06-02 Helge Hess <helge.hess@opengroupware.org>
* WebDAV/SoObjectWebDAVDispatcher.m: prepared MKCALENDAR method
return self->wocName;
}
- (NSString *)frameworkName {
- return [[NGBundle bundleForClass:[self class]] bundleName];
+ NSBundle *cbundle;
+
+ cbundle = [NGBundle bundleForClass:[self class]];
+ if (cbundle == [NSBundle mainBundle])
+ return nil;
+
+ return [cbundle bundleName];
}
- (NSString *)path {
NSArray *languages = nil;
}
- (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_ext {
- NSFileManager *fm = [NSFileManager defaultManager];
- NSEnumerator *languages = nil;
- NSString *language = nil;
+ NSFileManager *fm;
+ NSEnumerator *languages;
+ NSString *language;
BOOL isDirectory = NO;
- NSString *cpath = [self path];
+ NSString *cpath;
if (_ext) _name = [_name stringByAppendingPathExtension:_ext];
- if (cpath == nil) {
+ if ((cpath = [self path]) == nil) {
[self warnWithFormat:@"no path set in component %@", [self name]];
return nil;
}
+
+ fm = [NSFileManager defaultManager];
if (![fm fileExistsAtPath:cpath isDirectory:&isDirectory]) {
[self warnWithFormat:@"component directory %@ does not exist !", cpath];
return nil;
[self warnWithFormat:@"component path %@ is not a directory !", cpath];
return nil;
}
+
+ /* check in language projects */
- // check in language projects
-
- languages = [[(WOSession *)[self session] languages] objectEnumerator];
- while ((language = [languages nextObject])) {
- language = [[cpath stringByAppendingPathComponent:
- [language stringByAppendingPathExtension:@"lproj"]]
- stringByAppendingPathExtension:_name];
+ languages = [self hasSession]
+ ? [[(WOSession *)[self session] languages] objectEnumerator]
+ : [[[[self context] request] browserLanguages] objectEnumerator];
+
+ while ((language = [languages nextObject]) != nil) {
+ language = [language stringByAppendingPathExtension:@"lproj"];
+ language = [cpath stringByAppendingPathComponent:language];
+ language = [language stringByAppendingPathExtension:_name];
if ([fm fileExistsAtPath:language])
return language;
}
-
- // check in component
+
+ /* check in component */
cpath = [cpath stringByAppendingPathComponent:_name];
if ([fm fileExistsAtPath:cpath])
return cpath;
/* template */
-- (WOElement *)templateWithHTMLString:(NSString *)_html
++ (WOElement *)templateWithHTMLString:(NSString *)_html
declarationString:(NSString *)_wod
languages:(NSArray *)_languages
{
declarationString:(NSString *)_wod
{
IS_DEPRECATED;
- return [self templateWithHTMLString:_html
- declarationString:_wod
- languages:[(WOSession *)[self session] languages]];
+ return [[self class] templateWithHTMLString:_html
+ declarationString:_wod
+ languages:[(WOSession *)[self session] languages]];
}
- (WOElement *)templateWithName:(NSString *)_name {
}
- (BOOL)synchronizesVariablesWithBindings {
- return YES;
+ return [self isStateless] ? NO : YES;
}
- (void)setValue:(id)_value forBinding:(NSString *)_name {
return str;
}
-@end /* WOComponent */
-
-@implementation WOComponent(Statistics)
+/* Statistics */
- (NSString *)descriptionForResponse:(WOResponse *)_response
inContext:(WOContext *)_context
return [self name];
}
-@end /* WOComponent(Statistics) */
-
-@implementation WOComponent(AdvancedBindingAccessors)
+/* AdvancedBindingAccessors */
- (void)setUnsignedIntValue:(unsigned)_value forBinding:(NSString *)_name {
[self setValue:[NSNumber numberWithUnsignedInt:_value] forBinding:_name];
}
#endif
-@end /* WOComponent(AdvancedBindingAccessors) */
+@end /* WOComponent */