[work on initialize dummy data thomashartman1@gmail.com**20081002105359] hunk ./src/AppStateSetBased.hs 169 -initializeDummyData = modUsers g - where g users = if ( S.null users) - then datastoreDummyData - else error failmsg - failmsg = "initializeDummyData, for safety, only works if there is currently no data in app\ - \Maybe you shouldd first do mv _local _local.bak to get any existing data out of the way." +initializeDummyData = modUsers (const datastoreDummyData) + + hunk ./src/Controller.hs 138 -spAddDummyData rglobs = do - withRequest $ \rq -> (update InitializeDummyData) - ( return . tutlayoutU rglobs [] ) "home" +spAddDummyData rglobs = + withRequest $ \_ -> do + us <- query AskDatastore + if S.null us + then do update InitializeDummyData + return $ tutlayoutU rglobs [] "home" + else return $ tutlayoutU rglobs [("errormsg", failmsg)] "errortemplate" + where failmsg = "initializeDummyData, for safety, only works if there is currently no data in app\ + \Maybe you shouldd first do mv _local _local.bak to get any existing data out of the way." + hunk ./templates/maciddatasafety.st 3 -

All web startups have something in common. If you lose your user data, you are hosed. +$!

All web startups have something in common. If you lose your user data, you are hosed. !$ hunk ./templates/maciddatasafety.st 8 -

If you are using php, ruby on rails, or one of the other popular web frameworks, your user data is probably - in a mysql database, or if you are well funded maybe in Oracle. If you have outsourced your server hosting, - maybe you are even lucky enough to have a database administrator that takes backups for you on a regular basis. - That should help you sleep at night -- assuming that you can really trust that your dba is doing their job. +

If you are using php, ruby on rails, or one of the other popular web frameworks, your user data is likely + in a mysql database$!, or if you are well funded maybe in Oracle!$. If you have outsourced your server hosting, + maybe you $!are even lucky enough to!$ have a database administrator that takes backups for you on a regular basis. + That probably helps you sleep at night, assuming that you can really trust that your dba is doing their job. hunk ./templates/maciddatasafety.st 23 -

If you have valuable data, and are migrating macid (lesson in progress) to a new data schema, - you are also going to want to be extra cautious. +

When migrating macid data to a new schema, you are also going to want to be extra cautious. hunk ./templates/maciddatasafety.st 26 - to remind yourself to be cautious while learning about HAppS in the tutorial sandbox. + to remind yourself to be careful while learning about HAppS in the tutorial sandbox. hunk ./templates/maciddatasafety.st 99 - - - - - - +

Let's now populate our web application with dummy data. hunk ./templates/maciddummydata.st 3 -

Assumng you are running this tutorial locally and everything worked, you now have a job board with no jobs -- -unless of course you took the time to create some some test data manually. +

Assumng you are following along with the tutorial and running locally, you now have a job board with one user + ("testuser") and no jobs, unless you took the time to create additional test data manually. hunk ./templates/maciddummydata.st 10 -

Firstly, you need to know how to back up your HAppS State data. +

Firstly, restart HAppS in a pristine state by either deleting or backing up your _local data directory + as described earler. Now, click this link. + +