PublicAPI.Docflow.DocumentELMA API Documentation
Document
Access path: PublicAPI.Docflow.Document
Methods

  NameDescription
Public methodAddComment(Document, Comment)
Add a comment
Public methodAddComment(Document, String)
Add a comment to the document
Public methodAddComment(Document, String, User, IEnumerable DocumentAttachment , IEnumerable Attachment )
Add a comment to the document
Public methodAddDocumentCreatePermission(OrganizationItem, Type)
Add the organization item permissions to create documents of a certain type
Public methodAddDocumentCreatePermission(User, Type)
Add the user permissions to create documents of a certain type
Public methodAddDocumentCreatePermission(UserGroup, Type)
Add the user group permissions to create documents of a certain type
Public methodAddEditPermission(Document, OrganizationItem)
Method for adding permissions to edit the document
Public methodAddEditPermission(Document, User)
Method for adding permissions to edit the document
Public methodAddEditPermission(Document, UserGroup)
Method for adding permissions to edit the document
Public methodAddFullAccessPermission(Document, OrganizationItem)
Method for adding the full access to the document
Public methodAddFullAccessPermission(Document, User)
Method for adding the full access to the document
Public methodAddFullAccessPermission(Document, UserGroup)
Method for adding the full access to the document
Public methodAddManageAccessPermission(Document, OrganizationItem)
Method for adding access permissions to the document
Public methodAddManageAccessPermission(Document, User)
Method for adding access permissions to the document
Public methodAddManageAccessPermission(Document, UserGroup)
Grant admin permissions to this document
Public methodAddQuestion(Document, Question)
Add a question to the document
Public methodAddQuestion(Document, User, String, IEnumerable Attachment , Boolean)
Add a question to the document
Public methodAddViewPermission(Document, OrganizationItem)
Grant the organization item users permissions to view the document
Public methodAddViewPermission(Document, User)
Grant the user permissions to view the document
Public methodAddViewPermission(Document, UserGroup)
Method for adding a user group permissions to view the document
Public methodArchive
Send Document to archive
Public methodCount 
Returns the total number of objects of this type
Public methodCount(IEntityFilter)
Get Total Number of Objects by Filter
Public methodCreate 
Create New Entity (without a Database entry)
Public methodCreate(Folder, String)
Create a document of a certain type. Creates an object without saving to the database
Public methodCreate(BinaryFile, Folder, String)
Create a document of a certain type
Public methodCreateLink
Create document link
Public methodDelete
Delete Entity from Database
Public methodDeleteDocumentCreatePermission(OrganizationItem, Type)
Delete the organization item permissions to create documents of a certain type
Public methodDeleteDocumentCreatePermission(User, Type)
Delete the user permissions to create documents of a certain type
Public methodDeleteDocumentCreatePermission(UserGroup, Type)
Delete the user group permissions to create documents of a certain type
Public methodDeleteLinks
Delete all the document links
Public methodDeletePermissions(Document, OrganizationItem)
Delete the organization item's permissions to the document
Public methodDeletePermissions(Document, User)
Delete the user's permissions to the document
Public methodDeletePermissions(Document, UserGroup)
Delete the user group's permissions to the document
Public methodFilter
Creates an assistant for working with the "Document" object filter
Public methodFind(FetchOptions)
Find objects according to fetch options
Public methodFind(String)
Find objects according to the filter in the EQL language
Public methodFind(IEntityFilter, FetchOptions)
Fing objects according to fetch options and filter
Public methodFindByIdArray
Find All Objects by Array IDs
Public methodGetAllLinkedDocuments
Get all the linked documents
Public methodGetFileByDocumentId
Get the file of the current document version
Public methodIsDirty
Check, if there are unsaved changes in the object
Public methodIsNew
Check, if the object is new (not saved in the database)
Public methodLoad(Guid)
Load by UID. If not found, an exception is invoked
Public methodLoad(Int64)
Load by ID. If not found, an exception is invoked
Public methodLoadOrCreate(Guid)
Load by ID. If not found, the new object is returned
Public methodLoadOrCreate(Int64)
Load by ID. If not found, the new object is returned
Public methodLoadOrNull(Guid)
Load by UID. If not found, null is returned
Public methodLoadOrNull(Int64)
Load by ID. If not found, null is returned
Public methodLoadRegVariant
Load registration variant by ID
Public methodMove
Move the document to another folder
Public methodRefresh
Refresh (read over) Object from Database
Public methodRegister(Document, RegistrationVariant)
Register document using a registration variant
Public methodRegister(Document, Depository, DocumentFlowType)
Register document by category and document flow
Public methodRegister(Document, RegistrationVariant, ReservedRegNumber)
Register document using a registration variant
Public methodRegister(Document, Depository, DocumentFlowType, ReservedRegNumber)
Register document by category and document flow
Public methodRegister(Document, RegistrationVariant, ReservedRegNumber, Nullable DateTime )
Public methodRegister(Document, Depository, DocumentFlowType, ReservedRegNumber, Nullable DateTime )
Public methodSave
Save Object to Database
Public methodUnArchive
Extract the document from the archive
Back to Top
Properties

  NameDescription
Public propertyTypeUid
Returns the unique object identifier "Document"
Back to Top
Remarks

Section containing methods for managing documents
Examples

Create a document to work with. The document will be stored in the folder created here:

var myDocument = PublicAPI.Docflow.Types.File.Create(context.File, myFolder, "New Sample Document");
context.File - file that will be a default version of the document

After additions of document versions and changes of theirs statuses , register the document

//load the registration variant required to register the document 
var regVariant = PublicAPI.Docflow.Document.LoadRegVariant(1);
//register the document
PublicAPI.Docflow.Document.Register(myDocument, regVariant);
The registration function is available only with configured records classification scheme and registration variants

Add the document "edit" permission to the user

PublicAPI.Docflow.Document.AddEditPermission(myDocument, context.User);
context.User is the user to whom the permission is added. If the user already has this permission, no changes will be applied

Please save the object in the database to ensure it's functioning properly

myDocument.Save();

You can archive your document or restore it from the archive

//Archive the document
PublicAPI.Docflow.Document.Archive(myDocument);
//restore the document from archive
PublicAPI.Docflow.Document.UnArchive(myDocument);

Add a comment to the document

PublicAPI.Docflow.Document.AddComment(myDocument, "The document is successfully restored from the archive");

Learn how to send the document for acquaintance, consideration and approval here

See Also