📜 ⬆️ ⬇️

Single space to work with accounts in Dropbox, Google Drive and Box

Many of us today are registered in various services for storing / exchanging / editing data. A separate article can be devoted to the inconveniences of our multi-world world, but today we offer you one of the ways to combine accounts in the well-known Dropbox, Google Drive and Box.
Recently, the “Add resource” function has become available in the DocumentsLab module. For those who have not paid attention to this innovation, we advise you to try and appreciate our Beta-service, which allows you to use documents from Dropbox, Box and Google Drive right on the portal TeamLab . How we implemented integration of documents and what opportunities it gives, we read under a cat.



Implementation
')
The integration of documents from third-party repositories is implemented through the Sharpbox open source library, which provides interfaces and classes for accessing documents from third-party providers through their public Api. Access to Dropbox and Box.com is provided via Dropbox Api and Webdav, respectively. More specifically, we added caching for documents and organized direct access to folders and files for Dropbox. In other words, earlier, in order to get access to the folder folder_1 / folder_2 / folder_3 , folder_1 and folder_2 were sequentially requested, and then folder_3 . Now the process fits into one request. Due to this, we have significantly accelerated the work of the program (compared to the original Sharpbox).

Access to Google Drive was made through its public Document List Api. To connect Google Drive, we had to slightly change the structure of the Sharpbox.

The fact is that in Google Drive:

- one and the same folder can be simultaneously in several folders
-in one folder can be several at once with the same name.

We made it so that the access that was previously carried out by the name of the folder is now carried out by a unique id provided by Google itself. In this case, the path to the folder does not consist of name_1 / name_2 / name_3 , but of id_1 / id_2 / id_3 . By default, id is taken equal to the name, so this change does not affect the work of other providers.

If there were no problems with Google and Dropbox, then with Box everything was not quite smooth. Empirically, we found out that when creating a file / document via WebDAV, the Box.net protocol “cuts off” from the name all Cyrillic characters to the first ASCII character. This situation does not occur when connecting other WebDAV providers, for example Yandex.DISK. To fix the problem, we plan to rewrite the provider for Box.net through the API.

Profit

Document integration allows the user to:



Nota bene

- the user at any time can disable any of the resources from the portal;

- actions that you perform with documents from third-party resource folders on the portal are directly performed in the original folder of a service;

-deletion of a file from the source folder will lead to its loss on the portal (it will pass the basket).

And, as always, we are waiting for your wishes and any comments, especially integration is still available in test mode.

Source: https://habr.com/ru/post/148290/


All Articles