PageRenderTime 33ms CodeModel.GetById 11ms app.highlight 20ms RepoModel.GetById 1ms app.codeStats 0ms

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