cparnot / remoteactivity

Automatically exported from code.google.com/p/remoteactivity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Host should validate data before going online

GoogleCodeExporter opened this issue · comments

If a query cannot proceed, because something is not set right, like the batch 
system or access shell, 
the host should not be able to go online, and the Go Online button and menu 
items should be 
disabled. At the moment, the host query fails silently. The user gets no 
indication as to why the 
update did not proceed.

Original issue reported on code.google.com by drewmcco...@gmail.com on 30 May 2007 at 7:24

I think this is how we should solve the issue:
- Make a method to RealHost called 'canBecomeActive' (Active is the internal 
word for 'online'). This method 
checks the things above to make sure they are non-nil, and returns a BOOL to 
indicate if everything is setup 
right.
- Write a method called 'validateIsActive:error:'. This would call 
'canBecomeActive' to determine if the setting 
for the isActive property is allowed. For more info on core data validation, 
see validateValue:forKey:error: in 
the docs.
- Update the user interface so that it is not possible to go online when 
canBecomeActive returns NO. This 
involves binding the Go Online buttons enabled binding to canBecomeActive. 
Also, the -(BOOL)
validateMenuItem:(NSMenuItem *)anItem method in MainController will need 
updating, so that it too calls 
canBecomeActive on the selected hosts.

Original comment by drewmcco...@gmail.com on 31 May 2007 at 6:59

Okay, I started work on this. I'll keep you updated.

Original comment by gchin...@gmail.com on 31 May 2007 at 4:55

  • Changed state: Started
It looks like I need to learn a lot more about Core Data before I can 
successfully
tackle this issue. I have changed the status back to where it was. If I had 
specific
questions about Core Data, I would immediately ask, but I need to understand 
more
about  how KVC is used in Core Data, and a whole lot of other Core Data idioms.

Sorry about the inconvenience,

Regards,
Chinmoy.

Original comment by gchin...@gmail.com on 1 Jun 2007 at 2:53

  • Changed state: Accepted
You will also need the key 'canBecomeActive' to triggger KVO (you  are not 
adding a coredata attribute, right?). 
This means using the method

+ (void)setKeys:(NSArray *)keys 
triggerChangeNotificationsForDependentKey:(NSString *)dependentKey

in the initialize.

Original comment by charles....@gmail.com on 2 Jun 2007 at 5:28