Copied to clipboard

Flag this post as spam?

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


  • Loïc AUDUSSEAU 11 posts 81 karma points
    Nov 07, 2015 @ 14:00
    Loïc AUDUSSEAU
    0

    How to use "Enabled" property for handlers ?

    Hi,

    I'm trying to use "Enabled" property for handlers in config file but when I values it ​​to true or false nothing special seems to change during import and export processes.

    Here what I'm trying to do : I would like to disable content export on my dev environment (all other handlers would be enabled), and enable it on my stage environment (all other handlers would be disabled). Is it possible to define such configuration ?

    Thanks for your help and your good work.

    Loïc

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Nov 07, 2015 @ 19:59
    Kevin Jump
    0

    Hi,

    Hi it should work but there are a couple of "gotchas"

    1. Editing the uSync config, doesn't restart the site, so the settings aren't reloaded. if you change the usync configs, you should either also touch the web.config or restart the site somehow so the configs are reloaded.

    2. you have to get the names right, and the content ones are not in the editor by default. so for content it should be.

      HandlerConfig Name="uSync: ContentHandler" Enabled="false" HandlerConfig Name="uSync: MediaHandler" Enabled="false"

    it should be possible to have the handlers on and off on different environments.

    if this doesn't work give us a shout.

  • Loïc AUDUSSEAU 11 posts 81 karma points
    Nov 08, 2015 @ 07:13
    Loïc AUDUSSEAU
    0

    Hi,

    First thanks to your quick answer.

    I must admit that I have some problems in using uSync.

    Concerning the "gotchas", I was alreading using them.

    Here's my configuration, on my dev server, all handlers are enabled except ContentHandler and MediaHandler. I want to export all all my modifications on corresponding elements (data types, template, content types... all except content and media). When I use "modifications" term it means creation, update and delete.

    I do export manually. After export I take all my data folder, to put it on my stage server after deleting data folder on this server.

    After all my files are copied, I go to my stage server and manually click on "Import" button (not "Import all"). What's the configuration on my stage server ? First I disabled all handlers except "ContentHandler" and "MediaHandler", why ? Because, I was thinking "enabled" property was for the export action. But I seems to be wrong. Indeed, when I import my data with all my handlers disabled, nothing import. So I changed that and put all my handlers enabled except "ContentHandler" and "MediaHandler", finnaly the same configuration as my dev server. Then when I use "Import" command my data are imported... but...not always as expected.

    For exemple, I try to delete a data type on my dev server, then I export manually my data. I delete the data folder on stage server, then I copy my data folder on dev server to stage server. Finally I use "Import" button on my stage server. Result : my data type is not deleted, is it normal ?

    There's no problem when adding or updating data types but for deleting...I don't know, I'm missing something ?

    If I come back to my disabled handlers on my stage server... If I want to export Content and Media from my stage server to my dev server how can I do ? Apparently "enabled" property i used for export and import, here's I need two differents configurations because, on a same server, I want to import some data and export other data, is it possible ?

    Thanks for your help.

    Loïc

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Nov 08, 2015 @ 10:09
    Kevin Jump
    0

    Hi,

    sorry its causing you problems - some of the config can be a little complex, but it was an attempt to allow different configurations.

    As you've noticed the handlers are either enabled or not, it doesn't change the import / export.

    the import and export are controlled higher up in the config file.

    <Import>True</Import>
    

    Turns of the importing of usync files at startup (so when you're site starts, if this is true, the files get imported then - you probably don't want this on a stage server).

    <ExportAtStartup>False</ExportAtStartup>
    

    this is the opposite of import, it writes everything to disk when the app starts up, this is false and most of the time you wouldn't want to do this.

      <ExportOnSave>true</ExportOnSave> 
    

    Export on Save will write out changes every time an item is saved inside umbraco (so when you click save on a doctype the usync file gets written to disk)

    Deletes are handled by uSync, they are written to the uSyncActions.config file - when you delete this should be in the root of your uSync/data folder. make sure it makes it over to the other side too.

    However because you don't want to go around deleting things that may have been recreated on the other side, the deletes are done via the internal GUID property on the item. this means that the GUIDs must match on the source and target servers - which in turn means the items must have been synced at least once before a delete will find them.

    Its equally possible that one of the delete types isn't working as expected. so if you have the file, and they match, if you post any usync errors you see from the /app_data/logs/umbracoTraceLog.txt that would help work out if that's the problem.

    You can also if you really want at the following to the bottom of the config/log4net.config file and you will get lots of usync debugging written into the logfile.

    <logger name="Jumoo.uSync.BackOffice">
      <level value="Debug" />
    </logger>
    <logger name="Jumoo.uSync.Core">
       <level value="Debug" />
    </logger>
    

    hope that helps a little.

  • Loïc AUDUSSEAU 11 posts 81 karma points
    Nov 08, 2015 @ 10:53
    Loïc AUDUSSEAU
    0

    Hi,

    Thanks for your advices.

    So...There's something I don't understand.

    Here's my dev config file :

    <?xml version="1.0" encoding="utf-8"?>
    <uSyncBackOfficeSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Import>true</Import>
      <ExportAtStartup>false</ExportAtStartup>
      <ExportOnSave>true</ExportOnSave>
      <WatchForFileChanges>false</WatchForFileChanges>
      <ArchiveVersions>false</ArchiveVersions>
      <Folder>~/uSync/data/</Folder>
      <ArchiveFolder>~/uSync/Archive/</ArchiveFolder>
      <BackupFolder>~/uSync/Backup/</BackupFolder>
      <MaxArchiveVersionCount>0</MaxArchiveVersionCount>
      <Handlers>
        <HandlerConfig Name="uSync: DataTypeHandler" Enabled="true" />
        <HandlerConfig Name="uSync: TemplateHandler" Enabled="true" />
        <HandlerConfig Name="uSync: ContentTypeHanlder" Enabled="true" />
        <HandlerConfig Name="uSync: MediaTypeHandler" Enabled="true" />
        <HandlerConfig Name="uSync: MemberTypeHandler" Enabled="true" />
        <HandlerConfig Name="uSync: LanguageHandler" Enabled="true" />
        <HandlerConfig Name="uSync: DictionaryHandler" Enabled="true" />
        <HandlerConfig Name="uSync: MacroHandler" Enabled="true" />
        <HandlerConfig Name="uSync: ContentHandler" Enabled="false" />
        <HandlerConfig Name="uSync: MediaHandler" Enabled="false" />
      </Handlers>
    </uSyncBackOfficeSettings>
    

    And my stage config file :

    <?xml version="1.0" encoding="utf-8"?>
    <uSyncBackOfficeSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Import>true</Import>
      <ExportAtStartup>false</ExportAtStartup>
      <ExportOnSave>true</ExportOnSave>
      <WatchForFileChanges>false</WatchForFileChanges>
      <ArchiveVersions>false</ArchiveVersions>
      <Folder>~/uSync/data/</Folder>
      <ArchiveFolder>~/uSync/Archive/</ArchiveFolder>
      <BackupFolder>~/uSync/Backup/</BackupFolder>
      <MaxArchiveVersionCount>0</MaxArchiveVersionCount>
      <Handlers>
        <HandlerConfig Name="uSync: DataTypeHandler" Enabled="false" />
        <HandlerConfig Name="uSync: TemplateHandler" Enabled="false" />
        <HandlerConfig Name="uSync: ContentTypeHanlder" Enabled="false" />
        <HandlerConfig Name="uSync: MediaTypeHandler" Enabled="false" />
        <HandlerConfig Name="uSync: MemberTypeHandler" Enabled="false" />
        <HandlerConfig Name="uSync: LanguageHandler" Enabled="false" />
        <HandlerConfig Name="uSync: DictionaryHandler" Enabled="false" />
        <HandlerConfig Name="uSync: MacroHandler" Enabled="false" />
        <HandlerConfig Name="uSync: ContentHandler" Enabled="true" />
        <HandlerConfig Name="uSync: MediaHandler" Enabled="true" />
      </Handlers>
    </uSyncBackOfficeSettings>
    

    As you said "the handlers are either enabled or not, it doesn't change the import / export", on my stage server I disabled all my handlers except "ContentHandler" and "MediaHandler" (because I want to trace only the changes concerning these 2 types on my stage server) . Then I try to import my data after adding a data type on my dev server... and nothing appear on my stage server.

    In the content of my "UmbracoTraceLog.txt" :

    2015-11-08 11:32:10,284 [P6580/D2/T1] INFO  Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Running Full uSync Import
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: DataTypeHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: TemplateHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: ContentTypeHanlder is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MediaTypeHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MemberTypeHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: LanguageHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: DictionaryHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MacroHandler is disabled by config
     2015-11-08 11:32:10,299 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Import Calling Handler: uSync: MediaHandler
     2015-11-08 11:32:10,315 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.Logging - Running Content Import: Media
     2015-11-08 11:32:10,315 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Import Calling Handler: uSync: ContentHandler
     2015-11-08 11:32:10,315 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.Logging - Running Content Import: Content
     2015-11-08 11:32:10,330 [P6580/D2/T1] INFO  Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Setting up Events
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: DataTypeHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: TemplateHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: ContentTypeHanlder is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MediaTypeHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MemberTypeHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: LanguageHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: DictionaryHandler is disabled by config
     2015-11-08 11:32:10,330 [P6580/D2/T1] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MacroHandler is disabled by config
     2015-11-08 11:32:10,346 [P6580/D2/T1] INFO  Jumoo.uSync.BackOffice.uSyncAction - ### uSync.BackOffice Processed 0 items with 0 changes ###
    

    It really seams "enabled" property is used during "Import", I'm wrong ?

    For deletion, I found uSyncActions.config file at the root of my data folder. Thanks

    Loïc

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Nov 08, 2015 @ 20:17
    Kevin Jump
    0

    Hi

    yes with the handlers disabled on the stage server they will never import the doctype changes.

    I suspect the current uSync config isn't quite fine enough to do this perfectly for you but i think you can do it.

    • I would keep the dev config as you have it
    • I would enable all handlers on Stage

    if you enable everything on stage, then it will track things like doctype changes, but if you copy over the folders from dev, they will then get imported.

    by not having content or media on dev, there will never be and content or media to overwrite on stage, (which is what you want?) but everything else will be imported when you bring the folders over. I would also bring the uSyncActions.config file over from dev so you get devs deletes and renames.

    Making the handlers a bit more subtle (so export, import, save, disabled) is something i have considered, its just not something i've managed to look at just yet.

  • Loïc AUDUSSEAU 11 posts 81 karma points
    Nov 09, 2015 @ 11:12
    Loïc AUDUSSEAU
    0

    Thanks for your advices.

    I continue my tests with this configuration. I check all handlers one by one to see if all case are ok.

    Thanks again.

    Loic

Please Sign in or register to post replies

Write your reply to:

Draft