Exemplo n.º 1
0
        private static void SetHasChildrenForEntryContent(IModelTransformContext context, IFacetContent source)
        {
            var structureStoreContentDataModel = context.Target as StructureStoreContentDataModel;

            if (structureStoreContentDataModel == null)
            {
                return;
            }

            structureStoreContentDataModel.HasChildren = source.VariationLinks != null && source.VariationLinks.Any();
        }
Exemplo n.º 2
0
        private static void SetCurrentCategoryRelation(IModelTransformContext context, PropertyDictionary properties, IFacetContent source)
        {
            ContentReference currentCategoryLink;

            if (ContentReference.TryParse(context.QueryParameters.AllParameters["currentCategory"], out currentCategoryLink))
            {
                properties["IsRelatedToCurrentCategory"] =
                    source.NodeLinks != null &&
                    source.NodeLinks.Any(link => link.CompareToIgnoreWorkID(currentCategoryLink));
            }
            else
            {
                properties["IsRelatedToCurrentCategory"] = true;
            }
        }
 public override void TransformInstance(IContent source, EnhancedStructureStoreContentDataModel target, IModelTransformContext context)
 {
     _baseTransform.TransformInstance(source, target, context);
     target.IsPartOfActiveApproval = _approvalResolver.IsPartOfActiveApproval(source);
 }