locked
IFilteredSimpleSyncProvider never invoked RRS feed

  • Question

  • I've writting a custom provider sync class in order to perform some advanced filtering. I saw IFilteredSimpleSyncProvider in the Sync 2.0 SDK and was interested in the "IsItemInFilterScope" method.

    The problem I am running into is when I synchronize, the methods of my implementation of IFilteredSimpleSyncProvider are never invoked (never ever). My provider class declaration looks something like this (jsut to give you a better idea of what I am talking about):

    class FilterSyncProvider : SqlSyncProvider, IFilteredSimpleSyncProvider, IRequestFilteredSync, ISupportFilteredSync {
    // interfaces implemented here, IRequestFilteredSync, ISupportFilteredSync negotiate fine, but IFilteredSimpleSyncProvider methods are never invoked
    }
     
    I am properly negotiating with SpecifyFilter (IRequestFilteredSync) on my destination calling FilterRequestCallback, and finally responding to TryAddFilter (ISupportFilteredSync) with true on my source. No methods on my implementation of IFilteredSimpleSyncProvider are ever invoked. What do I need to do to have Sync services call my IFilteredSimpleSyncProvider interface to include or exclude items from being sent to the destination?

    E.g. this is never invoked:

    public bool IFilteredSimpleSyncProvider.IsItemInFilterScope(ItemFieldDictionary keyAndVersion)

    I must examine each change item to potentially prevent it from being sent back to the destination provider.

    Any advice would be very much appreciated!




    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:34 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, November 19, 2009 9:48 PM

Answers

  • Hi,
     This is by design and IFilteredSimpleSyncProvide is not supported and we will be looking into it for future versions. Can you share what you are trying to achieve exactly and what functionality are you looking for?
    jandeepc
    Saturday, November 21, 2009 12:13 AM

All replies

  • Hi,
     This is by design and IFilteredSimpleSyncProvide is not supported and we will be looking into it for future versions. Can you share what you are trying to achieve exactly and what functionality are you looking for?
    jandeepc
    Saturday, November 21, 2009 12:13 AM
  • Absolutely I will.

    We are writing a desktop application based on sql server databases. The tricky thing is we are using an ORM which saves business objects across table heirarchies for example, a customer entity is persisted across multiple tables (XObject->XPerson->XCustomer).

    *But* The big deal is this ... We have are modeling business data belonging to different agencies entities. An agency is a business customer of ours and likely contain unlimited levels of child agencies.

    An example and fictitious agency chart (looks much like an org chart):

    Root
      -Daren Restraunts
         -Olive Garden
           North East Region
             New York
             Pennsylvania
           South East Region
             Alabama
             Florida
             Georgia
             Virginia
        -Red Lobster
           North East Region
             Maine
             New Hampshire
           South East Region
             Florida
             South Carolina
      -Ruth's Chris Steakhouse
         Corporate
           Store001
           Store002
         Franchise
           Franchise Owner A
           Franchise Owner B


    *And* We want to use the Sync Framework to allow these agencies to share data with their child agencies and sibling agencies. The rules for sharing are somewhat complex. When a parent agency creates sharing rules, those rules are inherited to all child agencies.

    For example:

    Daren Restraunts may want both Olive Garden and Red Lobster to share customers, while the Olvie Garden South East Region might want to share menu items with all child agencies, but not menu prices. Ruth's Chris Steakhouse on the other hand might not want to share customers, but share all menu items.

    To accommate this our system creates an org chart type interface and allows items to be checked off. Here is what the ui looks like:

    http://imagebot.org/snapshops/sharing-ui.jpg

    Now I have created a series of c# classes which can determine from the database which tables and records are to be shared with from between which agencies.

    When Syn occurs I need to restrict which records are sent to which which office.


    *That is to say*

    If the rules say Red Lobsters can receive customer information from Olive Garden North East, then during sync I need to examine customer records and allow them only if they were created by Olive Garden North East agencies or by other Red Lobster agencies.

    And as I have said, I already have a set of .net objects which encapsulated this work for me. (determining if a table is allowed to be shared and accepted by another agency).

    Wheat I need to do is figure out how to use these object with the Sync framework so that sync doesn't try to send certain updates to certain clients.
    Monday, November 23, 2009 4:26 PM