Beispiel #1
0
        private async Task <CustomEntityRenderDetails> GetCustomEntityModel(PageActionRoutingState state)
        {
            var query = new GetCustomEntityRenderDetailsByIdQuery();

            query.CustomEntityId = state.PageRoutingInfo.CustomEntityRoute.CustomEntityId;
            query.PageId         = state.PageData.PageId;

            // If we're editing the custom entity, we need to get the version we're editing, otherwise just get latest
            if (state.InputParameters.IsEditingCustomEntity)
            {
                if (state.InputParameters.VersionId.HasValue)
                {
                    query.CustomEntityVersionId = state.InputParameters.VersionId;
                    query.PublishStatus         = PublishStatusQuery.SpecificVersion;
                }
                else
                {
                    query.PublishStatus = state.VisualEditorState.GetPublishStatusQuery();
                }
            }
            else if (state.IsCofoundryAdminUser)
            {
                query.PublishStatus = PublishStatusQuery.Latest;
            }

            var model = await _queryExecutor.ExecuteAsync(query);

            return(model);
        }
Beispiel #2
0
        public IDomainRepositoryQueryContext <CustomEntityRenderDetails> AsRenderDetails(int pageId, int customEntityVersionId)
        {
            var query = new GetCustomEntityRenderDetailsByIdQuery()
            {
                CustomEntityId        = _customEntityId,
                PageId                = pageId,
                PublishStatus         = PublishStatusQuery.SpecificVersion,
                CustomEntityVersionId = customEntityVersionId
            };

            return(DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }
Beispiel #3
0
        public IDomainRepositoryQueryContext <CustomEntityRenderDetails> AsRenderDetails(int pageId, PublishStatusQuery?publishStatus = null)
        {
            var query = new GetCustomEntityRenderDetailsByIdQuery()
            {
                CustomEntityId = _customEntityId,
                PageId         = pageId
            };

            if (publishStatus.HasValue)
            {
                query.PublishStatus = publishStatus.Value;
            }

            return(DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }
Beispiel #4
0
        private async Task <CustomEntityRenderDetails> GetCustomEntityModel(PageActionRoutingState state)
        {
            var query = new GetCustomEntityRenderDetailsByIdQuery();

            query.CustomEntityId = state.PageRoutingInfo.CustomEntityRoute.CustomEntityId;
            query.PageTemplateId = state.PageData.Template.PageTemplateId;

            // If we're editing the custom entity, we need to get the version we're editing, otherwise just get latest
            if (state.InputParameters.IsEditingCustomEntity)
            {
                query.WorkFlowStatus        = state.VisualEditorMode.ToWorkFlowStatusQuery();
                query.CustomEntityVersionId = state.InputParameters.VersionId;
            }
            var model = await _queryExecutor.ExecuteAsync(query);

            return(model);
        }