Hello,
i want to develop an app, that can open files with a custom file extension/ending. When someone clicks on a file in nextcloud files with that extension, it should open the file in a 3D Viewer (that i already have). What i would also need, is the header of the file, to display various informations.
I have setup the basic app structure from the tutorials. My first goal is now to have my mime type recognized and my app set as default. I have now come across registerFileAction:
- registerFileAction | @nextcloud/files
- nextcloud-files/lib/fileAction.ts at 939f71d90888bbaaeba6fb2b6b6752fad98940a5 · nextcloud-libraries/nextcloud-files · GitHub
My question would be, if registerFileAction can handle my first goal.
Here is my app.php
<?php
namespace OCA\SamoViewer\AppInfo;
use OCP\AppFramework\App;
use OCP\Util;
class Application extends App {
public function __construct(array $urlParams = []) {
parent::__construct('samoviewer', $urlParams);
Util::addScript('samoviewer', 'extension');
}
}
Now i can see in my browser, that the extension gets loaded, but i am not sure how to use the registerFileAction or if i should use something else.
Can someone tell me, if i am on the right path with registerFileAction or do i need something else to get my mimetype registered and my app set to default?
I would be very grateful for any examples/explanations/links/help.
thank you!
kind regards Christoph