orion.navigate.content

The orion.navigate.content service is used to contribute buttons that help the user to create new top level folders with autogenerated content. The service describes a folder name and a command that should be run to generate the content, including the parameters to pass to the command. If the content is to be generated by simply linking to another page, a uriTemplate can be used to specify the link instead of a command and folder.

Service methods

None. This service is purely declarative.

Service attributes

Implementations of orion.navigate.content may define the following attributes:

name
The text to show to the user in the create content button.
id
The extension point id.
description
The description shown next to the create content button which explains how the content is generated.
uriTemplate
Optional. A URI Template that defines a link to another page. If this property is specified, then the command property will be ignored.
folder
Optional. The name of the folder that should be created for the content. The user may override this name. If it is not specified, a default will be proposed for the user.
command
Optional. The id of a command that should be run to generate content into the folder.
parameters
Optional. Parameters that should be passed to the command that generates content.

Example

Here is a sample plug-in that uses the HTTP import command to unzip a zip file that is colocated with the Orion plugin into an Orion folder.

var provider = new orion.PluginProvider();
var temp = document.createElement('a');
temp.href = "testContent.zip";

provider.registerService("orion.navigate.content", null, {
	id: "orion.content.test",
	name: "Another Exemplary Sample Site",
	description: "Generate a sample site from Susan's test plugin.",
	folder: "Test New Content",
	command: "orion.importZipURL",
	parameters: [{name: "url", type: "url", label: "Extracted from:", defaultValue: temp.href},
		{name: "unzip", type: "boolean", label: "Unzip:", defaultValue: true}]
});
provider.connect();

When this plug-in is installed, the user will see the "Another Exemplary Sample Site" button appear in the new content section of the navigator.