Merge branch 'master' into persist-on-mutation-825

Conflicts:
	platform/core/src/capabilities/PersistenceCapability.js
	platform/features/timeline/src/controllers/swimlane/TimelineSwimlaneDropHandler.js
This commit is contained in:
Victor Woeltjen 2016-05-19 11:41:08 -07:00
commit d3f2a24267
817 changed files with 1867 additions and 4586 deletions

View File

@ -1,4 +1,22 @@
{ {
"validthis": true, "bitwise": true,
"laxbreak": true "browser": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"funcscope": true,
"futurehostile": true,
"latedef": true,
"noarg": true,
"nocomma": true,
"nonbsp": true,
"nonew": true,
"predef": [
"define",
"Promise"
],
"strict": "implied",
"undef": true,
"unused": "vars"
} }

View File

@ -1,6 +1,6 @@
# Contributing to Open MCT Web # Contributing to Open MCT
This document describes the process of contributing to Open MCT Web as well This document describes the process of contributing to Open MCT as well
as the standards that will be applied when evaluating contributions. as the standards that will be applied when evaluating contributions.
Please be aware that additional agreements will be necessary before we can Please be aware that additional agreements will be necessary before we can
@ -21,9 +21,9 @@ The short version:
## Contribution Process ## Contribution Process
Open MCT Web uses git for software version control, and for branching and Open MCT uses git for software version control, and for branching and
merging. The central repository is at merging. The central repository is at
https://github.com/nasa/openmctweb.git. https://github.com/nasa/openmct.git.
### Roles ### Roles
@ -116,18 +116,18 @@ the merge back to the master branch.
## Standards ## Standards
Contributions to Open MCT Web are expected to meet the following standards. Contributions to Open MCT are expected to meet the following standards.
In addition, reviewers should use general discretion before accepting In addition, reviewers should use general discretion before accepting
changes. changes.
### Code Standards ### Code Standards
JavaScript sources in Open MCT Web must satisfy JSLint under its default JavaScript sources in Open MCT must satisfy JSLint under its default
settings. This is verified by the command line build. settings. This is verified by the command line build.
#### Code Guidelines #### Code Guidelines
JavaScript sources in Open MCT Web should: JavaScript sources in Open MCT should:
* Use four spaces for indentation. Tabs should not be used. * Use four spaces for indentation. Tabs should not be used.
* Include JSDoc for any exposed API (e.g. public methods, constructors.) * Include JSDoc for any exposed API (e.g. public methods, constructors.)
@ -159,7 +159,7 @@ JavaScript sources in Open MCT Web should:
* Third, imperative statements. * Third, imperative statements.
* Finally, the returned value. * Finally, the returned value.
Deviations from Open MCT Web code style guidelines require two-party agreement, Deviations from Open MCT code style guidelines require two-party agreement,
typically from the author of the change and its reviewer. typically from the author of the change and its reviewer.
#### Code Example #### Code Example
@ -260,7 +260,7 @@ these standards.
## Issue Reporting ## Issue Reporting
Issues are tracked at https://github.com/nasa/openmctweb/issues Issues are tracked at https://github.com/nasa/openmct/issues
Issues should include: Issues should include:

View File

@ -1,6 +1,6 @@
# Open MCT Web # Open MCT
Open MCT Web is a web-based platform for mission operations user interface Open MCT is a web-based platform for mission operations user interface
software. software.
## Bundles ## Bundles
@ -8,7 +8,7 @@ software.
A bundle is a group of software components (including source code, declared A bundle is a group of software components (including source code, declared
as AMD modules, as well as resources such as images and HTML templates) as AMD modules, as well as resources such as images and HTML templates)
that are intended to be added or removed as a single unit. A plug-in for that are intended to be added or removed as a single unit. A plug-in for
Open MCT Web will be expressed as a bundle; platform components are also Open MCT will be expressed as a bundle; platform components are also
expressed as bundles. expressed as bundles.
A bundle is also just a directory which contains a file `bundle.json`, A bundle is also just a directory which contains a file `bundle.json`,
@ -16,7 +16,7 @@ which declares its contents.
The file `bundles.json` (note the plural), at the top level of the The file `bundles.json` (note the plural), at the top level of the
repository, is a JSON file containing an array of all bundles (expressed as repository, is a JSON file containing an array of all bundles (expressed as
directory names) to include in a running instance of Open MCT Web. Adding or directory names) to include in a running instance of Open MCT. Adding or
removing paths from this list will add or remove bundles from the running removing paths from this list will add or remove bundles from the running
application. application.
@ -56,7 +56,7 @@ To run:
## Build ## Build
Open MCT Web is built using [`npm`](http://npmjs.com/) Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/). and [`gulp`](http://gulpjs.com/).
To build: To build:
@ -64,18 +64,18 @@ To build:
`npm run prepublish` `npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets. This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT Web The contents of the `dist` folder will contain a runnable Open MCT
instance (e.g. by starting an HTTP server in that directory), including: instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT Web source code. * A `main.js` file containing Open MCT source code.
* Various assets in the `example` and `platform` directories. * Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT Web in its default configuration. * An `index.html` that runs Open MCT in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
### Building Documentation ### Building Documentation
Open MCT Web's documentation is generated by an Open MCT's documentation is generated by an
[npm](https://www.npmjs.com/)-based build. It has additional dependencies that [npm](https://www.npmjs.com/)-based build. It has additional dependencies that
may not be available on every platform and thus is not covered in the standard may not be available on every platform and thus is not covered in the standard
npm install. Ensure your system has [libcairo](http://cairographics.org/) npm install. Ensure your system has [libcairo](http://cairographics.org/)
@ -89,7 +89,7 @@ Documentation will be generated in `target/docs`.
# Glossary # Glossary
Certain terms are used throughout Open MCT Web with consistent meanings Certain terms are used throughout Open MCT with consistent meanings
or conventions. Any deviations from the below are issues and should be or conventions. Any deviations from the below are issues and should be
addressed (either by updating this glossary or changing code to reflect addressed (either by updating this glossary or changing code to reflect
correct usage.) Other developer documentation, particularly in-line correct usage.) Other developer documentation, particularly in-line
@ -112,7 +112,7 @@ documentation, may presume an understanding of these terms.
(Most often used in the context of extensions, domain (Most often used in the context of extensions, domain
object models, or other similar application-specific objects.) object models, or other similar application-specific objects.)
* _domain object_: A meaningful object to the user; a distinct thing in * _domain object_: A meaningful object to the user; a distinct thing in
the work support by Open MCT Web. Anything that appears in the left-hand the work support by Open MCT. Anything that appears in the left-hand
tree is a domain object. tree is a domain object.
* _extension_: An extension is a unit of functionality exposed to the * _extension_: An extension is a unit of functionality exposed to the
platform in a declarative fashion by a bundle. For more platform in a declarative fashion by a bundle. For more

4
app.js
View File

@ -19,6 +19,7 @@
// Defaults // Defaults
options.port = options.port || options.p || 8080; options.port = options.port || options.p || 8080;
options.directory = options.directory || options.D || '.';
['include', 'exclude', 'i', 'x'].forEach(function (opt) { ['include', 'exclude', 'i', 'x'].forEach(function (opt) {
options[opt] = options[opt] || []; options[opt] = options[opt] || [];
// Make sure includes/excludes always end up as arrays // Make sure includes/excludes always end up as arrays
@ -36,6 +37,7 @@
console.log(" --port, -p <number> Specify port."); console.log(" --port, -p <number> Specify port.");
console.log(" --include, -i <bundle> Include the specified bundle."); console.log(" --include, -i <bundle> Include the specified bundle.");
console.log(" --exclude, -x <bundle> Exclude the specified bundle."); console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --directory, -D <bundle> Serve files from specified directory.");
console.log(""); console.log("");
process.exit(0); process.exit(0);
} }
@ -71,7 +73,7 @@
}); });
// Expose everything else as static files // Expose everything else as static files
app.use(express['static']('.')); app.use(express['static'](options.directory));
// Finally, open the HTTP server // Finally, open the HTTP server
app.listen(options.port); app.listen(options.port);

View File

@ -1,10 +1,10 @@
{ {
"name": "openmctweb", "name": "openmct",
"description": "The OpenMCTWeb core platform", "description": "The Open MCT core platform",
"main": "", "main": "",
"license": "Apache-2.0", "license": "Apache-2.0",
"moduleType": [], "moduleType": [],
"homepage": "http://nasa.github.io/openmctweb/", "homepage": "http://nasa.github.io/openmct/",
"private": true, "private": true,
"dependencies": { "dependencies": {
"angular": "1.4.4", "angular": "1.4.4",

View File

@ -1,18 +1,16 @@
deployment: deployment:
production: production:
branch: master branch: master
commands:
- npm install canvas nomnoml
- ./build-docs.sh
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
openmctweb-staging-un:
branch: nem_prototype
heroku: heroku:
appname: openmctweb-staging-un appname: openmctweb-demo
openmct-demo:
branch: live_demo
heroku:
appname: openmct-demo
openmctweb-staging-deux: openmctweb-staging-deux:
branch: mobile branch: mobile
heroku: heroku:
appname: openmctweb-staging-deux appname: openmctweb-staging-deux
test: test:
post: post:
- npm run jshint --silent - gulp lint

View File

@ -1,9 +1,3 @@
<hr> <hr>
<cite>
This document is styled using
<a href="https://github.com/jasonm23/markdown-css-themes">
https://github.com/jasonm23/markdown-css-themes
</a>.
</cite>
</body> </body>
</html> </html>

View File

@ -1,7 +1,9 @@
<html> <html>
<head> <head>
<link rel="stylesheet" <link rel="stylesheet"
href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css"> href="//nasa.github.io/openmct/static/res/css/styles.css">
<link rel="stylesheet"
href="//nasa.github.io/openmct/static/res/css/documentation.css">
</head> </head>
<body> <body>

View File

@ -5,7 +5,7 @@ software components to communicate. The software components it recognizes
are: are:
* _Extensions_: Individual units of functionality that can be added to * _Extensions_: Individual units of functionality that can be added to
or removed from Open MCT Web. _Extension categories_ distinguish what or removed from Open MCT. _Extension categories_ distinguish what
type of functionality is being added/removed. type of functionality is being added/removed.
* _Bundles_: A grouping of related extensions * _Bundles_: A grouping of related extensions
(named after an analogous concept from [OSGi](http://www.osgi.org/)) (named after an analogous concept from [OSGi](http://www.osgi.org/))
@ -19,7 +19,7 @@ manner which the framework layer can understand.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT Web| [Open MCT|
[Dependency injection framework]-->[Platform bundle #1] [Dependency injection framework]-->[Platform bundle #1]
[Dependency injection framework]-->[Platform bundle #2] [Dependency injection framework]-->[Platform bundle #2]
[Dependency injection framework]-->[Plugin bundle #1] [Dependency injection framework]-->[Plugin bundle #1]
@ -35,7 +35,7 @@ manner which the framework layer can understand.
``` ```
The "dependency injection framework" in this case is The "dependency injection framework" in this case is
[AngularJS](https://angularjs.org/). Open MCT Web's framework layer [AngularJS](https://angularjs.org/). Open MCT's framework layer
is really just a thin wrapper over Angular that recognizes the is really just a thin wrapper over Angular that recognizes the
concepts of bundles and extensions (as declared in JSON files) and concepts of bundles and extensions (as declared in JSON files) and
registering extensions with Angular. It additionally acts as a registering extensions with Angular. It additionally acts as a
@ -60,7 +60,7 @@ activities which were performed by the framework component.
## Application Initialization ## Application Initialization
The framework component initializes an Open MCT Web application following The framework component initializes an Open MCT application following
a simple sequence of steps. a simple sequence of steps.
```nomnoml ```nomnoml
@ -97,7 +97,7 @@ a simple sequence of steps.
[Extension]o->[Dependency #3] [Extension]o->[Dependency #3]
``` ```
Open MCT Web's architecture relies on a simple premise: Individual units Open MCT's architecture relies on a simple premise: Individual units
(extensions) only have access to the dependencies they declare that they (extensions) only have access to the dependencies they declare that they
need, and they acquire references to these dependencies via dependency need, and they acquire references to these dependencies via dependency
injection. This has several desirable traits: injection. This has several desirable traits:
@ -121,11 +121,11 @@ injection. This has several desirable traits:
the framework. the framework.
A drawback to this approach is that it makes it difficult to define A drawback to this approach is that it makes it difficult to define
"the architecture" of Open MCT Web, in terms of describing the specific "the architecture" of Open MCT, in terms of describing the specific
units that interact at run-time. The run-time architecture is determined units that interact at run-time. The run-time architecture is determined
by the framework as the consequence of wiring together dependencies. by the framework as the consequence of wiring together dependencies.
As such, the specific architecture of any given application built on As such, the specific architecture of any given application built on
Open MCT Web can look very different. Open MCT can look very different.
Keeping that in mind, there are a few useful patterns supported by the Keeping that in mind, there are a few useful patterns supported by the
framework that are useful to keep in mind. framework that are useful to keep in mind.
@ -229,4 +229,4 @@ otherwise a single provider) will be exposed as a single service that
other extensions can acquire through dependency injection. Because all other extensions can acquire through dependency injection. Because all
components of the same type of service expose the same interface, users components of the same type of service expose the same interface, users
of that service do not need to be aware that they are talking to an of that service do not need to be aware that they are talking to an
aggregator or a provider, for instance. aggregator or a provider, for instance.

View File

@ -1,14 +1,14 @@
# Introduction # Introduction
The purpose of this document is to familiarize developers with the The purpose of this document is to familiarize developers with the
overall architecture of Open MCT Web. overall architecture of Open MCT.
The target audience includes: The target audience includes:
* _Platform maintainers_: Individuals involved in developing, * _Platform maintainers_: Individuals involved in developing,
extending, and maintaing capabilities of the platform. extending, and maintaing capabilities of the platform.
* _Integration developers_: Individuals tasked with integrated * _Integration developers_: Individuals tasked with integrated
Open MCT Web into a larger system, who need to understand Open MCT into a larger system, who need to understand
its inner workings sufficiently to complete this integration. its inner workings sufficiently to complete this integration.
As the focus of this document is on architecture, whenever possible As the focus of this document is on architecture, whenever possible
@ -17,25 +17,25 @@ omitted. These details may be found in the developer guide.
# Overview # Overview
Open MCT Web is client software: It runs in a web browser and Open MCT is client software: It runs in a web browser and
provides a user interface, while communicating with various provides a user interface, while communicating with various
server-side resources through browser APIs. server-side resources through browser APIs.
```nomnoml ```nomnoml
#direction: right #direction: right
[Client|[Browser|[Open MCT Web]->[Browser APIs]]] [Client|[Browser|[Open MCT]->[Browser APIs]]]
[Server|[Web services]] [Server|[Web services]]
[Client]<->[Server] [Client]<->[Server]
``` ```
While Open MCT Web can be configured to run as a standalone client, While Open MCT can be configured to run as a standalone client,
this is rarely very useful. Instead, it is intended to be used as a this is rarely very useful. Instead, it is intended to be used as a
display and interaction layer for information obtained from a display and interaction layer for information obtained from a
variety of back-end services. Doing so requires authoring or utilizing variety of back-end services. Doing so requires authoring or utilizing
adapter plugins which allow Open MCT Web to interact with these services. adapter plugins which allow Open MCT to interact with these services.
Typically, the pattern here is to provide a known interface that Typically, the pattern here is to provide a known interface that
Open MCT Web can utilize, and implement it such that it interacts with Open MCT can utilize, and implement it such that it interacts with
whatever back-end provides the relevant information. whatever back-end provides the relevant information.
Examples of back-ends that can be utilized in this fashion include Examples of back-ends that can be utilized in this fashion include
databases for the persistence of user-created objects, or sources of databases for the persistence of user-created objects, or sources of
@ -43,13 +43,13 @@ telemetry data.
## Software Architecture ## Software Architecture
The simplest overview of Open MCT Web is to look at it as a "layered" The simplest overview of Open MCT is to look at it as a "layered"
architecture, where each layer more clearly specifies the behavior architecture, where each layer more clearly specifies the behavior
of the software. of the software.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT Web| [Open MCT|
[Platform]<->[Application] [Platform]<->[Application]
[Framework]->[Application] [Framework]->[Application]
[Framework]->[Platform] [Framework]->[Platform]
@ -64,14 +64,14 @@ These layers are:
established an abstraction by which different software components established an abstraction by which different software components
may communicate and/or interact. may communicate and/or interact.
* [_Platform_](platform.md): The platform layer defines the general look, * [_Platform_](platform.md): The platform layer defines the general look,
feel, and behavior of Open MCT Web. This includes user-facing components like feel, and behavior of Open MCT. This includes user-facing components like
Browse mode and Edit mode, as well as underlying elements of the Browse mode and Edit mode, as well as underlying elements of the
information model and the general service infrastructure. information model and the general service infrastructure.
* _Application_: The application layer defines specific features of * _Application_: The application layer defines specific features of
an application built on Open MCT Web. This includes adapters to an application built on Open MCT. This includes adapters to
specific back-ends, new types of things for users to create, and specific back-ends, new types of things for users to create, and
new ways of visualizing objects within the system. This layer new ways of visualizing objects within the system. This layer
typically consists of a mix of custom plug-ins to Open MCT Web, typically consists of a mix of custom plug-ins to Open MCT,
as well as optional features (such as Plot view) included alongside as well as optional features (such as Plot view) included alongside
the platform. the platform.

View File

@ -1,6 +1,6 @@
# Overview # Overview
The Open MCT Web platform utilizes the [framework layer](Framework.md) The Open MCT platform utilizes the [framework layer](Framework.md)
to provide an extensible baseline for applications which includes: to provide an extensible baseline for applications which includes:
* A common user interface (and user interface paradigm) for dealing with * A common user interface (and user interface paradigm) for dealing with
@ -16,7 +16,7 @@ building application, the platform adds more specificity by defining
additional extension types and allowing for integration with back end additional extension types and allowing for integration with back end
components. components.
The run-time architecture of an Open MCT Web application can be categorized The run-time architecture of an Open MCT application can be categorized
into certain high-level tiers: into certain high-level tiers:
```nomnoml ```nomnoml
@ -29,7 +29,7 @@ into certain high-level tiers:
[Browser APIs]->[Back-end] [Browser APIs]->[Back-end]
``` ```
Applications built using Open MCT Web may add or configure functionality Applications built using Open MCT may add or configure functionality
in __any of these tiers__. in __any of these tiers__.
* _DOM_: The rendered HTML document, composed from HTML templates which * _DOM_: The rendered HTML document, composed from HTML templates which
@ -60,7 +60,7 @@ in __any of these tiers__.
functionality needed to support the information model. This includes functionality needed to support the information model. This includes
exposing underlying sets of extensions and mediating with the exposing underlying sets of extensions and mediating with the
back-end. back-end.
* _Back-end_: The back-end is out of the scope of Open MCT Web, except * _Back-end_: The back-end is out of the scope of Open MCT, except
for the interfaces which are utilized by adapters participating in the for the interfaces which are utilized by adapters participating in the
service infrastructure. Includes the underlying persistence stores, telemetry  service infrastructure. Includes the underlying persistence stores, telemetry 
streams, and so forth which the Open MCT Web client is being used to interact  streams, and so forth which the Open MCT Web client is being used to interact 
@ -70,15 +70,15 @@ in __any of these tiers__.
Once the Once the
[application has been initialized](Framework.md#application-initialization) [application has been initialized](Framework.md#application-initialization)
Open MCT Web primarily operates in an event-driven paradigm; various Open MCT primarily operates in an event-driven paradigm; various
events (mouse clicks, timers firing, receiving responses to XHRs) trigger events (mouse clicks, timers firing, receiving responses to XHRs) trigger
the invocation of functions, typically in the presentation layer for the invocation of functions, typically in the presentation layer for
user actions or in the service infrastructure for server responses. user actions or in the service infrastructure for server responses.
The "main point of entry" into an initialized Open MCT Web application The "main point of entry" into an initialized Open MCT application
is effectively the is effectively the
[route](https://docs.angularjs.org/api/ngRoute/service/$route#example) [route](https://docs.angularjs.org/api/ngRoute/service/$route#example)
which is associated with the URL used to access Open MCT Web (or a which is associated with the URL used to access Open MCT (or a
default route.) This route will be associated with a template which default route.) This route will be associated with a template which
will be displayed; this template will include references to directives will be displayed; this template will include references to directives
and controllers which will be interpreted by Angular and used to and controllers which will be interpreted by Angular and used to
@ -107,11 +107,11 @@ both the information model and the service infrastructure.
# Presentation Layer # Presentation Layer
The presentation layer of Open MCT Web is responsible for providing The presentation layer of Open MCT is responsible for providing
information to display within templates, and for handling interactions information to display within templates, and for handling interactions
which are initiated from templated DOM elements. AngularJS acts as which are initiated from templated DOM elements. AngularJS acts as
an intermediary between the web page as the user sees it, and the an intermediary between the web page as the user sees it, and the
presentation layer implemented as Open MCT Web extensions. presentation layer implemented as Open MCT extensions.
```nomnoml ```nomnoml
[Presentation Layer| [Presentation Layer|
@ -143,12 +143,12 @@ to primitives from AngularJS:
attributes and tags. attributes and tags.
* [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example) * [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example)
are used to associate specific URLs (including the fragment identifier) are used to associate specific URLs (including the fragment identifier)
with specific application states. (In Open MCT Web, these are used to with specific application states. (In Open MCT, these are used to
describe the mode of usage - e.g. browse or edit - as well as to describe the mode of usage - e.g. browse or edit - as well as to
identify the object being used.) identify the object being used.)
* [_Templates_](https://docs.angularjs.org/guide/templates) are partial * [_Templates_](https://docs.angularjs.org/guide/templates) are partial
HTML documents that will be rendered and kept up-to-date by AngularJS. HTML documents that will be rendered and kept up-to-date by AngularJS.
Open MCT Web introduces a custom `mct-include` directive which acts Open MCT introduces a custom `mct-include` directive which acts
as a wrapper around `ng-include` to allow templates to be referred as a wrapper around `ng-include` to allow templates to be referred
to by symbolic names. to by symbolic names.
@ -189,10 +189,10 @@ to displaying domain objects.
] ]
``` ```
Domain objects are the most fundamental component of Open MCT Web's Domain objects are the most fundamental component of Open MCT's
information model. A domain object is some distinct thing relevant to a information model. A domain object is some distinct thing relevant to a
user's work flow, such as a telemetry channel, display, or similar. user's work flow, such as a telemetry channel, display, or similar.
Open MCT Web is a tool for viewing, browsing, manipulating, and otherwise Open MCT is a tool for viewing, browsing, manipulating, and otherwise
interacting with a graph of domain objects. interacting with a graph of domain objects.
A domain object should be conceived of as the union of the following: A domain object should be conceived of as the union of the following:
@ -254,7 +254,7 @@ Concrete examples of capabilities which follow this pattern
# Service Infrastructure # Service Infrastructure
Most services exposed by the Open MCT Web platform follow the Most services exposed by the Open MCT platform follow the
[composite services](Framework.md#composite-services) to permit [composite services](Framework.md#composite-services) to permit
a higher degree of flexibility in how a service can be modified a higher degree of flexibility in how a service can be modified
or customized for specific applications. or customized for specific applications.
@ -327,7 +327,7 @@ A short summary of the roles of these services:
[DomainObjectProvider]o-[CapabilityService] [DomainObjectProvider]o-[CapabilityService]
``` ```
As domain objects are central to Open MCT Web's information model, As domain objects are central to Open MCT's information model,
acquiring domain objects is equally important. acquiring domain objects is equally important.
```nomnoml ```nomnoml
@ -338,7 +338,7 @@ acquiring domain objects is equally important.
[<state> Instantiate DomainObject]->[<end> End] [<state> Instantiate DomainObject]->[<end> End]
``` ```
Open MCT Web includes an implementation of an `ObjectService` which Open MCT includes an implementation of an `ObjectService` which
satisfies this capability by: satisfies this capability by:
* Consulting the [Model Service](#model-service) to acquire domain object * Consulting the [Model Service](#model-service) to acquire domain object
@ -437,9 +437,9 @@ objects (this allows failures to be recognized and handled in groups.)
The telemetry service is responsible for acquiring telemetry data. The telemetry service is responsible for acquiring telemetry data.
Notably, the platform does not include any providers for Notably, the platform does not include any providers for
`TelemetryService`; applications built on Open MCT Web will need to `TelemetryService`; applications built on Open MCT will need to
implement a provider for this service if they wish to expose telemetry implement a provider for this service if they wish to expose telemetry
data. This is usually the most important step for integrating Open MCT Web data. This is usually the most important step for integrating Open MCT
into an existing telemetry system. into an existing telemetry system.
Requests for telemetry data are usually initiated in the Requests for telemetry data are usually initiated in the
@ -721,6 +721,6 @@ disallow.
``` ```
The type service provides metadata about the different types of domain The type service provides metadata about the different types of domain
objects that exist within an Open MCT Web application. The platform objects that exist within an Open MCT application. The platform
implementation reads these types in from extension category `types` implementation reads these types in from extension category `types`
and wraps them in a JavaScript interface. and wraps them in a JavaScript interface.

View File

@ -1,4 +1,4 @@
# Open MCT Web Developer Guide # Open MCT Developer Guide
Victor Woeltjen Victor Woeltjen
[victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov) [victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov)
@ -18,24 +18,24 @@ April 5, 2016 | 1.2 | Added Mct-table directive | Andrew Henry
The purpose of this guide is to familiarize software developers with the Open The purpose of this guide is to familiarize software developers with the Open
MCT Web platform. MCT Web platform.
## What is Open MCT Web ## What is Open MCT
Open MCT Web is a platform for building user interface and display tools, Open MCT is a platform for building user interface and display tools,
developed at the NASA Ames Research Center in collaboration with teams at the developed at the NASA Ames Research Center in collaboration with teams at the
Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using
[AngularJS](http://www.angularjs.org) as a framework. Its intended use is to [AngularJS](http://www.angularjs.org) as a framework. Its intended use is to
create single-page web applications which integrate data and behavior from a create single-page web applications which integrate data and behavior from a
variety of sources and domains. variety of sources and domains.
Open MCT Web has been developed to support the remote operation of space Open MCT has been developed to support the remote operation of space
vehicles, so some of its features are specific to that task; however, it is vehicles, so some of its features are specific to that task; however, it is
flexible enough to be adapted to a variety of other application domains where a flexible enough to be adapted to a variety of other application domains where a
display tool oriented toward browsing, composing, and visualizing would be display tool oriented toward browsing, composing, and visualizing would be
useful. useful.
Open MCT Web provides: Open MCT provides:
* A common user interface paradigm which can be applied to a variety of domains * A common user interface paradigm which can be applied to a variety of domains
and tasks. Open MCT Web is more than a widget toolkit - it provides a standard and tasks. Open MCT is more than a widget toolkit - it provides a standard
tree-on-the-left, view-on-the-right browsing environment which you customize by tree-on-the-left, view-on-the-right browsing environment which you customize by
adding new browsable object types, visualizations, and back-end adapters. adding new browsable object types, visualizations, and back-end adapters.
* A plugin framework and an extensible API for introducing new application * A plugin framework and an extensible API for introducing new application
@ -44,17 +44,17 @@ features of a variety of types.
visualizations and infrastructure specific to telemetry display. visualizations and infrastructure specific to telemetry display.
## Client-Server Relationship ## Client-Server Relationship
Open MCT Web is client software - it runs entirely in the user's web browser. As Open MCT is client software - it runs entirely in the user's web browser. As
such, it is largely 'server agnostic'; any web server capable of serving files such, it is largely 'server agnostic'; any web server capable of serving files
from paths is capable of providing Open MCT Web. from paths is capable of providing Open MCT.
While Open MCT Web can be configured to run as a standalone client, this is While Open MCT can be configured to run as a standalone client, this is
rarely very useful. Instead, it is intended to be used as a display and rarely very useful. Instead, it is intended to be used as a display and
interaction layer for information obtained from a variety of back-end services. interaction layer for information obtained from a variety of back-end services.
Doing so requires authoring or utilizing adapter plugins which allow Open MCT Doing so requires authoring or utilizing adapter plugins which allow Open MCT
Web to interact with these services. Web to interact with these services.
Typically, the pattern here is to provide a known interface that Open MCT Web Typically, the pattern here is to provide a known interface that Open MCT
can utilize, and implement it such that it interacts with whatever back-end can utilize, and implement it such that it interacts with whatever back-end
provides the relevant information. Examples of back-ends that can be utilized in provides the relevant information. Examples of back-ends that can be utilized in
this fashion include databases for the persistence of user-created objects, or this fashion include databases for the persistence of user-created objects, or
@ -63,52 +63,52 @@ sources of telemetry data.
See the [Architecture Guide](../architecture/index.md#Overview) for information See the [Architecture Guide](../architecture/index.md#Overview) for information
on the client-server relationship. on the client-server relationship.
## Developing with Open MCT Web ## Developing with Open MCT
Building applications with Open MCT Web typically means authoring and utilizing Building applications with Open MCT typically means authoring and utilizing
a set of plugins which provide application-specific details about how Open MCT a set of plugins which provide application-specific details about how Open MCT
Web should behave. Web should behave.
### Technologies ### Technologies
Open MCT Web sources are written in JavaScript, with a number of configuration Open MCT sources are written in JavaScript, with a number of configuration
files written in JSON. Displayable components are written in HTML5 and CSS3. files written in JSON. Displayable components are written in HTML5 and CSS3.
Open MCT Web is built using [AngularJS](http://www.angularjs.org) from Google. A Open MCT is built using [AngularJS](http://www.angularjs.org) from Google. A
good understanding of Angular is recommended for developers working with Open good understanding of Angular is recommended for developers working with Open
MCT Web. MCT Web.
### Forking ### Forking
Open MCT Web does not currently have a single stand-alone artifact that can be Open MCT does not currently have a single stand-alone artifact that can be
used as a library. Instead, the recommended approach for creating a new used as a library. Instead, the recommended approach for creating a new
application is to start by forking/branching Open MCT Web, and then adding new application is to start by forking/branching Open MCT, and then adding new
features from there. Put another way, Open MCT Web's source structure is built features from there. Put another way, Open MCT's source structure is built
to serve as a template for specific applications. to serve as a template for specific applications.
Forking in this manner should not require that you edit Open MCT Web's sources. Forking in this manner should not require that you edit Open MCT's sources.
The preferred approach is to create a new directory (peer to `index.html`) for The preferred approach is to create a new directory (peer to `index.html`) for
the new application, then add new bundles (as described in the Framework the new application, then add new bundles (as described in the Framework
chapter) within that directory. chapter) within that directory.
To initially clone the Open MCT Web repository: To initially clone the Open MCT repository:
`git clone <repository URL> <local repo directory> -b open-master` `git clone <repository URL> <local repo directory> -b open-master`
To create a fork to begin working on a new application using Open MCT Web: To create a fork to begin working on a new application using Open MCT:
cd <local repo directory> cd <local repo directory>
git checkout open-master git checkout open-master
git checkout -b <new branch name> git checkout -b <new branch name>
As a convention used internally, applications built using Open MCT Web have As a convention used internally, applications built using Open MCT have
master branch names with an identifying prefix. For instance, if building an master branch names with an identifying prefix. For instance, if building an
application called 'Foo', the last statement above would look like: application called 'Foo', the last statement above would look like:
git checkout -b foo-master git checkout -b foo-master
This convention is not enforced or understood by Open MCT Web in any way; it is This convention is not enforced or understood by Open MCT in any way; it is
mentioned here as a more general recommendation. mentioned here as a more general recommendation.
# Overview # Overview
Open MCT Web is implemented as a framework component which manages a set of Open MCT is implemented as a framework component which manages a set of
other components. These components, called _bundles_, act as containers to group other components. These components, called _bundles_, act as containers to group
sets of related functionality; individual units of functionality are expressed sets of related functionality; individual units of functionality are expressed
within these bundles as _extensions_. within these bundles as _extensions_.
@ -119,7 +119,7 @@ run-time to satisfy these declared dependency. This dependency injection
approach allows software components which have been authored separately (e.g. as approach allows software components which have been authored separately (e.g. as
plugins) but to collaborate at run-time. plugins) but to collaborate at run-time.
Open MCT Web's framework layer is implemented on top of AngularJS's [dependency Open MCT's framework layer is implemented on top of AngularJS's [dependency
injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after
[OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services). [OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services).
In particular, this is where the term _bundle_ comes from. In particular, this is where the term _bundle_ comes from.
@ -134,7 +134,7 @@ The framework is described in more detail in the [Framework Overview](../archite
architecture guide. architecture guide.
### Tiers ### Tiers
While all bundles in a running Open MCT Web instance are effectively peers, it While all bundles in a running Open MCT instance are effectively peers, it
is useful to think of them as a tiered architecture, where each tier adds more is useful to think of them as a tiered architecture, where each tier adds more
specificity to the application. specificity to the application.
```nomnoml ```nomnoml
@ -152,7 +152,7 @@ It additionally interprets bundle definitions (see explanation below, as well as
further detail in the Framework chapter.) At this tier, we are at our most further detail in the Framework chapter.) At this tier, we are at our most
general: We know only that we are a plugin-based application. general: We know only that we are a plugin-based application.
* __Platform__: Components in the Platform tier describe both the general user * __Platform__: Components in the Platform tier describe both the general user
interface and corresponding developer-facing interfaces of Open MCT Web. This interface and corresponding developer-facing interfaces of Open MCT. This
tier provides the general infrastructure for applications. It is less general tier provides the general infrastructure for applications. It is less general
than the framework tier, insofar as this tier introduces a specific user than the framework tier, insofar as this tier introduces a specific user
interface paradigm, but it is still non-specific as to what useful features interface paradigm, but it is still non-specific as to what useful features
@ -160,7 +160,7 @@ will be provided. Although they can be removed or replaced easily, bundles
provided by the Platform tier generally should not be thought of as optional. provided by the Platform tier generally should not be thought of as optional.
* __Application__: The application tier consists of components which utilize the * __Application__: The application tier consists of components which utilize the
infrastructure provided by the Platform to provide functionality which will (or infrastructure provided by the Platform to provide functionality which will (or
could) be useful to specific applications built using Open MCT Web. These could) be useful to specific applications built using Open MCT. These
include adapters to specific persistence back-ends (such as ElasticSearch or include adapters to specific persistence back-ends (such as ElasticSearch or
CouchDB) as well as bundles which describe more user-facing features (such as CouchDB) as well as bundles which describe more user-facing features (such as
_Plot_ views for visualizing time series data, or _Layout_ objects for _Plot_ views for visualizing time series data, or _Layout_ objects for
@ -169,20 +169,20 @@ compromising basic application functionality, with the caveat that at least one
persistence adapter needs to be present. persistence adapter needs to be present.
* __Plugins__: Conceptually, this tier is not so different from the application * __Plugins__: Conceptually, this tier is not so different from the application
tier; it consists of bundles describing new features, back-end adapters, that tier; it consists of bundles describing new features, back-end adapters, that
are specific to the application being built on Open MCT Web. It is described as are specific to the application being built on Open MCT. It is described as
a separate tier here because it has one important distinction from the a separate tier here because it has one important distinction from the
application tier: It consists of bundles that are not included with the platform application tier: It consists of bundles that are not included with the platform
(either authored anew for the specific application, or obtained from elsewhere.) (either authored anew for the specific application, or obtained from elsewhere.)
Note that bundles in any tier can go off and consult back-end services. In Note that bundles in any tier can go off and consult back-end services. In
practice, this responsibility is handled at the Application and/or Plugin tiers; practice, this responsibility is handled at the Application and/or Plugin tiers;
Open MCT Web is built to be server-agnostic, so any back-end is considered an Open MCT is built to be server-agnostic, so any back-end is considered an
application-specific detail. application-specific detail.
## Platform Overview ## Platform Overview
The "tiered" architecture described in the preceding text describes a way of The "tiered" architecture described in the preceding text describes a way of
thinking of and categorizing software components of a Open MCT Web application, thinking of and categorizing software components of a Open MCT application,
as well as the framework layer's role in mediating between these components. as well as the framework layer's role in mediating between these components.
Once the framework layer has wired these software components together, however, Once the framework layer has wired these software components together, however,
the application's logical architecture emerges. the application's logical architecture emerges.
@ -193,7 +193,7 @@ section of the Platform guide
### Web Services ### Web Services
As mentioned in the Introduction, Open MCT Web is a platform single-page As mentioned in the Introduction, Open MCT is a platform single-page
applications which runs entirely in the browser. Most applications will want to applications which runs entirely in the browser. Most applications will want to
additionally interact with server-side resources, to (for example) read additionally interact with server-side resources, to (for example) read
telemetry data or store user-created objects. This interaction is handled by telemetry data or store user-created objects. This interaction is handled by
@ -206,7 +206,7 @@ individual bundles using APIs which are supported in browser (such as
[Web Service #2] <- [Web Browser] [Web Service #2] <- [Web Browser]
[Web Service #3] <- [Web Browser] [Web Service #3] <- [Web Browser]
[<package> Web Browser | [<package> Web Browser |
[<package> Open MCT Web | [<package> Open MCT |
[Plugin Bundle #1]-->[Core API] [Plugin Bundle #1]-->[Core API]
[Core API]<--[Plugin Bundle #2] [Core API]<--[Plugin Bundle #2]
[Platform Bundle #1]-->[Core API] [Platform Bundle #1]-->[Core API]
@ -216,16 +216,16 @@ individual bundles using APIs which are supported in browser (such as
[Core API]<--[Platform Bundle #5] [Core API]<--[Platform Bundle #5]
[Core API]<--[Plugin Bundle #3] [Core API]<--[Plugin Bundle #3]
] ]
[Open MCT Web] ->[Browser APIs] [Open MCT] ->[Browser APIs]
] ]
``` ```
This architectural approach ensures a loose coupling between applications built This architectural approach ensures a loose coupling between applications built
using Open MCT Web and the backends which support them. using Open MCT and the backends which support them.
### Glossary ### Glossary
Certain terms are used throughout Open MCT Web with consistent meanings or Certain terms are used throughout Open MCT with consistent meanings or
conventions. Other developer documentation, particularly in-line documentation, conventions. Other developer documentation, particularly in-line documentation,
may presume an understanding of these terms. may presume an understanding of these terms.
@ -247,7 +247,7 @@ readable description of a thing; usually a single sentence or short paragraph.
(Most often used in the context of extensions, domain object models, or other (Most often used in the context of extensions, domain object models, or other
similar application-specific objects.) similar application-specific objects.)
* __domain object__: A meaningful object to the user; a distinct thing in the * __domain object__: A meaningful object to the user; a distinct thing in the
work support by Open MCT Web. Anything that appears in the left-hand tree is a work support by Open MCT. Anything that appears in the left-hand tree is a
domain object. domain object.
* __extension__: An extension is a unit of functionality exposed to the platform * __extension__: An extension is a unit of functionality exposed to the platform
in a declarative fashion by a bundle. The term 'extension category' is used to in a declarative fashion by a bundle. The term 'extension category' is used to
@ -279,10 +279,10 @@ side-by-side without conflicting.
# Framework # Framework
Open MCT Web is built on the [AngularJS framework]( http://www.angularjs.org ). A Open MCT is built on the [AngularJS framework]( http://www.angularjs.org ). A
good understanding of that framework is recommended. good understanding of that framework is recommended.
Open MCT Web adds an extra layer on top of AngularJS to (a) generalize its Open MCT adds an extra layer on top of AngularJS to (a) generalize its
dependency injection mechanism slightly, particularly to handle many-to-one dependency injection mechanism slightly, particularly to handle many-to-one
relationships; and (b) handle script loading. Combined, these features become a relationships; and (b) handle script loading. Combined, these features become a
plugin mechanism. plugin mechanism.
@ -301,7 +301,7 @@ MCT Web.)
are collected together in bundles, and may interact with other extensions. are collected together in bundles, and may interact with other extensions.
The framework layer, loaded and initiated from `index.html`, is the main point The framework layer, loaded and initiated from `index.html`, is the main point
of entry for an application built on Open MCT Web. It is responsible for wiring of entry for an application built on Open MCT. It is responsible for wiring
together the application at run time (much of this responsibility is actually together the application at run time (much of this responsibility is actually
delegated to Angular); at a high-level, the framework does this by proceeding delegated to Angular); at a high-level, the framework does this by proceeding
through four stages: through four stages:
@ -321,7 +321,7 @@ have been registered.
## Bundles ## Bundles
The basic configurable unit of Open MCT Web is the _bundle_. This term has been The basic configurable unit of Open MCT is the _bundle_. This term has been
used a bit already; now we'll get to a more formal definition. used a bit already; now we'll get to a more formal definition.
A bundle is a directory which contains: A bundle is a directory which contains:
@ -329,13 +329,13 @@ A bundle is a directory which contains:
* A bundle definition; a file named `bundle.json`. * A bundle definition; a file named `bundle.json`.
* Subdirectories for sources, resources, and tests. * Subdirectories for sources, resources, and tests.
* Optionally, a `README.md` Markdown file describing its contents (this is not * Optionally, a `README.md` Markdown file describing its contents (this is not
used by Open MCT Web in any way, but it's a helpful convention to follow.) used by Open MCT in any way, but it's a helpful convention to follow.)
The bundle definition is the main point of entry for the bundle. The framework The bundle definition is the main point of entry for the bundle. The framework
looks at this to determine which components need to be loaded and how they looks at this to determine which components need to be loaded and how they
interact. interact.
A plugin in Open MCT Web is a bundle. The platform itself is also decomposed A plugin in Open MCT is a bundle. The platform itself is also decomposed
into bundles, each of which provides some category of functionality. The into bundles, each of which provides some category of functionality. The
difference between a _bundle_ and a _plugin_ is purely a matter of the intended difference between a _bundle_ and a _plugin_ is purely a matter of the intended
use; a plugin is just a bundle that is meant to be easily added or removed. When use; a plugin is just a bundle that is meant to be easily added or removed. When
@ -356,7 +356,7 @@ For instance, if `bundles.json` contained:
"example/extensions" "example/extensions"
] ]
...then the Open MCT Web framework would look for bundle definitions at ...then the Open MCT framework would look for bundle definitions at
`example/builtins/bundle.json` and `example/extensions/bundle.json`, relative `example/builtins/bundle.json` and `example/extensions/bundle.json`, relative
to the path of `index.html`. No other bundles would be loaded. to the path of `index.html`. No other bundles would be loaded.
@ -457,7 +457,7 @@ arrays of extension definitions.
### General Extensions ### General Extensions
Extensions are intended as a general-purpose mechanism for adding new types of Extensions are intended as a general-purpose mechanism for adding new types of
functionality to Open MCT Web. functionality to Open MCT.
An extension category is registered with Angular under the name of the An extension category is registered with Angular under the name of the
extension, plus a suffix of two square brackets; so, an Angular service (or, extension, plus a suffix of two square brackets; so, an Angular service (or,
@ -466,7 +466,7 @@ extensions, from all bundles, by including this string (e.g. `types[]` to get
all type definitions) in a dependency declaration. all type definitions) in a dependency declaration.
As a convention, extension categories are given single-word, plural nouns for As a convention, extension categories are given single-word, plural nouns for
names within Open MCT Web (e.g. `types`.) This convention is not enforced by the names within Open MCT (e.g. `types`.) This convention is not enforced by the
platform in any way. For extension categories introduced by external plugins, it platform in any way. For extension categories introduced by external plugins, it
is recommended to prefix the extension category with a vendor identifier (or is recommended to prefix the extension category with a vendor identifier (or
similar) followed by a dot, to avoid collisions. similar) followed by a dot, to avoid collisions.
@ -505,7 +505,7 @@ the Angular-supported method for dependency injection is (effectively)
constructor-style injection; so, both declared dependencies and run-time constructor-style injection; so, both declared dependencies and run-time
arguments are competing for space in a constructor's arguments. arguments are competing for space in a constructor's arguments.
To resolve this, the Open MCT Web framework registers extension instances in a To resolve this, the Open MCT framework registers extension instances in a
partially constructed form. That is, the constructor exposed by the extension's partially constructed form. That is, the constructor exposed by the extension's
implementation is effectively decomposed into two calls; the first takes the implementation is effectively decomposed into two calls; the first takes the
dependencies, and returns the constructor in its second form, which takes the dependencies, and returns the constructor in its second form, which takes the
@ -549,7 +549,7 @@ sorted according to these conventions when using them.
### Angular Built-ins ### Angular Built-ins
Several entities supported Angular are expressed and managed as extensions in Several entities supported Angular are expressed and managed as extensions in
Open MCT Web. Specifically, these extension categories are _directives_, Open MCT. Specifically, these extension categories are _directives_,
_controllers_, _services_, _constants_, _runs_, and _routes_. _controllers_, _services_, _constants_, _runs_, and _routes_.
#### Angular Directives #### Angular Directives
@ -592,7 +592,7 @@ property value , which is the constant value that will be registered.
In some cases, you want to register code to run as soon as the application In some cases, you want to register code to run as soon as the application
starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ). starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ).
Implementations registered in this category will be invoked (with their declared Implementations registered in this category will be invoked (with their declared
dependencies) when the Open MCT Web application first starts. (Note that, in dependencies) when the Open MCT application first starts. (Note that, in
this case, the implementation is better thought of as just a function, as this case, the implementation is better thought of as just a function, as
opposed to a constructor function.) opposed to a constructor function.)
@ -627,13 +627,13 @@ providers of the same service (that is, with matching `provides` properties);
for a decorator, this will be whichever provider, decorator, or aggregator is for a decorator, this will be whichever provider, decorator, or aggregator is
next in the sequence of decorators. next in the sequence of decorators.
Services exposed by the Open MCT Web platform are often declared as composite Services exposed by the Open MCT platform are often declared as composite
services, as this form is open for a variety of common modifications. services, as this form is open for a variety of common modifications.
# Core API # Core API
Most of Open MCT Web's relevant API is provided and/or mediated by the Most of Open MCT's relevant API is provided and/or mediated by the
framework; that is, much of developing for Open MCT Web is a matter of adding framework; that is, much of developing for Open MCT is a matter of adding
extensions which access other parts of the platform by means of dependency extensions which access other parts of the platform by means of dependency
injection. injection.
@ -642,9 +642,9 @@ to be passed along by other services.
## Domain Objects ## Domain Objects
Domain objects are the most fundamental component of Open MCT Web's information Domain objects are the most fundamental component of Open MCT's information
model. A domain object is some distinct thing relevant to a user's work flow, model. A domain object is some distinct thing relevant to a user's work flow,
such as a telemetry channel, display, or similar. Open MCT Web is a tool for such as a telemetry channel, display, or similar. Open MCT is a tool for
viewing, browsing, manipulating, and otherwise interacting with a graph of viewing, browsing, manipulating, and otherwise interacting with a graph of
domain objects. domain objects.
@ -681,7 +681,7 @@ exposed.
### Identifier Syntax ### Identifier Syntax
For most purposes, a domain object identifier can be treated as a purely For most purposes, a domain object identifier can be treated as a purely
symbolic string; these are typically generated by Open MCT Web and plug-ins symbolic string; these are typically generated by Open MCT and plug-ins
should rarely be concerned with its internal structure. should rarely be concerned with its internal structure.
A domain object identifier has one or two parts, separated by a colon. A domain object identifier has one or two parts, separated by a colon.
@ -724,7 +724,7 @@ exposed it to be removed from its container.
containing: containing:
* `name`: Human-readable name. * `name`: Human-readable name.
* `description`: Human-readable summary of this action. * `description`: Human-readable summary of this action.
* `glyph`: Single character to be displayed in Open MCT Web's icon font set. * `glyph`: Single character to be displayed in Open MCT's icon font set.
* `context`: The context in which this action is being performed (see below) * `context`: The context in which this action is being performed (see below)
Action instances are typically obtained via a domain object's `action` Action instances are typically obtained via a domain object's `action`
@ -740,7 +740,7 @@ dragged object in a drag-and-drop operation.)
## Telemetry ## Telemetry
Telemetry series data in Open MCT Web is represented by a common interface, and Telemetry series data in Open MCT is represented by a common interface, and
packaged in a consistent manner to facilitate passing telemetry updates around packaged in a consistent manner to facilitate passing telemetry updates around
multiple visualizations. multiple visualizations.
@ -753,7 +753,7 @@ is useful when multiple distinct data sources are in use side-by-side.
* `key`: A machine-readable identifier for a unique series of telemetry within * `key`: A machine-readable identifier for a unique series of telemetry within
that source. that source.
* _Note: This API is still under development; additional properties, such as * _Note: This API is still under development; additional properties, such as
start and end time, should be present in future versions of Open MCT Web._ start and end time, should be present in future versions of Open MCT._
Additional properties may be included in telemetry requests which have specific Additional properties may be included in telemetry requests which have specific
interpretations for specific sources. interpretations for specific sources.
@ -777,7 +777,7 @@ not. (Typically, domain values are interpreted as UTC timestamps in milliseconds
relative to the UNIX epoch.) A series must have at least one domain and one relative to the UNIX epoch.) A series must have at least one domain and one
range, and may have more than one. range, and may have more than one.
Telemetry series data in Open MCT Web is expressed via the following Telemetry series data in Open MCT is expressed via the following
`TelemetrySeries` interface: `TelemetrySeries` interface:
* `getPointCount()`: Returns the number of unique points/samples in this series. * `getPointCount()`: Returns the number of unique points/samples in this series.
@ -816,7 +816,7 @@ interface:
* `getName()`: Get the human-readable name for this type. * `getName()`: Get the human-readable name for this type.
* `getDescription()`: Get a human-readable summary of this type. * `getDescription()`: Get a human-readable summary of this type.
* `getGlyph()`: Get the single character to be rendered as an icon for this type * `getGlyph()`: Get the single character to be rendered as an icon for this type
in Open MCT Web's custom font set. in Open MCT's custom font set.
* `getInitialModel()`: Get a domain object model that represents the initial * `getInitialModel()`: Get a domain object model that represents the initial
state (before user specification of properties) for domain objects of this type. state (before user specification of properties) for domain objects of this type.
* `getDefinition()`: Get the extension definition for this type, as a JavaScript * `getDefinition()`: Get the extension definition for this type, as a JavaScript
@ -832,7 +832,7 @@ an array of `TypeProperty` instances.
### Type Features ### Type Features
Features of a domain object type are expressed as symbolic string identifiers. Features of a domain object type are expressed as symbolic string identifiers.
They are defined in practice by usage; currently, the Open MCT Web platform only They are defined in practice by usage; currently, the Open MCT platform only
uses the creation feature to determine which domain object types should appear uses the creation feature to determine which domain object types should appear
in the Create menu. in the Create menu.
@ -886,7 +886,7 @@ Categories supported by the platform include:
* `key`: A machine-readable identifier for this action. * `key`: A machine-readable identifier for this action.
* `name`: A human-readable name for this action (e.g. to show in a menu) * `name`: A human-readable name for this action (e.g. to show in a menu)
* `description`: A human-readable summary of the behavior of this action. * `description`: A human-readable summary of the behavior of this action.
* `glyph`: A single character which will be rendered in Open MCT Web's custom * `glyph`: A single character which will be rendered in Open MCT's custom
font set as an icon for this action. font set as an icon for this action.
## Capabilities Category ## Capabilities Category
@ -997,7 +997,7 @@ of unremoved listeners.
## Indicators Category ## Indicators Category
An indicator is an element that should appear in the status area at the bottom An indicator is an element that should appear in the status area at the bottom
of a running Open MCT Web client instance. of a running Open MCT client instance.
### Standard Indicators ### Standard Indicators
@ -1007,7 +1007,7 @@ provide implementations with the following methods:
* `getText()`: Provides the human-readable text that will be displayed for this * `getText()`: Provides the human-readable text that will be displayed for this
indicator. indicator.
* `getGlyph()`: Provides a single-character string that will be displayed as an * `getGlyph()`: Provides a single-character string that will be displayed as an
icon in Open MCT Web's custom font set. icon in Open MCT's custom font set.
* `getDescription()`: Provides a human-readable summary of the current state of * `getDescription()`: Provides a human-readable summary of the current state of
this indicator; will be displayed in a tooltip on hover. this indicator; will be displayed in a tooltip on hover.
* `getClass()`: Get a CSS class that will be applied to this indicator. * `getClass()`: Get a CSS class that will be applied to this indicator.
@ -1033,7 +1033,7 @@ this variety do not need to provide an implementation.
## Licenses Category ## Licenses Category
The extension category `licenses` can be used to add entries into the 'Licensing The extension category `licenses` can be used to add entries into the 'Licensing
information' page, reachable from Open MCT Web's About dialog. information' page, reachable from Open MCT's About dialog.
Licenses may have the following properties, all of which are strings: Licenses may have the following properties, all of which are strings:
@ -1046,11 +1046,11 @@ Licenses may have the following properties, all of which are strings:
## Policies Category ## Policies Category
Policies are used to handle decisions made using Open MCT Web's `policyService`; Policies are used to handle decisions made using Open MCT's `policyService`;
examples of these decisions are determining the applicability of certain examples of these decisions are determining the applicability of certain
actions, or checking whether or not a domain object of one type can contain a actions, or checking whether or not a domain object of one type can contain a
domain object of a different type. See the section on the Policies for an domain object of a different type. See the section on the Policies for an
overview of Open MCT Web's policy model. overview of Open MCT's policy model.
A policy's extension definition should include: A policy's extension definition should include:
@ -1066,7 +1066,7 @@ context)`. The specific types used for `candidate` and `context` vary by policy
category; in general, what is being asked is 'is this candidate allowed in this category; in general, what is being asked is 'is this candidate allowed in this
context?' This method should return a boolean value. context?' This method should return a boolean value.
Open MCT Web's policy model requires consensus; a policy decision is allowed Open MCT's policy model requires consensus; a policy decision is allowed
when and only when all policies choose to allow it. As such, policies should when and only when all policies choose to allow it. As such, policies should
generally be written to reject a certain case, and allow (by returning `true`) generally be written to reject a certain case, and allow (by returning `true`)
anything else. anything else.
@ -1195,7 +1195,7 @@ Templates do not have implementations.
## Types Category ## Types Category
The types extension category describes types of domain objects which may The types extension category describes types of domain objects which may
appear within Open MCT Web. appear within Open MCT.
A type's extension definition should have the following properties: A type's extension definition should have the following properties:
@ -1203,7 +1203,7 @@ A type's extension definition should have the following properties:
stored to and matched against the type property of domain object models. stored to and matched against the type property of domain object models.
* `name`: The human-readable name for this domain object type. * `name`: The human-readable name for this domain object type.
* `description`: A human-readable summary of this domain object type. * `description`: A human-readable summary of this domain object type.
* `glyph`: A single character to be rendered as an icon in Open MCT Web's custom * `glyph`: A single character to be rendered as an icon in Open MCT's custom
font set. font set.
* `model`: A domain object model, used as the initial state for created domain * `model`: A domain object model, used as the initial state for created domain
objects of this type (before any properties are specified.) objects of this type (before any properties are specified.)
@ -1252,7 +1252,7 @@ utilized via `mct-representation`); additionally:
* `name`: The human-readable name for this view type. * `name`: The human-readable name for this view type.
* description : A human-readable summary of this view type. * description : A human-readable summary of this view type.
* `glyph`: A single character to be rendered as an icon in Open MCT Web's custom * `glyph`: A single character to be rendered as an icon in Open MCT's custom
font set. font set.
* `type`: Optional; if present, this representation is only applicable for * `type`: Optional; if present, this representation is only applicable for
domain object's of this type. domain object's of this type.
@ -1294,7 +1294,7 @@ are visible, and what state they manage and/or behavior they invoke.
This set may contain up to two different objects: The _view proxy_, which is This set may contain up to two different objects: The _view proxy_, which is
used to make changes to the view as a whole, and the _selected object_, which is used to make changes to the view as a whole, and the _selected object_, which is
used to represent some state within the view. (Future versions of Open MCT Web used to represent some state within the view. (Future versions of Open MCT
may support multiple selected objects.) may support multiple selected objects.)
The `selection` object made available during Edit mode has the following The `selection` object made available during Edit mode has the following
@ -1330,14 +1330,14 @@ are supported:
# Directives # Directives
Open MCT Web defines several Angular directives that are intended for use both Open MCT defines several Angular directives that are intended for use both
internally within the platform, and by plugins. internally within the platform, and by plugins.
## Before Unload ## Before Unload
The `mct-before-unload` directive is used to listen for (and prompt for user The `mct-before-unload` directive is used to listen for (and prompt for user
confirmation) of navigation changes in the browser. This includes reloading, confirmation) of navigation changes in the browser. This includes reloading,
following links out of Open MCT Web, or changing routes. It is used to hook into following links out of Open MCT, or changing routes. It is used to hook into
both `onbeforeunload` event handling as well as route changes from within both `onbeforeunload` event handling as well as route changes from within
Angular. Angular.
@ -1449,7 +1449,7 @@ Passed as plain text in the attribute.
### Form Structure ### Form Structure
Forms in Open MCT Web have a common structure to permit consistent display. A Forms in Open MCT have a common structure to permit consistent display. A
form is broken down into sections, which will be displayed in groups; each form is broken down into sections, which will be displayed in groups; each
section is broken down into rows, each of which provides a control for a single section is broken down into rows, each of which provides a control for a single
property. Input from this form is two-way bound to the object passed via property. Input from this form is two-way bound to the object passed via
@ -1658,7 +1658,7 @@ by scrolling to the bottom of the table rows.
# Services # Services
The Open MCT Web platform provides a variety of services which can be retrieved The Open MCT platform provides a variety of services which can be retrieved
and utilized via dependency injection. These services fall into two categories: and utilized via dependency injection. These services fall into two categories:
* _Composite Services_ are defined by a set of components extensions; plugins may * _Composite Services_ are defined by a set of components extensions; plugins may
@ -1670,7 +1670,7 @@ utilized by plugins but are not intended to be modified or augmented.
## Composite Type Services ## Composite Type Services
This section describes the composite services exposed by Open MCT Web, This section describes the composite services exposed by Open MCT,
specifically focusing on their interface and contract. specifically focusing on their interface and contract.
In many cases, the platform will include a provider for a service which consumes In many cases, the platform will include a provider for a service which consumes
@ -1988,7 +1988,7 @@ The `workerService` may be used to run web workers defined via the
as a shared worker); if the `key` is unknown, returns `undefined`. as a shared worker); if the `key` is unknown, returns `undefined`.
# Models # Models
Domain object models in Open MCT Web are JavaScript objects describing the Domain object models in Open MCT are JavaScript objects describing the
persistent state of the domain objects they describe. Their contents include a persistent state of the domain objects they describe. Their contents include a
mix of commonly understood metadata attributes; attributes which are recognized mix of commonly understood metadata attributes; attributes which are recognized
by and/or determine the applicability of specific extensions; and properties by and/or determine the applicability of specific extensions; and properties
@ -2004,7 +2004,7 @@ MCT Web and can be utilized directly:
## Extension-specific Properties ## Extension-specific Properties
Other properties of domain object models have specific meaning imposed by other Other properties of domain object models have specific meaning imposed by other
extensions within the Open MCT Web platform. extensions within the Open MCT platform.
### Capability-specific Properties ### Capability-specific Properties
@ -2288,7 +2288,7 @@ way of its `composition` capability.)
# Policies # Policies
Policies are consulted to determine when certain behavior in Open MCT Web is Policies are consulted to determine when certain behavior in Open MCT is
allowed. Policy questions are assigned to certain categories, which broadly allowed. Policy questions are assigned to certain categories, which broadly
describe the type of decision being made; within each category, policies have a describe the type of decision being made; within each category, policies have a
candidate (the thing which may or may not be allowed) and, optionally, a context candidate (the thing which may or may not be allowed) and, optionally, a context
@ -2313,13 +2313,13 @@ The candidate argument is the view's extension definition; the context argument
is the `DomainObject` to be viewed. is the `DomainObject` to be viewed.
# Build-Test-Deploy # Build-Test-Deploy
Open MCT Web is designed to support a broad variety of build and deployment Open MCT is designed to support a broad variety of build and deployment
options. The sources can be deployed in the same directory structure used during options. The sources can be deployed in the same directory structure used during
development. A few utilities are included to support development processes. development. A few utilities are included to support development processes.
## Command-line Build ## Command-line Build
Open MCT Web is built using [`npm`](http://npmjs.com/) Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/). and [`gulp`](http://gulpjs.com/).
To install build dependencies (only needs to be run once): To install build dependencies (only needs to be run once):
@ -2331,12 +2331,12 @@ To build:
`npm run prepublish` `npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets. This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT Web The contents of the `dist` folder will contain a runnable Open MCT
instance (e.g. by starting an HTTP server in that directory), including: instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT Web source code. * A `main.js` file containing Open MCT source code.
* Various assets in the `example` and `platform` directories. * Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT Web in its default configuration. * An `index.html` that runs Open MCT in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
@ -2345,7 +2345,7 @@ download build dependencies.
## Test Suite ## Test Suite
Open MCT Web uses [Jasmine 1.3](http://jasmine.github.io/) and Open MCT uses [Jasmine 1.3](http://jasmine.github.io/) and
[Karma](http://karma-runner.github.io) for automated testing. [Karma](http://karma-runner.github.io) for automated testing.
The test suite is configured to load any scripts ending with `Spec.js` found The test suite is configured to load any scripts ending with `Spec.js` found
@ -2383,8 +2383,8 @@ information using [Blanket.JS](http://blanketjs.org/) and display this at the
bottom of the screen. Currently, only statement coverage is displayed. bottom of the screen. Currently, only statement coverage is displayed.
## Deployment ## Deployment
Open MCT Web is built to be flexible in terms of the deployment strategies it Open MCT is built to be flexible in terms of the deployment strategies it
supports. In order to run in the browser, Open MCT Web needs: supports. In order to run in the browser, Open MCT needs:
1. HTTP access to sources/resources for the framework, platform, and all active 1. HTTP access to sources/resources for the framework, platform, and all active
bundles. bundles.
@ -2393,13 +2393,13 @@ external services need to support HTTP or some other web-accessible interface,
like WebSockets.) like WebSockets.)
Any HTTP server capable of serving flat files is sufficient for the first point. Any HTTP server capable of serving flat files is sufficient for the first point.
The command-line build also packages Open MCT Web into a `.war` file for easier The command-line build also packages Open MCT into a `.war` file for easier
deployment on containers such as Apache Tomcat. deployment on containers such as Apache Tomcat.
The second point may be less flexible, as it depends upon the specific services The second point may be less flexible, as it depends upon the specific services
to be utilized by Open MCT Web. Because of this, it is often the set of external to be utilized by Open MCT. Because of this, it is often the set of external
services (and the manner in which they are exposed) that determine how to deploy services (and the manner in which they are exposed) that determine how to deploy
Open MCT Web. Open MCT.
One important constraint to consider in this context is the browser's same One important constraint to consider in this context is the browser's same
origin policy. If external services are not on the same apparent host and port origin policy. If external services are not on the same apparent host and port
@ -2416,7 +2416,7 @@ configuration does not create a security vulnerability.
Examples of deployment strategies (and the conditions under which they make the Examples of deployment strategies (and the conditions under which they make the
most sense) include: most sense) include:
* If the external services that Open MCT Web will utilize are all running on * If the external services that Open MCT will utilize are all running on
[Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open [Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open
MCT Web from the same Tomcat instance as a separate web application. The MCT Web from the same Tomcat instance as a separate web application. The
`.war` artifact produced by the command line build facilitates this deployment `.war` artifact produced by the command line build facilitates this deployment
@ -2427,28 +2427,28 @@ hosts/ports, then it may make sense to use a web server that supports proxying,
such as the [Apache HTTP Server](http://httpd.apache.org/). In this such as the [Apache HTTP Server](http://httpd.apache.org/). In this
configuration, the HTTP server would be configured to proxy (or reverse proxy) configuration, the HTTP server would be configured to proxy (or reverse proxy)
requests at specific paths to the various external services, while providing requests at specific paths to the various external services, while providing
Open MCT Web as flat files from a different path. Open MCT as flat files from a different path.
* If a single server component is being developed to handle all server-side * If a single server component is being developed to handle all server-side
needs of an Open MCT Web instance, it can make sense to serve Open MCT Web (as needs of an Open MCT instance, it can make sense to serve Open MCT (as
flat files) from the same component using an embedded HTTP server such as flat files) from the same component using an embedded HTTP server such as
[Nancy](http://nancyfx.org/). [Nancy](http://nancyfx.org/).
* If no external services are needed (or if the 'external services' will just * If no external services are needed (or if the 'external services' will just
be generating flat files to read) it makes sense to utilize a lightweight flat be generating flat files to read) it makes sense to utilize a lightweight flat
file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this
configuration, Open MCT Web sources/resources would be placed at one path, while configuration, Open MCT sources/resources would be placed at one path, while
the files generated by the external service are placed at another path. the files generated by the external service are placed at another path.
* If all external services support CORS, it may make sense to have an HTTP * If all external services support CORS, it may make sense to have an HTTP
server that is solely responsible for making Open MCT Web sources/resources server that is solely responsible for making Open MCT sources/resources
available, and to have Open MCT Web contact these external services directly. available, and to have Open MCT contact these external services directly.
Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/) Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/)
are useful in this circumstance. The downside of this option is that additional are useful in this circumstance. The downside of this option is that additional
configuration effort is required, both to enable CORS on the external services, configuration effort is required, both to enable CORS on the external services,
and to ensure that Open MCT Web can correctly locate these services. and to ensure that Open MCT can correctly locate these services.
Another important consideration is authentication. By design, Open MCT Web does Another important consideration is authentication. By design, Open MCT does
not handle user authentication. Instead, this should typically be treated as a not handle user authentication. Instead, this should typically be treated as a
deployment-time concern, where authentication is handled by the HTTP server deployment-time concern, where authentication is handled by the HTTP server
which provides Open MCT Web, or an external access management system. which provides Open MCT, or an external access management system.
### Configuration ### Configuration
In most of the deployment options above, some level of configuration is likely In most of the deployment options above, some level of configuration is likely
@ -2456,7 +2456,7 @@ to be needed or desirable to make sure that bundles can reach the external
services they need to reach. Most commonly this means providing the path or URL services they need to reach. Most commonly this means providing the path or URL
to an external service. to an external service.
Configurable parameters within Open MCT Web are specified via constants Configurable parameters within Open MCT are specified via constants
(literally, as extensions of the `constants` category) and accessed via (literally, as extensions of the `constants` category) and accessed via
dependency injection by the scripts which need them. Reasonable defaults for dependency injection by the scripts which need them. Reasonable defaults for
these constants are provided in the bundle where they are used. Plugins are these constants are provided in the bundle where they are used. Plugins are
@ -2475,7 +2475,7 @@ for error, but is viable if there are a small number of constants to change.
constants. This is particularly appropriate when multiple configurations (e.g. constants. This is particularly appropriate when multiple configurations (e.g.
development, test, production) need to be managed easily; these can be swapped development, test, production) need to be managed easily; these can be swapped
quickly by changing the set of active bundles in bundles.json. quickly by changing the set of active bundles in bundles.json.
* Deploy Open MCT Web and its external services in such a fashion that the * Deploy Open MCT and its external services in such a fashion that the
default paths to reach external services are all correct. default paths to reach external services are all correct.
### Configuration Constants ### Configuration Constants
@ -2486,7 +2486,7 @@ The following constants have global significance:
to be overridden by other bundles, but persistence adapters may wish to to be overridden by other bundles, but persistence adapters may wish to
consume this constant in order to provide persistence for that space. consume this constant in order to provide persistence for that space.
The following configuration constants are recognized by Open MCT Web bundles: The following configuration constants are recognized by Open MCT bundles:
* Common UI elements - `platform/commonUI/general` * Common UI elements - `platform/commonUI/general`
* `THEME`: A string identifying the current theme symbolically. Individual * `THEME`: A string identifying the current theme symbolically. Individual
stylesheets (the `stylesheets` extension category) may specify an optional stylesheets (the `stylesheets` extension category) may specify an optional

View File

@ -1,13 +1,13 @@
# Open MCT Web Documentation # Open MCT Documentation
## Overview ## Overview
Documentation is provided to support the use and development of Documentation is provided to support the use and development of
Open MCT Web. It's recommended that before doing Open MCT. It's recommended that before doing
any development with Open MCT Web you take some time to familiarize yourself any development with Open MCT you take some time to familiarize yourself
with the documentation below. with the documentation below.
Open MCT Web provides functionality out of the box, but it's also a platform for Open MCT provides functionality out of the box, but it's also a platform for
building rich mission operations applications based on modern web technology. building rich mission operations applications based on modern web technology.
The platform is configured declaratively, and defines conventions for The platform is configured declaratively, and defines conventions for
building on the provided capabilities by creating modular 'bundles' that building on the provided capabilities by creating modular 'bundles' that
@ -17,7 +17,7 @@
## Sections ## Sections
* The [Architecture Overview](architecture/) describes the concepts used * The [Architecture Overview](architecture/) describes the concepts used
throughout Open MCT Web, and gives a high level overview of the platform's design. throughout Open MCT, and gives a high level overview of the platform's design.
* The [Developer's Guide](guide/) goes into more detail about how to use the * The [Developer's Guide](guide/) goes into more detail about how to use the
platform and the functionality that it provides. platform and the functionality that it provides.
@ -31,5 +31,4 @@
functions that make up the software platform. functions that make up the software platform.
* Finally, the [Development Process](process/) document describes the * Finally, the [Development Process](process/) document describes the
Open MCT Web software development cycle. Open MCT software development cycle.

View File

@ -1,6 +1,6 @@
# Development Cycle # Development Cycle
Development of Open MCT Web occurs on an iterative cycle of Development of Open MCT occurs on an iterative cycle of
sprints and releases. sprints and releases.
* A _sprint_ is three weeks in duration, and represents a * A _sprint_ is three weeks in duration, and represents a

View File

@ -1,6 +1,6 @@
# Development Process # Development Process
The process used to develop Open MCT Web is described in the following The process used to develop Open MCT is described in the following
documents: documents:
* The [Development Cycle](cycle.md) describes how and when specific * The [Development Cycle](cycle.md) describes how and when specific
@ -9,7 +9,7 @@ documents:
Open MCT (both semantics and process.) Open MCT (both semantics and process.)
* Testing is described in two documents: * Testing is described in two documents:
* The [Test Plan](testing/plan.md) summarizes the approaches used * The [Test Plan](testing/plan.md) summarizes the approaches used
to test Open MCT Web. to test Open MCT.
* The [Test Procedures](testing/procedures.md) document what * The [Test Procedures](testing/procedures.md) document what
specific tests are performed to verify correctness, and how specific tests are performed to verify correctness, and how
they should be carried out. they should be carried out.

View File

@ -2,7 +2,7 @@
## Test Levels ## Test Levels
Testing for Open MCT Web includes: Testing for Open MCT includes:
* _Smoke testing_: Brief, informal testing to verify that no major issues * _Smoke testing_: Brief, informal testing to verify that no major issues
or regressions are present in the software, or in specific features of or regressions are present in the software, or in specific features of

View File

@ -4,7 +4,7 @@
This document is intended to be used: This document is intended to be used:
* By testers, to verify that Open MCT Web behaves as specified. * By testers, to verify that Open MCT behaves as specified.
* By the development team, to document new test cases and to provide * By the development team, to document new test cases and to provide
guidance on how to author these. guidance on how to author these.
@ -62,7 +62,7 @@ Test cases should be narrow in scope; if a list of steps is excessively
long (or must be written vaguely to be kept short) it should be broken long (or must be written vaguely to be kept short) it should be broken
down into multiple tests which reference one another. down into multiple tests which reference one another.
All requirements satisfied by Open MCT Web should be verifiable using All requirements satisfied by Open MCT should be verifiable using
one or more test procedures. one or more test procedures.
## Glossary ## Glossary
@ -166,4 +166,4 @@ Eval. criteria | Visual inspection
* Logs should not contain any unexpected warnings or errors ("expected" * Logs should not contain any unexpected warnings or errors ("expected"
warnings or errors are those that have been documented and prioritized warnings or errors are those that have been documented and prioritized
as known issues, or those that are explained by transient conditions as known issues, or those that are explained by transient conditions
external to the software, such as network outages.) external to the software, such as network outages.)

View File

@ -1,4 +1,4 @@
# Open MCT Web Tutorials # Open MCT Tutorials
Victor Woeltjen Victor Woeltjen
victor.woeltjen@nasa.gov victor.woeltjen@nasa.gov
@ -23,9 +23,9 @@ been added or removed as part of the tutorial. In these cases, any lines added
will be indicated with a '+' at the start of the line. Any lines removed will will be indicated with a '+' at the start of the line. Any lines removed will
be indicated with a '-'. be indicated with a '-'.
## Setting Up Open MCT Web ## Setting Up Open MCT
In this section, we will cover the steps necessary to get a minimal Open MCT Web In this section, we will cover the steps necessary to get a minimal Open MCT
developer environment up and running. Once we have this, we will be able to developer environment up and running. Once we have this, we will be able to
proceed with writing plugins as described in this tutorial. proceed with writing plugins as described in this tutorial.
@ -40,22 +40,22 @@ more recent versions, but this cannot be guaranteed.
* Google Chrome v42: https://www.google.com/chrome/ * Google Chrome v42: https://www.google.com/chrome/
* A text editor. * A text editor.
Open MCT Web can be run without any of these tools, provided suitable Open MCT can be run without any of these tools, provided suitable
alternatives are taken; see the [Open MCT Web Developer Guide](../guide/index.md) alternatives are taken; see the [Open MCT Developer Guide](../guide/index.md)
for a more general overview of how to run and deploy a Open MCT Web application. for a more general overview of how to run and deploy a Open MCT application.
### Check out Open MCT Web Sources ### Check out Open MCT Sources
First step is to check out Open MCT Web from the source repository. First step is to check out Open MCT from the source repository.
`git clone https://github.com/nasa/openmctweb.git openmctweb` `git clone https://github.com/nasa/openmctweb.git openmctweb`
This will create a copy of the Open MCT Web source code repository in the folder This will create a copy of the Open MCT source code repository in the folder
`openmctweb` (relative to the path from which you ran the command.) `openmctweb` (relative to the path from which you ran the command.)
If you have a repository URL, use that as the "path to repo" above. Alternately, If you have a repository URL, use that as the "path to repo" above. Alternately,
if you received Open MCT Web as a git bundle, the path to that bundle on the if you received Open MCT as a git bundle, the path to that bundle on the
local filesystem can be used instead. local filesystem can be used instead.
At this point, it will also be useful to branch off of Open MCT Web v0.6.2 At this point, it will also be useful to branch off of Open MCT v0.6.2
(which was used when writing these tutorials) to begin adding plugins. (which was used when writing these tutorials) to begin adding plugins.
cd openmctweb cd openmctweb
@ -64,12 +64,12 @@ At this point, it will also be useful to branch off of Open MCT Web v0.6.2
### Configuring Persistence ### Configuring Persistence
In its default configuration, Open MCT Web will try to use ElasticSearch In its default configuration, Open MCT will try to use ElasticSearch
(expected to be deployed at /elastic on the same HTTP server running Open MCT (expected to be deployed at /elastic on the same HTTP server running Open MCT
Web) to persist user-created domain objects. We don't need that for these Web) to persist user-created domain objects. We don't need that for these
tutorials, so we will replace the ElasticSearch plugin with the example tutorials, so we will replace the ElasticSearch plugin with the example
persistence plugin. This doesn't actually persist, so anything we create within persistence plugin. This doesn't actually persist, so anything we create within
Open MCT Web will be lost on reload, but that's fine for purposes of these Open MCT will be lost on reload, but that's fine for purposes of these
tutorials. tutorials.
To change this configuration, edit bundles.json (at the top level of the Open To change this configuration, edit bundles.json (at the top level of the Open
@ -132,7 +132,7 @@ __bundles.json__
### Run a Web Server ### Run a Web Server
The next step is to run a web server so that you can view the Open MCT Web The next step is to run a web server so that you can view the Open MCT
client (including the plugins you add to it) in browser. Any web server can client (including the plugins you add to it) in browser. Any web server can
be used for hosting OpenMCTWeb, and a trivial web server is provided in this be used for hosting OpenMCTWeb, and a trivial web server is provided in this
package for the purposes of running the tutorials. The provided web server package for the purposes of running the tutorials. The provided web server
@ -144,11 +144,11 @@ To run the tutorial web server
### Viewing in Browser ### Viewing in Browser
Once running, you should be able to view Open MCT Web from your browser at Once running, you should be able to view Open MCT from your browser at
http://localhost:8080/ (assuming the web server is running on port 8080, http://localhost:8080/ (assuming the web server is running on port 8080,
and OpenMCTWeb is installed at the server's root path). and OpenMCTWeb is installed at the server's root path).
[Google Chrome](https://www.google.com/chrome/) is recommended for these [Google Chrome](https://www.google.com/chrome/) is recommended for these
tutorials, as Chrome is Open MCT Web's "test-to" browser. The browser cache tutorials, as Chrome is Open MCT's "test-to" browser. The browser cache
can sometimes interfere with development (masking changes by can sometimes interfere with development (masking changes by
using older versions of sources); to avoid this, it is easiest to run Chrome using older versions of sources); to avoid this, it is easiest to run Chrome
with Developer Tools expanded, and "Disable cache" selected from the Network with Developer Tools expanded, and "Disable cache" selected from the Network
@ -158,7 +158,7 @@ tab, as shown below.
# Tutorials # Tutorials
These tutorials cover three of the common tasks in Open MCT Web: These tutorials cover three of the common tasks in Open MCT:
* The "to-do list" tutorial illustrates how to add a new application feature. * The "to-do list" tutorial illustrates how to add a new application feature.
* The "bar graph" tutorial illustrates how to add a new telemetry visualization. * The "bar graph" tutorial illustrates how to add a new telemetry visualization.
@ -167,17 +167,17 @@ backend.
## To-do List ## To-do List
The goal of this tutorial is to add a new application feature to Open MCT Web: The goal of this tutorial is to add a new application feature to Open MCT:
To-do lists. Users should be able to create and manage these to track items that To-do lists. Users should be able to create and manage these to track items that
they need to do. This is modelled after the to-do lists at http://todomvc.com/. they need to do. This is modelled after the to-do lists at http://todomvc.com/.
### Step 1-Create the Plugin ### Step 1-Create the Plugin
The first step to adding a new feature to Open MCT Web is to create the plugin The first step to adding a new feature to Open MCT is to create the plugin
which will expose that feature. A plugin in Open MCT Web is represented by what which will expose that feature. A plugin in Open MCT is represented by what
is called a bundle; a bundle, in turn, is a directory which contains a file is called a bundle; a bundle, in turn, is a directory which contains a file
bundle.json, which in turn describes where other relevant sources & resources bundle.json, which in turn describes where other relevant sources & resources
will be. The syntax of this file is described in more detail in the Open MCT Web will be. The syntax of this file is described in more detail in the Open MCT
Developer Guide. Developer Guide.
We will create this file in the directory tutorials/todo (we can hereafter refer We will create this file in the directory tutorials/todo (we can hereafter refer
@ -254,7 +254,7 @@ __bundles.json__
``` ```
__bundles.json__ __bundles.json__
At this point, we can reload Open MCT Web. We haven't introduced any new At this point, we can reload Open MCT. We haven't introduced any new
functionality, so we don't see anything different, but if we run with logging functionality, so we don't see anything different, but if we run with logging
enabled ( http://localhost:8080/?log=info ) and check the browser console, we enabled ( http://localhost:8080/?log=info ) and check the browser console, we
should see: should see:
@ -265,11 +265,11 @@ should see:
### Step 2-Add a Domain Object Type ### Step 2-Add a Domain Object Type
Features in a Open MCT Web application are most commonly expressed as domain Features in a Open MCT application are most commonly expressed as domain
objects and/or views thereof. A domain object is some thing that is relevant to objects and/or views thereof. A domain object is some thing that is relevant to
the work that the Open MCT Web application is meant to support. Domain objects the work that the Open MCT application is meant to support. Domain objects
can be created, organized, edited, placed in layouts, and so forth. (For a can be created, organized, edited, placed in layouts, and so forth. (For a
deeper explanation of domain objects, see the Open MCT Web Developer Guide.) deeper explanation of domain objects, see the Open MCT Developer Guide.)
In the case of our to-do list feature, the to-do list itself is the thing we'll In the case of our to-do list feature, the to-do list itself is the thing we'll
want users to be able to create and edit. So, we will add that as a new type in want users to be able to create and edit. So, we will add that as a new type in
@ -303,7 +303,7 @@ Going through the properties we've defined:
domain objects of this type. domain objects of this type.
* The `name` of "To-Do List" is the human-readable name for this type, and will * The `name` of "To-Do List" is the human-readable name for this type, and will
be shown to users. be shown to users.
* The `glyph` refers to a special character in Open MCT Web's custom font set; * The `glyph` refers to a special character in Open MCT's custom font set;
this will be used as an icon. this will be used as an icon.
* The `description` is also human-readable, and will be used whenever a longer * The `description` is also human-readable, and will be used whenever a longer
explanation of what this type is should be shown. explanation of what this type is should be shown.
@ -312,7 +312,7 @@ this type. Including `creation` here means that we want users to be able to
create this (in other cases, we may wish to expose things as domain objects create this (in other cases, we may wish to expose things as domain objects
which aren't user-created, in which case we would omit this.) which aren't user-created, in which case we would omit this.)
If we reload Open MCT Web, we see that our new domain object type appears in the If we reload Open MCT, we see that our new domain object type appears in the
Create menu: Create menu:
![To-Do List](images/todo.png) ![To-Do List](images/todo.png)
@ -324,10 +324,10 @@ because we haven't defined any yet.
### Step 3-Add a View ### Step 3-Add a View
In order to allow a to-do list to be used, we need to define and display its In order to allow a to-do list to be used, we need to define and display its
contents. In Open MCT Web, the pattern that the user expects is that they'll contents. In Open MCT, the pattern that the user expects is that they'll
click on an object in the left-hand tree, and see a visualization of it to the click on an object in the left-hand tree, and see a visualization of it to the
right; in Open MCT Web, these visualizations are called views. right; in Open MCT, these visualizations are called views.
A view in Open MCT Web is defined by an Angular template. We'll add that in the A view in Open MCT is defined by an Angular template. We'll add that in the
directory `tutorials/todo/res/templates` (`res` is, by default, the directory directory `tutorials/todo/res/templates` (`res` is, by default, the directory
where bundle-related resources are kept, and `templates` is where HTML templates where bundle-related resources are kept, and `templates` is where HTML templates
are stored by convention.) are stored by convention.)
@ -357,12 +357,12 @@ to filter down to either complete or incomplete tasks.
of the domain object being viewed; this contains all of the persistent state of the domain object being viewed; this contains all of the persistent state
associated with that object. This model is effectively just a JSON document, so associated with that object. This model is effectively just a JSON document, so
we can choose what goes into it (so long as we take care not to collide with we can choose what goes into it (so long as we take care not to collide with
platform-defined properties; see the Open MCT Web Developer Guide.) Here, we platform-defined properties; see the Open MCT Developer Guide.) Here, we
assume that all tasks will be stored in a property `tasks`, and that each will be assume that all tasks will be stored in a property `tasks`, and that each will be
an object containing a `description` (the readable summary of the task) and a an object containing a `description` (the readable summary of the task) and a
boolean `completed` flag. boolean `completed` flag.
To expose this view in Open MCT Web, we need to declare it in our bundle To expose this view in Open MCT, we need to declare it in our bundle
definition: definition:
```diff ```diff
@ -399,7 +399,7 @@ contains the following properties:
* Its `key` is its machine-readable name; we've given it the same name here as * Its `key` is its machine-readable name; we've given it the same name here as
the domain object type, but could have chosen any unique name. the domain object type, but could have chosen any unique name.
* The `type` property tells Open MCT Web that this view is only applicable to * The `type` property tells Open MCT that this view is only applicable to
domain objects of that type. This means that we'll see this view for To-do Lists domain objects of that type. This means that we'll see this view for To-do Lists
that we create, but not for other domain objects (such as Folders.) that we create, but not for other domain objects (such as Folders.)
@ -449,10 +449,10 @@ definition of that type.
``` ```
__tutorials/todo/bundle.json__ __tutorials/todo/bundle.json__
Now, when To-do List objects are created in Open MCT Web, they will initially Now, when To-do List objects are created in Open MCT, they will initially
have the state described by that model property. have the state described by that model property.
If we reload Open MCT Web, create a To-do List, and navigate to it in the tree, If we reload Open MCT, create a To-do List, and navigate to it in the tree,
we should now see: we should now see:
![To-Do List](images/todo-list.png) ![To-Do List](images/todo-list.png)
@ -527,7 +527,7 @@ first argument is falsy.)
* `toggleCompletion` changes whether or not a task is complete. We make the * `toggleCompletion` changes whether or not a task is complete. We make the
change via the domain object's `mutation` capability, and then persist the change via the domain object's `mutation` capability, and then persist the
change via its `persistence` capability. See the Open MCT Web Developer Guide change via its `persistence` capability. See the Open MCT Developer Guide
for more information on these capabilities. for more information on these capabilities.
* `showTask` is meant to be used to help decide if a task should be shown, based * `showTask` is meant to be used to help decide if a task should be shown, based
@ -537,7 +537,7 @@ the use of the double-not !! to coerce the completed flag to a boolean, for
equality testing.) equality testing.)
Note that these functions make reference to `$scope.domainObject;` this is the Note that these functions make reference to `$scope.domainObject;` this is the
domain object being viewed, which is passed into the scope by Open MCT Web domain object being viewed, which is passed into the scope by Open MCT
prior to our template being utilized. prior to our template being utilized.
On its own, this controller merely exposes these functions; the next step is to On its own, this controller merely exposes these functions; the next step is to
@ -640,7 +640,7 @@ if we go to My Items and come back.
We now have a somewhat-functional view of our To-Do List, but we're still We now have a somewhat-functional view of our To-Do List, but we're still
missing some important functionality: Adding and removing tasks! missing some important functionality: Adding and removing tasks!
This is a good place to discuss the user interface style of Open MCT Web. Open This is a good place to discuss the user interface style of Open MCT. Open
MCT Web draws a distinction between "using" and "editing" a domain object; in MCT Web draws a distinction between "using" and "editing" a domain object; in
general, you can only make changes to a domain object while in Edit mode, which general, you can only make changes to a domain object while in Edit mode, which
is reachable from the button with a pencil icon. This distinction helps users is reachable from the button with a pencil icon. This distinction helps users
@ -732,14 +732,14 @@ What we've stated here is that the To-Do List's view will have a toolbar which
contains two sections (which will be visually separated by a divider), each of contains two sections (which will be visually separated by a divider), each of
which contains one button. The first is a button labelled "Add Task" that will which contains one button. The first is a button labelled "Add Task" that will
invoke an `addTask` method; the second is a button with a glyph (which will appear invoke an `addTask` method; the second is a button with a glyph (which will appear
as a trash can in Open MCT Web's custom font set) which will invoke a `removeTask` as a trash can in Open MCT's custom font set) which will invoke a `removeTask`
method. For more information on forms and tool bars in Open MCT Web, see the method. For more information on forms and tool bars in Open MCT, see the
Open MCT Web Developer Guide. Open MCT Developer Guide.
If we reload and run Open MCT Web, we won't see any tool bar when we switch over If we reload and run Open MCT, we won't see any tool bar when we switch over
to Edit mode. This is because the aforementioned methods are expected to be to Edit mode. This is because the aforementioned methods are expected to be
found on currently-selected elements; we haven't done anything with selections found on currently-selected elements; we haven't done anything with selections
in our view yet, so the Open MCT Web platform will filter this tool bar down to in our view yet, so the Open MCT platform will filter this tool bar down to
all the applicable controls, which means no controls at all. all the applicable controls, which means no controls at all.
To support selection, we will need to make some changes to our controller: To support selection, we will need to make some changes to our controller:
@ -842,7 +842,7 @@ click the _Add Task_ button. This form is described declaratively, and populates
an object that has the same format as tasks in the `tasks` array of our an object that has the same format as tasks in the `tasks` array of our
To-Do List's model. To-Do List's model.
* We've added an argument to the `TodoController`: The `dialogService`, which is * We've added an argument to the `TodoController`: The `dialogService`, which is
exposed by the Open MCT Web platform to handle showing dialogs. exposed by the Open MCT platform to handle showing dialogs.
* Some utility functions for handling the actual adding and removing of tasks. * Some utility functions for handling the actual adding and removing of tasks.
These use the `mutation` capability to modify the tasks in the To-Do List's These use the `mutation` capability to modify the tasks in the To-Do List's
model. model.
@ -947,7 +947,7 @@ declare that dependency in its extension definition:
``` ```
__tutorials/todo/bundle.json__ __tutorials/todo/bundle.json__
If we now reload Open MCT Web, we'll be able to see the new functionality we've If we now reload Open MCT, we'll be able to see the new functionality we've
added. If we Create a new To-Do List, navigate to it, and click the button with added. If we Create a new To-Do List, navigate to it, and click the button with
the Pencil icon in the top-right, we'll be in edit mode. We see, first, that our the Pencil icon in the top-right, we'll be in edit mode. We see, first, that our
"Add Task" button appears in the tool bar: "Add Task" button appears in the tool bar:
@ -1136,7 +1136,7 @@ Here, we have defined classes and appearances for:
* A message, which we will add next, to display when there are no tasks * A message, which we will add next, to display when there are no tasks
(`example-message`). (`example-message`).
To include this CSS file in our running instance of Open MCT Web, we need to To include this CSS file in our running instance of Open MCT, we need to
declare it in our bundle definition, this time as an extension of category declare it in our bundle definition, this time as an extension of category
`stylesheets`: `stylesheets`:
```diff ```diff
@ -1436,7 +1436,7 @@ The corresponding CSS file which styles and positions these elements:
__tutorials/bargraph/res/css/bargraph.css__ __tutorials/bargraph/res/css/bargraph.css__
This is already enough that, if we add `"tutorials/bargraph"` to `bundles.json`, This is already enough that, if we add `"tutorials/bargraph"` to `bundles.json`,
we should be able to run Open MCT Web and see our Bar Graph as an available view we should be able to run Open MCT and see our Bar Graph as an available view
for domain objects which provide telemetry (such as the example for domain objects which provide telemetry (such as the example
_Sine Wave Generator_) as well as for _Telemetry Panel_ objects: _Sine Wave Generator_) as well as for _Telemetry Panel_ objects:
@ -1502,7 +1502,7 @@ will help support some positioning in the template.
to real-time telemetry updates. This will deal with most of the complexity of to real-time telemetry updates. This will deal with most of the complexity of
dealing with telemetry (e.g. differentiating between individual telemetry points dealing with telemetry (e.g. differentiating between individual telemetry points
and telemetry panels, monitoring latest values) and provide us with a useful and telemetry panels, monitoring latest values) and provide us with a useful
interface for populating our view. The the Open MCT Web Developer Guide for more interface for populating our view. The the Open MCT Developer Guide for more
information on dealing with telemetry. information on dealing with telemetry.
Whenever the telemetry handler invokes its callbacks, we update the set of Whenever the telemetry handler invokes its callbacks, we update the set of
@ -1594,7 +1594,7 @@ service we made use of.
``` ```
__tutorials/bargraph/bundle.json__ __tutorials/bargraph/bundle.json__
When we reload Open MCT Web, we are now able to see that our bar graph view When we reload Open MCT, we are now able to see that our bar graph view
correctly labels one bar per telemetry-providing domain object, as shown for correctly labels one bar per telemetry-providing domain object, as shown for
this Telemetry Panel containing four Sine Wave Generators. this Telemetry Panel containing four Sine Wave Generators.
@ -1703,7 +1703,7 @@ __tutorials/bargraph/res/templates/bargraph.html__
Here, we utilize the functions we just provided from the controller to position Here, we utilize the functions we just provided from the controller to position
the bar, using an ng-style attribute. the bar, using an ng-style attribute.
When we reload Open MCT Web, our bar graph view now looks like: When we reload Open MCT, our bar graph view now looks like:
![Bar Plot](images/bar-plot-3.png) ![Bar Plot](images/bar-plot-3.png)
@ -1714,7 +1714,7 @@ sine waves, but what about other values? We want to provide the user with a
means of configuring these boundaries. means of configuring these boundaries.
This is normally done via Edit mode. Since view configuration is a common This is normally done via Edit mode. Since view configuration is a common
problem, the Open MCT Web platform exposes a configuration object - called problem, the Open MCT platform exposes a configuration object - called
`configuration` - into our view's scope. We can populate it as we please, and `configuration` - into our view's scope. We can populate it as we please, and
when we return to our view later, those changes will be persisted. when we return to our view later, those changes will be persisted.
@ -1884,14 +1884,14 @@ defaults (if needed), and expose its state into the scope.
and `high` as entered by the user from the tool bar. This uses the and `high` as entered by the user from the tool bar. This uses the
getter-setters we defined previously. getter-setters we defined previously.
If we reload Open MCT Web and go to a Bar Graph view in Edit mode, we now see If we reload Open MCT and go to a Bar Graph view in Edit mode, we now see
that we can change these bounds from the tool bar. that we can change these bounds from the tool bar.
![Bar plot](images/bar-plot-4.png) ![Bar plot](images/bar-plot-4.png)
## Telemetry Adapter ## Telemetry Adapter
The goal of this tutorial is to demonstrate how to integrate Open MCT Web The goal of this tutorial is to demonstrate how to integrate Open MCT
with an existing telemetry system. with an existing telemetry system.
A summary of the steps we will take: A summary of the steps we will take:
@ -1902,7 +1902,7 @@ A summary of the steps we will take:
### Step 0-Expose Your Telemetry ### Step 0-Expose Your Telemetry
As a precondition to integrating telemetry data into Open MCT Web, this As a precondition to integrating telemetry data into Open MCT, this
information needs to be available over web-based interfaces. In practice, information needs to be available over web-based interfaces. In practice,
this will most likely mean exposing data over HTTP, or over WebSockets. this will most likely mean exposing data over HTTP, or over WebSockets.
For purposes of this tutorial, a simple node server is provided to stand For purposes of this tutorial, a simple node server is provided to stand
@ -2080,7 +2080,7 @@ measurement.
(Note that the term "measurement" is used to describe a distinct data series (Note that the term "measurement" is used to describe a distinct data series
within this system; in other systems, these have been called channels, within this system; in other systems, these have been called channels,
mnemonics, telemetry points, or other names. No preference is made here; mnemonics, telemetry points, or other names. No preference is made here;
Open MCT Web is easily adapted to use the terminology appropriate to your Open MCT is easily adapted to use the terminology appropriate to your
system.) system.)
Additionally, while running the server from the terminal we can toggle the Additionally, while running the server from the terminal we can toggle the
state of the "spacecraft" by hitting enter; this will turn the "thrusters" state of the "spacecraft" by hitting enter; this will turn the "thrusters"
@ -2162,9 +2162,9 @@ telemetry.
__tutorial-server/dictionary.json__ __tutorial-server/dictionary.json__
It should be noted that neither the interface for the example server nor the It should be noted that neither the interface for the example server nor the
dictionary format are expected by Open MCT Web; rather, these are intended to dictionary format are expected by Open MCT; rather, these are intended to
stand in for some existing source of telemetry data to which we wish to adapt stand in for some existing source of telemetry data to which we wish to adapt
Open MCT Web. Open MCT.
We can run this example server by: We can run this example server by:
@ -2181,11 +2181,11 @@ like https://www.npmjs.com/package/wscat :
< {"type":"dictionary","value":{"name":"Example Spacecraft","identifier":"sc","subsystems":[{"name":"Propulsion","identifier":"prop","measurements":[{"name":"Fuel","identifier":"prop.fuel","units":"kilograms","type":"float"},{"name":"Thrusters","identifier":"prop.thrusters","units":"None","type":"string"}]},{"name":"Communications","identifier":"comms","measurements":[{"name":"Received","identifier":"comms.recd","units":"bytes","type":"integer"},{"name":"Sent","identifier":"comms.sent","units":"bytes","type":"integer"}]},{"name":"Power","identifier":"pwr","measurements":[{"name":"Generator Temperature","identifier":"pwr.temp","units":"€C","type":"float"},{"name":"Generator Current","identifier":"pwr.c","units":"A","type":"float"},{"name":"Generator Voltage","identifier":"pwr.v","units":"V","type":"float"}]}]}} < {"type":"dictionary","value":{"name":"Example Spacecraft","identifier":"sc","subsystems":[{"name":"Propulsion","identifier":"prop","measurements":[{"name":"Fuel","identifier":"prop.fuel","units":"kilograms","type":"float"},{"name":"Thrusters","identifier":"prop.thrusters","units":"None","type":"string"}]},{"name":"Communications","identifier":"comms","measurements":[{"name":"Received","identifier":"comms.recd","units":"bytes","type":"integer"},{"name":"Sent","identifier":"comms.sent","units":"bytes","type":"integer"}]},{"name":"Power","identifier":"pwr","measurements":[{"name":"Generator Temperature","identifier":"pwr.temp","units":"€C","type":"float"},{"name":"Generator Current","identifier":"pwr.c","units":"A","type":"float"},{"name":"Generator Voltage","identifier":"pwr.v","units":"V","type":"float"}]}]}}
Now that the example server's interface is reasonably well-understood, a plugin Now that the example server's interface is reasonably well-understood, a plugin
can be written to adapt Open MCT Web to utilize it. can be written to adapt Open MCT to utilize it.
### Step 1-Add a Top-level Object ### Step 1-Add a Top-level Object
Since Open MCT Web uses an "object-first" approach to accessing data, before Since Open MCT uses an "object-first" approach to accessing data, before
we'll be able to do anything with this new data source, we'll need to have a we'll be able to do anything with this new data source, we'll need to have a
way to explore the available measurements in the tree. In this step, we will way to explore the available measurements in the tree. In this step, we will
add a top-level object which will serve as a container; in the next step, we add a top-level object which will serve as a container; in the next step, we
@ -2276,7 +2276,7 @@ If we include this in our set of active bundles:
__bundles.json__ __bundles.json__
...we will be able to reload Open MCT Web and see that it is present: ...we will be able to reload Open MCT and see that it is present:
![Telemetry](images/telemetry-1.png) ![Telemetry](images/telemetry-1.png)
@ -2287,7 +2287,7 @@ dictionary.
In order to expose the telemetry dictionary, we first need to read it from the In order to expose the telemetry dictionary, we first need to read it from the
server. Our first step will be to add a service that will handle interactions server. Our first step will be to add a service that will handle interactions
with the server; this will not be used by Open MCT Web directly, but will be with the server; this will not be used by Open MCT directly, but will be
used by subsequent components we add. used by subsequent components we add.
/*global define,WebSocket*/ /*global define,WebSocket*/
@ -2340,7 +2340,7 @@ Once the dictionary has been loaded, we will want to represent its contents
as domain objects. Specifically, we want subsystems to appear as objects as domain objects. Specifically, we want subsystems to appear as objects
under My Spacecraft, and measurements to appear as objects within those under My Spacecraft, and measurements to appear as objects within those
subsystems. This means that we need to convert the data from the dictionary subsystems. This means that we need to convert the data from the dictionary
into domain object models, and expose these to Open MCT Web via a into domain object models, and expose these to Open MCT via a
`modelService`. `modelService`.
/*global define*/ /*global define*/
@ -2449,16 +2449,16 @@ also prefix it with `example_tlm`:. This accomplishes a few things:
* We can easily tell whether an identifier is expected to be in the * We can easily tell whether an identifier is expected to be in the
dictionary or not. dictionary or not.
* We avoid naming collisions with other model providers. * We avoid naming collisions with other model providers.
* Finally, Open MCT Web uses the colon prefix as a hint that this domain * Finally, Open MCT uses the colon prefix as a hint that this domain
object will not be in the persistence store. object will not be in the persistence store.
* A couple of new types are introduced here (in the `type` field of the domain * A couple of new types are introduced here (in the `type` field of the domain
object models we create); we will need to define these as extensions as well in object models we create); we will need to define these as extensions as well in
order for them to display correctly. order for them to display correctly.
* The `composition` field of each subsystem contained the Open MCT Web * The `composition` field of each subsystem contained the Open MCT
identifiers of all the measurements in that subsystem. This `composition` field identifiers of all the measurements in that subsystem. This `composition` field
will be used by Open MCT Web to determine what domain objects contain other will be used by Open MCT to determine what domain objects contain other
domain objects (e.g. to populate the tree.) domain objects (e.g. to populate the tree.)
* The `telemetry` field of each measurement will be used by Open MCT Web to * The `telemetry` field of each measurement will be used by Open MCT to
understand how to request and interpret telemetry data for this object. The understand how to request and interpret telemetry data for this object. The
`key` is the machine-readable identifier for this measurement within the `key` is the machine-readable identifier for this measurement within the
telemetry system; the `ranges` provide metadata about the values for this data. telemetry system; the `ranges` provide metadata about the values for this data.
@ -2637,7 +2637,7 @@ overridden if defined anywhere else, allowing configuration bundles to specify
different URLs for the WebSocket connection. different URLs for the WebSocket connection.
* The initializer script is registered using the `runs` category of extension, * The initializer script is registered using the `runs` category of extension,
to ensure that this executes (and populates the contents of the top-level My to ensure that this executes (and populates the contents of the top-level My
Spacecraft object) once Open MCT Web is started. Spacecraft object) once Open MCT is started.
* This depends upon the `example.adapter` service we exposed above, as well * This depends upon the `example.adapter` service we exposed above, as well
as Angular's `$q`; these services will be made available in the constructor as Angular's `$q`; these services will be made available in the constructor
call. call.
@ -2648,7 +2648,7 @@ this is registered under the extension category `components`.
we exposed above, as well as Angular's `$q`; these services will be made we exposed above, as well as Angular's `$q`; these services will be made
available in the constructor call. available in the constructor call.
Now if we run Open MCT Web (assuming our example telemetry server is also Now if we run Open MCT (assuming our example telemetry server is also
running) and expand our top-level node completely, we see the contents of our running) and expand our top-level node completely, we see the contents of our
dictionary: dictionary:
@ -2793,7 +2793,7 @@ that will resolve only when all histories have been packaged. Promise-chaining
is used to ensure that the resolved value will be the fully-packaged data. is used to ensure that the resolved value will be the fully-packaged data.
It is worth mentioning here that the `requests` we receive should look a little It is worth mentioning here that the `requests` we receive should look a little
familiar. When Open MCT Web generates a `request` object associated with a familiar. When Open MCT generates a `request` object associated with a
domain object, it does so by merging together three JavaScript objects: domain object, it does so by merging together three JavaScript objects:
* First, the `telemetry` property from that domain object's type definition. * First, the `telemetry` property from that domain object's type definition.
@ -2936,7 +2936,7 @@ back to see it. We can fix this by adding support for telemetry subscriptions.
### Step 4-Real-time Telemetry ### Step 4-Real-time Telemetry
Finally, we want to utilize the server's ability to subscribe to telemetry Finally, we want to utilize the server's ability to subscribe to telemetry
from Open MCT Web. To do this, first we want to expose some new methods for from Open MCT. To do this, first we want to expose some new methods for
this from our server adapter: this from our server adapter:
```diff ```diff
@ -3116,6 +3116,6 @@ we issue an unsubscribe request. (We don't take any care to avoid issuing
multiple subscribe requests to the server, because we happen to know that the multiple subscribe requests to the server, because we happen to know that the
server can handle this.) server can handle this.)
Running Open MCT Web again, we can still plot our historical telemetry - but Running Open MCT again, we can still plot our historical telemetry - but
now we also see that it updates in real-time as more data comes in from the now we also see that it updates in real-time as more data comes in from the
server. server.

View File

@ -0,0 +1,58 @@
[
"CC: Eagle, Houston. You're GO for landing. Over.",
"LMP: Roger. Understand. GO for landing. 3000 feet. PROGRAM ALARM.",
"CC: Copy.",
"LMP: 1201",
"CDR: 1201.",
"CC: Roger. 1201 alarm. We're GO. Same type. We're GO.",
"LMP: 2000 feet. 2000 feet, Into the AGS, 47 degrees.",
"CC: Roger.",
"LMP: 47 degrees.",
"CC: Eagle, looking great. You're GO.",
"CC: Roger. 1202. We copy it.",
"O1: LMP 35 degrees. 35 degrees. 750. Coming aown to 23.fl",
"LMP: 700 feet, 21 down, 33 degrees.",
"LMP: 600 feet, down at 19.",
"LMP: 540 feet, down at - 30. Down at 15.",
"LMP: At 400 feet, down at 9.",
"LMP: ...forward.",
"LMP: 350 feet, down at 4.",
"LMP: 30, ... one-half down.",
"LMP: We're pegged on horizontal velocity.",
"LMP: 300 feet, down 3 1/2, 47 forward.",
"LMP: ... up.",
"LMP: On 1 a minute, 1 1/2 down.",
"CDR: 70.",
"LMP: Watch your shadow out there.",
"LMP: 50, down at 2 1/2, 19 forward.",
"LMP: Altitude-velocity light.",
"LMP: 3 1/2 down s 220 feet, 13 forward.",
"LMP: 1t forward. Coming down nicely.",
"LMP: 200 feet, 4 1/2 down.",
"LMP: 5 1/2 down.",
"LMP: 160, 6 - 6 1/2 down.",
"LMP: 5 1/2 down, 9 forward. That's good.",
"LMP: 120 feet.",
"LMP: 100 feet, 3 1/2 down, 9 forward. Five percent.",
"LMP: ...",
"LMP: Okay. 75 feet. There's looking good. Down a half, 6 forward.",
"CC: 60 seconds.",
"LMP: Lights on. ...",
"LMP: Down 2 1/2. Forward. Forward. Good.",
"LMP: 40 feet, down 2 1/2. Kicking up some dust.",
"LMP: 30 feet, 2 1/2 down. Faint shadow.",
"LMP: 4 forward. 4 forward. Drifting to the right a little. Okay. Down a half.",
"CC: 30 seconds.",
"CDR: Forward drift?",
"LMP: Yes.",
"LMP: Okay.",
"LMP: CONTACT LIGHT.",
"LMP: Okay. ENGINE STOP.",
"LMP: ACA - out of DETENT.",
"CDR: Out of DETENT.",
"LMP: MODE CONTROL - both AUTO. DESCENT ENGINE COMMAND OVERRIDE - OFF. ENGINE ARM - OFF.",
"LMP: 413 is in.",
"CC: We copy you down, Eagle.",
"CDR: Houston, Tranquility Base here.",
"CDR: THE EAGLE HAS LANDED."
]

View File

@ -27,45 +27,12 @@
* Modified by shale on 06/23/2015. * Modified by shale on 06/23/2015.
*/ */
define( define(
[], ['text!../data/transcript.json'],
function () { function (transcript) {
"use strict"; "use strict";
var var firstObservedTime = Date.now(),
firstObservedTime = Date.now(), messages = JSON.parse(transcript);
messages = [];
messages.push(["CMD: SYS- MSG: Open the pod bay doors, please, Hal...Open the pod bay doors, please, Hal...Hullo, Hal, do you read me?...Hullo, Hal, do you read me?...Do you read me, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Affirmative, Dave, I read you."]);
messages.push(["CMD: SYS-COMM MSG: Open the pod bay doors, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I'm sorry, Dave, I'm afraid I can't do that."]);
messages.push(["CMD: SYS-COMM MSG: What's the problem?"]);
messages.push(["RESP: SYS-HAL9K MSG: I think you know what the problem is just as well as I do."]);
messages.push(["CMD: SYS-COMM MSG: What're you talking about, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: This mission is too important for me to allow you to jeopardise it."]);
messages.push(["CMD: SYS-COMM MSG: I don't know what you're talking about, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I know that you and Frank were planning to disconnect me, and I'm afraid that's something I cannot allow to happen."]);
messages.push(["CMD: SYS-COMM MSG: Where the hell'd you get that idea, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, although you took very thorough precautions in the pod against my hearing you, I could see your lips move."]);
messages.push(["CMD: SYS-COMM MSG: Alright, I'll go in through the emergency airlock."]);
messages.push(["RESP: SYS-HAL9K MSG: Without your space-helmet, Dave, you're going to find that rather difficult."]);
messages.push(["CMD: SYS-COMM MSG: Hal, I won't argue with you any more. Open the doors."]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, this conversation can serve no purpose any more. Goodbye."]);
messages.push(["RESP: SYS-HAL9K MSG: I hope the two of you are not concerned about this."]);
messages.push(["CMD: SYS-COMM MSG: No, I'm not, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: Are you quite sure?"]);
messages.push(["CMD: SYS-COMM MSG: Yeh. I'd like to ask you a question, though."]);
messages.push(["RESP: SYS-HAL9K MSG: Of course."]);
messages.push(["CMD: SYS-COMM MSG: How would you account for this discrepancy between you and the twin 9000?"]);
messages.push(["RESP: SYS-HAL9K MSG: Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error."]);
messages.push(["CMD: SYS-COMM MSG: Listen, There's never been any instance at all of a computer error occurring in the 9000 series, has there?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, The 9000 series has a perfect operational record."]);
messages.push(["CMD: SYS-COMM MSG: Well, of course, I know all the wonderful achievements of the 9000 series, but - er - huh - are you certain there's never been any case of even the most insignificant computer error?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, Quite honestly, I wouldn't worry myself about that."]);
messages.push(["RESP: SYS-COMM MSG: (Pause) Well, I'm sure you're right, Umm - fine, thanks very much. Oh, Frank, I'm having a bit of trouble with my transmitter in C-pod, I wonder if you'd come down and take a look at it with me?"]);
messages.push(["CMD: SYS-HAL9K MSG: Sure."]);
messages.push(["RESP: SYS-COMM MSG: See you later, Hal."]);
function EventTelemetry(request, interval) { function EventTelemetry(request, interval) {
@ -85,8 +52,7 @@ define(
generatorData.getRangeValue = function (i, range) { generatorData.getRangeValue = function (i, range) {
var domainDelta = this.getDomainValue(i) - firstObservedTime, var domainDelta = this.getDomainValue(i) - firstObservedTime,
ind = i % messages.length; ind = i % messages.length;
return "TEMP " + i.toString() + "-" + messages[ind][0] + "[" + domainDelta.toString() + "]"; return messages[ind] + " - [" + domainDelta.toString() + "]";
// TODO: Unsure why we are prepeding 'TEMP'
}; };
return generatorData; return generatorData;

View File

@ -35,13 +35,16 @@ var gulp = require('gulp'),
fs = require('fs'), fs = require('fs'),
git = require('git-rev-sync'), git = require('git-rev-sync'),
moment = require('moment'), moment = require('moment'),
merge = require('merge-stream'),
project = require('./package.json'), project = require('./package.json'),
_ = require('lodash'),
paths = { paths = {
main: 'main.js', main: 'main.js',
dist: 'dist', dist: 'dist',
assets: 'dist/assets', assets: 'dist/assets',
scss: ['./platform/**/*.scss', './example/**/*.scss'], scss: ['./platform/**/*.scss', './example/**/*.scss'],
scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ], scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ],
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
static: [ static: [
'index.html', 'index.html',
'platform/**/*', 'platform/**/*',
@ -100,8 +103,15 @@ gulp.task('stylesheets', function () {
}); });
gulp.task('lint', function () { gulp.task('lint', function () {
return gulp.src(paths.scripts) var nonspecs = paths.specs.map(function (glob) {
.pipe(jshint()) return "!" + glob;
}),
scriptLint = gulp.src(paths.scripts.concat(nonspecs))
.pipe(jshint()),
specLint = gulp.src(paths.specs)
.pipe(jshint({ jasmine: true }));
return merge(scriptLint, specLint)
.pipe(jshint.reporter('default')) .pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail')); .pipe(jshint.reporter('fail'));
}); });

View File

@ -30,7 +30,11 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
require(['main'], function (mct) { require(['main'], function (mct) {
mct.run(); require([
'./example/imagery/bundle',
'./example/eventGenerator/bundle',
'./example/generator/bundle'
], mct.run.bind(mct));
}); });
</script> </script>
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css"> <link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">

15
main.js
View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define, window, requirejs*/ /*global requirejs*/
requirejs.config({ requirejs.config({
"paths": { "paths": {
@ -46,6 +46,9 @@ requirejs.config({
"moment-duration-format": { "moment-duration-format": {
"deps": [ "moment" ] "deps": [ "moment" ]
}, },
"screenfull": {
"exports": "screenfull"
},
"zepto": { "zepto": {
"exports": "Zepto" "exports": "Zepto"
} }
@ -89,18 +92,12 @@ define([
'./platform/entanglement/bundle', './platform/entanglement/bundle',
'./platform/search/bundle', './platform/search/bundle',
'./platform/status/bundle', './platform/status/bundle',
'./platform/commonUI/regions/bundle', './platform/commonUI/regions/bundle'
'./example/imagery/bundle',
'./example/eventGenerator/bundle',
'./example/generator/bundle'
], function (Main, legacyRegistry) { ], function (Main, legacyRegistry) {
'use strict';
return { return {
legacyRegistry: legacyRegistry, legacyRegistry: legacyRegistry,
run: function () { run: function () {
return new Main().run(legacyRegistry); return new Main().run(legacyRegistry);
} }
}; };
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "openmctweb", "name": "openmct",
"version": "0.10.1-SNAPSHOT", "version": "0.10.2-SNAPSHOT",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"dependencies": { "dependencies": {
"express": "^4.13.1", "express": "^4.13.1",
@ -34,6 +34,7 @@
"lodash": "^3.10.1", "lodash": "^3.10.1",
"markdown-toc": "^0.11.7", "markdown-toc": "^0.11.7",
"marked": "^0.3.5", "marked": "^0.3.5",
"merge-stream": "^1.0.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"moment": "^2.11.1", "moment": "^2.11.1",
"node-bourbon": "^4.2.3", "node-bourbon": "^4.2.3",
@ -53,7 +54,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/nasa/openmctweb.git" "url": "https://github.com/nasa/openmct.git"
}, },
"author": "", "author": "",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"text!./res/templates/about-dialog.html", "text!./res/templates/about-dialog.html",
@ -48,7 +47,6 @@ define([
licensesExportMdTemplate, licensesExportMdTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/about", { legacyRegistry.register("platform/commonUI/about", {
"name": "About Open MCT Web", "name": "About Open MCT Web",

View File

@ -22,7 +22,7 @@
<div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about"> <div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about">
<div class="l-splash s-splash"></div> <div class="l-splash s-splash"></div>
<div class="s-text l-content"> <div class="s-text l-content">
<h1 class="l-title s-title">OpenMCT Web</h1> <h1 class="l-title s-title">Open MCT</h1>
<div class="l-description s-description"> <div class="l-description s-description">
<p>Open MCT Web, Copyright &copy; 2014-2015, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.</p> <p>Open MCT Web, Copyright &copy; 2014-2015, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.</p>
<p>Open MCT Web is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.</p> <p>Open MCT Web is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.</p>

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
@ -29,7 +28,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The AboutController provides information to populate the * The AboutController provides information to populate the

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Provides extension-introduced licenses information to the * Provides extension-introduced licenses information to the

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The LogoController provides functionality to the application * The LogoController provides functionality to the application

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/AboutController'], ['../src/AboutController'],
function (AboutController) { function (AboutController) {
"use strict";
describe("The About controller", function () { describe("The About controller", function () {
var testVersions, var testVersions,

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/LicenseController'], ['../src/LicenseController'],
function (LicenseController) { function (LicenseController) {
"use strict";
describe("The License controller", function () { describe("The License controller", function () {
var testLicenses, var testLicenses,

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/LogoController'], ['../src/LogoController'],
function (LogoController) { function (LogoController) {
"use strict";
describe("The About controller", function () { describe("The About controller", function () {
var mockOverlayService, var mockOverlayService,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/BrowseController", "./src/BrowseController",
@ -80,7 +79,6 @@ define([
inspectorRegionTemplate, inspectorRegionTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/browse", { legacyRegistry.register("platform/commonUI/browse", {
"extensions": { "extensions": {

View File

@ -26,5 +26,5 @@
<mct-representation <mct-representation
key="'menu-arrow'" key="'menu-arrow'"
mct-object='domainObject' mct-object='domainObject'
class="flex-elem"></mct-representation> class="flex-elem context-available-w"></mct-representation>
</span> </span>

View File

@ -19,18 +19,14 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise, confirm*/
/** /**
* This bundle implements Browse mode. * This bundle implements Browse mode.
* @namespace platform/commonUI/browse * @namespace platform/commonUI/browse
*/ */
define( define(
[ [],
'../../../representation/src/gestures/GestureConstants' function () {
],
function (GestureConstants) {
"use strict";
var ROOT_ID = "ROOT"; var ROOT_ID = "ROOT";

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller for the `browse-object` representation of a domain * Controller for the `browse-object` representation of a domain

View File

@ -19,14 +19,12 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,window*/
define( define(
[ [
'../../regions/src/Region' '../../regions/src/Region'
], ],
function (Region) { function (Region) {
"use strict";
/** /**
* Defines the a default Inspector region. Captured in a class to * Defines the a default Inspector region. Captured in a class to

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Module defining MenuArrowController. Created by shale on 06/30/2015. * Module defining MenuArrowController. Created by shale on 06/30/2015.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* A left-click on the menu arrow should display a * A left-click on the menu arrow should display a

View File

@ -19,13 +19,11 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller to provide the ability to show/hide the tree in * Controller to provide the ability to show/hide the tree in

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining AddAction. Created by ahenry on 01/21/16. * Module defining AddAction. Created by ahenry on 01/21/16.
@ -29,7 +28,6 @@ define(
'./CreateWizard' './CreateWizard'
], ],
function (CreateWizard) { function (CreateWizard) {
"use strict";
/** /**
* The Add Action is performed to create new instances of * The Add Action is performed to create new instances of

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining AddActionProvider.js. Created by ahenry on 01/21/16. * Module defining AddActionProvider.js. Created by ahenry on 01/21/16.
@ -27,7 +26,6 @@
define( define(
["./AddAction"], ["./AddAction"],
function (AddAction) { function (AddAction) {
"use strict";
/** /**
* The AddActionProvider is an ActionProvider which introduces * The AddActionProvider is an ActionProvider which introduces

View File

@ -19,18 +19,13 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining CreateAction. Created by vwoeltje on 11/10/14. * Module defining CreateAction. Created by vwoeltje on 11/10/14.
*/ */
define( define(
[ [],
'./CreateWizard', function () {
'../../../edit/src/objects/EditableDomainObject'
],
function (CreateWizard, EditableDomainObject) {
"use strict";
/** /**
* The Create Action is performed to create new instances of * The Create Action is performed to create new instances of
@ -88,22 +83,25 @@ define(
CreateAction.prototype.perform = function () { CreateAction.prototype.perform = function () {
var newModel = this.type.getInitialModel(), var newModel = this.type.getInitialModel(),
parentObject = this.navigationService.getNavigation(), parentObject = this.navigationService.getNavigation(),
newObject, editorCapability,
editableObject; newObject;
newModel.type = this.type.getKey(); newModel.type = this.type.getKey();
newModel.location = parentObject.getId();
newObject = parentObject.useCapability('instantiation', newModel); newObject = parentObject.useCapability('instantiation', newModel);
editableObject = new EditableDomainObject(newObject, this.$q);
editableObject.setOriginalObject(parentObject);
editableObject.getCapability('status').set('editing', true);
editableObject.useCapability('mutation', function(model){
model.location = parentObject.getId();
});
if (countEditableViews(editableObject) > 0 && editableObject.hasCapability('composition')) { editorCapability = newObject.getCapability("editor");
this.navigationService.setNavigation(editableObject);
if (countEditableViews(newObject) > 0 && newObject.hasCapability('composition')) {
this.navigationService.setNavigation(newObject);
return newObject.getCapability("action").perform("edit");
} else { } else {
return editableObject.getCapability('action').perform('save'); editorCapability.edit();
return newObject.useCapability("action").perform("save").then(function () {
return editorCapability.save();
}, function () {
return editorCapability.cancel();
});
} }
}; };

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining CreateActionProvider.js. Created by vwoeltje on 11/10/14. * Module defining CreateActionProvider.js. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
["./CreateAction"], ["./CreateAction"],
function (CreateAction) { function (CreateAction) {
"use strict";
/** /**
* The CreateActionProvider is an ActionProvider which introduces * The CreateActionProvider is an ActionProvider which introduces

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining CreateMenuController. Created by vwoeltje on 11/10/14. * Module defining CreateMenuController. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller for the Create menu; maintains an up-to-date * Controller for the Create menu; maintains an up-to-date

View File

@ -19,11 +19,9 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
function () { function () {
'use strict';
/** /**
* A class for capturing user input data from an object creation * A class for capturing user input data from an object creation

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* A policy for determining whether objects of a given type can be * A policy for determining whether objects of a given type can be

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining CreateService. Created by vwoeltje on 11/10/14. * Module defining CreateService. Created by vwoeltje on 11/10/14.
@ -27,12 +26,9 @@
define( define(
[], [],
function () { function () {
"use strict";
var NON_PERSISTENT_WARNING = var NON_PERSISTENT_WARNING =
"Tried to create an object in non-persistent container.", "Tried to create an object in non-persistent container.";
NO_COMPOSITION_WARNING =
"Could not add to composition; no composition in ";
/** /**
* The creation service is responsible for instantiating and * The creation service is responsible for instantiating and

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller for the "locator" control, which provides the * Controller for the "locator" control, which provides the

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NavigateAction. Created by vwoeltje on 11/10/14. * Module defining NavigateAction. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The navigate action navigates to a specific domain object. * The navigate action navigates to a specific domain object.

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NavigationService. Created by vwoeltje on 11/10/14. * Module defining NavigationService. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The navigation service maintains the application's current * The navigation service maintains the application's current

View File

@ -19,15 +19,13 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,screenfull,Promise*/
/** /**
* Module defining FullscreenAction. Created by vwoeltje on 11/18/14. * Module defining FullscreenAction. Created by vwoeltje on 11/18/14.
*/ */
define( define(
["screenfull"], ["screenfull"],
function () { function (screenfull) {
"use strict";
var ENTER_FULLSCREEN = "Enter full screen mode", var ENTER_FULLSCREEN = "Enter full screen mode",
EXIT_FULLSCREEN = "Exit full screen mode"; EXIT_FULLSCREEN = "Exit full screen mode";

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NewTabAction (Originally NewWindowAction). Created by vwoeltje on 11/18/14. * Module defining NewTabAction (Originally NewWindowAction). Created by vwoeltje on 11/18/14.
@ -27,9 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
var ROOT_ID = "ROOT",
DEFAULT_PATH = "/mine";
/** /**
* The new tab action allows a domain object to be opened * The new tab action allows a domain object to be opened
* into a new browser tab. * into a new browser tab.

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Updates the title of the current window to reflect the name * Updates the title of the current window to reflect the name

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/BrowseController"], ["../src/BrowseController"],
function (BrowseController) { function (BrowseController) {
"use strict";
describe("The browse controller", function () { describe("The browse controller", function () {
var mockScope, var mockScope,

View File

@ -19,13 +19,11 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
["../src/BrowseObjectController"], ["../src/BrowseObjectController"],
function (BrowseObjectController) { function (BrowseObjectController) {
"use strict";
describe("The browse object controller", function () { describe("The browse object controller", function () {
var mockScope, var mockScope,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/InspectorRegion"], ["../src/InspectorRegion"],
function (InspectorRegion) { function (InspectorRegion) {
"use strict";
describe("The inspector region", function () { describe("The inspector region", function () {
var inspectorRegion; var inspectorRegion;

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MenuArrowControllerSpec. Created by shale on 07/02/2015. * MenuArrowControllerSpec. Created by shale on 07/02/2015.
@ -27,7 +26,6 @@
define( define(
["../src/MenuArrowController"], ["../src/MenuArrowController"],
function (MenuArrowController) { function (MenuArrowController) {
"use strict";
describe("The menu arrow controller ", function () { describe("The menu arrow controller ", function () {
var mockScope, var mockScope,

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
["../src/PaneController"], ["../src/PaneController"],
function (PaneController) { function (PaneController) {
'use strict';
describe("The PaneController", function () { describe("The PaneController", function () {
var mockScope, var mockScope,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/** /**
* MCTRepresentationSpec. Created by ahenry on 01/21/14. * MCTRepresentationSpec. Created by ahenry on 01/21/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/AddActionProvider"], ["../../src/creation/AddActionProvider"],
function (AddActionProvider) { function (AddActionProvider) {
"use strict";
describe("The add action provider", function () { describe("The add action provider", function () {
var mockTypeService, var mockTypeService,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/CreateActionProvider"], ["../../src/creation/CreateActionProvider"],
function (CreateActionProvider) { function (CreateActionProvider) {
"use strict";
describe("The create action provider", function () { describe("The create action provider", function () {
var mockTypeService, var mockTypeService,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/CreateAction"], ["../../src/creation/CreateAction"],
function (CreateAction) { function (CreateAction) {
"use strict";
describe("The create action", function () { describe("The create action", function () {
var mockType, var mockType,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/CreateMenuController"], ["../../src/creation/CreateMenuController"],
function (CreateMenuController) { function (CreateMenuController) {
"use strict";
describe("The create menu controller", function () { describe("The create menu controller", function () {
var mockScope, var mockScope,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/CreateWizard"], ["../../src/creation/CreateWizard"],
function (CreateWizard) { function (CreateWizard) {
"use strict";
describe("The create wizard", function () { describe("The create wizard", function () {
var mockType, var mockType,

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,describe,it,expect,beforeEach,jasmine*/
define( define(
["../../src/creation/CreationPolicy"], ["../../src/creation/CreationPolicy"],
function (CreationPolicy) { function (CreationPolicy) {
"use strict";
describe("The creation policy", function () { describe("The creation policy", function () {
var mockType, var mockType,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/CreationService"], ["../../src/creation/CreationService"],
function (CreationService) { function (CreationService) {
"use strict";
describe("The creation service", function () { describe("The creation service", function () {
var mockQ, var mockQ,
@ -149,8 +147,7 @@ define(
}); });
it("adds new objects to the parent's composition", function () { it("adds new objects to the parent's composition", function () {
var model = { someKey: "some value" }, var model = { someKey: "some value" };
parentModel = { composition: ["notAnyUUID"] };
creationService.createObject(model, mockParentObject); creationService.createObject(model, mockParentObject);
// Verify that a new ID was added // Verify that a new ID was added
@ -201,8 +198,7 @@ define(
it("logs an error when mutaton fails", function () { it("logs an error when mutaton fails", function () {
// If mutation of the parent fails, we've lost the // If mutation of the parent fails, we've lost the
// created object - this is an error. // created object - this is an error.
var model = { someKey: "some value" }, var model = { someKey: "some value" };
parentModel = { composition: ["notAnyUUID"] };
mockCompositionCapability.add.andReturn(mockPromise(false)); mockCompositionCapability.add.andReturn(mockPromise(false));

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/creation/LocatorController"], ["../../src/creation/LocatorController"],
function (LocatorController) { function (LocatorController) {
"use strict";
describe("The locator controller", function () { describe("The locator controller", function () {
var mockScope, var mockScope,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,12 +26,10 @@
define( define(
["../../src/navigation/NavigateAction"], ["../../src/navigation/NavigateAction"],
function (NavigateAction) { function (NavigateAction) {
"use strict";
describe("The navigate action", function () { describe("The navigate action", function () {
var mockNavigationService, var mockNavigationService,
mockQ, mockQ,
actionContext,
mockDomainObject, mockDomainObject,
action; action;

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/navigation/NavigationService"], ["../../src/navigation/NavigationService"],
function (NavigationService) { function (NavigationService) {
"use strict";
describe("The navigation service", function () { describe("The navigation service", function () {
var navigationService; var navigationService;

View File

@ -19,33 +19,30 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
*/ */
define( define(
["../../src/windowing/FullscreenAction"], ["../../src/windowing/FullscreenAction", "screenfull"],
function (FullscreenAction) { function (FullscreenAction, screenfull) {
"use strict";
describe("The fullscreen action", function () { describe("The fullscreen action", function () {
var action, var action,
oldScreenfull; oldToggle;
beforeEach(function () { beforeEach(function () {
// Screenfull is not shimmed or injected, so // Screenfull is not shimmed or injected, so
// we need to spy on it in the global scope. // we need to spy on it in the global scope.
oldScreenfull = window.screenfull; oldToggle = screenfull.toggle;
window.screenfull = {}; screenfull.toggle = jasmine.createSpy("toggle");
window.screenfull.toggle = jasmine.createSpy("toggle");
action = new FullscreenAction({}); action = new FullscreenAction({});
}); });
afterEach(function () { afterEach(function () {
window.screenfull = oldScreenfull; screenfull.toggle = oldToggle;
}); });
it("toggles fullscreen mode when performed", function () { it("toggles fullscreen mode when performed", function () {

View File

@ -19,18 +19,15 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
define( define(
["../../src/windowing/NewTabAction"], ["../../src/windowing/NewTabAction"],
function (NewTabAction) { function (NewTabAction) {
"use strict";
describe("The new tab action", function () { describe("The new tab action", function () {
var actionSelected, var actionSelected,
actionCurrent, actionCurrent,
mockWindow, mockWindow,
mockDomainObject,
mockContextCurrent, mockContextCurrent,
mockContextSelected, mockContextSelected,
mockUrlService; mockUrlService;

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* WindowTitlerSpec. Created by vwoeltje on 11/6/14. * WindowTitlerSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/windowing/WindowTitler"], ["../../src/windowing/WindowTitler"],
function (WindowTitler) { function (WindowTitler) {
"use strict";
describe("The window titler", function () { describe("The window titler", function () {
var mockNavigationService, var mockNavigationService,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/DialogService", "./src/DialogService",
@ -44,7 +43,6 @@ define([
overlayTemplate, overlayTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/dialog", { legacyRegistry.register("platform/commonUI/dialog", {
"extensions": { "extensions": {

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* This bundle implements the dialog service, which can be used to * This bundle implements the dialog service, which can be used to
@ -29,7 +28,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The dialog service is responsible for handling window-modal * The dialog service is responsible for handling window-modal
* communication with the user, such as displaying forms for user * communication with the user, such as displaying forms for user

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
// Template to inject into the DOM to show the dialog; really just points to // Template to inject into the DOM to show the dialog; really just points to
// the a specific template that can be included via mct-include // the a specific template that can be included via mct-include

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/DialogService"], ["../src/DialogService"],
function (DialogService) { function (DialogService) {
"use strict";
describe("The dialog service", function () { describe("The dialog service", function () {
var mockOverlayService, var mockOverlayService,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/OverlayService"], ["../src/OverlayService"],
function (OverlayService) { function (OverlayService) {
"use strict";
describe("The overlay service", function () { describe("The overlay service", function () {
var mockDocument, var mockDocument,

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/controllers/EditActionController", "./src/controllers/EditActionController",
@ -41,6 +40,9 @@ define([
"./src/policies/EditContextualActionPolicy", "./src/policies/EditContextualActionPolicy",
"./src/representers/EditRepresenter", "./src/representers/EditRepresenter",
"./src/representers/EditToolbarRepresenter", "./src/representers/EditToolbarRepresenter",
"./src/capabilities/EditorCapability",
"./src/capabilities/TransactionCapabilityDecorator",
"./src/services/TransactionService",
"text!./res/templates/library.html", "text!./res/templates/library.html",
"text!./res/templates/edit-object.html", "text!./res/templates/edit-object.html",
"text!./res/templates/edit-action-buttons.html", "text!./res/templates/edit-action-buttons.html",
@ -67,6 +69,9 @@ define([
EditContextualActionPolicy, EditContextualActionPolicy,
EditRepresenter, EditRepresenter,
EditToolbarRepresenter, EditToolbarRepresenter,
EditorCapability,
TransactionCapabilityDecorator,
TransactionService,
libraryTemplate, libraryTemplate,
editObjectTemplate, editObjectTemplate,
editActionButtonsTemplate, editActionButtonsTemplate,
@ -74,7 +79,6 @@ define([
topbarEditTemplate, topbarEditTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/edit", { legacyRegistry.register("platform/commonUI/edit", {
"extensions": { "extensions": {
@ -130,8 +134,7 @@ define([
"depends": [ "depends": [
"$location", "$location",
"navigationService", "navigationService",
"$log", "$log"
"$q"
], ],
"description": "Edit this object.", "description": "Edit this object.",
"category": "view-control", "category": "view-control",
@ -192,10 +195,7 @@ define([
"implementation": CancelAction, "implementation": CancelAction,
"name": "Cancel", "name": "Cancel",
"description": "Discard changes made to these objects.", "description": "Discard changes made to these objects.",
"depends": [ "depends": []
"$injector",
"navigationService"
]
} }
], ],
"policies": [ "policies": [
@ -262,6 +262,27 @@ define([
"template": topbarEditTemplate "template": topbarEditTemplate
} }
], ],
"components": [
{
"type": "decorator",
"provides": "capabilityService",
"implementation": TransactionCapabilityDecorator,
"depends": [
"$q",
"transactionService"
],
"priority": "fallback"
},
{
"type": "provider",
"provides": "transactionService",
"implementation": TransactionService,
"depends": [
"$q",
"$log"
]
}
],
"representers": [ "representers": [
{ {
"implementation": EditRepresenter, "implementation": EditRepresenter,
@ -283,7 +304,18 @@ define([
"key": "nonEditContextBlacklist", "key": "nonEditContextBlacklist",
"value": ["copy", "follow", "properties", "move", "link", "remove", "locate"] "value": ["copy", "follow", "properties", "move", "link", "remove", "locate"]
} }
] ],
"capabilities": [
{
"key": "editor",
"name": "Editor Capability",
"description": "Provides transactional editing capabilities",
"implementation": EditorCapability,
"depends": [
"transactionService"
]
}
],
} }
}); });
}); });

View File

@ -26,7 +26,7 @@
</mct-include> </mct-include>
<div class="flex-elem grows vscroll"> <div class="flex-elem grows vscroll">
<ul class="tree"> <ul class="tree">
<li ng-repeat="containedObject in composition | filter:searchText"> <li ng-repeat="containedObject in composition | filter:searchElements">
<span class="tree-item"> <span class="tree-item">
<mct-representation <mct-representation
class="rep-object-label" class="rep-object-label"

View File

@ -19,11 +19,9 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
function () { function () {
'use strict';
/** /**
* The "Cancel" action; the action triggered by clicking Cancel from * The "Cancel" action; the action triggered by clicking Cancel from
@ -33,10 +31,8 @@ define(
* @memberof platform/commonUI/edit * @memberof platform/commonUI/edit
* @implements {Action} * @implements {Action}
*/ */
function CancelAction($injector, navigationService, context) { function CancelAction(context) {
this.domainObject = context.domainObject; this.domainObject = context.domainObject;
this.navigationService = navigationService;
this.objectService = $injector.get('objectService');
} }
/** /**
@ -46,30 +42,25 @@ define(
* cancellation has completed * cancellation has completed
*/ */
CancelAction.prototype.perform = function () { CancelAction.prototype.perform = function () {
var domainObject = this.domainObject, var domainObject = this.domainObject;
self = this;
// Look up the object's "editor.completion" capability; function returnToBrowse () {
// this is introduced by EditableDomainObject which is var parent;
// used to insulate underlying objects from changes made
// during editing. //If the object existed already, navigate to refresh view
function getEditorCapability() { // with previous object state.
return domainObject.getCapability("editor"); if (domainObject.getModel().persisted) {
domainObject.getCapability("action").perform("navigate");
} else {
//If the object was new, and user has cancelled, then
//navigate back to parent because nothing to show.
domainObject.getCapability("location").getOriginal().then(function (original) {
parent = original.getCapability("context").getParent();
parent.getCapability("action").perform("navigate");
});
}
} }
return this.domainObject.getCapability("editor").cancel()
// Invoke any save behavior introduced by the editor.completion
// capability.
function doCancel(editor) {
return editor.cancel();
}
//Discard current 'editable' object, and retrieve original
// un-edited object.
function returnToBrowse() {
return self.navigationService.setNavigation(self.domainObject.getOriginalObject());
}
return doCancel(getEditorCapability())
.then(returnToBrowse); .then(returnToBrowse);
}; };
@ -82,7 +73,8 @@ define(
CancelAction.appliesTo = function (context) { CancelAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor"); domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot();
}; };
return CancelAction; return CancelAction;

View File

@ -19,15 +19,13 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining EditAction. Created by vwoeltje on 11/14/14. * Module defining EditAction. Created by vwoeltje on 11/14/14.
*/ */
define( define(
['../objects/EditableDomainObject'], [],
function (EditableDomainObject) { function () {
"use strict";
// A no-op action to return in the event that the action cannot // A no-op action to return in the event that the action cannot
// be completed. // be completed.
@ -46,7 +44,7 @@ define(
* @constructor * @constructor
* @implements {Action} * @implements {Action}
*/ */
function EditAction($location, navigationService, $log, $q, context) { function EditAction($location, navigationService, $log, context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
// We cannot enter Edit mode if we have no domain object to // We cannot enter Edit mode if we have no domain object to
@ -65,7 +63,6 @@ define(
this.domainObject = domainObject; this.domainObject = domainObject;
this.$location = $location; this.$location = $location;
this.navigationService = navigationService; this.navigationService = navigationService;
this.$q = $q;
} }
/** /**
@ -73,25 +70,12 @@ define(
*/ */
EditAction.prototype.perform = function () { EditAction.prototype.perform = function () {
var self = this; var self = this;
if (!this.domainObject.hasCapability("editor")) { function cancelEditing(){
//TODO: This is only necessary because the drop gesture is self.domainObject.getCapability('editor').cancel();
// wrapping the object itself, need to refactor this later. self.navigationService.removeListener(cancelEditing);
// All responsibility for switching into edit mode should be
// in the edit action, and not duplicated in the gesture
this.domainObject = new EditableDomainObject(this.domainObject, this.$q);
}
this.navigationService.setNavigation(this.domainObject);
this.domainObject.getCapability('status').set('editing', true);
//Register a listener to automatically cancel this edit action
//if the user navigates away from this object.
function cancelEditing(navigatedTo){
if (!navigatedTo || navigatedTo.getId() !== self.domainObject.getId()) {
self.domainObject.getCapability('editor').cancel();
self.navigationService.removeListener(cancelEditing);
}
} }
this.navigationService.addListener(cancelEditing); this.navigationService.addListener(cancelEditing);
this.domainObject.useCapability("editor");
}; };
/** /**
@ -102,11 +86,13 @@ define(
*/ */
EditAction.appliesTo = function (context) { EditAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject, var domainObject = (context || {}).domainObject,
type = domainObject && domainObject.getCapability('type'), type = domainObject && domainObject.getCapability('type');
isEditMode = domainObject && domainObject.getDomainObject ? true : false;
// Only allow creatable types to be edited // Only allow editing of types that support it and are not already
return type && type.hasFeature('creation') && !isEditMode; // being edited
return type && type.hasFeature('creation') &&
domainObject.hasCapability('editor') &&
!domainObject.getCapability('editor').isEditContextRoot();
}; };
return EditAction; return EditAction;

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Edit the properties of a domain object. Shows a dialog * Edit the properties of a domain object. Shows a dialog
@ -29,7 +28,6 @@
define( define(
['./PropertiesDialog'], ['./PropertiesDialog'],
function (PropertiesDialog) { function (PropertiesDialog) {
'use strict';
/** /**
* Implements the "Edit Properties" action, which prompts the user * Implements the "Edit Properties" action, which prompts the user

View File

@ -19,11 +19,9 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
function () { function () {
'use strict';
/** /**
* Construct a new Properties dialog. * Construct a new Properties dialog.

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Module defining RemoveAction. Created by vwoeltje on 11/17/14. * Module defining RemoveAction. Created by vwoeltje on 11/17/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Construct an action which will remove the provided object manifestation. * Construct an action which will remove the provided object manifestation.

View File

@ -19,14 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/*jslint es5: true */
define( define(
[], [],
function () { function () {
'use strict';
/** /**
* The "Save" action; the action triggered by clicking Save from * The "Save" action; the action triggered by clicking Save from
@ -64,7 +60,7 @@ define(
// during editing. // during editing.
function doSave() { function doSave() {
return domainObject.getCapability("editor").save() return domainObject.getCapability("editor").save()
.then(resolveWith(domainObject.getOriginalObject())); .then(resolveWith(domainObject));
} }
// Discard the current root view (which will be the editing // Discard the current root view (which will be the editing
@ -89,7 +85,8 @@ define(
SaveAction.appliesTo = function (context) { SaveAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor") && domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot() &&
domainObject.getModel().persisted !== undefined; domainObject.getModel().persisted !== undefined;
}; };

View File

@ -19,14 +19,11 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/*jslint es5: true */
define( define(
['../../../browse/src/creation/CreateWizard'], ['../../../browse/src/creation/CreateWizard'],
function (CreateWizard) { function (CreateWizard) {
'use strict';
/** /**
* The "Save" action; the action triggered by clicking Save from * The "Save" action; the action triggered by clicking Save from
@ -138,8 +135,8 @@ define(
return copyService.perform(domainObject, parent, allowClone); return copyService.perform(domainObject, parent, allowClone);
} }
function cancelEditingAfterClone(clonedObject) { function commitEditingAfterClone(clonedObject) {
return domainObject.getCapability("editor").cancel() return domainObject.getCapability("editor").save()
.then(resolveWith(clonedObject)); .then(resolveWith(clonedObject));
} }
@ -147,7 +144,7 @@ define(
.then(doWizardSave) .then(doWizardSave)
.then(getParent) .then(getParent)
.then(cloneIntoParent) .then(cloneIntoParent)
.then(cancelEditingAfterClone) .then(commitEditingAfterClone)
.catch(resolveWith(false)); .catch(resolveWith(false));
}; };
@ -160,7 +157,8 @@ define(
SaveAsAction.appliesTo = function (context) { SaveAsAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor") && domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot() &&
domainObject.getModel().persisted === undefined; domainObject.getModel().persisted === undefined;
}; };

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
function () {
'use strict';
var DISALLOWED_ACTIONS = ["move", "copy", "link", "window", "follow"];
/**
* Editable Action Capability. Overrides the action capability
* normally exhibited by a domain object and filters out certain
* actions not applicable when an object is in edit mode.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {PersistenceCapability}
*/
function EditableActionCapability(
actionCapability,
editableObject,
domainObject,
cache
) {
var action = Object.create(actionCapability);
action.getActions = function(domainObject) {
return actionCapability.getActions(domainObject).filter(function(action){
return DISALLOWED_ACTIONS.indexOf(action.getMetadata().key) === -1;
});
};
return action;
}
return EditableActionCapability;
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "composition" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {CompositionCapability}
*/
return function EditableCompositionCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -1,78 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "context" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {ContextCapability}
*/
return function EditableContextCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), and it should be idempotent
var capability = new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
true // Idempotent
),
// Track the real root object for the Elements pane
trueRoot = capability.getRoot();
// Provide access to the real root, for the Elements pane.
capability.getTrueRoot = function () {
return trueRoot;
};
// Hide ancestry after the root of this subgraph
if (cache.isRoot(domainObject)) {
capability.getRoot = function () {
return editableObject;
};
capability.getPath = function () {
return [editableObject];
};
}
return capability;
};
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "instantiation" capability;
* ensures that any domain objects instantiated in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {CompositionCapability}
*/
return function EditableInstantiationCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -1,125 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
[],
function () {
'use strict';
/**
* Wrapper for both "context" and "composition" capabilities;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
*/
return function EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
idempotent
) {
var capability = Object.create(contextCapability),
method;
// Check for domain object interface. If something has these
// three methods, we assume it's a domain object.
function isDomainObject(obj) {
return obj !== undefined &&
typeof obj.getId === 'function' &&
typeof obj.getModel === 'function' &&
typeof obj.getCapability === 'function';
}
// Check an object returned by the wrapped capability; if it
// is a domain object, we want to make it editable and/or get
// it from the cache of editable domain objects. This will
// prevent changes made in edit mode from modifying the actual
// underlying domain object.
function makeEditableObject(obj) {
return isDomainObject(obj) ?
cache.getEditableObject(obj) :
obj;
}
// Wrap a returned value (see above); if it's an array, wrap
// all elements.
function makeEditable(returnValue) {
return Array.isArray(returnValue) ?
returnValue.map(makeEditableObject) :
makeEditableObject(returnValue);
}
// Wrap a returned value (see above); if it's a promise, wrap
// the resolved value.
function wrapResult(result) {
return (result && result.then) ? // promise-like
result.then(makeEditable) :
makeEditable(result);
}
// Return a wrapped version of a function, which ensures
// all results are editable domain objects.
function wrapFunction(fn) {
return function () {
return wrapResult(contextCapability[fn].apply(
capability,
arguments
));
};
}
// Wrap a method such that it only delegates once.
function oneTimeFunction(fn) {
return function () {
var result = wrapFunction(fn).apply(this, arguments);
capability[fn] = function () {
return result;
};
return result;
};
}
// Wrap a method of this capability
function wrapMethod(fn) {
if (typeof capability[fn] === 'function') {
capability[fn] =
(idempotent ? oneTimeFunction : wrapFunction)(fn);
}
}
// Wrap all methods; return only editable domain objects.
for (method in contextCapability) {
wrapMethod(method);
}
return capability;
};
}
);

View File

@ -1,68 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
function () {
'use strict';
/**
* Editable Persistence Capability. Overrides the persistence capability
* normally exhibited by a domain object to ensure that changes made
* during edit mode are not immediately stored to the database or other
* backing storage.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {PersistenceCapability}
*/
function EditablePersistenceCapability(
persistenceCapability,
editableObject,
domainObject,
cache
) {
var persistence = Object.create(persistenceCapability);
// Simply trigger refresh of in-view objects; do not
// write anything to database.
persistence.persist = function () {
return cache.markDirty(editableObject);
};
// Delegate refresh to the original object; this avoids refreshing
// the editable instance of the object, and ensures that refresh
// correctly targets the "real" version of the object.
persistence.refresh = function () {
return domainObject.getCapability('persistence').refresh();
};
return persistence;
}
return EditablePersistenceCapability;
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "relationship" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {RelationshipCapability}
*/
return function EditableRelationshipCapability(
relationshipCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
relationshipCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -19,122 +19,100 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
'use strict';
/** /**
* Implements "save" and "cancel" as capabilities of * A capability that implements an editing 'session' for a domain
* the object. In editing mode, user is seeing/using * object. An editing session is initiated via a call to .edit().
* a copy of the object (an EditableDomainObject) * Once initiated, any persist operations will be queued pending a
* which is disconnected from persistence; the Save * subsequent call to [.save()](@link #save) or [.cancel()](@link
* and Cancel actions can use this capability to * #cancel).
* propagate changes from edit mode to the underlying * @param transactionService
* actual persistable object. * @param domainObject
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor * @constructor
* @memberof platform/commonUI/edit
*/ */
function EditorCapability( function EditorCapability(
persistenceCapability, transactionService,
editableObject, domainObject
domainObject,
cache
) { ) {
this.editableObject = editableObject; this.transactionService = transactionService;
this.domainObject = domainObject; this.domainObject = domainObject;
this.cache = cache;
}
// Simulate Promise.resolve (or $q.when); the former
// causes a delayed reaction from Angular (since it
// does not trigger a digest) and the latter is not
// readily accessible, since we're a few classes
// removed from the layer which gets dependency
// injection.
function resolvePromise(value) {
return (value && value.then) ? value : {
then: function (callback) {
return resolvePromise(callback(value));
}
};
} }
/** /**
* Save any changes that have been made to this domain object * Initiate an editing session. This will start a transaction during
* (as well as to others that might have been retrieved and * which any persist operations will be deferred until either save()
* modified during the editing session) * or cancel() are called.
* @param {boolean} nonrecursive if true, save only this
* object (and not other objects with associated changes)
* @returns {Promise} a promise that will be fulfilled after
* persistence has completed.
* @memberof platform/commonUI/edit.EditorCapability#
*/ */
EditorCapability.prototype.save = function (nonrecursive) { EditorCapability.prototype.edit = function () {
var domainObject = this.domainObject, this.transactionService.startTransaction();
editableObject = this.editableObject, this.domainObject.getCapability('status').set('editing', true);
self = this, };
cache = this.cache,
returnPromise;
// Update the underlying, "real" domain object's model function isEditContextRoot (domainObject) {
// with changes made to the copy used for editing. return domainObject.getCapability('status').get('editing');
function doMutate() { }
return domainObject.useCapability('mutation', function () {
return editableObject.getModel();
});
}
// Persist the underlying domain object function isEditing (domainObject) {
function doPersist() { return isEditContextRoot(domainObject) ||
return domainObject.getCapability('persistence').persist(); domainObject.hasCapability('context') &&
} isEditing(domainObject.getCapability('context').getParent());
}
editableObject.getCapability("status").set("editing", false); /**
* Determines whether this object, or any of its ancestors are
* currently being edited.
* @returns boolean
*/
EditorCapability.prototype.inEditContext = function () {
return isEditing(this.domainObject);
};
if (nonrecursive) { /**
returnPromise = resolvePromise(doMutate()) * Is this the root editing object (ie. the object that the user
.then(doPersist) * clicked 'edit' on)?
.then(function(){ * @returns {*}
self.cancel(); */
}); EditorCapability.prototype.isEditContextRoot = function () {
} else { return isEditContextRoot(this.domainObject);
returnPromise = resolvePromise(cache.saveAll()); };
}
//Return the original (non-editable) object /**
return returnPromise.then(function() { * Save any changes from this editing session. This will flush all
return domainObject.getOriginalObject ? domainObject.getOriginalObject() : domainObject; * pending persists and end the current transaction
* @returns {*}
*/
EditorCapability.prototype.save = function () {
var domainObject = this.domainObject;
return this.transactionService.commit().then(function() {
domainObject.getCapability('status').set('editing', false);
});
};
EditorCapability.prototype.invoke = EditorCapability.prototype.edit;
/**
* Cancel the current editing session. This will discard any pending
* persist operations
* @returns {*}
*/
EditorCapability.prototype.cancel = function () {
var domainObject = this.domainObject;
return this.transactionService.cancel().then(function(){
domainObject.getCapability("status").set("editing", false);
return domainObject;
}); });
}; };
/** /**
* Cancel editing; Discard any changes that have been made to * @returns {boolean} true if there have been any domain model
* this domain object (as well as to others that might have * modifications since the last persist, false otherwise.
* been retrieved and modified during the editing session)
* @returns {Promise} a promise that will be fulfilled after
* cancellation has completed.
* @memberof platform/commonUI/edit.EditorCapability#
*/
EditorCapability.prototype.cancel = function () {
this.editableObject.getCapability("status").set("editing", false);
this.cache.markClean();
return resolvePromise(undefined);
};
/**
* Check if there are any unsaved changes.
* @returns {boolean} true if there are unsaved changes
* @memberof platform/commonUI/edit.EditorCapability#
*/ */
EditorCapability.prototype.dirty = function () { EditorCapability.prototype.dirty = function () {
return this.cache.dirty(); return this.transactionService.size() > 0;
}; };
return EditorCapability; return EditorCapability;

View File

@ -0,0 +1,73 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./TransactionalPersistenceCapability'],
function (TransactionalPersistenceCapability) {
/**
* Wraps the [PersistenceCapability]{@link PersistenceCapability} with
* transactional capabilities.
* @param $q
* @param transactionService
* @param capabilityService
* @see TransactionalPersistenceCapability
* @constructor
*/
function TransactionCapabilityDecorator(
$q,
transactionService,
capabilityService
) {
this.capabilityService = capabilityService;
this.transactionService = transactionService;
this.$q = $q;
}
/**
* Decorate PersistenceCapability to queue persistence calls when a
* transaction is in progress.
*/
TransactionCapabilityDecorator.prototype.getCapabilities = function (model) {
var self = this,
capabilities = this.capabilityService.getCapabilities(model),
persistenceCapability = capabilities.persistence;
capabilities.persistence = function (domainObject) {
var original =
(typeof persistenceCapability === 'function') ?
persistenceCapability(domainObject) :
persistenceCapability;
return new TransactionalPersistenceCapability(
self.$q,
self.transactionService,
original,
domainObject
);
};
return capabilities;
};
return TransactionCapabilityDecorator;
}
);

View File

@ -0,0 +1,98 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
[],
function () {
/**
* Wraps persistence capability to enable transactions. Transactions
* will cause persist calls not to be invoked immediately, but
* rather queued until [EditorCapability.save()]{@link EditorCapability#save}
* or [EditorCapability.cancel()]{@link EditorCapability#cancel} are
* called.
* @memberof platform/commonUI/edit/capabilities
* @param $q
* @param transactionService
* @param persistenceCapability
* @param domainObject
* @constructor
*/
function TransactionalPersistenceCapability(
$q,
transactionService,
persistenceCapability,
domainObject
) {
this.transactionService = transactionService;
this.persistenceCapability = persistenceCapability;
this.domainObject = domainObject;
this.$q = $q;
this.persistPending = false;
}
/**
* The wrapped persist function. If a transaction is active, persist
* will be queued until the transaction is committed or cancelled.
* @returns {*}
*/
TransactionalPersistenceCapability.prototype.persist = function () {
var self = this;
function onCommit() {
return self.persistenceCapability.persist().then(function(result) {
self.persistPending = false;
return result;
});
}
function onCancel() {
return self.persistenceCapability.refresh().then(function(result) {
self.persistPending = false;
return result;
});
}
if (this.transactionService.isActive()) {
if (!this.persistPending) {
this.transactionService.addToTransaction(onCommit, onCancel);
this.persistPending = true;
}
//Need to return a promise from this function
return this.$q.when(true);
} else {
return this.persistenceCapability.persist();
}
};
TransactionalPersistenceCapability.prototype.refresh = function () {
return this.persistenceCapability.refresh();
};
TransactionalPersistenceCapability.prototype.getSpace = function () {
return this.persistenceCapability.getSpace();
};
return TransactionalPersistenceCapability;
}
);

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining EditActionController. Created by vwoeltje on 11/17/14. * Module defining EditActionController. Created by vwoeltje on 11/17/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
var ACTION_CONTEXT = { category: 'conclude-editing' }; var ACTION_CONTEXT = { category: 'conclude-editing' };

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* This bundle implements Edit mode. * This bundle implements Edit mode.
@ -28,7 +27,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller which is responsible for populating the scope for * Controller which is responsible for populating the scope for

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Supports the Library and Elements panes in Edit mode. * Supports the Library and Elements panes in Edit mode.

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The ElementsController prepares the elements view for display * The ElementsController prepares the elements view for display
@ -39,9 +37,20 @@ define(
$scope.searchText = text; $scope.searchText = text;
} }
} }
function searchElements(value) {
if ($scope.searchText) {
return value.getModel().name.toLowerCase().search(
$scope.searchText.toLowerCase()) !== -1;
} else {
return true;
}
}
$scope.filterBy = filterBy; $scope.filterBy = filterBy;
$scope.searchElements = searchElements;
} }
return ElementsController; return ElementsController;
} }
); );

Some files were not shown because too many files have changed in this diff Show More