Ejemplo n.º 1
0
        private void UploadPendingData(Utilities.ProfilesRNSDLL.BO.ORCID.Person person)
        {
            // This method loads any pending interactions with ORCID.
            List <Utilities.ProfilesRNSDLL.BO.ORCID.PersonMessage> personMessagesWaitingForApproval = GetPersonMessagesWaitingForApproval(person);

            if (personMessagesWaitingForApproval.Count > 0)
            {
                foreach (Utilities.ProfilesRNSDLL.BO.ORCID.PersonMessage personMessage in personMessagesWaitingForApproval)
                {
                    Utilities.ProfilesRNSDLL.BO.ORCID.REFPermission refPermission = REFPermissionBLL.Get(personMessage.PermissionID);
                    Utilities.ProfilesRNSDLL.BO.ORCID.PersonToken   personToken   = PersonTokenBLL.GetByPersonIDAndPermissionID(person.PersonID, personMessage.PermissionID);
                    if (!personToken.Exists || personToken.IsExpired)
                    {
                        // Go to ORCID and get a Token for this action.
                        Response.Redirect(Utilities.ProfilesRNSDLL.BLL.ORCID.OAuth.GetUserPermissionURL(refPermission.PermissionScope, "Default.aspx"), true);
                        return;
                    }

                    switch ((Utilities.ProfilesRNSDLL.BO.ORCID.REFPermission.REFPermissions)personMessage.PermissionID)
                    {
                    case Utilities.ProfilesRNSDLL.BO.ORCID.REFPermission.REFPermissions.orcid_profile_read_limited:
                    case Utilities.ProfilesRNSDLL.BO.ORCID.REFPermission.REFPermissions.orcid_bio_read_limited:
                    case Utilities.ProfilesRNSDLL.BO.ORCID.REFPermission.REFPermissions.orcid_works_read_limited:
                        ORCIDBLL.ReadORCIDProfile(person, personMessage, refPermission, LoggedInInternalUsername);
                        break;

                    default:
                        ORCIDBLL.SendORCIDXMLMessage(person, personToken.AccessToken, personMessage, refPermission);
                        break;
                    }
                }
            }
            LoadUserMessages(person);
        }
Ejemplo n.º 2
0
 private void ProcessORCIDResponse(Utilities.ProfilesRNSDLL.BO.ORCID.Person person)
 {
     if (HasORCID_OAuthCode)
     {
         PersonTokenBLL.UpdateUserToken(OAuthCode, person, "Default.aspx", LoggedInInternalUsername);
     }
     else if (HasORCID_ResponseError)
     {
         ProcessError(person);
     }
 }