Jump to: navigation, search

Difference between revisions of "Orion/Documentation/Developer Guide/Core client services"

(orion.core.favorite)
(orion.core.file)
Line 18: Line 18:
 
= orion.core.file =
 
= orion.core.file =
  
The <tt>orion.core.file</tt> service is used to contribute some custom content to the Orion Navigator/Explorer. Content could be in the form of files served from some remote system. The Orion navigator already displays any content created by the application user. These include any folder, file or files within a folder.
+
The <tt>orion.core.file</tt> service is used to provide file system contents for the Orion workspace. For example a plug-in can use this service to include content from one server into a workspace on another server. Each file service is displayed as a root element in the Orion <b>Navigator</b> page.
* A developer who creates an Orion plugin will use this service to contribute some custom content to the Navigator.
+
  
 
The code snippet below demonstrates an use of this service:
 
The code snippet below demonstrates an use of this service:
  provider.registerServiceProvider("orion.core.file", service, {Name: 'Test Project'});
+
<pre>
 +
  provider.registerServiceProvider("orion.core.file", service, {Name: 'Sample File System'});
 +
</pre>
  
The above code will contribute a top level node to the Navigator named "Test Project". The parameter "service" in the API above must provide the functions specified by the Orion file client API. Refer to <tt>orion.fileClient.FileClient</tt> in the client API reference for further details. For more information on client-server interaction, see Orion [http://wiki.eclipse.org/Orion/Server_API/File_API File Server API]
+
The above code will contribute a top level node to the Navigator named "Sample File System". The parameter "service" in the API above must provide the functions specified by the Orion file client API. Refer to <tt>orion.fileClient.FileClient</tt> in the client API reference for further details. For more information on client-server interaction, see Orion [http://wiki.eclipse.org/Orion/Server_API/File_API File Server API]. For an complete file system example, see the [https://github.com/eclipse/orion.client/blob/master/bundles/org.eclipse.orion.client.core/web/plugins/sampleFilePlugin.html sample file plugin] in the Orion Git repository.
  
 
= orion.core.marker =
 
= orion.core.marker =
 
= orion.core.preference =
 
= orion.core.preference =
 
= orion.core.user =
 
= orion.core.user =

Revision as of 15:37, 14 June 2011

Overview of core client services

Orion provides a number of basic infrastructure services that can be used by client scripts for performing various tasks. These services have no user interface component and can be used within any page of a client application. This section of the guide outlines what services are available, along with simple examples of how to use them.

orion.core.favorite

The orion.core.favorite service is used to access and store the user's bookmarks or favorites. While a user may opt to use their own browser's bookmark mechanism instead, there are some specific advantages to using Orion's favorite service instead:

  • Favorites are persisted on the server, so the user can switch to another client computer or browser and access their familiar bookmarks
  • Favorites are associated with a specific Orion application and user, so favorites from different users or applications are not all mixed into a single place.

Here is an example usage of the favorites service:

serviceRegistry.getService("orion.core.favorite").then(function(service) {
  service.makeFavorites(item);
});

See orion.favorites.FavoritesService in the Orion client API reference for a complete list of functions available on the favorite service.

orion.core.file

The orion.core.file service is used to provide file system contents for the Orion workspace. For example a plug-in can use this service to include content from one server into a workspace on another server. Each file service is displayed as a root element in the Orion Navigator page.

The code snippet below demonstrates an use of this service:

 provider.registerServiceProvider("orion.core.file", service, {Name: 'Sample File System'});

The above code will contribute a top level node to the Navigator named "Sample File System". The parameter "service" in the API above must provide the functions specified by the Orion file client API. Refer to orion.fileClient.FileClient in the client API reference for further details. For more information on client-server interaction, see Orion File Server API. For an complete file system example, see the sample file plugin in the Orion Git repository.

orion.core.marker

orion.core.preference

orion.core.user