Hi all, I''m curious, how do people currently manage "registering" template bundles for their app''s feed stories? I''m not talking about the specific method calls, but how do you determine *when* to register a template? Right now I have a call to the relevant register_action() method of my publisher objects in my controller. It gets called just before I call deliver_action(), but this is far from ideal as it slows down the request processing. My current thinking is that I should perhaps write a facebooker-specific rake task to register all the feed templates in a rails app. The tricky part is how to manage different versions of templates being registered in development and production. Anyone have any thoughts on this, or willing to share their current approach? Thanks, Lee. -- Lee Mallabone Director, Crossbone Systems Ltd http://www.crossbonesystems.com http://www.fonicmonkey.net http://CambridgeWebHeads.ning.com
When I am about to publish an action I check to see if the template is registered. If it is not then I register it before publishing. Then I push to production and test all the publishing, which registers the templates. Dave On Wed, Oct 15, 2008 at 11:25 AM, Lee Mallabone <lee at crossbonesystems.com>wrote:> Hi all, > > I''m curious, how do people currently manage "registering" template > bundles for their app''s feed stories? I''m not talking about the > specific method calls, but how do you determine *when* to register a > template? > > Right now I have a call to the relevant register_action() method of my > publisher objects in my controller. It gets called just before I call > deliver_action(), but this is far from ideal as it slows down the > request processing. > > My current thinking is that I should perhaps write a > facebooker-specific rake task to register all the feed templates in a > rails app. The tricky part is how to manage different versions of > templates being registered in development and production. > > Anyone have any thoughts on this, or willing to share their current > approach? > > Thanks, > Lee. > > > -- > Lee Mallabone > Director, Crossbone Systems Ltd > > http://www.crossbonesystems.com > http://www.fonicmonkey.net > http://CambridgeWebHeads.ning.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20081015/31ee8f7b/attachment.html>
Stéphane Akkaoui
2008-Oct-15 17:34 UTC
[Facebooker-talk] registering feed template bundles
Hi, Facebooker provide a generator for publishers. $ script/generate publisher app on my observer, I have something like : class MessageObserver < ActiveRecord::Observer observe Message def after_save(message) AppPublisher.register_new_message_feeds unless Facebooker ::Rails ::Publisher::FacebookTemplate.find_by_template_name("new_message_feeds") AppPublisher.deliver_new_message_feed(message) end end and in my publisher : class AppPublisher < Facebooker::Rails::Publisher def new_message_feed_item_template one_line_story_template(_(''one_line_story_template_new_message'')) short_story_template(_(''short_story_template_new_message_title''), _(''short_story_template_new_message_body'')) full_story_template(_(''full_story_template_new_message_title''), _(''full_story_template_new_message_body'')) end def new_message_feed_item(message) user = Facebooker::User.new(message.user.uid) send_as :user_action from(user) target_ids(user.some_friends) data({ :data1 => "value1", :data2 => "value2", }) end end HTH, -- St?phane Akkaoui Le 15 oct. 08 ? 19:25, Lee Mallabone a ?crit :> Hi all, > > I''m curious, how do people currently manage "registering" template > bundles for their app''s feed stories? I''m not talking about the > specific method calls, but how do you determine *when* to register a > template? > > Right now I have a call to the relevant register_action() method of my > publisher objects in my controller. It gets called just before I call > deliver_action(), but this is far from ideal as it slows down the > request processing. > > My current thinking is that I should perhaps write a > facebooker-specific rake task to register all the feed templates in a > rails app. The tricky part is how to manage different versions of > templates being registered in development and production. > > Anyone have any thoughts on this, or willing to share their current > approach? > > Thanks, > Lee. > > > -- > Lee Mallabone > Director, Crossbone Systems Ltd > > http://www.crossbonesystems.com > http://www.fonicmonkey.net > http://CambridgeWebHeads.ning.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
On Oct 15, 2008, at 1:25 PM, Lee Mallabone wrote:> Hi all, > > I''m curious, how do people currently manage "registering" template > bundles for their app''s feed stories? I''m not talking about the > specific method calls, but how do you determine *when* to register a > template? > > Right now I have a call to the relevant register_action() method of my > publisher objects in my controller. It gets called just before I call > deliver_action(), but this is far from ideal as it slows down the > request processing. > > My current thinking is that I should perhaps write a > facebooker-specific rake task to register all the feed templates in a > rails app. The tricky part is how to manage different versions of > templates being registered in development and production.We use a cap task that registers on each deploy. It registers all of the templates and then unregisters any old ones. Victor Costan has been working on support for auto-registering new templates on first use. Hopefully that will be available by the end of the week. Mike> > > Anyone have any thoughts on this, or willing to share their current > approach? > > Thanks, > Lee. > > > -- > Lee Mallabone > Director, Crossbone Systems Ltd > > http://www.crossbonesystems.com > http://www.fonicmonkey.net > http://CambridgeWebHeads.ning.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com