/// <summary> /// <see cref="VirtualListView.makeColumns()"/> /// </summary> /// <remarks> /// Create an additional column for each of the index groups used by the cached Sord objects. /// It merly looks on the currently available Sords in the cache and does not /// read all Sords from the IndexServer. /// </remarks> protected override void makeColumns() { if (objectsCacheValue == null) { return; } Dictionary <String, DocMaskLineUsage> mapDmlUsage = new Dictionary <String, DocMaskLineUsage>(); if (this.ShowObjKeyColumns) { for (int i = 0; i < objectsCacheValue.CountEstimated; i++) { FWSord sord = SordsCache[i]; if (!ShowDocuments && (sord is FWDocument)) { continue; } if (!ShowFolders && (sord is FWFolder)) { continue; } DocMask dm = Conn.MasterData.DocMasks[sord.MaskId].Core; for (int dmlIdx = 0; dmlIdx < dm.lines.Length; dmlIdx++) { DocMaskLine dml = dm.lines[dmlIdx]; String groupName = dml.key.ToLower(); DocMaskLineUsage u = null; if (!mapDmlUsage.TryGetValue(groupName, out u)) { u = new DocMaskLineUsage(); u.GroupName = groupName; u.lableNames = new List <String>(); u.lableNames.Add(dml.name); mapDmlUsage[groupName] = u; } u.usageCount++; u.minDmlId = Math.Min(u.minDmlId, dmlIdx); FWObjKeyValue okeyValue = sord.ObjKeys[dmlIdx].Value; if (okeyValue != null && !okeyValue.IsEmpty()) { u.valueCount++; } } } } List <DocMaskLineUsage> lstDmlUsages = new List <DocMaskLineUsage>(mapDmlUsage.Values); lstDmlUsages.Sort(new DocMaskLineUsageComparer()); List <ColumnHeaderEx> lstHeaders = new List <ColumnHeaderEx>(lstDmlUsages.Count + 11); ColumnHeaderName.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByName <FWSord>())); lstHeaders.Add(ColumnHeaderName); ColumnHeaderXDate.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByXDate <FWSord>())); lstHeaders.Add(ColumnHeaderXDate); ColumnHeaderIDate.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByIDate <FWSord>())); lstHeaders.Add(ColumnHeaderIDate); ColumnHeaderMaskName.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByMaskName <FWSord>(this.connVal))); lstHeaders.Add(ColumnHeaderMaskName); ColumnHeaderOwner.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByOwnerName <FWSord>())); lstHeaders.Add(ColumnHeaderOwner); ColumnHeaderVersion.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByVersion <FWSord>())); lstHeaders.Add(ColumnHeaderVersion); ColumnHeaderVersionDate.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByVersionDate <FWSord>())); lstHeaders.Add(ColumnHeaderVersionDate); ColumnHeaderVersionUser.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByVersionOwner <FWSord>())); lstHeaders.Add(ColumnHeaderVersionUser); ColumnHeaderFileSize.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByVersionFileSize <FWSord>())); lstHeaders.Add(ColumnHeaderFileSize); ColumnHeaderArcPath.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByArcPath <FWSord>())); lstHeaders.Add(ColumnHeaderArcPath); ColumnHeaderLockName.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByLockName <FWSord>())); lstHeaders.Add(ColumnHeaderLockName); if (this.ShowObjKeyColumns) { foreach (DocMaskLineUsage u in lstDmlUsages) { if (u.valueCount > 0) { ColumnHeaderEx h = new ColumnHeaderEx(); String hname = ""; for (int i = 0; i < u.lableNames.Count; i++) { if (i > 0) { hname += "/"; } hname += u.lableNames[i]; } h.Text = hname; h.Tag = new ColumnHeaderTag(compareObjectComparersVal.Add(new FWCompareSordByObjKey <FWSord>(u.GroupName))); h.Name = hname; lstHeaders.Add(h); } } } this.Columns.Clear(); this.Columns.AddRange(lstHeaders.ToArray()); }
public FWDocMask(FWConnection conn, DocMask docMask) { connVal = conn; docMaskVal = docMask; }
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 editInfo = ix.Ix.createSord(parentId, maskId, EditInfoC.mbAll); // Hint: Supply the constant EditInfoC.mbAll to get not only the Sord object data // but the storage mask data too. Logger.instance().log("prepared sord with GUID=" + editInfo.sord.guid); DocMask mask = editInfo.mask; Sord sord = editInfo.sord; // Set display name sord.name = "C# sord"; // Set some index attributes for (int i = 0; i < mask.lines.Length; i++) { DocMaskLine dml = mask.lines[i]; if (dml.name.Equals("From") || dml.key.Equals("ELOOUTL1")) // this line is just to make it work with all languages { sord.objKeys[i].data = new String[] { "*****@*****.**" }; } else if (dml.name.Equals("To") || dml.key.Equals("ELOOUTL2")) // this line is just to make it work with all languages { sord.objKeys[i].data = new String[] { "*****@*****.**" }; } } // CHECKIN int objId = ix.Ix.checkinSord(sord, SordC.mbAll, LockC.NO); Logger.instance().log("Created sord successfully, objId=" + objId); // CHECKOUT String strObjId = (String)Convert.ChangeType(objId, typeof(String)); editInfo = ix.Ix.checkoutSord(strObjId, EditInfoC.mbSord, LockC.NO); sord = editInfo.sord; Logger.instance().log("Checkout sord successfully, GUID=" + sord.guid); Logger.instance().log("name=" + sord.name); for (int i = 0; i < sord.objKeys.Length; i++) { ObjKey okey = sord.objKeys[i]; if (okey.data.Length != 0) { Logger.instance().log("okey, goup-name=" + okey.name + ", data=" + okey.data[0]); } } } catch (Exception e) { throw e; } finally { // Logout // -- if (ix != null) { Logger.instance().log("IX logout..."); ix.Logout(); Logger.instance().log("IX logout OK"); } } }
public virtual FWDocMask NewFWDocMask(DocMask core) { return(new FWDocMask(ifc.Conn, core)); }
/// <summary> /// Reads Sord values into dialog elements /// </summary> private void loadIndexingInfo() { // set name, description and dates txName.Text = ed.sord.name; rtDesc.Text = ed.sord.desc; // archiving date if (ed.sord.IDateIso != null && ed.sord.IDateIso.Length != 0) { dtIDate.Value = isoToDateTime(ed.sord.IDateIso); } // user defined date dtXDate.Checked = ed.sord.XDateIso != null && ed.sord.XDateIso.Length != 0; if (dtXDate.Checked) { dtXDate.Value = isoToDateTime(ed.sord.XDateIso); } // select mask lockChangeMaskIndex = true; lbMasks.SelectedItem = ed.mask.name; lockChangeMaskIndex = false; // handle index lines DocMask dm = ed.mask; Label[] labels = new Label[] { lbIndex1, lbIndex2, lbIndex3 }; TextBox[] textBoxes = new TextBox[] { txIndex1, txIndex2, txIndex3 }; for (int i = 0; i < labels.Length; i++) { // visible? bool visible = (i < dm.lines.Length && i < ed.sord.objKeys.Length); labels[i].Visible = visible; textBoxes[i].Visible = visible; if (visible) { // label text from storage mask labels[i].Text = dm.lines[i].name; // enabled ? textBoxes[i].Enabled = dm.lines[i].canEdit; // hidden? labels[i].Visible = !dm.lines[i].hidden; textBoxes[i].Visible = !dm.lines[i].hidden; // index line data String data = ""; if (ed.sord.objKeys[i].data.Length > 1) { // more then one value: ¶¶val1¶val2¶val3... data = "¶"; for (int c = 0; c < ed.sord.objKeys[i].data.Length; c++) { data += "¶" + ed.sord.objKeys[i].data[c]; } } else if (ed.sord.objKeys[i].data.Length == 1) { // one value data = ed.sord.objKeys[i].data[0]; } textBoxes[i].Text = data; } } }
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 storage mask Logger.instance().log("create mask..."); DocMask docMask = ix.Ix.createDocMask(null); Logger.instance().log("create mask OK"); // set some mask values docMask.name = "C# Example Mask"; // mask name docMask.details.documentMask = true; // can be used as template for documents and structure elements docMask.details.searchMask = true; // can be used to search for archive items docMask.details.archivingMode = ArchivingModeC.VERSION; // documents of this mask are stored with version controll // assign index lines docMask.lines = new DocMaskLine[3]; docMask.lines[0] = new DocMaskLine(); docMask.lines[0].id = 0; docMask.lines[0].name = "Author"; docMask.lines[0].key = "AUTHOR"; docMask.lines[0].type = DocMaskLineC.TYPE_TEXT; docMask.lines[0].labelCol = 1; docMask.lines[0].labelRow = 4; docMask.lines[0].editCol = 14; docMask.lines[0].editRow = 4; docMask.lines[0].editWidth = 20; docMask.lines[1] = new DocMaskLine(); docMask.lines[1].id = 1; docMask.lines[1].name = "Title"; docMask.lines[1].key = "TITLE"; docMask.lines[1].type = DocMaskLineC.TYPE_TEXT; docMask.lines[1].labelCol = 1; docMask.lines[1].labelRow = 5; docMask.lines[1].editCol = 14; docMask.lines[1].editRow = 5; docMask.lines[1].editWidth = 20; docMask.lines[2] = new DocMaskLine(); docMask.lines[2].id = 2; docMask.lines[2].name = "Released at"; docMask.lines[2].key = "DATE"; docMask.lines[2].type = DocMaskLineC.TYPE_ISO_DATE; docMask.lines[2].labelCol = 1; docMask.lines[2].labelRow = 6; docMask.lines[2].editCol = 14; docMask.lines[2].editRow = 6; docMask.lines[2].editWidth = 20; // checkin Logger.instance().log("checkin..."); docMask.id = ix.Ix.checkinDocMask(docMask, DocMaskC.mbAll, LockC.NO); Logger.instance().log("checkin OK, docMask.id=" + docMask.id); // checkout Logger.instance().log("checkout..."); docMask = ix.Ix.checkoutDocMask(docMask.name, DocMaskC.mbAll, LockC.NO); Logger.instance().log("checkout OK, name=" + docMask.name); // Create a Sord object with this mask Logger.instance().log("create sord..."); Sord sord = ix.Ix.createSord("1", docMask.name, EditInfoC.mbSord).sord; Logger.instance().log("create sord OK"); Logger.instance().log("sord index lines: "); for (int i = 0; i < sord.objKeys.Length; i++) { Logger.instance().log(" id=" + sord.objKeys[i].id + ", group=" + sord.objKeys[i].name); } // checkin Sord ix.Ix.checkinSord(sord, SordC.mbAll, LockC.NO); // delete mask // - must fail, since there is still a sord object related to this mask try { Logger.instance().log("delete mask..."); ix.Ix.deleteDocMask(docMask.name, null, LockC.NO); Logger.instance().log("Error: delete mask must fail"); } catch (Exception e) { Logger.instance().log("OK, delete mask failed, err=" + formatException(e)); } // delete the mask and specify an alternative mask (with mask-ID "0") // for Sord objects related to the mask Logger.instance().log("delete mask..."); ix.Ix.deleteDocMask(docMask.name, "0", LockC.NO); Logger.instance().log("delete mask OK"); // delete sord DeleteOptions delOpts = new DeleteOptions(); delOpts.deleteFinally = true; 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"); } } }