: '''dependency''' ''optional'' <tt>DependencyDescription</tt> that contains <tt>Type</tt>, <tt>Name</tt> and <tt>Location</tt>. Location should describe the dependency in a way it allows to recreate it in the user's workspace. If invocation of this method contains <tt>dependency</tt> it means that user had the dependency defined and used '''Connect''' action to initialize its content in his workspace.

: '''dependency''' ''optional'' <tt>DependencyDescription</tt> that contains <tt>Type</tt>, <tt>Name</tt> and <tt>Location</tt>. Location should describe the dependency in a way it allows to recreate it in the user's workspace. If invocation of this method contains <tt>dependency</tt> it means that user had the dependency defined and used '''Connect''' action to initialize its content in his workspace.

: '''params''' parameters inputted by the user while requesting to create a new dependency. User is at first not prompt for parameters if he chooses to connect exiting dependency. Then <tt>DependencyDescription</tt> is passed as '''dependency'''. This function may request for extra parameters in the same way '''initProject''' does.

: '''params''' parameters inputted by the user while requesting to create a new dependency. User is at first not prompt for parameters if he chooses to connect exiting dependency. Then <tt>DependencyDescription</tt> is passed as '''dependency'''. This function may request for extra parameters in the same way '''initProject''' does.

: This function should return <tt>DependencyDescription</tt> containing <tt>Type</tt>, <tt>Name</tt> and <tt>Location</tt> for given item. This function is used to find dependency in users workspace. This function is only invoked when <tt>validationProperties</tt> are matched with <tt>item</tt>

; paramsToDependencyDescription (params)

; paramsToDependencyDescription (params)

+

: This function should return <tt>DependencyDescription</tt> containing <tt>Type</tt>, <tt>Name</tt> and <tt>Location</tt> created based on given <tt>params</tt>. This function is used to check if the dependency that should be created based on parameters inputted by the user already exists in this workspace.

Revision as of 10:45, 8 November 2013

Contents

Overview of project services

Orion allows to extend the project functionality by adding other project types. Project types are not exclusive, one project may be of two different types.

orion.project.handler

The orion.project.handler service is used to provide a custom project handler.
Creating a custom project handler enables to:

Creating project of given type

Adding dependencies of given type

Adding additional information to project page

Service attributes

id

String

type

String the unique identifier of the project type (for instance git or jazz)

addParamethers

ParameterDefinition[] Array of objects containing idString, typeString describing one of the html5 input types or "textarea" and name being a display String for the parameter. Those parameters will be used to generate an input form when user tries init and new project or dependency.

optionalParamethers

Since 5.0arameterDefinition[] a list of optional parameters that will display in a separate dialog when user clicks "More" in the input form with addParamethers

addDependencyName

String Name of the action for adding dependency

addDependencyTooltip

String Tooltip of the action for adding dependency

addProjectName

String Name of the action for adding project

addProjectTooltip

String Tooltip of the action for adding project

actionComment

optionalString comment displayed when project or dependency are being initialized

validationProperties

optionalValidationProperties[] that define if given item can be handled by this project handler, see Validation Properties

optional if implemented users will able to add projects of given type. The function should initialize project in the workspace (including adding project.json to it) and return the project description containing at least ContentLocation

params contains an object of parameters collected from the user based on description in addParamethers attribute. If the list of parameters is not complete rejecting the returned deferred with additional addParamethers attribute will invoke asking user for additional parameters. Afterwords all collected parameters will be resend, so there is no need to remember previously send params.

projectMetadata contains an object with some extra potential project metadata, in particular this object contains WorkspaceLocation.

initDependency (dependency, params, projectMetadata)

optional if implemented users will be able to add associated content of given type. This function should initialize the dependency in user's workspace and return the DependencyDescription

dependencyoptionalDependencyDescription that contains Type, Name and Location. Location should describe the dependency in a way it allows to recreate it in the user's workspace. If invocation of this method contains dependency it means that user had the dependency defined and used Connect action to initialize its content in his workspace.

params parameters inputted by the user while requesting to create a new dependency. User is at first not prompt for parameters if he chooses to connect exiting dependency. Then DependencyDescription is passed as dependency. This function may request for extra parameters in the same way initProject does.

projectMetadata contains an object with project metadata, in particular this object contains WorkspaceLocation.

getDependencyDescription (item)

This function should return DependencyDescription containing Type, Name and Location for given item. This function is used to find dependency in users workspace. This function is only invoked when validationProperties are matched with item

paramsToDependencyDescription (params)

This function should return DependencyDescription containing Type, Name and Location created based on given params. This function is used to check if the dependency that should be created based on parameters inputted by the user already exists in this workspace.