orion.file.contenttype | ||
---|---|---|
![]() |
![]() |
|
orion.navigate.openWith | Updating this document |
The content type service tells Orion about a new kind of file. The content types contributed to this service don't have any direct effect on the Orion UI, but they can be referred to by other services that need to associate themselves with a particular kind of file. For an example, see orion.navigate.openWith.
The Orion client UI defines a bunch of content types by default: see webEditingPlugin.html
in the client UI code.
None. This service is purely declarative.
This example code contributes contributes a new content type for Perl files. A Perl file extends from "text.plain"
and has the extension .pl
.
provider.registerServiceProvider("orion.file.contenttype", {}, { contentTypes: [{ id: "text.perl", name: "Perl", extension: ["pl"], "extends": "text.plain" }] }); provider.connect();
The example code below contributes a new content type for Ant build files. An Ant build file is a special kind of XML file that always has the name "build.xml".
provider.registerServiceProvider("orion.file.contenttype", {}, { contentTypes: [{ id: "text.ant", name: "Ant build file", filename: ["build.xml"], "extends": "text.xml" }] }); provider.connect();
![]() |
![]() |
![]() |
orion.navigate.openWith | Updating this document |