Ejemplo n.º 1
0
        /// <summary>
        /// The constructor for main (root) wrapper model node
        /// </summary>
        /// <param name="parentFolder">The folder.</param>
        /// <param name="_name">The name.</param>
        /// <param name="_description">The description.</param>
        protected WrapperModelGraph(folderNode parentFolder, String _name, String _description)
        {
            name = _name;
            if (_description.isNullOrEmpty())
            {
                description = "primary wrapper node - the root";
            }
            else
            {
                description = _description;
            }

            type = WrapperTypeEnum.rootModel;

            _folder = parentFolder.Add(name, "Wrapper model " + _name, "Directory with content harvested by WrapperModel [" + name + "]. " + _description);
        }
Ejemplo n.º 2
0
        protected Boolean useOwnFolder(WrapperTypeEnum _type)
        {
            //List<WrapperTypeEnum> types = type.getEnumListFromFlags<WrapperTypeEnum>();

            switch (_type)
            {
            case WrapperTypeEnum.rootModel:
                return(true);

                break;

            case WrapperTypeEnum.htmlHarvest:
                return(false);

                break;

            case WrapperTypeEnum.imageHarvest:
                return(true);

                break;

            case WrapperTypeEnum.linkHarvest:
                return(false);

                break;

            case WrapperTypeEnum.tableHarvest:
                return(false);

                break;

            case WrapperTypeEnum.none:
                return(false);

                break;

            case WrapperTypeEnum.textHarvest:
                return(false);

                break;
            }
            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds new wrapper node
        /// </summary>
        /// <param name="_XPath">The x path.</param>
        /// <param name="_type">The type.</param>
        /// <param name="_description">The description.</param>
        /// <param name="_name">The name.</param>
        /// <returns></returns>
        public TWrapper AddWrapper <TWrapper>(String _XPath, WrapperTypeEnum _type, String _description, String _name = "") where TWrapper : IWrapperModelGraph, new()
        {
            TWrapper output = new TWrapper();

            if (_name == "")
            {
                output.name = _type.ToString();
            }
            else
            {
                output.name = _name;
            }
            output.type        = _type;
            output.XPath       = _XPath;
            output.description = _description;

            Add(output);

            return(output);
        }