Any plans for supporting External Folders for DTTG?

I think that I asked that years ago already :wink:

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 ā€¦

Please :slight_smile:

No there are no such plans.

I can only assume that this is just a compile option ā€¦

I wouldnā€™t make such an assumption. Things are not the same under-the-hood with the apps you mentioned.

Thanks.

I asked ChatGPT about the requirements :smiley:

This was the reply:

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:

  1. 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.

  2. 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.

  3. File Coordination: Use NSFileCoordinator and NSFilePresenter to safely manage access to files, handling read/write operations without data conflicts.

  4. 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.

  5. 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.

For more details, Appleā€™s File Provider Framework documentation offers a comprehensive guide.

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 :smiley:
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:

  1. 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.
  1. Implementing NSFileProviderExtension (~200ā€“300 lines):
  • 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.
  1. 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).
  1. File Coordination and Error Handling (~50ā€“100 lines):
  • Use NSFileCoordinator to manage safe read/write access.
  • Error handling for missing files or conflicts.
  1. Optional FileProviderUI Extension (~100ā€“150 lines):
  • Adding UI for browsing, login interfaces, or error displays, if necessary.
  • Basic UI with Appleā€™s templates needs only minor customization.

In summary, a minimal setup for External Folders can be achieved with around 300ā€“500 lines of code.

Iā€™m not sure why you think this is trivial. Iā€™m also not sure why youā€™re assuming ChatGPTā€™s answer to be infallible.

4 Likes

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!

Thatā€™s all :wink:

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.

1 Like

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?

6 Likes

Yes, it may well be true that it is difficult to add to DTTG.

BLUEFROG is well capable of posting his stance is this, but thanks :wink:

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.

More clear now?

I found a workaround for this by using the External Folders that Working Copy offers: My current storage setup with DT and DTTG - #2 by tja

Iā€™m probably just not getting itā€¦ But at least pages seems to be fine with access to DT databases on my iPad.

No :wink:

You can only open single files here!
And Pages does not support External Folders at all, as far as I know too.

Therefor you cannot add a DTTG group as External Folder to Pages!

The ā€œclientā€ App needs to support his too, like iA Writer or Textastic or OmniWriter.

Such Apps can add folder as External Folder from iCloud or Working Copy or ShellFish - but not from DTTG, which is the reason I posted.

More clear?

I will add a screenshot from iA Writer to show this ā€¦

Here is how iA Writer looks like after adding the ā€œWorking Copyā€ git repository from WorkingCopy as External Folder:

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.

3 Likes

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 ā€¦