예제 #1
0
        public int GetPersonIdFromInternalId(string internalTag, string internalValue)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd       = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles        profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            int personId = 0;

            Connects.Profiles.Service.DataContracts.InternalIDList    internalIdList = new Connects.Profiles.Service.DataContracts.InternalIDList();
            List <Connects.Profiles.Service.DataContracts.InternalID> intIdList      = new List <Connects.Profiles.Service.DataContracts.InternalID>();

            Connects.Profiles.Service.DataContracts.InternalID intId = new Connects.Profiles.Service.DataContracts.InternalID();

            intId.Name = internalTag;
            intId.Text = internalValue;

            intIdList.Add(intId);

            internalIdList.InternalID = intIdList;

            profiles.QueryDefinition = qd;
            profiles.QueryDefinition.InternalIDList = internalIdList;

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType    = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            profiles.OutputOptions = oo;
            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));

            profiles.Version = 2;
            Connects.Profiles.Service.DataContracts.PersonList resp = ProfileSearch(profiles, isSecure);

            personId = Convert.ToInt32(resp.Person[0].PersonID);

            return(personId);
        }
예제 #2
0
        public Connects.Profiles.Service.DataContracts.PersonList GetPersonFromPersonId(int personId)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd       = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles        profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            profiles.Version                  = 2;
            profiles.QueryDefinition          = qd;
            profiles.QueryDefinition.PersonID = personId.ToString();

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType    = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            Connects.Profiles.Service.DataContracts.OutputFilterList ofl = new Connects.Profiles.Service.DataContracts.OutputFilterList();
            Connects.Profiles.Service.DataContracts.OutputFilter     of  = new Connects.Profiles.Service.DataContracts.OutputFilter();
            of.Summary = false;
            of.Text    = "CoAuthorList";

            ofl.OutputFilter = new List <Connects.Profiles.Service.DataContracts.OutputFilter>();
            ofl.OutputFilter.Add(of);

            oo.OutputFilterList    = ofl;
            profiles.OutputOptions = oo;

            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));

            profiles.Version = 2;

            return(ProfileSearch(profiles, isSecure));
        }
예제 #3
0
        public Connects.Profiles.Service.DataContracts.PersonList GetDepartmentPeopleFromPersonId(int personId, int count)
        {
            //thisPerson is the current profile being viewed by a user or process.
            Connects.Profiles.Service.DataContracts.PersonList thisPerson;
            Connects.Profiles.Service.DataContracts.PersonList returnPeople;

            thisPerson = GetPersonFromPersonId(personId);

            Connects.Profiles.Service.DataContracts.QueryDefinition qd       = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles        profiles = new Connects.Profiles.Service.DataContracts.Profiles();

            if (Convert.ToInt32(thisPerson.TotalCount) > 0)
            {
                if (thisPerson.Person[0].AffiliationList != null)
                {
                    if (thisPerson.Person[0].AffiliationList.Affiliation.Count > 0)
                    {
                        Connects.Profiles.Service.DataContracts.Affiliation     Affiliation = new Connects.Profiles.Service.DataContracts.Affiliation();
                        Connects.Profiles.Service.DataContracts.AffiliationList affList     = new Connects.Profiles.Service.DataContracts.AffiliationList();
                        Affiliation.DepartmentName  = new Connects.Profiles.Service.DataContracts.AffiliationDepartmentName();
                        Affiliation.InstitutionName = new Connects.Profiles.Service.DataContracts.AffiliationInstitutionName();

                        foreach (Connects.Profiles.Service.DataContracts.AffiliationPerson aff in thisPerson.Person[0].AffiliationList.Affiliation)
                        {
                            if (aff.Primary)
                            {
                                Affiliation.DepartmentName.Text  = aff.DepartmentName;
                                Affiliation.InstitutionName.Text = aff.InstitutionName;
                            }
                        }
                        affList.Affiliation = new List <Connects.Profiles.Service.DataContracts.Affiliation>();
                        affList.Affiliation.Add(Affiliation);

                        qd.AffiliationList = affList;

                        profiles.QueryDefinition = qd;

                        Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
                        oo.SortType    = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
                        oo.StartRecord = "0";
                        oo.MaxRecords  = count.ToString();

                        profiles.OutputOptions = oo;


                        bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));
                        profiles.Version = 2;
                        returnPeople     = ProfileSearch(profiles, isSecure);

                        //Filter out the current profile you are viewing.
                        if (Convert.ToInt32(thisPerson.ThisCount) > 0)
                        {
                            returnPeople.Person.RemoveAll(x => x.PersonID == thisPerson.Person[0].PersonID);
                        }

                        return(returnPeople);
                    }
                }
            }

            return(thisPerson);
        }
        public Connects.Profiles.Service.DataContracts.PersonList GetDepartmentPeopleFromPersonId(int personId, int count)
        {
            //thisPerson is the current profile being viewed by a user or process.
            Connects.Profiles.Service.DataContracts.PersonList thisPerson;
            Connects.Profiles.Service.DataContracts.PersonList returnPeople;

            thisPerson = GetPersonFromPersonId(personId);

            Connects.Profiles.Service.DataContracts.QueryDefinition qd = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles profiles = new Connects.Profiles.Service.DataContracts.Profiles();

            if (Convert.ToInt32(thisPerson.TotalCount) > 0)
            {
                if (thisPerson.Person[0].AffiliationList != null)
                {
                    if (thisPerson.Person[0].AffiliationList.Affiliation.Count > 0)
                    {
                        Connects.Profiles.Service.DataContracts.Affiliation Affiliation = new Connects.Profiles.Service.DataContracts.Affiliation();
                        Connects.Profiles.Service.DataContracts.AffiliationList affList = new Connects.Profiles.Service.DataContracts.AffiliationList();
                        Affiliation.DepartmentName = new Connects.Profiles.Service.DataContracts.AffiliationDepartmentName();
                        Affiliation.InstitutionName = new Connects.Profiles.Service.DataContracts.AffiliationInstitutionName();

                        foreach (Connects.Profiles.Service.DataContracts.AffiliationPerson aff in thisPerson.Person[0].AffiliationList.Affiliation)
                        {
                            if (aff.Primary)
                            {
                                Affiliation.DepartmentName.Text = aff.DepartmentName;
                                Affiliation.InstitutionName.Text = aff.InstitutionName;

                            }
                        }
                        affList.Affiliation = new List<Connects.Profiles.Service.DataContracts.Affiliation>();
                        affList.Affiliation.Add(Affiliation);

                        qd.AffiliationList = affList;

                        profiles.QueryDefinition = qd;

                        Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
                        oo.SortType = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
                        oo.StartRecord = "0";
                        oo.MaxRecords = count.ToString();

                        profiles.OutputOptions = oo;

                        bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));
                        profiles.Version = 2;
                        returnPeople = ProfileSearch(profiles, isSecure);

                        //Filter out the current profile you are viewing.
                        if (Convert.ToInt32(thisPerson.ThisCount) > 0)
                        {
                            returnPeople.Person.RemoveAll(x => x.PersonID == thisPerson.Person[0].PersonID);
                        }

                        return returnPeople;
                    }
                }
            }

            return thisPerson;
        }
        public int GetPersonIdFromInternalId(string internalTag, string internalValue)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            int personId = 0;

            Connects.Profiles.Service.DataContracts.InternalIDList internalIdList = new Connects.Profiles.Service.DataContracts.InternalIDList();
            List<Connects.Profiles.Service.DataContracts.InternalID> intIdList = new List<Connects.Profiles.Service.DataContracts.InternalID>();
            Connects.Profiles.Service.DataContracts.InternalID intId = new Connects.Profiles.Service.DataContracts.InternalID();

            intId.Name = internalTag;
            intId.Text = internalValue;

            intIdList.Add(intId);

            internalIdList.InternalID = intIdList;

            profiles.QueryDefinition = qd;
            profiles.QueryDefinition.InternalIDList = internalIdList;

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            profiles.OutputOptions = oo;
            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));
            profiles.Version = 2;
            Connects.Profiles.Service.DataContracts.PersonList resp = ProfileSearch(profiles, isSecure);

            personId = Convert.ToInt32(resp.Person[0].PersonID);

            return personId;
        }
        public Connects.Profiles.Service.DataContracts.PersonList GetPersonFromPersonId(int personId)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            profiles.Version = 2;
            profiles.QueryDefinition = qd;
            profiles.QueryDefinition.PersonID = personId.ToString();

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            Connects.Profiles.Service.DataContracts.OutputFilterList ofl = new Connects.Profiles.Service.DataContracts.OutputFilterList();
            Connects.Profiles.Service.DataContracts.OutputFilter of = new Connects.Profiles.Service.DataContracts.OutputFilter();
            of.Summary = false;
            of.Text = "CoAuthorList";

            ofl.OutputFilter = new List<Connects.Profiles.Service.DataContracts.OutputFilter>();
            ofl.OutputFilter.Add(of);

            oo.OutputFilterList = ofl;
            profiles.OutputOptions = oo;

            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));
            profiles.Version = 2;

            return ProfileSearch(profiles, isSecure);
        }