public ContentSerializationServices(IOrchardServices orchardServices,
                                            IProjectionManager projectionManager, ITaxonomyService taxonomyService,
                                            ILocalizationService localizationService)
        {
            _orchardServices     = orchardServices;
            _projectionManager   = projectionManager;
            _taxonomyService     = taxonomyService;
            _localizationService = localizationService;
            _markdownFilter      = new MarkdownFilter();

            _skipAlwaysProperties        = new string[] { "ContentItemRecord", "ContentItemVersionRecord" };
            _skipAlwaysPropertiesEndWith = "Proxy";
            _skipFieldProperties         = new string[] { "Storage", "Name", "DisplayName", "Setting" };
            _skipFieldTypes     = new string[] { "FieldDefinition", "PartFieldDefinition" };
            _skipPartNames      = new string[] { "InfosetPart", "FieldIndexPart", "IdentityPart", "UserPart", "UserRolesPart", "AdminMenuPart", "MenuPart" };
            _skipPartProperties = new string[] { };
            _skipPartTypes      = new string[] { "ContentItem", "Zones", "TypeDefinition", "TypePartDefinition", "PartDefinition", "Settings", "Fields", "Record" };

            _basicTypes = new Type[] {
                typeof(string),
                typeof(decimal),
                typeof(float),
                typeof(int),
                typeof(bool),
                typeof(DateTime),
                typeof(Enum)
            };

            processedItems = new List <string>();
        }
        public ObjectDumper(int levels, string[] filterContentFieldsParts = null, bool omitContentItem = false, bool tinyResponse = true, string[] complexBehaviour = null)
        {
            _levels            = levels;
            _xdoc              = new XDocument();
            _xdoc.Add(_current = new XElement("ul"));
            _complexBehaviour  = complexBehaviour;
            _markdownFilter    = new MarkdownFilter();

            _contentRendered = new List <ContentFlags>();
            if (tinyResponse)
            {
                _skipParts = new string[] { "CommonPart", "Version", "LocalizationPart", "Storage", "Taxonomy",
                                            "Ids", "LayerPart", "CommentsPart", "QrCodePart", "MobilePushPart", "InfosetPart", "FieldIndexPart", "IdentityPart", "UserPart",
                                            "UserRolesPart", "AdminMenuPart", "MenuPart", "TermsPart", "FieldStorageEventStorage", "ButtonToWorkflowsPart" };
            }
            else
            {
                _skipParts = new string[] {
                    "InfosetPart", "FieldIndexPart", "IdentityPart", "UserPart", "UserRolesPart", "AdminMenuPart", "MenuPart"
                };
            }
            _skipMembers = new string[] {
                "*/Storage", "*/Settings", "*/Zones", "LocalizationPart/CultureField", "LocalizationPart/MasterContentItemField", "DisplayName", "TableData"/*,"LocalizationPart/MasterContentItem"*/
            };
            _keepOnlyTheeseMembers = new string[] {
                "MasterContentItem/Id"
            };
            _filterContentFieldsParts = filterContentFieldsParts;
            _omitContentItem          = omitContentItem;
            // members ending with "Record" or "Definition" that have to be always included
            _includeMembers = new string[] { "PolicyTextInfoPartRecord" };
        }
Example #3
0
            public void should_be_able_to_transform_source()
            {
                string expected = "<h3>The Truth Is Out There</h3>";

                var markdownFilter = new MarkdownFilter();

                string result = markdownFilter.Execute("### The Truth Is Out There", new Dictionary <string, object>());

                result.ShouldContain(expected);
            }