Exemple #1
0
        public void t11_TargetDocumentId()
        {
            // Create xml document
            XmlDocument data = createDataPool().RootNode.InnerXmlNode.OwnerDocument;

            // We use a dedicated SIEE_Adapter for this test.  We must first register it in the FactoryManager.
            SIEEFactory factory = new Test_SIEEFactory();

            SIEEFactoryManager.Add(factory);

            // We use a default SIEE_Adapter_Settings object and set the Schema
            EECWriterSettings adapterSettings = createWriterSettings(new SIEEFieldlist());

            SIEEWriterExport adapterExport = new SIEEWriterExport();

            adapterExport.Configure(adapterSettings);

            Test_SIEEExport.ExportFunc = (settings, doc, name, fieldlist) =>
            {
                doc.TargetDocumentId = "4711";
            };

            DataPool pool = new DataPool(adapterExport.transform(data, null));

            Assert.AreEqual("4711", pool.RootNode.Documents[0].Annotations["TargetDocumentId"].Value);
            Assert.AreEqual("SIEE_Adapter", pool.RootNode.Documents[0].Annotations["TargetType"].Value);
        }
        private void Main_Load(object sender, EventArgs e)
        {
            string basePath = AppDomain.CurrentDomain.BaseDirectory;

            if (!Directory.Exists(basePath))
            {
                return;
            }

            string targetTraceFile = Path.Combine(TraceManager.RootPath, "CaptureCenter.traceconfig");

            TraceConfigurator.ConfigureAndWatch(new FileInfo(targetTraceFile));

#if ProcessSuite
            SIEEFactoryManager.Add(new ProcessSuiteFactory());
#endif
#if CMIS
            SIEEFactoryManager.Add(new CMISFactory());
#endif
#if SQL
            SIEEFactoryManager.Add(new SqlEEFactory());
#endif
#if EDOCS
            SIEEFactoryManager.Add(new eDocsFactory());
#endif
#if HELLO_WORLD
            SIEEFactoryManager.Add(new HelloWorldFactory());
#endif
#if SPO
            SIEEFactoryManager.Add(new SPOFactory());
#endif
#if AX
            SIEEFactoryManager.Add(new AXFactory());
#endif
#if xECM
            SIEEFactoryManager.Add(new xECMFactory());
#endif
            foreach (string ext in SIEEFactoryManager.GetKeysFromTypeName())
            {
                string name = ext.Split('.').Last();
                cbox_extensionSelector.Items.Add(name);
                factoryNameMap[name] = ext;
            }
            cbox_extensionSelector.Text = Properties.Settings.Default.CurrentExtension;

            if (Properties.Settings.Default.MainSize.Width != 0)
            {
                Size = Properties.Settings.Default.MainSize;
            }

            if (Properties.Settings.Default.MaintRichTextFont != null)
            {
                richTextBox_settings.Font = Properties.Settings.Default.MaintRichTextFont;
            }

            richTextBox_settings.ForeColor = Properties.Settings.Default.MainRichTextColor;

            setDefaults();
        }
 protected void Initialize(SIEEFactory f)
 {
     factory = f;
     SIEEFactoryManager.Add(factory);
     settings = new EECWriterSettings();
     settings.SetFactory(factory);
     description = f.CreateDescription();
 }
Exemple #4
0
        public void t09_SIEEAnnotation()
        {
            // Create a data pool
            DataPool pool = createDataPool();

            pool.RootNode.Documents[0].Fields["field1"].Value = "field1value";

            // Create an xml document from the data pool
            XmlDocument data;

            data = pool.RootNode.InnerXmlNode.OwnerDocument;

            // We use a dedicated SIEE_Adapter for this test.  We must first register it in the FactoryManager.
            SIEEFactory factory = new Test_SIEEFactory();

            SIEEFactoryManager.Add(factory);

            // We use a default SIEE_Adapter_Settings object and set the Schema
            EECWriterSettings adapterSettings = createWriterSettings(new SIEEFieldlist()
            {
                { new SIEEField()
                  {
                      Name = "field1", ExternalId = ""
                  } },
                { new SIEEField()
                  {
                      Name = "field2", ExternalId = ""
                  } },
            });

            SIEEWriterExport adapterExport = new SIEEWriterExport();

            adapterExport.Configure(adapterSettings);

            Test_SIEEExport.ExportFunc = (settings, doc, name, fieldlist) =>
            {
                int val = 0;
                if (doc.SIEEAnnotation != null)
                {
                    val = int.Parse(doc.SIEEAnnotation);
                }
                if (val <= 3)
                {
                    doc.NewSIEEAnnotation = (val + 1).ToString();
                }
                throw new Exception("Some exception");
            };
            int count = 1;

            pool = new DataPool(adapterExport.transform(data, null));
            t09_testAnnotation(pool, count++);
            pool = new DataPool(adapterExport.transform(pool.RootNode.InnerXmlNode.OwnerDocument, null));
            t09_testAnnotation(pool, count++);
            pool = new DataPool(adapterExport.transform(pool.RootNode.InnerXmlNode.OwnerDocument, null));
            t09_testAnnotation(pool, count);
            pool = new DataPool(adapterExport.transform(pool.RootNode.InnerXmlNode.OwnerDocument, null));
            t09_testAnnotation(pool, count);
        }
Exemple #5
0
 public SIEEBaseTest()
 {
     SIEEMessageBox.Suppress = true;
     // Initialize Factory manager with test export extension
     SIEEFactoryManager.Add(new Test_SIEEFactory());
 }