コード例 #1
0
        /// <summary>
        /// Gets the root keyword for the given <see cref="P:taxonomyUri" />
        /// </summary>
        /// <param name="taxonomyUri">Taxonomy <see cref="T:TcmCDService.Tridion.TcmUri" /></param>
        /// <param name="taxonomyFilter"><see cref="T:TcmCDService.Contracts.TaxonomyFilter" /> to apply.</param>
        /// <returns>
        ///   <see cref="T:TcmCDService.Contracts.Keyword" />
        /// </returns>
        public Contracts.Keyword Keywords(String taxonomyUri, Contracts.TaxonomyFilter taxonomyFilter, Contracts.TaxonomyFormatter taxonomyFormatter)
        {
            Logger.Debug("Keywords: taxonomyUri \"{0}\", taxonomyFilter \"{1}\".", taxonomyUri, taxonomyFilter != null ? "<Object>" : String.Empty);

            return(Cache.Get <Contracts.Keyword>(
                       String.Format("Keywords-{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}",
                                     taxonomyUri,
                                     taxonomyFilter != null ? taxonomyFilter.DepthFilteringDirection.ToString() : String.Empty,
                                     taxonomyFilter != null ? taxonomyFilter.DepthFilteringLevel.ToString() : String.Empty,
                                     taxonomyFilter != null ? taxonomyFilter.FilterAbstract.ToString() : String.Empty,
                                     taxonomyFilter != null ? taxonomyFilter.FilterConcrete.ToString() : String.Empty,
                                     taxonomyFilter != null ? taxonomyFilter.FilterHasChildren.ToString() : String.Empty,
                                     taxonomyFilter != null ? taxonomyFilter.FilterNavigable.ToString() : String.Empty,
                                     taxonomyFormatter.ToString()),
                       () =>
            {
                using (Keyword keyword = ContentDelivery.Taxonomies.KeywordCache.GetKeywords(taxonomyUri, taxonomyFilter, taxonomyFormatter))
                {
                    return keyword.ToContract();
                }
            },
                       CacheRegion.Taxonomy | CacheRegion.TanonomyKeywordCount | CacheRegion.TanonomyKeywordRelations,
                       taxonomyUri));
        }
コード例 #2
0
 /// <summary>
 /// Gets the root keyword for the given <see cref="P:taxonomyUri" />
 /// </summary>
 /// <param name="taxonomyUri">Taxonomy <see cref="T:TcmCDService.Tridion.TcmUri" /></param>
 /// <param name="taxonomyFilter"><see cref="T:TcmCDService.Contracts.TaxonomyFilter" /> to apply.</param>
 /// <returns>
 ///   <see cref="T:TcmCDService.Contracts.Keyword" />
 /// </returns>
 public Contracts.Keyword Keywords(String taxonomyUri, Contracts.TaxonomyFilter taxonomyFilter)
 {
     return(Keywords(taxonomyUri, taxonomyFilter, Contracts.TaxonomyFormatter.Hierarchy));
 }