Are there any plans to support External Folders with DTTG?
That is the method to allows other Apps to access DTTG groups within the DTTG Document Provider and add them to this Apps.
For example, iCloud Drive, Working Copy App and ShellFish App support this, and allow Apps like iA Writer or OmniOutliner to add groups (folders) from DTTG as storage for their content.
This is simply a fantastic feature and I can only assume that this is just a compile option ā¦
To provide āExternal Foldersā in iPadOS, an app needs to implement the File Provider framework, which is part of the iOS SDK. Hereās a concise breakdown of the necessary steps and components:
File Provider Extension: The app needs to include a File Provider extension, which enables it to present its storage as a virtual file system that other apps can access. This extension is responsible for defining and managing the files visible to other apps.
Implement the NSFileProviderExtension Class: This class allows the app to manage file operations and respond to requests from the system and other apps. The app should implement methods for reading, writing, and accessing file metadata.
File Coordination: Use NSFileCoordinator and NSFilePresenter to safely manage access to files, handling read/write operations without data conflicts.
FileProviderUI (Optional but recommended): To enhance the user experience, a FileProviderUI extension can be added to customize the interface for browsing and accessing files in the Files app.
Permissions: The app should request and handle permissions to ensure the user is aware of and consents to file sharing.
These APIs and frameworks are available starting from iOS 11, making it possible for apps to provide storage integration across the iOS and iPadOS ecosystem.
Looks like more than a ācompile optionā to me. And chatGPT only utters the most general of general things here. There already is a representation of DT databases and groups as folders on iOS, it must only be turned on.
Thatās the Document Provider, for the Files App.
To be used as storage location for other Apps, the mentioned API needs to be compiled in - then, other Apps could add DTTG groups as āExternal Foldersā.
That is not possible otherwise, you can at most use single files.
On my iPad, only iCloud Drive, Working Copy and ShellFish support this fantastic feature for other Apps.
But as you asked
ChatGPTsā reply to āHow much code is required to support External Folders?ā
The code required to support External Folders with the File Provider framework is fairly manageable, especially if you aim for basic functionality. Hereās an outline of the key components and approximate code length required for each:
File Provider Extension Setup:
Create a new File Provider extension in your project.
Appleās template for File Provider extension will generate the basic setup code automatically.
Implement methods like item(for identifier:), startProvidingItem(at url:), and stopProvidingItem(at:).
Handle file fetching, caching, and synchronization.
Basic setup can be done with about 100ā150 lines of code, and more advanced synchronization or conflict handling might need an additional 100ā150 lines.
Handling File Metadata with NSFileProviderItem (~50ā100 lines):
Create a custom class conforming to NSFileProviderItem to represent files and folders.
Typically about 50ā100 lines, depending on how much metadata you expose (e.g., file name, type, size, and creation date).
File Coordination and Error Handling (~50ā100 lines):
Use NSFileCoordinator to manage safe read/write access.
It was my initial assumption that this may only be a compile option, but then asked ChatGPT about details.
And I then just posted ChatGPTās initial response.
I SURE know that ChatGPT is mostly a useless elaborate mess!
But sometimes, it can give valuable hints!
Thereās no harm is making the suggestion and itās good you are aware that ChatGPT may not provide completely valid answers. But also bear in mind, DEVONthink and DEVONthink To Go are built on a fundamentally different structure than many other applications. So what is easily done in one app doesnāt necessarily translate to ours.
So youāre arguing with the actual creators of the software based on a conversation with ChatGPT? Thatās certainly a choiceā¦
A more useful conversation might center around the task youāre actually trying to accomplish. What are you trying to do that isnāt currently possible?
BLUEFROG is well capable of posting his stance is this, but thanks
And I explained that already.
For you, I repeat:
I want to add DTTP groups als External Folders to other Apps, so that they can use those as their own folders for their own content.
Esp. for DTTG this would be great, as it syncs to remote locations and therefor allows to sync ALL your DT and DTTG content for such Apps without using iCloud AND while staying encrypted!
That is a MASSIVE feature and has the potential to draw many more customers for DTTG too.
This folder becomes and integral part of the App, and for example all Markdown tags will be shown,
There are no other documents in iA Writer, only the content of the External Folder.
And it would be perfect to have DTTG to offer this, without the workaround over Working Copy.
Basically, those Apps could then use a DTTG groups as their own storage - probably together with other Apps.
We actually have implemented a complete file provider extension which exposes DEVONthink To Go databases like files and folders in the Files app.
However, this mechanism simply doesnāt support adding groups as external folders to other apps. For this feature iOS does not support virtual file systems like DEVONthink To Go but requires the groups to be real folders in a real folder structure, not virtual constructs. This was easier for Apple to implement but effectively keeps database-driven virtual file systems like DEVONthink To Go out and on the front porch.
Ah, that means you simply cannot add this features as the DTTG storage is already some kind of virtual view and therefor not compatible?
Thanks for the explanation!
I will then stick to my Working Copy workaround, which is crude but always to stay in two Apps without using iCloud and still be synced between all devices ā¦