Пример #1
0
        public SortProcessor(PipelineContext ctx, SortProcessor other, IDataEndpoint epOrnextProcessor)
            : base(other, epOrnextProcessor)
        {
            Sorter   = other.Sorter;
            Undupper = other.Undupper;
            if (other.undupActions != null)
            {
                undupActions = other.undupActions.Clone(ctx);
            }

            afterSort  = other.afterSort;
            beforeSort = other.beforeSort;
        }
Пример #2
0
        public SortProcessor(ImportEngine engine, XmlNode node) : base(engine, node)
        {
            List <KeyAndType> list = KeyAndType.CreateKeyList(node.SelectMandatoryNode("sorter"), "key", false);

            Sorter = JComparer.Create(list);

            //Interpret undupper
            XmlNode undupNode = node.SelectSingleNode("undupper");

            if (undupNode != null)
            {
                Undupper = Sorter.Clone(undupNode.ReadStr("@from_sort", null));
                if (Undupper == null)
                {
                    list     = KeyAndType.CreateKeyList(undupNode, "key", true);
                    Undupper = JComparer.Create(list);
                }

                XmlNode actionsNode = undupNode.SelectSingleNode("actions");
                if (actionsNode != null)
                {
                    undupActions = new UndupActions(engine, this, actionsNode);
                }
            }

            //Interpret sort scripts
            beforeSort = new DelayedScriptHolder(engine, node.SelectSingleNode("beforesort"), Name);
            if (beforeSort.ScriptName == null)
            {
                beforeSort = null;
            }
            afterSort = new DelayedScriptHolder(engine, node.SelectSingleNode("aftersort"), Name);
            if (afterSort.ScriptName == null)
            {
                afterSort = null;
            }
        }