Beispiel #1
0
        public List <TrackContract> GetTrackList(long projectId)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var result = m_projectItemManager.GetTrackList(projectId);

            return(result);
        }
Beispiel #2
0
        public IList <ChapterHierarchyDetailContract> GetChapterList(long projectId)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var result = m_projectItemManager.GetChapterList(projectId);

            return(result);
        }
        public IList <SnapshotAggregatedInfoContract> GetSnapshotList(long projectId, [FromQuery] int?start, [FromQuery] int?count, [FromQuery] string filterByComment)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var result = m_snapshotManager.GetPublishedSnapshotWithAggregatedInfo(projectId, start, count, filterByComment);

            SetTotalCountHeader(result.TotalCount);
            return(result.List);
        }
Beispiel #4
0
        public List <TextWithPageContract> GetTextResourceList(long projectId, [FromQuery] long?resourceGroupId)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var result = m_projectContentManager.GetTextResourceList(projectId, resourceGroupId);

            return(result);
        }
        public List <ImageWithPageContract> GetImageList(long projectId)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var result = m_projectContentManager.GetImageResourceList(projectId);

            return(result);
        }
Beispiel #6
0
        public IActionResult CreateEditionNoteVersion(long projectId, [FromBody] CreateEditionNoteContract data)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.EditProject);

            try
            {
                var resultId = m_editionNoteManager.CreateEditionNoteVersion(projectId, data);
                return(Ok(resultId));
            }
            catch (HttpErrorCodeException exception)
            {
                return(StatusCode((int)exception.StatusCode, exception.Message));
            }
        }
Beispiel #7
0
        public IList <ResourceWithLatestVersionContract> GetResourceList(long projectId, [FromQuery] ResourceTypeEnumContract?resourceType)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            return(m_projectContentManager.GetResourceList(projectId, resourceType));
        }
Beispiel #8
0
        public IActionResult GetProject(long projectId,
                                        [FromQuery] bool?fetchPageCount,
                                        [FromQuery] bool?fetchAuthors,
                                        [FromQuery] bool?fetchResponsiblePersons,
                                        //[FromQuery] bool? fetchLatestChangedResource,
                                        [FromQuery] bool?fetchPermissions)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.ReadProject);

            var isFetchPageCount          = fetchPageCount ?? false;
            var isFetchAuthors            = fetchAuthors ?? false;
            var isFetchResponsiblePersons = fetchResponsiblePersons ?? false;
            //var isFetchLatestChangedResource = fetchLatestChangedResource ?? false;
            var isFetchPermissions = fetchPermissions ?? false;

            var projectData = m_projectManager.GetProject(projectId, isFetchPageCount, isFetchAuthors, isFetchResponsiblePersons, isFetchPermissions);

            if (projectData == null)
            {
                return(NotFound());
            }

            return(Ok(projectData));
        }
Beispiel #9
0
        public long CreateSnapshot([FromBody] CreateSnapshotContract data)
        {
            m_authorizationManager.AuthorizeBook(data.ProjectId, PermissionFlag.EditProject);

            return(m_snapshotManager.CreateSnapshot(data));
        }