Exemple #1
0
    def batch_create(self, sync_list, src_dbid, items):
        """See the documentation in folder.Folder"""

        my_dbid = self.get_dbid()
        c = self.get_config()
        pname = sync_list.get_pname()

        src_sync_tag = c.make_sync_label(pname, src_dbid)
        dst_sync_tag = c.make_sync_label(pname, my_dbid)

        ex_cons = []
        for item in items:
            exc = EXContact(self, con=item)
            rid = item.get_itemid()
            exc.update_sync_tags(src_sync_tag, rid)

            self.add_item(exc)

            ews_con = exc.init_ews_con_from_props()
            ex_cons.append(ews_con)

        self.get_ews().CreateItems(self.get_fobj().Id, ex_cons)

        for i, item in enumerate(items):
            exc = ex_cons[i]
            item.update_sync_tags(dst_sync_tag, exc.itemid.value)

        ## FIXME: need to get error and fix it
        return True
Exemple #2
0
    def batch_create(self, sync_list, src_dbid, items):
        """See the documentation in folder.Folder"""

        my_dbid = self.get_dbid()
        c = self.get_config()
        pname = sync_list.get_pname()

        src_sync_tag = c.make_sync_label(pname, src_dbid)
        dst_sync_tag = c.make_sync_label(pname, my_dbid)

        ex_cons = []
        for item in items:
            con_itemid = item.get_itemid_from_synctags(pname, 'ex')
            exc = EXContact(self, con=item, con_itemid=con_itemid)
            rid = item.get_itemid()
            exc.update_sync_tags(src_sync_tag, rid)

            self.add_item(exc)

            ews_con = exc.init_ews_con_from_props()
            ex_cons.append(ews_con)

        self.get_ews().CreateItems(self.get_fobj().Id, ex_cons)

        for i, item in enumerate(items):
            exc = ex_cons[i]
            item.update_sync_tags(dst_sync_tag, exc.itemid.value)

        ## FIXME: need to get error and fix it
        return True