Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Duncanson 430 posts 1360 karma points c-trib
    Sep 18, 2013 @ 17:50
    Peter Duncanson
    0

    Can you add an event?

    I'm pondering doing some processing on the XML files you guys write down but to do it currently I'm going to have to use a file watcher, happy to do that but I wondered if it would be better to have an event in uSync itself that I could hook into that fires when it has done any syncing.

    Thoughts?

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Sep 19, 2013 @ 09:34
    Kevin Jump
    0

    yeah

    We currently have events for PreSave and PreDelete, those in the know tell me this is good for Team Foundation Server.

    I can add a Saved and Deleted event, so you can pick up on those if you want to do something afterwards.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Sep 19, 2013 @ 11:12
    Kevin Jump
    1

    Hi i've added some events to the latest build of uSync(1.5.1)

    jumps.umbraco.usync.helpers.XmlDoc.Deleting
    jumps.umbraco.usync.helpers.XmlDoc.Deleted
    jumps.umbraco.usync.helpers.XmlDoc.Saving
    jumps.umbraco.usync.helpers.XmlDoc.Saved
    

    These are fired every time an sync (xml) file is written to disk or deleted. they pass the filename in the event arg

    With Attach set (the default in the config attach="true") these events will fire shortly after any changes via the umbraco back end.

    and if you have a full sync running at startup write="true" then you would get lots of these events firing at start up as uSync writes all the doctypes out to disk.

    have a go and let me know if that does what you want.

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Sep 24, 2013 @ 16:21
    Peter Duncanson
    0

    Perfect Kevin, I'll have a play and report back :)

    A "sync'ed everything for now" event might be nice but guess I could fudge that by throttling/debouncing the Saved events?

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Oct 03, 2013 @ 17:15
    Kevin Jump
    1

    Hi i've just put a 'beta' of uSync 1.7.0 out.

    It has events for Starting and Initialized

    They are in main jumps.umbraco.usync class. and they fire with events arguments for import,export and attach so you can work out what uSync is about to do / has just done ?

    probably the most sensible way to use them all is attach to Initialized and then when it fires attach to the individual file events in that callback. then you won't get loads of events firing during startup ?

Please Sign in or register to post replies

Write your reply to:

Draft