locked
querying custom metadata RRS feed

  • Question

  • I'm using the sync framework to sync  folder/files to a remote system.  I'm using the filesyncprovider with a custom full enumeration provider for this.  I am storing custom metadata from the remote system in the sql metadata store.  Can anyone tell me how can i query this store for the custom fields in places where we are not provided a ItemFieldDictonary....i.e..in the "InsertItem" method?

    I need to query the metadata store to determine the ID of the parent folder under which the current file/folder is created, so that i can appropriately place the new file/folder in its rightful container on the remote system.

    Tuesday, November 27, 2012 10:57 PM

All replies

  • if I remember it right, the sql metadata store is actually a SQL Ce database.
    Wednesday, November 28, 2012 12:45 PM
  • This is what i have
     internal static class ItemFields
        {
            public const uint CUSTOM_FIELD_NAME = 1;
            public const uint CUSTOM_FIELD_TIMESTAMP = 2;
            public const uint CUSTOM_FIELD_SIZE = 3;
            public const uint CUSTOM_FIELD_REMOTEID = 4;
            public const uint CUSTOM_FIELD_FILENAME = 5;
            public const uint CUSTOM_FIELD_ISFOLDER = 6;
        }

    Then in the EnumerateItems method, i'm storing the custom metadata as follows 

     ItemFieldDictionary item = new ItemFieldDictionary();
                item.Add(new ItemField(ItemFields.CUSTOM_FIELD_REMOTEID, typeof(string), remote_id));
             

    I have assigned the identityRule to the "path" of the file/folder.

    Now...how can query on any of this custom metadata..i.e..given a path "Folder\Filename.txt", how can i get the value for remote_id

    Thursday, November 29, 2012 4:07 PM
  • Figured it out..

    IF anyone else is looking for this here it is..

    http://social.microsoft.com/forums/en-us/syncdevdiscussions/thread/DBE9CCF4-39FC-40AA-8D22-1F98B6D25595

    Friday, November 30, 2012 8:45 PM