/SA.Framework/SAWUI/Site.m

http://eeframework.googlecode.com/ · Objective C · 84 lines · 52 code · 20 blank · 12 comment · 1 complexity · f4db720a3233faff619fd7ff5d8e990c MD5 · raw file

  1. // -*- objc -*-
  2. #import "Site.h"
  3. @implementation Site
  4. - (id)init
  5. {
  6. self = [super init];
  7. return self;
  8. }
  9. - (void)dealloc
  10. {
  11. [super dealloc];
  12. }
  13. /* WO overridings */
  14. -(void)appendToResponse:(GSWResponse *)aResponse
  15. inContext:(GSWContext *)aContext
  16. {
  17. NSString *tmp = [[self parent] valueForKey:@"siteName"];
  18. if(![tmp isEqualToString:_entityName])
  19. {
  20. ASSIGN(_entityName, tmp);
  21. _isFirst = YES;
  22. }
  23. [super appendToResponse:aResponse inContext:aContext];
  24. }
  25. /* SAWUI specific */
  26. - (NSString *)entityName
  27. {
  28. /* return [_entityName stringByPaddingToLength:_maxLengthOfItemName
  29. withString:@" "
  30. startingAtIndex:0];*/
  31. return _entityName;
  32. }
  33. - (NSArray *)list
  34. {
  35. return [(SAWUIController *)GSWApp loginsForSite:_entityName];
  36. }
  37. - (NSDecimalNumber *)itemBytes
  38. {
  39. return [(SAWUIController *)GSWApp
  40. bytesForLogin:[[self list] objectAtIndex:_base + _index]
  41. bySite:_entityName];
  42. }
  43. - (NSString *)itemName
  44. {
  45. return [super itemName];
  46. }
  47. - (NSString *)selectedItemName
  48. {
  49. return [super selectedItemName];
  50. }
  51. - (GSWElement *)itemHasBeenClicked
  52. {
  53. _selectedItem = _base + _index;
  54. [[self parent] setValue:[self selectedItemName] forKey:@"loginName"];
  55. [[self parent] setValue:[NSNumber numberWithInt:LOGIN] forKey:@"mode"];
  56. return nil;
  57. }
  58. @end /* Site */
  59. /*
  60. - (NSDecimalNumber *)bytes
  61. {
  62. return [(SAWUIController *)GSWApp bytesForSite:_siteName];
  63. }
  64. */