/// <summary>
        /// Extracts link targets from a friends-list html page.
        /// </summary>
        /// <param name="currentContactsId">the profile id current of the current contact (the link SOURCE)</param>
        /// <param name="friendListContent">the html content of the friend list html of the current contact (containing the TARGETS)</param>
        /// <returns>the extracted link targets</returns>
        private List <string> ExtractProfileIdsFromFriendsList(ProfileIdInformation currentContactsId, string friendListContent)
        {
            var profileIdCandidates = this.personIdentifierFromContactsListExtractor.Matches(friendListContent);
            var profileIds          = new List <string>();

            foreach (var profileIdCandidate in profileIdCandidates)
            {
                var id = profileIdCandidate.ToString();
                if (id == currentContactsId)
                {
                    continue;
                }

                if (profileIds.Contains(id))
                {
                    continue;
                }

                profileIds.Add(id);
            }

            return(profileIds);
        }
Пример #2
0
        /// <summary>
        /// Overrides virtual write method for full list of elements
        /// </summary>
        /// <param name="elements">
        /// the list of elements that should be written to the target system.
        /// </param>
        /// <param name="clientFolderName">
        /// the information to where inside the source the elements should be written -
        ///   This does not need to be a real "path", but need to be something that can be expressed as a string
        /// </param>
        /// <param name="skipIfExisting">
        /// specifies whether existing elements should be updated or simply left as they are
        /// </param>
        protected override void WriteFullList(List <StdElement> elements, string clientFolderName, bool skipIfExisting)
        {
            string currentElementName = string.Empty;

            try
            {
                this.LogProcessingEvent(Resources.uiLogginIn);
                //Lotus Notes Object Creation
                _lotesNotesSession = new Domino.NotesSessionClass();
                //Initializing Lotus Notes Session
                _lotesNotesSession.Initialize(this.LogOnPassword);                       //Passwort
                _localDatabase = _lotesNotesSession.GetDatabase("", "names.nsf", false); //Database for Contacts default names.nsf

                this.LogProcessingEvent(Resources.uiPreparingList);

                string viewname = "$People";
                _contactsView = _localDatabase.GetView(viewname);
                // TODO: implement reading from the Lotus Notes server and map the entities to StdContact instances
                if (_contactsView == null)
                {
                    this.LogProcessingEvent(Resources.uiNoViewFound, viewname);
                }
                else
                {
                    foreach (StdContact item in elements)
                    {
                        NotesViewEntryCollection notesViewCollection = _contactsView.AllEntries;
                        //ArrayList notesUIDSList = new ArrayList();
                        bool gefunden = false;
                        for (int rowCount = 1; rowCount <= notesViewCollection.Count; rowCount++)
                        {
                            //Get the nth entry of the selected view according to the iteration.
                            NotesViewEntry viewEntry = notesViewCollection.GetNthEntry(rowCount);

                            //Get the first document of particular entry.
                            NotesDocument document = viewEntry.Document;
                            string        noteId   = document.NoteID;;
                            //
                            string id = string.Empty;
                            if (item.ExternalIdentifier != null)
                            {
                                ProfileIdInformation info = item.ExternalIdentifier.GetProfileId(ProfileIdentifierType.LotusNotesId);
                                if (info != null)
                                {
                                    id = document.NoteID;
                                }
                            }
                            if (id == noteId)
                            {
                                gefunden = true;
                                //
                                object documentItems = document.Items;
                                Array  itemArray     = (System.Array)documentItems;
                                //Daten übernehmen
                                for (int itemCount = 0; itemCount < itemArray.Length; itemCount++)
                                {
                                    NotesItem notesItem = (Domino.NotesItem)itemArray.GetValue(itemCount);
                                    //string itemname = notesItem.Name;
                                    string text = notesItem.Text;
                                    switch (notesItem.Name)
                                    {
                                    //Name
                                    case "FirstName":
                                        //  notesItem.Text = item.Name.FirstName;
                                        break;
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                this.LogProcessingEvent(
                    string.Format(CultureInfo.CurrentCulture, Resources.uiErrorAtName, currentElementName, ex.Message));
            }
            finally
            {
                //outlookNamespace.Logoff();
                _lotesNotesSession = null;
            }
        }