appjam 0.1.0.pre11 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +22 -2
- data/lib/appjam/generators/cli.rb +7 -0
- data/lib/appjam/generators/model.rb +66 -10
- data/lib/appjam/generators/project.rb +57 -7
- data/lib/appjam/generators/project/Classes/ContactsAppDelegate.h.tt +5 -5
- data/lib/appjam/generators/project/Classes/ContactsAppDelegate.m.tt +14 -14
- data/lib/appjam/generators/project/Classes/contacts/ApplicationFacade.h.tt +11 -11
- data/lib/appjam/generators/project/Classes/contacts/ApplicationFacade.m.tt +8 -8
- data/lib/appjam/generators/project/Classes/contacts/controller/CreateUserCommand.h.tt +4 -4
- data/lib/appjam/generators/project/Classes/contacts/controller/CreateUserCommand.m.tt +13 -13
- data/lib/appjam/generators/project/Classes/contacts/controller/DeleteUserCommand.h.tt +4 -4
- data/lib/appjam/generators/project/Classes/contacts/controller/DeleteUserCommand.m.tt +10 -10
- data/lib/appjam/generators/project/Classes/contacts/controller/GetUsersCommand.h.tt +4 -5
- data/lib/appjam/generators/project/Classes/contacts/controller/GetUsersCommand.m.tt +8 -9
- data/lib/appjam/generators/project/Classes/contacts/controller/StartupCommand.h.tt +2 -2
- data/lib/appjam/generators/project/Classes/contacts/controller/StartupCommand.m.tt +12 -12
- data/lib/appjam/generators/project/Classes/contacts/controller/UpdateUserCommand.h.tt +4 -4
- data/lib/appjam/generators/project/Classes/contacts/controller/UpdateUserCommand.m.tt +13 -13
- data/lib/appjam/generators/project/Classes/contacts/model/UserProxy.h.tt +4 -4
- data/lib/appjam/generators/project/Classes/contacts/model/UserProxy.m.tt +15 -15
- data/lib/appjam/generators/project/Classes/contacts/model/vo/UserVO.h.tt +7 -7
- data/lib/appjam/generators/project/Classes/contacts/model/vo/UserVO.m.tt +18 -18
- data/lib/appjam/generators/project/Classes/contacts/view/UserFormMediator.h.tt +5 -5
- data/lib/appjam/generators/project/Classes/contacts/view/UserFormMediator.m.tt +18 -18
- data/lib/appjam/generators/project/Classes/contacts/view/UserListMediator.h.tt +5 -5
- data/lib/appjam/generators/project/Classes/contacts/view/UserListMediator.m.tt +19 -19
- data/lib/appjam/generators/project/Classes/contacts/view/UserMediator.h.tt +15 -0
- data/lib/appjam/generators/project/Classes/contacts/view/UserMediator.m.tt +43 -0
- data/lib/appjam/generators/project/Classes/contacts/view/components/Contacts.h.tt +12 -12
- data/lib/appjam/generators/project/Classes/contacts/view/components/Contacts.m.tt +14 -14
- data/lib/appjam/generators/project/Classes/contacts/view/components/UserForm.h.tt +14 -14
- data/lib/appjam/generators/project/Classes/contacts/view/components/UserForm.m.tt +29 -29
- data/lib/appjam/generators/project/Classes/contacts/view/components/UserList.h.tt +15 -15
- data/lib/appjam/generators/project/Classes/contacts/view/components/UserList.m.tt +29 -29
- data/lib/appjam/generators/project/Classes/org/puremvc/objectivec/patterns/command/SimpleCommand.m +1 -1
- data/lib/appjam/generators/project/Contacts_Prefix.pch.tt +1 -1
- data/lib/appjam/generators/project/main.m.tt +4 -4
- data/lib/appjam/generators/project/utils/NSStringWhiteSpace.h +2 -2
- data/lib/appjam/generators/project/utils/NSStringWhiteSpace.m +2 -2
- data/lib/appjam/generators/project/utils/UIDevice.h +2 -2
- data/lib/appjam/generators/project/utils/UIDevice.m +2 -2
- data/lib/appjam/generators/project/utils/URLEncodeString.h +2 -2
- data/lib/appjam/generators/project/utils/URLEncodeString.m +2 -2
- data/lib/appjam/version.rb +4 -4
- data/test/test_model_generator.rb +28 -0
- data/test/test_project_generator.rb +5 -5
- metadata +13 -15
- data/lib/appjam/generators/project/Classes/contacts/view/ContactsMediator.h.tt +0 -15
- data/lib/appjam/generators/project/Classes/contacts/view/ContactsMediator.m.tt +0 -43
@@ -1,15 +1,15 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Delete<%= @class_name %>Command.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import "SimpleCommand.h"
|
10
10
|
|
11
11
|
|
12
|
-
@interface
|
12
|
+
@interface Delete<%= @class_name %>Command : SimpleCommand {
|
13
13
|
|
14
14
|
}
|
15
15
|
|
@@ -1,21 +1,21 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Delete<%= @class_name %>Command.m
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "
|
10
|
-
#import "
|
11
|
-
#import "
|
9
|
+
#import "Delete<%= @class_name %>Command.h"
|
10
|
+
#import "<%= @class_name %>Proxy.h"
|
11
|
+
#import "<%= @class_name %>VO.h"
|
12
12
|
|
13
|
-
@implementation
|
13
|
+
@implementation Delete<%= @class_name %>Command
|
14
14
|
|
15
15
|
-(void)execute:(id<INotification>)notification {
|
16
|
-
|
17
|
-
|
18
|
-
[
|
16
|
+
<%= @class_name %>Proxy *<%= @project_name %>Proxy = (<%= @class_name %>Proxy *)[facade retrieveProxy:[<%= @class_name %>Proxy NAME]];
|
17
|
+
<%= @class_name %>VO *<%= @project_name %>VO = [notification body];
|
18
|
+
[<%= @project_name %>Proxy delete:<%= @project_name %>VO];
|
19
19
|
}
|
20
20
|
|
21
21
|
@end
|
@@ -1,16 +1,15 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Get<%= @class_name %>sCommand.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
|
10
9
|
#import "SimpleCommand.h"
|
11
10
|
|
12
11
|
|
13
|
-
@interface
|
12
|
+
@interface Get<%= @class_name %>sCommand : SimpleCommand {
|
14
13
|
|
15
14
|
}
|
16
15
|
|
@@ -1,21 +1,20 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Get<%= @class_name %>sCommand.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
|
10
|
-
#import "GetUsersCommand.h"
|
9
|
+
#import "Get<%= @class_name %>sCommand.h"
|
11
10
|
#import "ApplicationFacade.h"
|
12
|
-
#import "
|
11
|
+
#import "<%= @class_name %>Proxy.h"
|
13
12
|
|
14
|
-
@implementation
|
13
|
+
@implementation Get<%= @class_name %>sCommand
|
15
14
|
|
16
15
|
-(void)execute:(id<INotification>)notification {
|
17
|
-
|
18
|
-
[facade sendNotification:
|
16
|
+
<%= @class_name %>Proxy *<%= @project_name %>Proxy = (<%= @class_name %>Proxy *)[facade retrieveProxy:[<%= @class_name %>Proxy NAME]];
|
17
|
+
[facade sendNotification:Get<%= @class_name %>sSuccess body:<%= @project_name %>Proxy.data];
|
19
18
|
}
|
20
19
|
|
21
20
|
@end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
// StartupCommand.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import <UIKit/UIKit.h>
|
@@ -2,28 +2,28 @@
|
|
2
2
|
// StartupCommand.m
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import "StartupCommand.h"
|
10
|
-
#import "
|
10
|
+
#import "<%= @class_name %>.h"
|
11
11
|
#import "ApplicationFacade.h"
|
12
|
-
#import "
|
13
|
-
#import "
|
14
|
-
#import "
|
15
|
-
#import "
|
12
|
+
#import "<%= @class_name %>ListMediator.h"
|
13
|
+
#import "<%= @class_name %>Proxy.h"
|
14
|
+
#import "<%= @class_name %>Mediator.h"
|
15
|
+
#import "<%= @class_name %>FormMediator.h"
|
16
16
|
|
17
17
|
@implementation StartupCommand
|
18
18
|
|
19
19
|
-(void)execute:(id<INotification>)notification {
|
20
|
-
[facade registerProxy:[
|
20
|
+
[facade registerProxy:[<%= @class_name %>Proxy proxy]];
|
21
21
|
|
22
|
-
|
22
|
+
<%= @class_name %> *app = [notification body];
|
23
23
|
|
24
|
-
[facade registerMediator:[
|
25
|
-
[facade registerMediator:[
|
26
|
-
[facade registerMediator:[
|
24
|
+
[facade registerMediator:[<%= @class_name %>Mediator withViewComponent:app]];
|
25
|
+
[facade registerMediator:[<%= @class_name %>ListMediator withViewComponent:app.<%= @project_name %>List]];
|
26
|
+
[facade registerMediator:[<%= @class_name %>FormMediator withViewComponent:app.<%= @project_name %>Form]];
|
27
27
|
}
|
28
28
|
|
29
29
|
@end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Update<%= @class_name %>Command.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import "SimpleCommand.h"
|
10
10
|
|
11
11
|
|
12
|
-
@interface
|
12
|
+
@interface Update<%= @class_name %>Command : SimpleCommand {
|
13
13
|
|
14
14
|
}
|
15
15
|
|
@@ -1,26 +1,26 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// Update<%= @class_name %>Command.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "
|
9
|
+
#import "Update<%= @class_name %>Command.h"
|
10
10
|
#import "ApplicationFacade.h"
|
11
|
-
#import "
|
12
|
-
#import "
|
11
|
+
#import "<%= @class_name %>Proxy.h"
|
12
|
+
#import "<%= @class_name %>VO.h"
|
13
13
|
|
14
|
-
@implementation
|
14
|
+
@implementation Update<%= @class_name %>Command
|
15
15
|
|
16
16
|
-(void)execute:(id<INotification>)notification {
|
17
|
-
|
18
|
-
|
19
|
-
if ([
|
20
|
-
[
|
21
|
-
[facade sendNotification:
|
17
|
+
<%= @class_name %>Proxy *<%= @project_name %>Proxy = (<%= @class_name %>Proxy *)[facade retrieveProxy:[<%= @class_name %>Proxy NAME]];
|
18
|
+
<%= @class_name %>VO *<%= @project_name %>VO = [notification body];
|
19
|
+
if ([<%= @project_name %>VO isValid]) {
|
20
|
+
[<%= @project_name %>Proxy update:<%= @project_name %>VO];
|
21
|
+
[facade sendNotification:Show<%= @class_name %>List];
|
22
22
|
} else {
|
23
|
-
[facade sendNotification:ShowError body:@"Invalid
|
23
|
+
[facade sendNotification:ShowError body:@"Invalid <%= @class_name %>"];
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>Proxy.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import <UIKit/UIKit.h>
|
10
10
|
#import "Proxy.h"
|
11
11
|
|
12
|
-
@interface
|
12
|
+
@interface <%= @class_name %>Proxy : Proxy {
|
13
13
|
}
|
14
14
|
|
15
15
|
-(void)create:(id)item;
|
@@ -1,27 +1,27 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>Proxy.m
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "
|
10
|
-
#import "
|
9
|
+
#import "<%= @class_name %>Proxy.h"
|
10
|
+
#import "<%= @class_name %>VO.h"
|
11
11
|
|
12
|
-
@implementation
|
12
|
+
@implementation <%= @class_name %>Proxy
|
13
13
|
|
14
14
|
-(void)initializeProxy {
|
15
15
|
[super initializeProxy];
|
16
|
-
self.proxyName = [
|
16
|
+
self.proxyName = [<%= @class_name %>Proxy NAME];
|
17
17
|
self.data = [NSMutableArray array];
|
18
|
-
[self create:[
|
19
|
-
[self create:[
|
20
|
-
[self create:[
|
18
|
+
[self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"eiffel" firstName:@"Eiffel" lastName:@"Qiu" email:@"eiffelqiu@gmail.com" password:@"trustno1" confirmPassword:@"trustno1" department:@"IT"]];
|
19
|
+
[self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"mulder" firstName:@"Fox" lastName:@"Mulder" email:@"f_mulder@fbi.gov" password:@"trustno1" confirmPassword:@"trustno1" department:@"FBI"]];
|
20
|
+
[self create:[<%= @class_name %>VO with<%= @class_name %>Name:@"scully" firstName:@"Dana" lastName:@"Scully" email:@"d_scully@fbi.gov" password:@"trustno1" confirmPassword:@"trustno1" department:@"FBI"]];
|
21
21
|
}
|
22
22
|
|
23
23
|
+(NSString *)NAME {
|
24
|
-
return @"
|
24
|
+
return @"<%= @class_name %>Proxy";
|
25
25
|
}
|
26
26
|
|
27
27
|
-(NSMutableArray *)data {
|
@@ -34,8 +34,8 @@
|
|
34
34
|
|
35
35
|
-(void)update:(id)item {
|
36
36
|
for (int i=0; i<[self.data count]; i++) {
|
37
|
-
|
38
|
-
if ([
|
37
|
+
<%= @class_name %>VO *<%= @project_name %>VO = [self.data objectAtIndex:i];
|
38
|
+
if ([<%= @project_name %>VO.<%= @project_name %>name isEqualToString:[item <%= @project_name %>name]]) {
|
39
39
|
[self.data replaceObjectAtIndex:i withObject:item];
|
40
40
|
break;
|
41
41
|
}
|
@@ -44,8 +44,8 @@
|
|
44
44
|
|
45
45
|
-(void)delete:(id)item {
|
46
46
|
for (int i=0; i<[self.data count]; i++) {
|
47
|
-
|
48
|
-
if ([
|
47
|
+
<%= @class_name %>VO *<%= @project_name %>VO = [self.data objectAtIndex:i];
|
48
|
+
if ([<%= @project_name %>VO.<%= @project_name %>name isEqualToString:[item <%= @project_name %>name]]) {
|
49
49
|
[self.data removeObjectAtIndex:i];
|
50
50
|
break;
|
51
51
|
}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>VO.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import <UIKit/UIKit.h>
|
10
10
|
|
11
11
|
|
12
|
-
@interface
|
13
|
-
NSString
|
12
|
+
@interface <%= @class_name %>VO : NSObject {
|
13
|
+
NSString *<%= @project_name %>name, *firstName, *lastName, *email, *password, *confirmPassword, *department;
|
14
14
|
}
|
15
15
|
|
16
|
-
@property(nonatomic, retain) NSString
|
16
|
+
@property(nonatomic, retain) NSString *<%= @project_name %>name, *firstName, *lastName, *email, *password, *confirmPassword, *department;
|
17
17
|
|
18
|
-
+(id)
|
18
|
+
+(id)with<%= @class_name %>Name:(NSString *)<%= @project_name %>name firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email password:(NSString *)password confirmPassword:(NSString *)confirmPassword department:(NSString *)department;
|
19
19
|
-(NSString *)givenName;
|
20
20
|
-(BOOL)isValid;
|
21
21
|
|
@@ -1,28 +1,28 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>VO.m
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "
|
9
|
+
#import "<%= @class_name %>VO.h"
|
10
10
|
|
11
11
|
|
12
|
-
@implementation
|
12
|
+
@implementation <%= @class_name %>VO
|
13
13
|
|
14
|
-
@synthesize
|
14
|
+
@synthesize <%= @project_name %>name, firstName, lastName, email, password, confirmPassword, department;
|
15
15
|
|
16
|
-
+(id)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
return
|
16
|
+
+(id)with<%= @class_name %>Name:(NSString *)<%= @project_name %>name firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email password:(NSString *)password confirmPassword:(NSString *)confirmPassword department:(NSString *)department {
|
17
|
+
<%= @class_name %>VO *<%= @project_name %>VO = [[[<%= @class_name %>VO alloc] init] autorelease];
|
18
|
+
<%= @project_name %>VO.<%= @project_name %>name = <%= @project_name %>name;
|
19
|
+
<%= @project_name %>VO.firstName = firstName;
|
20
|
+
<%= @project_name %>VO.lastName = lastName;
|
21
|
+
<%= @project_name %>VO.email = email;
|
22
|
+
<%= @project_name %>VO.password = password;
|
23
|
+
<%= @project_name %>VO.confirmPassword = confirmPassword;
|
24
|
+
<%= @project_name %>VO.department = department;
|
25
|
+
return <%= @project_name %>VO;
|
26
26
|
}
|
27
27
|
|
28
28
|
-(NSString *)givenName {
|
@@ -30,11 +30,11 @@
|
|
30
30
|
}
|
31
31
|
|
32
32
|
-(BOOL)isValid {
|
33
|
-
return
|
33
|
+
return <%= @project_name %>name != nil && password != nil && confirmPassword != nil && [password isEqualToString:confirmPassword];
|
34
34
|
}
|
35
35
|
|
36
36
|
-(void)dealloc {
|
37
|
-
self
|
37
|
+
self.<%= @project_name %>name = nil;
|
38
38
|
self.firstName = nil;
|
39
39
|
self.lastName = nil;
|
40
40
|
self.email = nil;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>FormMediator.h
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
9
|
#import <UIKit/UIKit.h>
|
10
10
|
#import "Mediator.h"
|
11
|
-
#import "
|
11
|
+
#import "<%= @class_name %>Form.h"
|
12
12
|
#import "ApplicationFacade.h"
|
13
13
|
|
14
|
-
@interface
|
14
|
+
@interface <%= @class_name %>FormMediator : Mediator <<%= @class_name %>FormViewControllerDelegate> {
|
15
15
|
}
|
16
16
|
|
17
17
|
@end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
//
|
2
|
-
//
|
2
|
+
// <%= @class_name %>FormMediator.m
|
3
3
|
// PureMVC_ObjectiveC
|
4
4
|
//
|
5
|
-
//
|
6
|
-
//
|
5
|
+
// Created by <%= @developer.capitalize %> on <%= @created_on %>
|
6
|
+
// Copyright(c) <%= Time.now.year %>, All rights reserved.
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "
|
9
|
+
#import "<%= @class_name %>FormMediator.h"
|
10
10
|
|
11
|
-
@implementation
|
11
|
+
@implementation <%= @class_name %>FormMediator
|
12
12
|
|
13
13
|
+(NSString *)NAME {
|
14
|
-
return @"
|
14
|
+
return @"<%= @class_name %>FormMediator";
|
15
15
|
}
|
16
16
|
|
17
|
-
-(
|
17
|
+
-(<%= @class_name %>Form *)viewComponent {
|
18
18
|
return viewComponent;
|
19
19
|
}
|
20
20
|
|
21
21
|
-(void)initializeMediator {
|
22
|
-
self.mediatorName = [
|
22
|
+
self.mediatorName = [<%= @class_name %>FormMediator NAME];
|
23
23
|
}
|
24
24
|
|
25
25
|
-(void)onRegister {
|
@@ -27,27 +27,27 @@
|
|
27
27
|
}
|
28
28
|
|
29
29
|
-(NSArray *)listNotificationInterests {
|
30
|
-
return [NSArray arrayWithObjects:
|
30
|
+
return [NSArray arrayWithObjects:ShowEdit<%= @class_name %>, ShowNew<%= @class_name %>, nil];
|
31
31
|
}
|
32
32
|
|
33
|
-
-(void)
|
34
|
-
[self sendNotification:
|
33
|
+
-(void)create<%= @class_name %>Selected:(<%= @class_name %>VO *)<%= @project_name %>VO {
|
34
|
+
[self sendNotification:Create<%= @class_name %> body:<%= @project_name %>VO];
|
35
35
|
}
|
36
36
|
|
37
|
-
-(void)
|
38
|
-
[self sendNotification:
|
37
|
+
-(void)update<%= @class_name %>Selected:(<%= @class_name %>VO *)<%= @project_name %>VO {
|
38
|
+
[self sendNotification:Update<%= @class_name %> body:<%= @project_name %>VO];
|
39
39
|
}
|
40
40
|
|
41
41
|
-(void)handleNotification:(id<INotification>)notification {
|
42
42
|
[self.viewComponent setView:nil];
|
43
|
-
if ([[notification name] isEqualToString:
|
44
|
-
[self.viewComponent
|
43
|
+
if ([[notification name] isEqualToString:ShowEdit<%= @class_name %>]) {
|
44
|
+
[self.viewComponent set<%= @class_name %>VO:[notification body]];
|
45
45
|
[self.viewComponent setMode:EDIT];
|
46
|
-
} else if ([[notification name] isEqualToString:
|
47
|
-
[self.viewComponent
|
46
|
+
} else if ([[notification name] isEqualToString:ShowNew<%= @class_name %>]) {
|
47
|
+
[self.viewComponent set<%= @class_name %>VO:[[[<%= @class_name %>VO alloc] init] autorelease]];
|
48
48
|
[self.viewComponent setMode:NEW];
|
49
49
|
}
|
50
|
-
[self sendNotification:
|
50
|
+
[self sendNotification:Show<%= @class_name %>Form body:self.viewComponent];
|
51
51
|
}
|
52
52
|
|
53
53
|
-(void)dealloc {
|