Visual of Communication Among ndOffice, MS Office, and Adobe

Follow

Table of Contents

General Information

ndOffice app contains several main parts:

  • Echoing client—This is a notification area application responsible for retrieving and updating data in the database, communicating with NetDocuments via REST API, and working with the file system. Also, echoing client hosts Extensibility COM API and WCF service:
    • Extensibility COM API is used for communication between Adobe add-in and echoing client and can be used by third-party interventions to organize the communication with echoing client.
    • WCF service is used for communication between MS Office add-ins and echoing client. This WCF is based on the NetNamedPipeBinding, which is optimal to organize on machine communication.

You can find more info about the WCF technology and NetNamedPipeBinding at the following links:

  • MS Office add-ins—This is the integrations with each specific MS Office apps: Word, Excel, PowerPoint, Outlook, and Visio. These add-ins are created with Visual Studio Tools for Office (VSTO) technology. For more info about VSTO, see here.

MS Office add-ins are used to intercept user actions and replace standard MS Office logic with a custom. MS Office add-ins intercept activities like document saving, opening, and others. Also, MS Office add-ins are responsible for performing MS Office-specific operations: modifying document content in Word (stamping), retrieving data about emails in Outlook, etc.

  • Adobe add-in—This is the integration with Adobe Reader and Adobe Acrobat. Adobe add-in is used to intercept user actions and replace standard Adobe logic with a custom one. It uses extensibility API to show ndOffice dialogs and initiate document actions like upload, check-in, check-out, and others.

MainArhitecture.png

Important: MS Office add-ins and Adobe add-ins do not communicate with NetDocuments REST API directly. So, all data loading and document operations initiated from the add-ins dialogs use echoing client for this. That is why the echoing client is automatically launched when a user tries to open any ndOffice dialog.

Database

ndOffice uses SQL Server Compact to store data on a user's machine. SQL Server Compact is an embedded, single-file database from Microsoft. The main benefit of SQL Server Compact, for which it was chosen, is that this does not require any additional software on the user's machine. ndOffice automatically creates a database on opening if it doesn't exist in the echo folder.

ndOffice uses Entity Framework to access data in the database. Entity Framework is an open-source object-relational mapping (ORM) framework from Microsoft. You can find more information about Entity Framework here.

MS Word, Excel, PowerPoint, and Visio Workflows

MS Word, Excel, PowerPoint, and Visio have similar workflows:

  • In these apps, ndOffice replaces the standard Save As and Open dialogs with ndOffice dialogs, which allow you to open and save documents to NetDocuments.
  • Except this, ndOffice intercepts the Save command and replaces it with custom logic, saving the document's content to NetDocuments. This functionality is implemented using VSTO. ndOffice handles events from the MS Office application and overrides the standard behavior. Instead, ndOffice uses its own logic.
  • Communication between MS Office add-ins and echoing client is organized using the WCF service hosted in the echoing client.

Save Document Content

Select the CTRL+S keyboard shortcut or the Save button on the ribbon to initiate the Save document process. In some cases, the following actions may cause the Save As dialog to open:

  • MS Office document is new, and you haven't saved it as a file;
  • You've opened the MS Office document in read-only mode;
  • You've opened the MS Office document in 97-2003 compatibility mode.

The Save document process is adapted to all MS Office applications except Outlook. A general workflow has the same steps. But each step in the Save process may contain different code to handle specific moments of the MS Office application.

For example, stamping functionality is supported only for MS Word, so Word add-in can search and update stamps in the document content. Other add-ins omit this step in the Save process.

In the diagram below, you can see detailed information about the Save process.

SaveProcess.1.png

Save As Document

Select the Save As button on the ribbon to initiate the saving process. Also, the Save As process may be automatically started instead of the Save process (These cases are described in the Save process section).

The Save As process consists of two phases:

  • Document or version shell creation—The MS Office add-in opens the Save As dialog during this phase. It does not load data for a dialog directly from NetDocuments. To do this, the MS Office add-ins use echoing client.

The next step in this phase is data validation. Add-in validates all data provided by a user.

Note: The MS Office add-in can load some settings needed for NetDocuments using the echoing client during this process.

As a final step, the MS Office add-in sends all the dialog data to the echoing client. Echoing client uses this data to create a shell for a new document or version and register it in the database.

  • Document content saving—During this phase, MS Office add-in updates the stamp in the document content and saves the content to the local file. When document content is saved to the local file, MS Office add-in requests the echoing client to upload a document.

In the diagram below, you can see detailed information about the Save As process.

SaveAsProcess..png

Open Document

You can select the CTRL+O keyboard shortcut or the Open button on the ribbon to start the opening process. This process is mainly concentrated in the echoing client. Almost all steps of this process are related to communication with NetDocuments via REST API and registration of a document in the database that is the echoing client's responsibility. MS Office add-in only opens the Open dialog and sends data from the dialog to the echoing client.

In the following diagram, you can see detailed information about the Open process.

OpenProcess.png

MS Outlook Workflows

The main principles of Outlook add-in are the same as in other add-ins. Outlook add-in uses VSTO technology to subscribe to Outlook events like SelectionChange, AttachmentSelectionChange. Except for VSTO, ndOffice also uses Add-in Express libraries to display Outlook panes. You can find detailed information about Add-in Express here.

The same as other add-ins, Outlook add-in does not communicate with database and NetDocuments directly. For these purposes, it uses echoing client. Communication between Outlook add-in and echoing client is also organized using WCF service hosted in the echoing client.

Attach Document

You can insert the NDs document to an email as an attachment or a link:

  • In the Message tab, select the Attach file Attach_file.png icon on the ribbon;
  • In the Message tab, select the Insert a link Insert_a_Link.png icon on the ribbon.

The Insert Attachment functionality is async. So, ndOffice loads documents in a separate thread and does not block the UI for users.

Outlook_Insert_Attachment_Process.png

Save Attachment

The Save Attachment process can be started in two ways:

  • Select the chevron chevron_icon.png icon next to the attachment, and click the Save to NetDocuments option from the dropdown menu;
  • Go to the File tab and select the Save Attachments button.

The Save Attachment processes from each place are almost the same. In the diagram below, you can see detailed information about the Save As process.

Outlook_Save_Attachment_Process..png

Save Email

To start the Save Email process do one of the following:

  • Go to the File tab, and select the Save button;
  • Select the Suggested location button on the ribbon.

In general, the saving process is the same in both cases.

The saving process is asynchronous, except first steps: document data validation and dialog showing. This means that it does not block UI threads, and users may start several saving processes simultaneously. If the user started several saving processes and there were some errors, errors dialog would be shown after all saving processes finished.

Outlook_Save_Email_Process..png