Ejemplo n.º 1
0
        public ProfilesRNSDLL.BO.ORCID.Person GetPersonWithDBData(int profilePersonID, string sessionID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person  profilePerson    = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long   profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Person orcidPerson = GetByInternalUsername(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Narrative narrative = new ProfilesRNSDLL.BLL.RDF.Triple().GetNarrative(profileSubjectID);
            if (!string.IsNullOrEmpty(narrative.Overview) && !narrative.Overview.Trim().Equals(string.Empty))
            {
                orcidPerson.Biography = narrative.Overview;
                if (!narrative.Decision.DecisionIDIsNull)
                {
                    orcidPerson.BiographyDecisionID = narrative.Decision.DecisionID;
                }
                else
                {
                    orcidPerson.BiographyDecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                }
            }
            orcidPerson.Affiliations = new ProfilesRNSDLL.BLL.ORCID.PersonAffiliation().GetForORCIDUpdate(orcidPerson, profileSubjectID, profilePersonID);
            orcidPerson.URLs         = new ProfilesRNSDLL.BLL.ORCID.PersonURL().GetForORCIDUpdate(orcidPerson, profileSubjectID);
            orcidPerson.Works        = new ProfilesRNSDLL.BLL.ORCID.PersonWork().GetForORCIDUpdate(orcidPerson, profileSubjectID, sessionID);
            if (BO.ORCID.Config.UseMailinatorEmailAddressForTestingOnStagingEnvironment)
            {
                orcidPerson.EmailAddress = System.Text.RegularExpressions.Regex.Split(profilePerson.EmailAddr, "@")[0] + DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("hhmmss") + "@mailinator.com";
            }
            else
            {
                orcidPerson.EmailAddress = profilePerson.EmailAddr;
            }
            return(orcidPerson);
        }
Ejemplo n.º 2
0
 private static ProfilesRNSDLL.BO.ORCID.REFDecision GetPublicationVisibility(long subject)
 {
     System.Data.DataView dv = new ProfilesRNSDLL.BLL.RDF.Triple().GetPublications(subject);
     if (dv.Table.Rows.Count > 0)
     {
         int securityGroup = 1;
         int.TryParse(dv.Table.Rows[0]["ViewSecurityGroup"].ToString(), out securityGroup);
         if (securityGroup != 1)
         {
             ProfilesRNSDLL.BO.RDF.Security.Group group    = new ProfilesRNSDLL.BLL.RDF.Security.Group().Get(securityGroup);
             ProfilesRNSDLL.BO.ORCID.REFDecision  decision = new ProfilesRNSDLL.BLL.ORCID.REFDecision().Get(group.DefaultORCIDDecisionID);
             if (decision.Exists)
             {
                 return(decision);
             }
         }
     }
     // default to private if unable to find the default for the publications security group.
     return(new ProfilesRNSDLL.BLL.ORCID.REFDecision().Get((int)ProfilesRNSDLL.BO.ORCID.REFDecision.REFDecisions.Private));
 }
Ejemplo n.º 3
0
 private static ProfilesRNSDLL.BO.ORCID.REFDecision GetPublicationVisibility(long subject)
 {
     System.Data.DataView dv = new ProfilesRNSDLL.BLL.RDF.Triple().GetPublications(subject);
     if (dv.Table.Rows.Count > 0)
     {
         int securityGroup = 1;
         int.TryParse(dv.Table.Rows[0]["ViewSecurityGroup"].ToString(), out securityGroup);
         if (securityGroup != 1)
         {
             ProfilesRNSDLL.BO.RDF.Security.Group group = new ProfilesRNSDLL.BLL.RDF.Security.Group().Get(securityGroup);
             ProfilesRNSDLL.BO.ORCID.REFDecision decision = new ProfilesRNSDLL.BLL.ORCID.REFDecision().Get(group.DefaultORCIDDecisionID);
             if (decision.Exists)
             {
                 return decision;
             }
         }
     }
     // default to private if unable to find the default for the publications security group.
     return new ProfilesRNSDLL.BLL.ORCID.REFDecision().Get((int)ProfilesRNSDLL.BO.ORCID.REFDecision.REFDecisions.Private);
 }
        public ProfilesRNSDLL.BO.ORCID.Person GetPersonWithDBData(int profilePersonID, string sessionID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person profilePerson = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Person orcidPerson = GetByInternalUsername(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Narrative narrative = new ProfilesRNSDLL.BLL.RDF.Triple().GetNarrative(profileSubjectID);
            if (!string.IsNullOrEmpty(narrative.Overview) && !narrative.Overview.Trim().Equals(string.Empty))
            {
                orcidPerson.Biography = narrative.Overview;
                if (!narrative.Decision.DecisionIDIsNull)
                {
                    orcidPerson.BiographyDecisionID = narrative.Decision.DecisionID;
                }
                else
                {
                    orcidPerson.BiographyDecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                }
            }
            orcidPerson.Affiliations = new ProfilesRNSDLL.BLL.ORCID.PersonAffiliation().GetForORCIDUpdate(orcidPerson, profileSubjectID, profilePersonID);
            orcidPerson.URLs = new ProfilesRNSDLL.BLL.ORCID.PersonURL().GetForORCIDUpdate(orcidPerson, profileSubjectID);
            orcidPerson.Works = new ProfilesRNSDLL.BLL.ORCID.PersonWork().GetForORCIDUpdate(orcidPerson, profileSubjectID, sessionID);
            if (BO.ORCID.Config.UseMailinatorEmailAddressForTestingOnStagingEnvironment)
            {
                orcidPerson.EmailAddress = System.Text.RegularExpressions.Regex.Split(profilePerson.EmailAddr, "@")[0] + DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("hhmmss") + "@mailinator.com";
            }
            else
            {
                orcidPerson.EmailAddress = profilePerson.EmailAddr;
            }
            return orcidPerson;
        }