Show / Hide Table of Contents

Class SoArc2CheckoutHelper

Class for helping with locking/checkout functionality

Inheritance
Object
SoArc2CheckoutHelper
Namespace: SuperOffice.CRM.Documents
Assembly: SoDataBase.dll
Syntax
public class SoArc2CheckoutHelper : Object

Constructors

SoArc2CheckoutHelper(ICheckinFileOperations)

Class for helping with locking/checkout functionality

Declaration
public SoArc2CheckoutHelper(ICheckinFileOperations fileOps)
Parameters
Type Name Description
ICheckinFileOperations fileOps

Fields

LockedFolderName

Class for helping with locking/checkout functionality

Declaration
public const string LockedFolderName = "locked"
Field Value
Type Description
String

Methods

CheckinDocument(IDocumentInfo)

Check-in the document. This will copy the locked\document to the original folder and remove the checkoutdata.

Declaration
public void CheckinDocument(IDocumentInfo documentInfo)
Parameters
Type Name Description
IDocumentInfo documentInfo

CheckoutDocument(IDocumentInfo, Int32)

Check-out the document. This will copy the current document to the locked folder.

Declaration
public string CheckoutDocument(IDocumentInfo documentInfo, int associateId)
Parameters
Type Name Description
IDocumentInfo documentInfo
Int32 associateId
Returns
Type Description
String

The path to the locked document.

GetCheckedOutDocumentPath(IDocumentInfo)

Get the path to the checked-out document.

Assumes that the document is checked-out.

Declaration
public string GetCheckedOutDocumentPath(IDocumentInfo incomingInfo)
Parameters
Type Name Description
IDocumentInfo incomingInfo
Returns
Type Description
String

GetCheckoutData(IDocumentInfo)

Get the internal representation of the checkout meta-data.

Declaration
public CheckoutData GetCheckoutData(IDocumentInfo documentInfo)
Parameters
Type Name Description
IDocumentInfo documentInfo
Returns
Type Description
CheckoutData

GetDocumentLockedPath(IDocumentInfo, Boolean)

Get the path to the locked folder for the supplied document.

Declaration
protected string GetDocumentLockedPath(IDocumentInfo documentInfo, bool createIfNeccessary = false)
Parameters
Type Name Description
IDocumentInfo documentInfo
Boolean createIfNeccessary
Returns
Type Description
String

The path to the locked folder for the document - excluding the document name

GetDocumentPath(IDocumentInfo, CheckoutData, Int32)

Get the path to the document which this associate has access to. If the document is checked-out to the user, he will receive the path to the document in the locked folder. If the document is not checked out, or the current associate is not the checked-out-associate, he will receive the path to the original document.

Declaration
public string GetDocumentPath(IDocumentInfo documentInfo, CheckoutData checkoutData, int associateId)
Parameters
Type Name Description
IDocumentInfo documentInfo
CheckoutData checkoutData
Int32 associateId
Returns
Type Description
String

GetDocumentPath(IDocumentInfo, Int32)

Get the path to the document which this associate has access to. If the document is checked-out to the user, he will receive the path to the document in the locked folder. If the document is not checked out, or the current associate is not the checked-out-associate, he will receive the path to the original document.

Declaration
public string GetDocumentPath(IDocumentInfo documentInfo, int associateId)
Parameters
Type Name Description
IDocumentInfo documentInfo
Int32 associateId
Returns
Type Description
String

IsDocumentLockedByOffice(IDocumentInfo, out String)

Check if the document is locked by Office. If the file is locked, displayName will be populated with the name of the editor.

Declaration
public bool IsDocumentLockedByOffice(IDocumentInfo documentInfo, out string displayName)
Parameters
Type Name Description
IDocumentInfo documentInfo
String displayName
Returns
Type Description
Boolean
Remarks

The displayName will be the name supplied by the user in Microsoft Office. Note that the name MAY in some scenarios be wrong.

IsWriteableForAssociate(IDocumentInfo, CheckoutData, Int32)

Class for helping with locking/checkout functionality

Declaration
public bool IsWriteableForAssociate(IDocumentInfo documentInfo, CheckoutData checkoutData, int associateId)
Parameters
Type Name Description
IDocumentInfo documentInfo
CheckoutData checkoutData
Int32 associateId
Returns
Type Description
Boolean

IsWriteableForAssociate(IDocumentInfo, Int32)

Class for helping with locking/checkout functionality

Declaration
public bool IsWriteableForAssociate(IDocumentInfo documentInfo, int associateId)
Parameters
Type Name Description
IDocumentInfo documentInfo
Int32 associateId
Returns
Type Description
Boolean

RenameDocument(IDocumentInfo, String)

Rename the checkout data when the document is renamed. Should only be called when the document has actually changed file name.

Declaration
public void RenameDocument(IDocumentInfo documentInfo, string newFileName)
Parameters
Type Name Description
IDocumentInfo documentInfo
String newFileName

SaveCheckoutData(IDocumentInfo, CheckoutData)

Save the checkout data as JSON in the archivepath. The checkoutdata is removed if the checkoutData is null.

Declaration
public void SaveCheckoutData(IDocumentInfo documentInfo, CheckoutData checkoutData)
Parameters
Type Name Description
IDocumentInfo documentInfo
CheckoutData checkoutData

UndoCheckout(IDocumentInfo)

Class for helping with locking/checkout functionality

Declaration
public void UndoCheckout(IDocumentInfo documentInfo)
Parameters
Type Name Description
IDocumentInfo documentInfo

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top