Hi Keith,
I have tried out your Magma seasideHelper and the ToDo application. Everything looks good but I have one problem. The data inputs in the ToDO application are not stored in the magma database (used the default configuration WAMagmaSoloAuto).
When I call "self session db addUser: 'aUser' in a renderContentOn method, the new user was added to the STMagmaDatabase dictionary but these changes are not stored persistent in the magma database.
Do I anything wrong or how can I find out what was going wrong?
Robert
"Robert Schwarz" r.schwarz@blackstream.at wrote in message
When I call "self session db addUser: 'aUser' in a renderContentOn method, the new user was added to the STMagmaDatabase dictionary but
I noticed this too; changes at the root itself are persisted.
itsme213 wrote:
"Robert Schwarz" r.schwarz@blackstream.at wrote in message
When I call "self session db addUser: 'aUser' in a renderContentOn method, the new user was added to the STMagmaDatabase dictionary but
I noticed this too; changes at the root itself are persisted.
This shouldnt be too hard to sort out... gimme a couple of days...
Keith
Hi Keith,
I'm trying your tutorial out now too and am experiencing the same issue as Robert and itsMe213. That is that "users" are persisted but the any new tasks they created are not.
Good news! I figured it out.
The issue is that when you follow the tutorial on Potsdam, they never actually put the "tasks" in the "user" object. You are going to have to do that yourself and when you do, Magma works like a charm. Here are excerpts of my relevant methods:
StUser... addTask: aTask (self tasks includes: aTask) ifFalse: [self tasks add: aTask]. ^ aTask.
StLoggedInComponent... initialize super initialize. self initializeMenuComponent. self initializeListComponent. self listComponent items: self session user tasks. Transcript show: 'Initialized listComponent'; cr. self listComponent items isEmptyOrNil ifTrue: [ Transcript show: 'Making test tasks'; cr. self listComponent items: self testTasks]. taskEditor := StTaskEditor new.
testTasks ^ OrderedCollection with: (self session user addTask: (StTask new deadline: Date yesterday; completed: false; taskName: 'Missed task')) with: (self session user addTask: (StTask new deadline: Date tomorrow; completed: false; taskName: 'Pending task')) with: (self session user addTask: (StTask new deadline: Date tomorrow; completed: true; taskName: 'Already completed task'))
createNewTask | answer newTask | answer := self call: (self taskEditor newTask; yourself). answer ifTrue: [ newTask := self taskEditor task. self session user addTask: newTask].
Cheers, -- Aaron
On Jan 9, 2008, at 11:52 PM, Keith Hodges wrote:
itsme213 wrote:
"Robert Schwarz" r.schwarz@blackstream.at wrote in message
When I call "self session db addUser: 'aUser' in a renderContentOn method, the new user was added to the STMagmaDatabase dictionary but
I noticed this too; changes at the root itself are persisted.
This shouldnt be too hard to sort out... gimme a couple of days...
Keith _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Hi Keith,
Question for you :-)
I liked how in your tutorial write up you mentioned we could build a "where" clause in the "findUserByEmail" method. Unfortunately, I could never get this to work. I kept getting nil back. Could you take a moment to look at that and elaborate a bit more because it looked cool.
I noticed in your repository code that you just do a "detect" instead of a "where" clause. I ended up doing that too to get it to work but I'd like to know more about the "where:" approach and how it might be better / worse than a "detect".
Thanks!
-- Aaron
magma@lists.squeakfoundation.org