Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom file type ".drawio" in addition to ".xml" #41

Merged
merged 4 commits into from
Jun 20, 2018
Merged

Add custom file type ".drawio" in addition to ".xml" #41

merged 4 commits into from
Jun 20, 2018

Conversation

arnowelzel
Copy link
Contributor

@arnowelzel arnowelzel commented Apr 22, 2018

This is one possible way to deal with #32.

My change adds the additional neccessary handling:

  • additional MIME type application/x-drawio (extension .drawio) in the app configuration
  • extending actions for opening files - .drawio will be handled as well and not only .xml
  • if XML is not associated with Draw.io, the "new" action will create files with the extension .drawio and not .xml
  • additional note in the admin settings about the need to register the MIME type manually

To do

Translations for the admin settings note. And maybe we also find a more elegant way to deal with custom file types and the associated icons without "hacking" the file list on the fly.

How to deal with the custom MIME type

Unfortunately an app can not extend the MIME type mapping in Nextcloud by itself (at least I don't know any official way) - however one can register this type manually (as described for Ownpad which also uses a custom file type):

Just copy /resources/config/mimetypemapping.dist.json to /config/mimetypemapping.json (in the config/ folder at Nextcloud’s root directory; the file should be stored next to the config.php file). Afterwards add the two following line just after the “_comment” lines.

"drawio": ["application/x-drawio"],

If all other mimetypes are not working properly, just run the following command:

sudo -u www-data php occ files:scan --all

@arnowelzel
Copy link
Contributor Author

It's now nearly two months since my last update. Any problem with this pull request? Is this app still under active development?

@pawelrojek
Copy link
Owner

@arnowelzel
Sorry for the delay. I had to miss the notification earlier.

Thanks for the code. Great job.

@pawelrojek pawelrojek merged commit f2100c8 into pawelrojek:master Jun 20, 2018
@arnowelzel
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants