/// <summary> /// Makes a LockZ object from a FWAccessModes enum. /// </summary> /// <param name="accessMode">Access mode</param> /// <returns>Lock object</returns> public static LockZ MakeLockZ(FWAccessModes accessMode) { LockZ lockZ = LockC.NO; if ((accessMode & FWAccessModes.Lock) == FWAccessModes.Lock) { lockZ = LockC.IF_FREE; } if ((accessMode & FWAccessModes.LockAgain) == FWAccessModes.LockAgain) { lockZ = LockC.YES; } if ((accessMode & FWAccessModes.LockForce) == FWAccessModes.LockForce) { lockZ = LockC.FORCE; } return(lockZ); }
public abstract void onReadSord(IXServerEventsContext ec, Sord sord, SordZ sordZ, Document doc, LockZ lockZ);
public abstract void onAfterCheckinActivity(IXServerEventsContext ec, Activity act, bool isNew, Sord sord, SordZ sordZ, LockZ unlockZ);
public abstract void onAfterCheckinReminder(IXServerEventsContext ec, Reminder[] remiArray, Sord sord, SordZ sordZ, LockZ unlockZ);
///<summary>See IX documentation</summary> ///<param name="ec">See IX documentation</param> ///<param name="parentSord">See IX documentation</param> ///<param name="sord">See IX documentation</param> ///<param name="unlockZ">See IX documentation</param> ///<param name="delOpts">See IX documentation</param> ///<param name="ret">See IX documentation</param> public abstract void onAfterDeleteSord(IXServerEventsContext ec, Sord parentSord, Sord sord, LockZ unlockZ, DeleteOptions delOpts, bool ret);
///<summary>See IX documentation</summary> ///<param name="ec">See IX documentation</param> ///<param name="parentSord">See IX documentation</param> ///<param name="sord">See IX documentation</param> ///<param name="unlockZ">See IX documentation</param> ///<param name="delOpts">See IX documentation</param> public abstract void onBeforeDeleteSord(IXServerEventsContext ec, Sord parentSord, Sord sord, LockZ unlockZ, DeleteOptions delOpts);
///<summary>See IX documentation</summary> ///<param name="ec">See IX documentation</param> ///<param name="sord">See IX documentation</param> ///<param name="sordDB">See IX documentation</param> ///<param name="parentSord">See IX documentation</param> ///<param name="doc">See IX documentation</param> ///<param name="sordZ">See IX documentation</param> ///<param name="unlockZ">See IX documentation</param> public abstract void onAfterCheckinDocEnd(IXServerEventsContext ec, Sord sord, Sord sordDB, Sord parentSord, Document doc, SordZ sordZ, LockZ unlockZ);
/* * Example: start workflow for new document * public override void onAfterCheckinSord(EloixClient.IndexServer.IXServerEventsContext ec, EloixClient.IndexServer.Sord sord, EloixClient.IndexServer.Sord sordDB, EloixClient.IndexServer.Sord parentSord, EloixClient.IndexServer.SordZ sordZ, EloixClient.IndexServer.LockZ unlockZ) * { * // new sord? * if (sordDB == null && sord.type >= SordC.LBT_DOCUMENT) * { * FWConnection conn = connMap.getConn(ec); * conn.Ix.startWorkFlow("myHttpHandlerWorkflow", sord.name + "-workflow", sord.guid); * } * } */ ///<summary>See IX documentation</summary> ///<param name="ec">See IX documentation</param> ///<param name="sord">See IX documentation</param> ///<param name="sordDB">See IX documentation</param> ///<param name="parentSord">See IX documentation</param> ///<param name="sordZ">See IX documentation</param> ///<param name="unlockZ">See IX documentation</param> public abstract void onBeforeCheckinSord(IXServerEventsContext ec, Sord sord, Sord sordDB, Sord parentSord, SordZ sordZ, LockZ unlockZ);
/// <summary> /// Try to read a Sord object. /// </summary> /// <param name="objId">Object ID</param> /// <param name="accessMode">A combination of the FWAccessMode constants.</param> /// <param name="docAction">DocAction. /// If the Sord object is a <c>FWDocument</c> and the parameter is set to <c>DocAction.EditDocument</c> and FWAccessMode.Lock is set, the document will copied to the checkout-directory. /// Th eparameter will be ignored, if the Sord object is a <c>FWFolder</c>. /// </param> /// <returns>Sord object or null, if the object does not exist and accessMode does not include MustExist.</returns> /// <exception>IOException: object already locked, access denied, etc.</exception> public virtual FWSord TryGetSord(string objId, FWAccessModes accessMode, DocAction docAction) { FWSord xsord = null; bool exceptionOccured = false; FWSord tmpSord = null; try { //GetSord(objId); LockZ lockZ = FWLockMode.MakeLockZ(FWAccessModes.MustExist); Sord sord = Conn.Ix.checkoutDoc(objId, null, EditZ, lockZ).sord; sord.changedMembers = EditZ.bset; if (sord.id == 1 || sord.type < SordC.LBT_DOCUMENT) { tmpSord = ClassFactory.NewFolder(sord); } else { tmpSord = ClassFactory.NewDocument(sord); } } catch (Exception e) { exceptionOccured = true; if ((accessMode & FWAccessModes.MustExist) != 0) { throw e; } if (e.Message.IndexOf("[ELOIX:" + IXExceptionC.NOT_FOUND) < 0) { throw e; } } if (tmpSord != null && tmpSord.IsDocument() && docAction == DocAction.EditDocument) { CheckoutResult result = checkedOutDocumentsManagerVal.Checkout(tmpSord as FWDocument); if (result.Success) { xsord = result.FWDocument; } } else if (!exceptionOccured) { try { LockZ lockZ = FWLockMode.MakeLockZ(accessMode); Sord sord = Conn.Ix.checkoutDoc(objId, null, EditZ, lockZ).sord; sord.changedMembers = EditZ.bset; if (sord.id == 1 || sord.type < SordC.LBT_DOCUMENT) { xsord = ClassFactory.NewFolder(sord); } else { xsord = ClassFactory.NewDocument(sord); } } catch (Exception e) { if ((accessMode & FWAccessModes.MustExist) != 0) { throw e; } if (e.Message.IndexOf("[ELOIX:" + IXExceptionC.NOT_FOUND) < 0) { throw e; } } } return(xsord); }