This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Replicating from a Workspace
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
I tried a new tact to code replication yesterday. I thought I'd just see if I could skip the StoreForGlorpVWUI package and do it directly with the tools provided (I'm not a fan of all the disparate stuff StoreForGlorpVWUI adds in).
Loading just StoreForGlorpReplication was very pleasant. The only "why is that in there?" I noticed was OracleEXDI. It was a marked improvement over loading the other package. The loaded nicely, I wouldn't have gotten very far without some wonderful help from Alan Knight, the main author or Glorp. Glorp is good and I like it. The more I use it, the more it impresses me. And Alan's always very helpful. Too bad it doesn't have a catchy name like the Ruby stuff does for Rails. "Smalltalk with Glorp" just doesn't sound as elegant as "Ruby on Rails." I digress.
Replicating a package between two repositories is a bit longish, but it's very straightforward. Here's an example:
sr := StoreReplicator new.
"setup the source login"
login := Login new.
login database: PostgreSQLPlatform new.
login username: 'xp'.
login password: ''.
login connectString: 'puffin.keyww.com_teamw'.
login schema: ''. "you do this for PostGreSQL, other platforms, you actually put something here"
login name: 'Key'.
"create a session around the login, add it to the replicators"
session := GlorpSession new.
session system: (StoreDescriptorSystem forPlatform: login database).
session accessor: (DatabaseAccessor forLogin: login).
session login.
sr sourceSession: session.
"rinse/repeat for the target"
login := Login new.
login database: PostgreSQLPlatform new.
login username: 'tgriggs'.
login password: ''.
login connectString: 'store.cincomsmalltalk.com:5432_store_public'.
login schema: ''.
login name: 'OR'.
session := GlorpSession new.
session system: (StoreDescriptorSystem forPlatform: login database).
session accessor: (DatabaseAccessor forLogin: login).
session login.
sr targetSession: session.
"tell the replicator to replicate the latest and all versions backwards from it and then replicate a package or two"
sr replicateRecursively: true.
sr replicatePackageNamed: 'StoreExtensions'