Beispiel #1
0
        private IsPagePathUniqueQuery GetUniquenessQuery(UpdatePageUrlCommand command, Page page)
        {
            var query = new IsPagePathUniqueQuery();

            query.PageId   = page.PageId;
            query.LocaleId = command.LocaleId;

            query.UrlPath         = GetUrlPath(command, page);
            query.PageDirectoryId = command.PageDirectoryId;

            return(query);
        }
        private IsPagePathUniqueQuery CreateUniquenessQuery(AddPageCommand command)
        {
            var query = new IsPagePathUniqueQuery();

            query.LocaleId        = command.LocaleId;
            query.PageDirectoryId = command.PageDirectoryId;

            if (command.PageType == PageType.CustomEntityDetails)
            {
                query.UrlPath = command.CustomEntityRoutingRule;
            }
            else
            {
                query.UrlPath = command.UrlPath;
            }

            return(query);
        }
Beispiel #3
0
 public Task <bool> IsPathUniqueAsync(IsPagePathUniqueQuery query)
 {
     return(ExtendableContentRepository.ExecuteQueryAsync(query));
 }
Beispiel #4
0
 /// <summary>
 /// Determines if a page path already exists. Page paths are made
 /// up of a locale, directory and url path; duplicates are not permitted.
 /// </summary>
 /// <param name="query">Query parameters.</param>
 /// <param name="executionContext">Optional execution context to use when executing the query. Useful if you need to temporarily elevate your permission level.</param>
 public Task <bool> IsPagePathUniqueAsync(IsPagePathUniqueQuery query, IExecutionContext executionContext = null)
 {
     return(_queryExecutor.ExecuteAsync(query, executionContext));
 }
Beispiel #5
0
 public bool IsPagePathUnique(IsPagePathUniqueQuery query, IExecutionContext executionContext = null)
 {
     return(_queryExecutor.Execute(query, executionContext));
 }
 public IContentRepositoryQueryContext <bool> IsPathUnique(IsPagePathUniqueQuery query)
 {
     return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
 }