Esempio n. 1
0
        public void run()
        {
            lockKey = "mykey";

            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // Get the current archive key
                int keyIdBeforeLock = ix.Ix.lockArchive(null);
                Logger.instance().log("key before lock=" + keyIdBeforeLock);

                // LOCK
                int keyIdBeforeLock2 = ix.Ix.lockArchive(lockKey);

                // Get the current archive key
                int keyIdAfterLock = ix.Ix.lockArchive(null);
                Logger.instance().log("key after lock=" + keyIdAfterLock);

                // UNLOCK
                int keyIdBeforeUnlock = ix.Ix.lockArchive("0");
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 2
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // Create a root folder based on keywording form "Email".
                // Parent is the "imaginary" archive entry with object ID = 1.
                String   parentId = "1";
                String   maskId   = "email";
                EditInfo ed       = ix.Ix.createSord(parentId, maskId, EditInfoC.mbAll);
                ed.sord.name = "New Sord";

                ViewAndEditSordDlg dlg = new ViewAndEditSordDlg();
                dlg.init(ix, ed);
                dlg.ShowDialog(null);

                // CHECKIN
                int objId = ix.Ix.checkinSord(dlg.getSord(), SordC.mbAll, LockC.NO);
                Logger.instance().log("Created sord successfully, objId=" + objId);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 3
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);

                Logger.instance().log("Version=" + connFact.Version);
                Logger.instance().log("ImplVersion=" + ix.ImplVersion);
                Logger.instance().log("InterfaceVersion=" + ix.InterfaceVersion);
                Logger.instance().log("ClientVersion=" + ix.ClientVersion);

                LoginResult loginResult = ix.LoginResult;

                // If successfully logged on, you can find the ticket here:
                // loginResult.clientInfo.ticket.
                Logger.instance().log("login successfully, ticket=" + loginResult.clientInfo.ticket);
                Logger.instance().log("ticket lifetime seconds=" + loginResult.ticketLifetime);
                Logger.instance().log("user ID=" + loginResult.user.id);

                // Otherwise an exception was thrown in ix.Ix.login() and you will not
                // reach this lines.

                // Use in subsequent calls always the returned ClientInfo object (contains ticket).
                // ci = ix.Login.ci


                ix.Ix.checkoutWorkflowTemplate("6439", "", WFDiagramC.mbAll, LockC.NO);
                FindWorkflowInfo findInfo = new FindWorkflowInfo();
                findInfo.type = WFTypeC.TEMPLATE;
                FindResult findResult = ix.Ix.findFirstWorkflows(findInfo, 100, WFDiagramC.mbLean);
                Logger.instance().log("wfs=" + findResult.workflows);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    ix.Dispose();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 4
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // Create a document
                EditInfo ed = ix.Ix.createDoc("1", null, null, EditInfoC.mbSordDoc);
                ed.sord.name     = "document with sticky notes";
                ed.document      = new Document();
                ed.document.docs = new DocVersion[1] {
                    new DocVersion()
                };
                ed.document.docs[0].ext           = "tif";
                ed.document.docs[0].pathId        = ed.sord.path;
                ed.document.docs[0].encryptionSet = ed.sord.details.encryptionSet;
                ed.document = ix.Ix.checkinDocBegin(ed.document);
                ed.document.docs[0].uploadResult = ix.Upload(ed.document.docs[0].url, @"..\..\00000001.TIF");
                ed.document = ix.Ix.checkinDocEnd(ed.sord, SordC.mbAll, ed.document, LockC.NO);

                Note[] notes = new Note[3];

                // Create a normal sticky note
                notes[0]      = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_NORMAL, null);
                notes[0].desc = "This is a normal sticky note";

                // Create a personal note
                notes[1]      = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_PERSONAL, null);
                notes[1].desc = "This is a personal note";

                // Create a stamp note
                notes[2]      = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_STAMP, null);
                notes[2].desc = "This is a stamp note";

                int[] noteIds = ix.Ix.checkinNotes(null, notes, NoteC.mbAll, LockC.NO);
                Logger.instance().log("noteIds=" + noteIds);
            }
            finally
            {
                ix.Logout();
            }
        }
Esempio n. 5
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  conn     = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                conn     = connFact.Create(userName, userPwd, "myComputer", null);
                Logger.instance().log("login OK");

                Logger.instance().log("Check whether OCR is available...");
                bool avail = checkOcrAvail(conn);
                Logger.instance().log("OCR is available=" + avail);

                if (avail)
                {
                    String fileName = "..\\..\\sample.tif";

                    Logger.instance().log("Recognize file synchronously");
                    String text = recognizeFileSync(conn, fileName);
                    Logger.instance().log("text=" + text.Substring(0, 100) + "...");

                    // Recognize rectangle.
                    // Rectangle units are given in per thousand of document width resp. height.
                    Logger.instance().log("Recognize rect ");
                    int pmLeft = 50, pmTop = 100, pmRight = 200, pmBottom = 1000;
                    text = recognizeRect(conn, fileName, pmLeft, pmTop, pmRight, pmBottom);
                    Logger.instance().log("text=" + text.Substring(0, 100) + "...");

                    // Return character positions
                    Logger.instance().log("Recognize file return character positions");
                    recognizeFileCharPos(conn, fileName);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                if (conn != null)
                {
                    Logger.instance().log("IX logout...");
                    conn.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 6
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login ...");
                ClientInfo ci = new ClientInfo();
                ci.timeZone = "GMT+01:00"; // "Europe/Berlin";
                ix          = connFact.CreateSso(ci, Environment.MachineName);
                LoginResult loginResult = ix.LoginResult;

                // If successfully logged on, you can find the ticket here:
                // loginResult.clientInfo.ticket.
                Logger.instance().log("login successfully, ticket=" + loginResult.clientInfo.ticket);
                Logger.instance().log("ticket lifetime seconds=" + loginResult.ticketLifetime);
                Logger.instance().log("user ID=" + loginResult.user.id);

                // Otherwise an exception was thrown in ix.Ix.login() and you will not
                // reach this lines.

                // Use in subsequent calls always the returned ClientInfo object (contains ticket).
                // ci = ix.Login.ci
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 7
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                FindInfo findInfo = new FindInfo();
                findInfo.findDirect                  = new FindDirect();
                findInfo.findDirect.query            = "buch sord.type:[254 TO 255]";
                findInfo.findDirect.searchInFulltext = true;
                findInfo.findDirect.searchInIndex    = true;
                findInfo.findDirect.searchInMemo     = true;
                findInfo.findDirect.searchInSordName = true;

                FindResult findResult = ix.Ix.findFirstSords(findInfo, 100, SordC.mbAll);
                for (int i = 0; i < findResult.sords.Length; i++)
                {
                    Logger.instance().log(findResult.sords[i].name + "," + findResult.sords[i].type);
                }

                ix.Ix.findClose(findResult.searchId);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 8
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  conn     = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                conn     = connFact.Create(userName, userPwd, "myComputer", null);
                Logger.instance().log("login OK");

                Logger.instance().log("Check whether OCR is available...");
                bool avail = checkOcrAvail(conn);
                Logger.instance().log("OCR is available=" + avail);

                if (avail)
                {
                    Logger.instance().log("Query languages:");
                    OcrInfo ocrInfo = new OcrInfo();
                    ocrInfo.queryLanguages = new OcrInfoQueryLanguages();

                    // Extenal language names should be returned in this language
                    ocrInfo.messagesLanguage = OcrInfoC.MESSAGES_LANGUAGE_GERMAN;

                    OcrResult ocrResult = conn.Ix.processOcr(ocrInfo);
                    for (int i = 0; i < ocrResult.queryLanguages.externalLangs.Length; i++)
                    {
                        Logger.instance().log("external=" + ocrResult.queryLanguages.externalLangs[i]);
                        Logger.instance().log("internal=" + ocrResult.queryLanguages.internalLangs[i]);
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                if (conn != null)
                {
                    Logger.instance().log("IX logout...");
                    conn.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 9
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                SelectKeywordDlg dlg = new SelectKeywordDlg(ix);
                dlg.ShowDialog();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 10
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  conn     = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                conn     = connFact.Create(userName, userPwd, "myComputer", null);
                Logger.instance().log("login OK");

                Logger.instance().log("Check whether OCR is available...");
                bool avail = checkOcrAvail(conn);
                Logger.instance().log("OCR is available=" + avail);

                if (avail)
                {
                    String fileName = "..\\..\\sample.tif";

                    Logger.instance().log("Recognize file asynchronously");
                    String text = recognizeFileAsync(conn, fileName, 30);
                    Logger.instance().log("text=" + text.Substring(0, 100) + "...");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                if (conn != null)
                {
                    Logger.instance().log("IX logout...");
                    conn.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 11
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix1      = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login connections...");
                ix1 = connFact.Create(userName, userPwd, "myComputer-conn1", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                EventBusWatchFolderEventsDlg dlg = new EventBusWatchFolderEventsDlg(ix1);
                dlg.ShowDialog();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix1 != null)
                {
                    Logger.instance().log("IX logout...");
                    ix1.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 12
0
        public void run()
        {
            IXConnection ix = null;

            String[] userIds = null;
            String   objId   = null;
            int      flowId  = -1;

            String[] userNames = new String[] { "WFUser1", "WFUser2", "WFUser3" };

            workflowScripts = new String[] { finishedScript,
                                             "DumpWorkFlow.js",
                                             "DumpSord.js",
                                             "Dump.js" };

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                //////////////////////////////////////////////////////////////
                // 1. Upload example scripts
                internalCheckinScripts(ix, CONST, workflowScripts);

                //////////////////////////////////////////////////////////////
                // 2. Create 3 users: WFUser1, WFUser2, WFUser3

                Logger.instance().log("create users...");
                userIds = internalCreateSomeUsers(ix, CONST, userNames);
                Logger.instance().log("create users OK");

                //////////////////////////////////////////////////////////////
                // 3. Create a document

                Logger.instance().log("create document...");
                objId = internalCreateDocument(ix, CONST);
                Logger.instance().log("create document OK, objId=" + objId);

                //////////////////////////////////////////////////////////////
                // 4. Start Ad Hoc Workflow

                Logger.instance().log("start workflow...");
                flowId = ix.Ix.startAdHocWorkFlow("C# Example AdHocWorkflow " + DateTime.Now,
                                                  objId, userIds, "C# example Ad Hoc Workflow", false, true,
                                                  "0", "canceled", "0", "Everyone has seen the document.",
                                                  myServerScriptDir + "\\" + finishedScript
                                                  );
                Logger.instance().log("start workflow OK, flowId=" + flowId);

                // dump nodes, verify that userNames[0] got an active node
                int testUserId = ix.LoginResult.user.id;
                dumpWFNodes(ix, CONST, flowId, testUserId, userIds);

                //////////////////////////////////////////////////////////////
                // 5. Forward all nodes

                for (int i = 0; i < userIds.Length; i++)
                {
                    internalForwardNode(ix, CONST, flowId, userNames[i], "elo");
                    dumpWFNodes(ix, CONST, flowId, testUserId, userIds);
                }

                // At this point the test user got the finished node
                internalForwardNode(ix, CONST, flowId, userName, userPwd);
                dumpWFNodes(ix, CONST, flowId, testUserId, userIds);

                // Check the sord description: the script should have stored some text in it.
                Sord sord = ix.Ix.checkoutSord(objId, EditInfoC.mbSord, LockC.NO).sord;
                Logger.instance().log("sord.desc=" + sord.desc);

                //////////////////////////////////////////////////////////////
                // 6. Clean up

                // delete document
                bool isDeleteDocument = true;
                if (isDeleteDocument)
                {
                    Logger.instance().log("delete document...");
                    ix.Ix.deleteSord(null, objId, LockC.NO, null);
                    Logger.instance().log("delete document OK");
                }

                // delete users
                bool isDeleteUsers = false;
                if (isDeleteUsers)
                {
                    Logger.instance().log("delete users ...");
                    ix.Ix.deleteUsers(userIds, LockC.NO);
                    Logger.instance().log("delete users OK");
                }

                // delete scripts
                Logger.instance().log("delete scripts ...");
                internalDeleteScripts(ix, CONST, workflowScripts);
                Logger.instance().log("delete scripts OK");
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 13
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // 1. Create document without an associated file
                EditInfo ed = ix.Ix.createDoc("1", "0", null, EditInfoC.mbSord);
                ed.sord.name = "C# example CheckinNewDocument";
                ed.sord.id   = ix.Ix.checkinSord(ed.sord, SordC.mbAll, LockC.NO);

                // Create test file
                // 2. Checkout document
                ed = ix.Ix.checkoutDoc(ed.sord.guid, null, EditInfoC.mbSordDocAtt, LockC.YES);
                Logger.instance().log("checkout sord succeeded, objId=" + ed.document.objId);

                // Hint: Now the document is locked and will be unlocked by checkinDocEnd

                // 3. Checkin a file as a new Version
                String text     = "version 1";
                String testFile = internalCreateTestFile(text, "txt");

                // Supply the extension of the document
                ed.document.docs                  = new DocVersion[1];
                ed.document.docs[0]               = new DocVersion();
                ed.document.docs[0].ext           = ix.GetFileExt(testFile);
                ed.document.docs[0].pathId        = ed.sord.path;
                ed.document.docs[0].encryptionSet = ed.sord.details.encryptionSet;

                // CheckinDocBegin: let IndexServer generate an URL to upload the document
                ed.document = ix.Ix.checkinDocBegin(ed.document);

                // Upload the document
                String uploadResult = ix.Upload(ed.document.docs[0].url, testFile);
                ed.document.docs[0].uploadResult = uploadResult;

                // Set version comment
                ed.document.docs[0].version = "1.0";
                ed.document.docs[0].comment = "IndexServer C# example";

                // CheckinDocEnd: uploadResult contains the document information from ELODM.
                // Pass this information to
                ed.document = ix.Ix.checkinDocEnd(null, null, ed.document, LockC.YES);

                // Hint: It's not nessesary to pass a Sord object to IndexServer in checkinDocEnd,
                //       if the indexing information was not changed. IndexServer gets the
                //       object ID from ed.document.objId.

                Logger.instance().log("inserted document version:");
                Logger.instance().log("  objId=" + ed.document.objId);
                Logger.instance().log("  docId=" + ed.document.docs[0].id);
                Logger.instance().log("  doc-guid=" + ed.document.docs[0].guid);
                Logger.instance().log("  URL=" + ed.document.docs[0].url);

                // 2. Checkout and show document
                ed = ix.Ix.checkoutDoc(ed.sord.guid, ed.document.docs[0].guid, EditInfoC.mbAll, LockC.YES);
                String tempName2 = internalMakeTempFileName(ed.document.docs[0].ext);
                ix.Download(ed.document.docs[0].url, tempName2);

                // Uncomment this to show document in notepad:
                //System.Diagnostics.Process.Start("notepad.exe", tempName2);
                //System.Threading.Thread.Sleep(3000);

                System.IO.File.Delete(tempName2);

                // insert second version
                //text = "version 2";
                //testFile = internalCreateTestFile(text, "txt");
                //ed.document.docs = new DocVersion[1];
                //ed.document.docs[0] = new DocVersion();
                //ed.document.docs[0].ext = IXClient.getFileExt(testFile);
                //ed.document = ix.Ix.checkinDocBegin(ed.document);
                //uploadResult = ix.Upload(ed.document.docs[0].url, testFile);
                //ed.document.docs[0].uploadResult = uploadResult;
                //ed.document.docs[0].version = "2.0";
                //ed.document.docs[0].comment = "2.0 IndexServer C# example";
                //ed.document = ix.Ix.checkinDocEnd(null, null, ed.document, LockC.YES);

                bool cleanUp = true;
                if (cleanUp)
                {
                    // Delete Document
                    DeleteOptions delOpts = new DeleteOptions();
                    delOpts.deleteFinally = true;
                    ix.Ix.deleteSord(null, ed.sord.guid, LockC.NO, null);
                    ix.Ix.deleteSord(null, ed.sord.guid, LockC.NO, delOpts);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 14
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // 1. Create archive structure
                Logger.instance().log("create structure...");

                // create root folder s1
                EditInfo ed = ix.Ix.createSord("1", "0", EditInfoC.mbAll);
                Sord     s1 = ed.sord;
                s1.name = "s1 C# example FindByIndexValues";
                s1.id   = ix.Ix.checkinSord(s1, SordC.mbAll, LockC.NO);

                ///     d1, name=The Inner Circle,		AUTHOR=T. Coraghessan Boyle,	PRICE=039
                ///     d2  name=The Shifting Tide,		AUTHOR=Anne Perry,				PRICE=037
                ///     d3  name=Feel,					AUTHOR=Robbie Williams,			PRICE=142
                ///     d4	name=The Da Vinci Code,     AUTHOR=Dan Brown,				PRICE=032
                ///
                Sord d1 = internalCreateBook(ix, CONST, s1.guid, "The Inner Circle", "T. Coraghessan Boyle", "039");
                Sord d2 = internalCreateBook(ix, CONST, s1.guid, "The Shifting Tide", "Anne Perry", "037");
                Sord d3 = internalCreateBook(ix, CONST, s1.guid, "Feel", "Robbie Williams", "142");
                Sord d4 = internalCreateBook(ix, CONST, s1.guid, "The Da Vinci Code", "Dan Brown", "032");

                Logger.instance().log("create structure OK");

                // 2. Find books from Authors with names from "A" to "J"
                internalFindBooks(ix, CONST, s1.guid, "A* ... J*", "");
                // Finds: The Da Vinci Code,The Shifting Tide

                // 3. Find books from Authors with names from "J"
                internalFindBooks(ix, CONST, s1.guid, "J*...*", "");
                // Finds: Feel,The Inner Circle

                // 4. Find books from Authors with names from "J" and price higher than 100
                internalFindBooks(ix, CONST, s1.guid, "J*...", "100...*");
                // Finds: Feel

                bool cleanUp = true;
                if (cleanUp)
                {
                    Logger.instance().log("clean up...");
                    ix.Ix.deleteSord(null, s1.guid, LockC.NO, null);
                    Logger.instance().log("clean up OK");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 15
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // 1. Create sord for document without version

                // Initialize Sord object
                EditInfo ed = ix.Ix.createDoc("1", "0", null, EditInfoC.mbSordDocAtt);
                ed.sord.name = "C# example CheckinAttachment";

                // Create attachment file
                String attFile = internalCreateTestFile("CheckinNewAttachment attachment file", "txt");

                // Supply the extension of the document
                ed.document.atts           = new DocVersion[1];
                ed.document.atts[0]        = new DocVersion();
                ed.document.atts[0].ext    = ix.GetFileExt(attFile);
                ed.document.atts[0].pathId = ed.sord.path;
                // ed.document.atts[0].encryptionSet = ignored

                // CheckinDocBegin: let IndexServer generate an URL to upload the document
                ed.document = ix.Ix.checkinDocBegin(ed.document);
                Logger.instance().log("prepared upload URL=" + ed.document.atts[0].url + ", att-guid=" + ed.document.atts[0].guid);

                // Upload the document
                String uploadResult = ix.Upload(ed.document.atts[0].url, attFile);
                ed.document.atts[0].uploadResult = uploadResult;
                Logger.instance().log("upload succeeded");
                System.IO.File.Delete(attFile);

                // CheckinDocEnd: uploadResult contains the document information from ELODM.
                // Pass this information to
                ed.document = ix.Ix.checkinDocEnd(ed.sord, SordC.mbAll, ed.document, LockC.NO);
                Logger.instance().log("inserted document:");
                Logger.instance().log("  objId=" + ed.document.objId);
                Logger.instance().log("  attId=" + ed.document.atts[0].id);
                Logger.instance().log("  att-guid=" + ed.document.atts[0].guid);
                Logger.instance().log("  URL=" + ed.document.atts[0].url);

                // 2. Checkout and show document
                ed = ix.Ix.checkoutDoc(ed.sord.guid, null, EditInfoC.mbAll, LockC.NO);
                String tempName2 = internalMakeTempFileName(ed.document.atts[0].ext);
                ix.Download(ed.document.atts[0].url, tempName2);

                // Uncomment this to show document in notepad:
                // System.Diagnostics.Process.Start("notepad.exe", tempName2);
                // System.Threading.Thread.Sleep(3000);

                System.IO.File.Delete(tempName2);

                bool cleanUp = true;
                if (cleanUp)
                {
                    // Delete Document
                    DeleteOptions delOpts = new DeleteOptions();
                    delOpts.deleteFinally = true;
                    ix.Ix.deleteSord(null, ed.sord.guid, LockC.NO, null);
                    ix.Ix.deleteSord(null, ed.sord.guid, LockC.NO, delOpts);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 16
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // get templates
                Logger.instance().log("get workflow templates...");
                IdName[] idNames = ix.Ix.collectWorkFlows(WFTypeC.TEMPLATE);
                Logger.instance().log("  #workflows=" + idNames.Length);
                for (int i = 0; i < idNames.Length; i++)
                {
                    Logger.instance().log("  id=" + idNames[i].id + ", name=" + idNames[i].name);
                }
                Logger.instance().log("get workflow templates OK");

                // get active workflows
                Logger.instance().log("get active workflows...");
                idNames = ix.Ix.collectWorkFlows(WFTypeC.ACTIVE);
                Logger.instance().log("  #workflows=" + idNames.Length);
                for (int i = 0; i < idNames.Length; i++)
                {
                    Logger.instance().log("  id=" + idNames[i].id + ", name=" + idNames[i].name);
                }
                Logger.instance().log("get active workflows OK");

                // get finished workflows
                Logger.instance().log("get finished workflows...");
                idNames = ix.Ix.collectWorkFlows(WFTypeC.FINISHED);
                Logger.instance().log("  #workflows=" + idNames.Length);
                for (int i = 0; i < idNames.Length; i++)
                {
                    Logger.instance().log("  id=" + idNames[i].id + ", name=" + idNames[i].name);
                }
                Logger.instance().log("get finished workflows OK");
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 17
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // 1. Create Sord
                Sord sord = ix.Ix.createSord("1", null, EditInfoC.mbSord).sord;
                sord.name = "C# example CheckoutAndUnlock";
                sord.id   = ix.Ix.checkinSord(sord, SordC.mbAll, LockC.NO);
                Logger.instance().log("sord.id=" + sord.id);

                // 2. Create a new test user
                UserInfo uiFritz = ix.Ix.createUser("0");
                uiFritz.name = "Fritz";                 // [X]
                uiFritz.pwd  = "Fritz password";
                int[] uids = ix.Ix.checkinUsers(new UserInfo[] { uiFritz }, CheckinUsersC.PASSWORD, LockC.NO);
                Logger.instance().log("created account for " + uiFritz.name + ", uid=" + uids[0]);

                // 3. Login
                IXConnection ixFritz = connFact.Create(uiFritz.name, uiFritz.pwd, "mycomp", null);
                Logger.instance().log(uiFritz.name + " logged in successfully");

                // 4. Firtz locks Sord
                sord = ixFritz.Ix.checkoutSord(sord.guid, EditInfoC.mbSord, LockC.YES).sord;
                Logger.instance().log("Fritz checked out with lock, lockId=" + sord.lockId + " == Fritz's user ID");

                // 5. Try to lock with current account
                try
                {
                    sord = ix.Ix.checkoutSord(sord.guid, EditInfoC.mbSord, LockC.YES).sord;
                    throw new System.InvalidOperationException("ERROR: current user can lock Sord");
                }
                catch (Exception e)
                {
                    Logger.instance().log("OK, current user cannot lock Sord: " + formatException(e));
                }

                // 6. Try to get lock forced with current account
                try
                {
                    sord = ix.Ix.checkoutSord(sord.guid, EditInfoC.mbSord, LockC.FORCE).sord;
                    Logger.instance().log("OK, current user is administrator and can lock Sord");
                }
                catch (Exception e)
                {
                    Logger.instance().log("OK, current user is not an administrator and cannot lock Sord: " + formatException(e));
                }

                // 7. Unlock
                ix.Ix.checkinSord(sord, SordC.mbOnlyUnlock, LockC.YES);
                Logger.instance().log("Sord unlocked");

                // 8. Fritz deletes Sord
                DeleteOptions delOpts = new DeleteOptions();
                delOpts.deleteFinally = true;
                ixFritz.Ix.deleteSord(null, sord.guid, LockC.NO, null);
                ixFritz.Ix.deleteSord(null, sord.guid, LockC.NO, delOpts);
                Logger.instance().log("Sord deleted");

                // clean up
                ixFritz.Logout();
                ix.Ix.deleteUsers(new String[] { uiFritz.name }, LockC.NO);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 18
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // 1. Create archive hirarchie

                // root folder
                Sord sordRoot = ix.Ix.createSord("1", null, EditInfoC.mbSord).sord;
                sordRoot.name = "C# example FindFirstFindNext";
                sordRoot.id   = ix.Ix.checkinSord(sordRoot, SordC.mbAll, LockC.NO);

                // create sords
                Logger.instance().log("create sords...");
                for (int i = 0; i < nbOfChildren; i++)
                {
                    String namePrefix = "" + i;
                    while (namePrefix.Length < 4)
                    {
                        namePrefix = "0" + namePrefix;
                    }
                    Sord sord = ix.Ix.createSord(sordRoot.guid, null, EditInfoC.mbSord).sord;
                    sord.name = namePrefix + "-o-" + namePrefix;
                    sord.id   = ix.Ix.checkinSord(sord, SordC.mbAll, LockC.NO);
                }
                Logger.instance().log("create sords OK");

                // 2. List hirarchie
                Logger.instance().log("find...");

                // Prepare FindInfo object
                FindInfo findInfo = new FindInfo();
                findInfo.findChildren          = new EloixClient.IndexServer.FindChildren();
                findInfo.findChildren.parentId = sordRoot.guid;

                // find
                FindResult findResult = ix.Ix.findFirstSords(findInfo, 1000, SordC.mbAll);
                Logger.instance().log("found #=" + findResult.sords.Length);
                for (int i = 0; i < findResult.sords.Length; i++)
                {
                    Logger.instance().log("sord.id=" + findResult.sords[i].id + ", sord.name=" + findResult.sords[i].name);
                }
                ix.Ix.findClose(findResult.searchId);
                Logger.instance().log("find OK");

                bool cleanUp = true;
                if (cleanUp)
                {
                    Logger.instance().log("clean up...");
                    DeleteOptions delOpts = new DeleteOptions();
                    delOpts.deleteFinally = true;
                    ix.Ix.deleteSord(null, sordRoot.guid, LockC.NO, null);
                    ix.Ix.deleteSord(null, sordRoot.guid, LockC.NO, delOpts);
                    Logger.instance().log("clean up OK");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 19
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // List all users and groups
                Logger.instance().log("all users and groups:");
                UserName[] allNames = ix.Ix.getUserNames(null, CheckoutUsersC.ALL_USERS_AND_GROUPS);
                dumpUserNames("  ", CONST, allNames);

                // List all groups
                Logger.instance().log("all groups:");
                UserName[] groupNames = ix.Ix.getUserNames(null, CheckoutUsersC.ALL_GROUPS);
                dumpUserNames("  ", CONST, groupNames);

                // List members of groups
                for (int i = 0; i < groupNames.Length; i++)
                {
                    String name = groupNames[i].name;
                    Logger.instance().log("users of group " + name + ":");
                    UserName[] memberNames = ix.Ix.getUserNames(new String[] { name }, CheckoutUsersC.MEMBERS_OF_GROUP);
                    dumpUserNames("    ", CONST, memberNames);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 20
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // Example for initializing an encryption set with a new internal password.
                // If you uncomment this lines, aready encrypted documents of this encryption set
                // cannot be decrypted anymore since the internal key is lost!
                // Logger.instance().log("init encryption set ...");
                //initializeNewEncryptionSet(ix, CONST, 13, "CS-TEST", encryptionPassword);
                // Logger.instance().log("init encryption set OK");

                // checkin example document and encrypt it
                string objId = checkinDocEncrypted(ix, CONST);

                // checkout example document
                checkoutDocDecryptedUsingSessionOption(ix, CONST, objId);

                // checkout example document
                checkoutDocDecryptedUsingUrlExt(ix, CONST, objId);

                bool cleanUp = true;
                if (cleanUp)
                {
                    // Delete Document
                    DeleteOptions delOpts = new DeleteOptions();
                    delOpts.deleteFinally = true;
                    ix.Ix.deleteSord(null, objId, LockC.NO, null);
                    ix.Ix.deleteSord(null, objId, LockC.NO, delOpts);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 21
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                Logger.instance().log("get nodes...");
                FindTasksInfo findInfo = new FindTasksInfo();
                findInfo.inclWorkflows = true;
                FindResult findResult = ix.Ix.findFirstTasks(findInfo, 10);

                int idx = 0;
                while (true)
                {
                    Logger.instance().log("#nodes=" + findResult.tasks.Length);
                    for (int i = 0; i < findResult.tasks.Length; i++)
                    {
                        WFCollectNode node = findResult.tasks[i].wfNode;
                        Logger.instance().log("name=" + node.nodeName);
                        Logger.instance().log("  flowId=" + node.nodeId + ", nodeId=" + node.nodeId);
                        Logger.instance().log("  objId=" + node.objId + ", userId=" + node.userId);
                    }

                    if (!findResult.moreResults)
                    {
                        break;
                    }

                    idx       += findResult.tasks.Length;
                    findResult = ix.Ix.findNextTasks(findResult.searchId, idx, 10);
                }

                Logger.instance().log("get nodes OK");
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 22
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                String   name = userName;
                UserInfo ui   = ix.Ix.checkoutUsers(new String[] { name },
                                                    CheckoutUsersC.BY_IDS, LockC.NO)[0];

                Logger.instance().log("Main admin                 " + ((ui.flags & AccessC.FLAG_ADMIN) != 0));
                Logger.instance().log("Edit configuration         " + ((ui.flags & AccessC.FLAG_EDITCONFIG) != 0));
                Logger.instance().log("Edit archive structure     " + ((ui.flags & AccessC.FLAG_EDITSTRUCTURE) != 0));
                Logger.instance().log("Edit documents             " + ((ui.flags & AccessC.FLAG_EDITDOCS) != 0));
                Logger.instance().log("Change password            " + ((ui.flags & AccessC.FLAG_CHANGEPW) != 0));
                Logger.instance().log("Change revision            " + ((ui.flags & AccessC.FLAG_CHANGEREV) != 0));
                Logger.instance().log("Edit user rights           " + ((ui.flags & AccessC.FLAG_SUBADMIN) != 0));
                Logger.instance().log("Edit workflows             " + ((ui.flags & AccessC.FLAG_EDITWF) != 0));
                Logger.instance().log("Start workflows            " + ((ui.flags & AccessC.FLAG_STARTWF) != 0));
                Logger.instance().log("Delete documents           " + ((ui.flags & AccessC.FLAG_DELDOC) != 0));
                Logger.instance().log("Delete structure           " + ((ui.flags & AccessC.FLAG_DELSTRUC) != 0));
                Logger.instance().log("SAP admin                  " + ((ui.flags & AccessC.FLAG_SAPADMIN) != 0));
                Logger.instance().log("Import                     " + ((ui.flags & AccessC.FLAG_IMPORT) != 0));
                Logger.instance().log("Export                     " + ((ui.flags & AccessC.FLAG_EXPORT) != 0));
                Logger.instance().log("Edit storage masks         " + ((ui.flags & AccessC.FLAG_EDITMASK) != 0));
                Logger.instance().log("Edit scripts               " + ((ui.flags & AccessC.FLAG_EDITSCRIPT) != 0));
                Logger.instance().log("Edit expiration date       " + ((ui.flags & AccessC.FLAG_EDITDUEDATE) != 0));
                Logger.instance().log("Edit buzzword lists        " + ((ui.flags & AccessC.FLAG_EDITSWL) != 0));
                Logger.instance().log("Delete read-only Documents " + ((ui.flags & AccessC.FLAG_DELREADONLY) != 0));
                Logger.instance().log("Edit replication sets      " + ((ui.flags & AccessC.FLAG_EDITREPL) != 0));
                Logger.instance().log("Edit ACL                   " + ((ui.flags & AccessC.FLAG_EDITACL) != 0));
                Logger.instance().log("Ignore ACL                 " + ((ui.flags & AccessC.FLAG_IGNOREACL) != 0));
                Logger.instance().log("Edit scanner configuration " + ((ui.flags & AccessC.FLAG_EDITSCAN) != 0));
                Logger.instance().log("Change storage mask        " + ((ui.flags & AccessC.FLAG_CHANGEMASK) != 0));
                Logger.instance().log("Edit activity projects     " + ((ui.flags & AccessC.FLAG_EDITACT) != 0));
                Logger.instance().log("Edit storage path          " + ((ui.flags & AccessC.FLAG_CHANGEPATH) != 0));
                Logger.instance().log("Inhibit login              " + ((ui.flags & AccessC.FLAG_NOLOGIN) != 0));
                Logger.instance().log("Delete document version    " + ((ui.flags & AccessC.FLAG_DELVERSION) != 0));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 23
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // create Sord s1
                Sord s1 = ix.Ix.createSord("1", null, EditInfoC.mbSord).sord;
                s1.name = "s1 C# example MoveSord";
                s1.id   = ix.Ix.checkinSord(s1, SordC.mbAll, LockC.NO);
                Logger.instance().log("s1.id=" + s1.id);

                // create Sord o1
                Sord o1 = ix.Ix.createSord(s1.guid, null, EditInfoC.mbSord).sord;
                o1.name = "o1";
                o1.id   = ix.Ix.checkinSord(o1, SordC.mbAll, LockC.NO);
                Logger.instance().log("o1.id=" + o1.id);

                // create Sord r1
                Sord r1 = ix.Ix.createSord(o1.guid, null, EditInfoC.mbSord).sord;
                r1.name = "r1";
                r1.id   = ix.Ix.checkinSord(r1, SordC.mbAll, LockC.NO);
                Logger.instance().log("r1.id=" + r1.id);

                // create Sord o2
                Sord o2 = ix.Ix.createSord(s1.guid, null, EditInfoC.mbSord).sord;
                o2.name = "o2";
                o2.id   = ix.Ix.checkinSord(o2, SordC.mbAll, LockC.NO);
                Logger.instance().log("o2.id=" + o2.id);

                // VERIFY o1 contains r1
                String childIdsO1 = internalFindSordIdsInParent(ix, o1.guid);
                String childIdsO2 = internalFindSordIdsInParent(ix, o2.guid);
                Logger.instance().log("before move: o1:(" + childIdsO1 + "), o2:(" + childIdsO2 + ")");

                // MOVE r1 -> o2
                ix.Ix.copySord(o2.guid, r1.guid, null, CopySordC.MOVE);

                // VERIFY o2 contains r1
                childIdsO1 = internalFindSordIdsInParent(ix, o1.guid);
                childIdsO2 = internalFindSordIdsInParent(ix, o2.guid);
                Logger.instance().log("after move: o1:(" + childIdsO1 + "), o2:(" + childIdsO2 + ")");


                // Clean up?
                bool cleanUp = true;
                if (cleanUp)
                {
                    ix.Ix.deleteSord(null, s1.guid, LockC.NO, null);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 24
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");
                // 1. Create structure
                Sord e1 = ix.Ix.createSord("1", "0", EditInfoC.mbSord).sord;
                e1.name = "e1";
                e1.id   = ix.Ix.checkinSord(e1, SordC.mbAll, LockC.NO);
                Logger.instance().log("created e1: id=" + e1.id);

                Sord e2 = ix.Ix.createSord(e1.guid, "0", EditInfoC.mbSord).sord;
                e2.name = "e2";
                e2.id   = ix.Ix.checkinSord(e2, SordC.mbAll, LockC.NO);
                Logger.instance().log("created e2: id=" + e2.id);

                Sord e3 = ix.Ix.createSord(e2.guid, "0", EditInfoC.mbSord).sord;
                e3.name = "e3";
                e3.id   = ix.Ix.checkinSord(e3, SordC.mbAll, LockC.NO);
                Logger.instance().log("created e3: id=" + e3.id);

                Sord e4 = ix.Ix.createSord(e3.guid, "0", EditInfoC.mbSord).sord;
                e4.name = "e4";
                e4.id   = ix.Ix.checkinSord(e4, SordC.mbAll, LockC.NO);
                Logger.instance().log("created e4: id=" + e4.id);

                // 2. Checkout Sord by archive path: /e1/e2/e3/e4
                Sord sord = ix.Ix.checkoutSord("ARCPATH:¶e1¶e2¶e3¶e4",
                                               EditInfoC.mbSord, LockC.NO).sord;
                Logger.instance().log("¶e1¶e2¶e3¶e4, id=" + sord.id + " == e4.id=" + e4.id);

                // Hint: The first character in the archive path defines the delimiter
                //       character used to seperate the archive levels.
                //       Thus you can use any character as delimiter. But consider
                //		 that this character should not be used in Sord names.

                sord = ix.Ix.checkoutSord("ARCPATH:\\e1\\e2\\e3\\e4",
                                          EditInfoC.mbSord, LockC.NO).sord;
                Logger.instance().log("\\e1\\e2\\e3\\e4, id=" + sord.id + " == e4.id=" + e4.id);

                bool cleanUp = true;
                if (cleanUp)
                {
                    DeleteOptions delOpts = new DeleteOptions();
                    delOpts.deleteFinally = true;
                    ix.Ix.deleteSord(null, e1.guid, LockC.NO, delOpts);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 25
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix1      = null;
            IXConnection  ix2      = null;

            // generate an event type that is most likely only used by me.
            myEventType = computeMyEventType();

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login connections...");
                ix1 = connFact.Create(userName, userPwd, "myComputer-conn1", null);
                ix2 = connFact.Create(userName, userPwd, "myComputer-conn2", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // Add event bus handlers.
                // This handlers are called for the received events from a background thread.
                // Thus we cannot update the user interfache in this threads directly.
                // The handlers will add the received events to the list receivedMessages and
                // the items of the list are printed from the main thread.
                ix1.EventBusApi.EventBusHandler += new EventBusApi.ProcessEventBusEvents(EventBusApi_EventBusHandler1);
                ix2.EventBusApi.EventBusHandler += new EventBusApi.ProcessEventBusEvents(EventBusApi_EventBusHandler2);

                // Add listeners to our private event.
                ix1.EventBusApi.BroadcastBus.AddListener(myEventType);
                ix2.EventBusApi.BroadcastBus.AddListener(myEventType);

                Logger.instance().log("conn1.subsId=" + ix1.EventBusApi.SubscriberId);
                Logger.instance().log("conn2.subsId=" + ix2.EventBusApi.SubscriberId);

                // Each connection sends 3 events to the other connection.
                // Here, the event data is a simple string. But it could be a Sord e.g. too.
                Logger.instance().log("send events");
                for (int i = 0; i < 3; i++)
                {
                    EventBusApi.Bus bbus1 = ix1.EventBusApi.BroadcastBus;
                    bbus1.Send(myEventType, "Hello conn2 - " + i);

                    EventBusApi.Bus bbus2 = ix2.EventBusApi.BroadcastBus;
                    bbus2.Send(myEventType, "Hello conn1 - " + i);
                }

                // Wait for the events and print them.
                Logger.instance().log("wait 1");
                Thread.Sleep(1 * 1000);

                // Print received messages
                Logger.instance().log("received:");
                foreach (String s in receivedMessages)
                {
                    Logger.instance().log(s);
                }

                if (receivedMessages.Count != 6)
                {
                    Logger.instance().log("Error: 6 events should have been received");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix1 != null && ix2 != null)
                {
                    Logger.instance().log("IX logout...");
                    ix1.Logout();
                    ix2.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 26
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // Create a root folder
                Sord e1 = ix.Ix.createSord("1", "0", EditInfoC.mbSord).sord;
                e1.name = "e1";
                e1.id   = ix.Ix.checkinSord(e1, SordC.mbAll, LockC.NO);
                Logger.instance().log("created e1: id=" + e1.id);

                // Create 100 Sords
                String[] guids = new String[nbOfDocs];

                long diffTicks = 0;
                for (int i = 0; i < nbOfDocs; i++)
                {
                    // Initialize a EditInfo object
                    long     t1 = System.DateTime.Now.Ticks;
                    EditInfo ed = ix.Ix.createDoc(e1.guid, "Email", null, EditInfoC.mbSordDocAtt);
                    long     t2 = System.DateTime.Now.Ticks;
                    diffTicks += (t2 - t1);

                    // Add some index attributes
                    ed.sord.name = "e1." + i;
                    for (int idx = 0; idx < ed.sord.objKeys.Length; idx++)
                    {
                        ed.sord.objKeys[idx].data = new String[] { ed.sord.name + ".idx" + idx };
                    }

                    // Create a file
                    String docFile = internalCreateTestFile("DocPerformance " + ed.sord.name, "txt");

                    // checkinDocBegin
                    ed.document.docs                  = new DocVersion[1];
                    ed.document.docs[0]               = new DocVersion();
                    ed.document.docs[0].ext           = ix.GetFileExt(docFile);
                    ed.document.docs[0].pathId        = ed.sord.path;
                    ed.document.docs[0].encryptionSet = ed.sord.details.encryptionSet;
                    ed.document = ix.Ix.checkinDocBegin(ed.document);

                    // upload
                    t1 = System.DateTime.Now.Ticks;
                    ed.document.docs[0].uploadResult = ix.Upload(ed.document.docs[0].url, docFile);
                    t2         = System.DateTime.Now.Ticks;
                    diffTicks += (t2 - t1);

                    // checkinDocEnd
                    t1          = System.DateTime.Now.Ticks;
                    ed.document = ix.Ix.checkinDocEnd(ed.sord, SordC.mbAll, ed.document, LockC.NO);
                    t2          = System.DateTime.Now.Ticks;
                    diffTicks  += (t2 - t1);

                    guids[i] = ed.sord.guid;
                    if ((i + 1) % 20 == 0)
                    {
                        Logger.instance().log("create: " + (i + 1) + "/" + nbOfDocs);
                    }

                    System.IO.File.Delete(docFile);
                }

                // Log time values
                logTimeValues("create", diffTicks, nbOfDocs);

                // 2. Read 100 Documents
                diffTicks = 0;
                for (int i = 0; i < nbOfDocs; i++)
                {
                    // checkoutDoc
                    long     t1 = System.DateTime.Now.Ticks;
                    EditInfo ed = ix.Ix.checkoutDoc(guids[i], null, EditInfoC.mbSordDocAtt, LockC.NO);

                    // download
                    String docFile = internalMakeTempFileName(ed.document.docs[0].ext);
                    ix.Download(ed.document.docs[0].url, docFile);
                    long t2 = System.DateTime.Now.Ticks;
                    diffTicks += (t2 - t1);

                    System.IO.FileInfo fi = new System.IO.FileInfo(docFile);
                    if (fi.Length < fileSize)
                    {
                        throw new InvalidOperationException("download failed");
                    }

                    if ((i + 1) % 20 == 0)
                    {
                        Logger.instance().log("read: " + (i + 1) + "/" + nbOfDocs);
                    }

                    System.IO.File.Delete(docFile);
                }

                // Log time values
                logTimeValues("read", diffTicks, nbOfDocs);

                // 3. Delete root folder logically (implicitly deletes the 100 included Sords)
                Logger.instance().log("delete logically...");
                DateTime startTime = System.DateTime.Now;
                ix.Ix.deleteSord(null, e1.guid, LockC.NO, null);
                DateTime endTime = System.DateTime.Now;
                logTimeValues("delete logically", startTime, endTime, nbOfDocs);

                // 4. Delete root folder finally (implicitly deletes the 100 included Sords)
                Logger.instance().log("delete finally...");
                startTime = System.DateTime.Now;
                DeleteOptions delOpts = new DeleteOptions();
                delOpts.deleteFinally = true;
                ix.Ix.deleteSord(null, e1.guid, LockC.NO, delOpts);
                endTime = System.DateTime.Now;
                logTimeValues("delete finally", startTime, endTime, nbOfDocs);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 27
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // Create a document
                EditInfo ed = ix.Ix.createDoc("1", null, null, EditInfoC.mbSordDoc);
                ed.sord.name     = "document with annotations";
                ed.document      = new Document();
                ed.document.docs = new DocVersion[1] {
                    new DocVersion()
                };
                ed.document.docs[0].ext           = "tif";
                ed.document.docs[0].pathId        = ed.sord.path;
                ed.document.docs[0].encryptionSet = ed.sord.details.encryptionSet;
                ed.document = ix.Ix.checkinDocBegin(ed.document);
                ed.document.docs[0].uploadResult = ix.Upload(ed.document.docs[0].url, @"..\..\00000001.TIF");
                ed.document = ix.Ix.checkinDocEnd(ed.sord, SordC.mbAll, ed.document, LockC.NO);

                List <Note> notes = new List <Note>();

                // -------------------------------------------------------
                // Do not use the member Note.desc for annotations because
                // it contains position and formatting information.
                // -------------------------------------------------------

                // Text on a opaque rectangle
                if (true)
                {
                    Note note = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_NOTE_WITHFONT, null);
                    note.noteText.text = "This is an annotation with font=" + note.noteText.fontInfo.faceName;

                    note.color = NetColorToEloColor(System.Drawing.Color.RosyBrown);
                    note.noteText.fontInfo.height *= 2;
                    note.noteText.fontInfo.bold    = true;
                    note.noteText.fontInfo.italic  = true;
                    note.noteText.fontInfo.RGB     = NetColorToEloColor(System.Drawing.Color.SkyBlue);

                    note.XPos   = 100;
                    note.YPos   = 200;
                    note.width  = 1000;
                    note.height = 500;

                    notes.Add(note);
                }

                // Horizontal line
                if (true)
                {
                    Note      note = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_HORIZONTAL_LINE, null);
                    PointInfo p1   = new PointInfo();
                    p1.x = 100;
                    p1.y = 750;
                    PointInfo p2 = new PointInfo();
                    p2.x = p1.x + 900;
                    p2.y = p1.y;
                    note.noteFreehand.points = new PointInfo[] { p1, p2 };

                    note.noteFreehand.width = 20; // Pen width

                    note.color = NetColorToEloColor(System.Drawing.Color.Violet);

                    notes.Add(note);
                }

                // Freehand line (this example draws a circle)
                if (true)
                {
                    Note             note   = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_FREEHAND, null);
                    List <PointInfo> points = new List <PointInfo>();
                    for (int i = 0; i < 360; i += 5)
                    {
                        double    alpha = 2 * Math.PI * (double)i / 360.0;
                        PointInfo p     = new PointInfo();
                        p.x = 200 + (int)(Math.Sin(alpha) * 100);
                        p.y = 900 + (int)(Math.Cos(alpha) * 100);
                        points.Add(p);
                    }
                    note.noteFreehand.points = points.ToArray();

                    note.noteFreehand.width = 50; // Pen width

                    note.color = NetColorToEloColor(System.Drawing.Color.Tomato);

                    notes.Add(note);
                }

                // Draws a half-transparent rectangle
                if (true)
                {
                    Note note = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_MARKER, null);
                    note.XPos   = 400;
                    note.YPos   = 800;
                    note.width  = 300;
                    note.height = 200;
                    note.color  = NetColorToEloColor(System.Drawing.Color.YellowGreen);

                    notes.Add(note);
                }

                // Draws a filled (opaque) rectangle
                if (true)
                {
                    Note note = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_FILLEDRECTANGLE, null);
                    note.XPos   = 800;
                    note.YPos   = 800;
                    note.width  = 300;
                    note.height = 200;
                    note.color  = NetColorToEloColor(System.Drawing.Color.YellowGreen);

                    notes.Add(note);
                }

                // Draws a strikeout line
                if (true)
                {
                    Note note = ix.Ix.createNote2(ed.document.objId, NoteC.TYPE_ANNOTATION_STRIKEOUT, null);

                    PointInfo p1 = new PointInfo();
                    p1.x = 100;
                    p1.y = 1100;
                    PointInfo p2 = new PointInfo();
                    p2.x = p1.x + 900;
                    p2.y = p1.y;
                    note.noteFreehand.points = new PointInfo[] { p1, p2 };

                    note.noteFreehand.width          = 100;
                    note.noteFreehand.strikeoutWidth = 20;
                    note.noteFreehand.strikeoutColor = NetColorToEloColor(System.Drawing.Color.Red);

                    note.color = NetColorToEloColor(System.Drawing.Color.Yellow);

                    notes.Add(note);
                }


                int[] noteIds = ix.Ix.checkinNotes(null, notes.ToArray(), NoteC.mbAll, LockC.NO);
                Logger.instance().log("noteIds=" + noteIds);
            }
            finally
            {
                ix.Logout();
            }
        }
Esempio n. 28
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // use createSord to get mask names
                Logger.instance().log("createSord...");
                EditInfo ed = ix.Ix.createSord(null, null, EditInfoC.mbBasicData);
                Logger.instance().log("createSord OK");

                Logger.instance().log("mask names:");
                for (int i = 0; i < ed.maskNames.Length; i++)
                {
                    Logger.instance().log("  name=" + ed.maskNames[i].name + ", id=" + ed.maskNames[i].id);
                }

                Logger.instance().log("marker names:");
                for (int i = 0; i < ed.markerNames.Length; i++)
                {
                    Logger.instance().log("  name=" + ed.markerNames[i].name + ", id=" + ed.markerNames[i].id);
                }

                Logger.instance().log("path names:");
                for (int i = 0; i < ed.pathNames.Length; i++)
                {
                    Logger.instance().log("  name=" + ed.pathNames[i].name + ", id=" + ed.pathNames[i].id);
                }

                Logger.instance().log("replication set names:");
                for (int i = 0; i < ed.replNames.Length; i++)
                {
                    Logger.instance().log("  name=" + ed.replNames[i].name + ", id=" + ed.replNames[i].id);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 29
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // lock key data
                // This is optional since checkinKeys and
                // deleteKeys check the lock too.
                Logger.instance().log("lock key data...");
                ix.Ix.checkoutKeys(null, LockC.YES);
                Logger.instance().log("lock key data OK");

                // create key
                // - be aware to set KeyInfo.id = -1 to create a new key!
                Logger.instance().log("create key...");
                KeyInfo ki = new KeyInfo();
                ki.id   = -1;
                ki.name = "C# Example Key";
                ki.id   = ix.Ix.checkinKeys(new KeyInfo[] { ki }, LockC.NO)[0];
                Logger.instance().log("create key OK, name=" + ki.name + ", id=" + ki.id);

                // delete key and unlock
                Logger.instance().log("delete key...");
                ix.Ix.deleteKeys(new String[] { ki.name }, LockC.YES);
                Logger.instance().log("delete key OK");
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }
Esempio n. 30
0
        public void run()
        {
            IXConnFactory connFact = null;
            IXConnection  ix       = null;

            try
            {
                IXProperties connProps = IXConnFactory.CreateConnProperties(url);
                IXProperties sessOpts  = IXConnFactory.CreateSessionOptions("IX-Examples", "1.0");
                connFact = new IXConnFactory(connProps, sessOpts);
                Logger.instance().log("create IXConnFactory OK");

                // Prepare ClientInfo object with language and country
                // ClientInfo ci = new ClientInfo();
                // ci.language = "de";
                // ci.country = "DE";

                // LOGIN
                Logger.instance().log("login...");
                ix = connFact.Create(userName, userPwd, "myComputer", null);
                // ci = ix.Login.ci
                Logger.instance().log("login OK");

                // get constants
                Logger.instance().log("get const...");
                IXServicePortC CONST = ix.CONST;
                Logger.instance().log("get const OK");

                // Create a Sord object to generate some report information
                Logger.instance().log("create sord...");
                Sord sord = ix.Ix.createSord("1", null, EditInfoC.mbSord).sord;
                sord.name = "C# Example Report";
                sord.id   = ix.Ix.checkinSord(sord, SordC.mbLean, LockC.NO);
                Logger.instance().log("create sord OK");

                // Wait some seconds. Report information is wirtten with a little
                // time delay after the action was taken.
                Logger.instance().log("sleep two seconds ...");
                System.Threading.Thread.Sleep(2000);
                Logger.instance().log("sleep two seconds OK");

                // Find report entries to sord
                Logger.instance().log("find report...");
                FindReportInfo findReport = new FindReportInfo();
                findReport.objId = sord.guid;
                FindResult findResult = ix.Ix.findFirstReportInfos(findReport, 10);

                int idx = 0;
                while (true)
                {
                    ReportInfo[] rinfos = findResult.reportInfos;
                    Logger.instance().log("find report OK, #infos=" + rinfos.Length);

                    // Dump report information.
                    // There could be more information since already deleted sord objects
                    // could have had the same ID.
                    for (int i = 0; i < rinfos.Length; i++)
                    {
                        Logger.instance().log("  action=" + rinfos[i].action);
                        Logger.instance().log("    time=" + rinfos[i].actTimeISO);
                        Logger.instance().log("    user="******"    text=" + rinfos[i].text);
                    }

                    if (!findResult.moreResults)
                    {
                        break;
                    }

                    idx       += rinfos.Length;
                    findResult = ix.Ix.findNextReportInfos(findResult.searchId, idx, 10);
                }

                DeleteOptions delOpts = new DeleteOptions();
                delOpts.deleteFinally = true;
                ix.Ix.deleteSord(null, sord.guid, LockC.NO, null);
                ix.Ix.deleteSord(null, sord.guid, LockC.NO, delOpts);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                // Logout
                // --
                if (ix != null)
                {
                    Logger.instance().log("IX logout...");
                    ix.Logout();
                    Logger.instance().log("IX logout OK");
                }
            }
        }