Exemplo n.º 1
0
        public UserDetailContract GetCurrentUser()
        {
            try
            {
                return(m_client.Get <UserDetailContract>("user/current"));
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 2
0
        public List <string> GetPublisherAutoComplete(string query)
        {
            try
            {
                var publishers = m_client.Get <List <string> >($"metadata/publisher/autocomplete?query={query}");
                return(publishers);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 3
0
        public List <RoleContract> GetRoleAutocomplete(string query)
        {
            try
            {
                var result = m_client.Get <List <RoleContract> >("role/autocomplete".AddQueryString("query", query));
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 4
0
        public List <CardFileContract> GetCardFiles()
        {
            try
            {
                var result = m_client.Get <List <CardFileContract> >("cardfile");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public IList <FilteringExpressionSetContract> GetAllFilteringExpressionSets()
        {
            try
            {
                var result = m_client.Get <IList <FilteringExpressionSetContract> >($"bibliography/filtering-expression-set/all");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 6
0
        public BookContract GetBookInfo(long projectId)
        {
            try
            {
                var result = m_client.Get <BookContract>($"book/{projectId}");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 7
0
        public List <TermCategoryDetailContract> GetTermCategoriesWithTerms()
        {
            try
            {
                var result = m_client.Get <List <TermCategoryDetailContract> >("term/category/detail");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 8
0
        public SnapshotDetailContract GetSnapshot(long snapshotId)
        {
            try
            {
                var result = m_client.Get <SnapshotDetailContract>($"{BasePath}/{snapshotId}");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 9
0
        public List <FavoriteLabelContract> GetFavoriteLabelList(int?count = null)
        {
            try
            {
                var result = m_client.Get <List <FavoriteLabelContract> >(UrlQueryBuilder.Create("favorite/label").AddParameter("count", count)
                                                                          .ToResult());
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
        public IList <ExternalRepositoryContract> GetAllExternalRepositories()
        {
            try
            {
                var result = m_client.Get <IList <ExternalRepositoryContract> >($"bibliography/repository/all");
                return(result);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }
Exemplo n.º 11
0
        public ProjectDetailContract GetProject(long projectId, bool fetchPageCount = false, bool fetchPermissions = false)
        {
            try
            {
                var project = m_client.Get <ProjectDetailContract>($"project/{projectId}?fetchPageCount={fetchPageCount}&fetchPermissions={fetchPermissions}");
                return(project);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }