Class Index | File Index

Classes


Class orion.file.ContentTypeService

A service for querying orion.file.ContentTypes.
Defined in: </shared/eclipse/e4/orion/I201203052230/plugins/org.eclipse.orion.client.core/web/orion/contentTypes.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
A service for querying orion.file.ContentTypes.
Method Summary
Method Attributes Method Name and Description
 
Gets a ContentType by ID.
 
Gets all the ContentTypes in the registry.
 
Gets a map of all ContentTypes.
 
getFileContentType(fileMetadata)
Looks up the ContentType for a file or search result, given the metadata.
 
Looks up the ContentType, given a filename.
 
isExtensionOf(contentTypeA, contentTypeB)
Determines whether a ContentType is an extension of another.
 
isSomeExtensionOf(contentType, contentTypes)
Similar to #isExtensionOf, but works on an array of contentTypes.
Class Detail
orion.file.ContentTypeService(serviceRegistry)
A service for querying orion.file.ContentTypes. Clients should request the "orion.file.contenttypes" service from the orion.serviceregistry.ServiceRegistry rather than instantiate this class directly. This constructor is intended for use only by page initialization code.
Parameters:
{orion.serviceregistry.ServiceRegistry} serviceRegistry
The service registry to use for looking up registered content types and for registering this service.
Method Detail
{orion.file.ContentType} getContentType(id)
Gets a ContentType by ID.
Parameters:
{String} id
The ContentType ID.
Returns:
{orion.file.ContentType} The ContentType having the given ID, or null.

{orion.file.ContentType[]} getContentTypes()
Gets all the ContentTypes in the registry.
Returns:
{orion.file.ContentType[]} An array of all registered ContentTypes.

{Object} getContentTypesMap()
Gets a map of all ContentTypes.
Returns:
{Object} A map whose keys are ContentType IDs and values are the orion.file.ContentType having that ID.

{orion.file.ContentType} getFileContentType(fileMetadata)
Looks up the ContentType for a file or search result, given the metadata.
Parameters:
{Object} fileMetadata
Metadata for a file or search result.
Returns:
{orion.file.ContentType} The ContentType for the file, or null if none could be found.

{orion.file.ContentType} getFilenameContentType(filename)
Looks up the ContentType, given a filename.
Parameters:
{String} filename
The filename.
Returns:
{orion.file.ContentType} The ContentType for the file, or null if none could be found.

{Boolean} isExtensionOf(contentTypeA, contentTypeB)
Determines whether a ContentType is an extension of another.
Parameters:
{orion.file.ContentType|String} contentTypeA
ContentType or ContentType ID.
{orion.file.ContentType|String} contentTypeB
ContentType or ContentType ID.
Returns:
{Boolean} Returns true if contentTypeA equals contentTypeB, or contentTypeA descends from contentTypeB.

{Boolean} isSomeExtensionOf(contentType, contentTypes)
Similar to #isExtensionOf, but works on an array of contentTypes.
Parameters:
{orion.file.ContentType|String} contentType
ContentType or ContentType ID.
{orion.file.ContentType[]|String[]} contentTypes
Array of ContentTypes or ContentType IDs.
Returns:
{Boolean} true if contentType equals or descends from any of the ContentTypes in contentTypes.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 05 2012 22:33:44 GMT-0500 (EST)