Plugin API: force Oxygen to open a file in the archive browser
Posted: Thu Jan 23, 2025 2:20 pm
Hi Oxygen team,
I hope you are all fine and you had a good start in the new year!
I'm currently trying to implement for an Oxygen plugin an option to open an archive that has a custrom file extension (which is not in the default list of known archive file extensions). Currently I do it this way:
This works fine, but at the first time it shows the message: "Unknown archive extension 'ocf'. Do you want to map this extension to an archive type?" If the user chooses "Yes" the archive preference page opens and the extension was added to the list. After submitting the file is opened in the archive browser. But in case of "No" Oxygen tries to open the archive as text in the main area.
I think we can live with this, but the dialogs are maybe a bit surprising for the user. It would be a great enhancement if there is a way to force the Oxygen to open the file in the archive browser without this dialogs (e.g. ignoring un/known file extensions). Is there a way to do this?
An alternative would be to add the extension to the list of known archive types in the background. But I'm not sure how to do that. I think it should be possible by using the ro.sync.exml.workspace.api.options.WSOptionsStorage but I don't not know what option keys I have to use.
Do you have any hint for me, how I could achieve one of the alternatives?
Best Regards,
Nico
I hope you are all fine and you had a good start in the new year!
I'm currently trying to implement for an Oxygen plugin an option to open an archive that has a custrom file extension (which is not in the default list of known archive file extensions). Currently I do it this way:
Code: Select all
spw.open(url, EditorPageConstants.PAGE_UNKNOWN, "application/zip");
I think we can live with this, but the dialogs are maybe a bit surprising for the user. It would be a great enhancement if there is a way to force the Oxygen to open the file in the archive browser without this dialogs (e.g. ignoring un/known file extensions). Is there a way to do this?
An alternative would be to add the extension to the list of known archive types in the background. But I'm not sure how to do that. I think it should be possible by using the ro.sync.exml.workspace.api.options.WSOptionsStorage but I don't not know what option keys I have to use.
Do you have any hint for me, how I could achieve one of the alternatives?
Best Regards,
Nico