[JSDoc] Add annotations

Bulk-add JSDoc annotations, WTD-1482.
This commit is contained in:
Victor Woeltjen 2015-08-07 11:44:54 -07:00
parent 14f97eae9c
commit c08a460d30
239 changed files with 939 additions and 185 deletions

View File

@ -29,6 +29,7 @@ define(
/**
* The AboutController provides information to populate the
* About dialog.
* @memberof platform/commonUI/about
* @constructor
* @param {object[]} versions an array of version extensions;
* injected from `versions[]`
@ -42,6 +43,7 @@ define(
* as a line-item in the version information listing.
* @memberof AboutController#
* @returns {object[]} version information
* @memberof platform/commonUI/about.AboutController#
*/
versions: function () {
return versions;
@ -50,6 +52,7 @@ define(
* Open a new window (or tab, depending on browser
* configuration) containing open source licenses.
* @memberof AboutController#
* @memberof platform/commonUI/about.AboutController#
*/
openLicenses: function () {
// Open a new browser window at the licenses route
@ -60,4 +63,4 @@ define(
return AboutController;
}
);
);

View File

@ -29,6 +29,7 @@ define(
/**
* Provides extension-introduced licenses information to the
* licenses route.
* @memberof platform/commonUI/about
* @constructor
*/
function LicenseController(licenses) {
@ -36,6 +37,7 @@ define(
/**
* Get license information.
* @returns {Array} license extensions
* @memberof platform/commonUI/about.LicenseController#
*/
licenses: function () {
return licenses;
@ -45,4 +47,4 @@ define(
return LicenseController;
}
);
);

View File

@ -29,6 +29,7 @@ define(
/**
* The LogoController provides functionality to the application
* logo in the bottom-right of the user interface.
* @memberof platform/commonUI/about
* @constructor
* @param {OverlayService} overlayService the overlay service
*/
@ -37,6 +38,7 @@ define(
/**
* Display the About dialog.
* @memberof LogoController#
* @memberof platform/commonUI/about.LogoController#
*/
showAboutDialog: function () {
overlayService.createOverlay("overlay-about");
@ -46,4 +48,4 @@ define(
return LogoController;
}
);
);

View File

@ -39,6 +39,7 @@ define(
* which Angular templates first have access to the domain object
* hierarchy.
*
* @memberof platform/commonUI/browse
* @constructor
*/
function BrowseController($scope, $route, $location, objectService, navigationService, urlService) {
@ -157,3 +158,4 @@ define(
return BrowseController;
}
);

View File

@ -29,6 +29,7 @@ define(
/**
* Controller for the `browse-object` representation of a domain
* object (the right-hand side of Browse mode.)
* @memberof platform/commonUI/browse
* @constructor
*/
function BrowseObjectController($scope, $location, $route) {
@ -71,3 +72,4 @@ define(
return BrowseObjectController;
}
);

View File

@ -33,6 +33,7 @@ define(
* A left-click on the menu arrow should display a
* context menu. This controller launches the context
* menu.
* @memberof platform/commonUI/browse
* @constructor
*/
function MenuArrowController($scope) {
@ -48,4 +49,4 @@ define(
return MenuArrowController;
}
);
);

View File

@ -34,6 +34,7 @@ define(
* domain objects of a specific type. This is the action that
* is performed when a user uses the Create menu.
*
* @memberof platform/commonUI/browse
* @constructor
* @param {Type} type the type of domain object to create
* @param {DomainObject} parent the domain object that should
@ -95,6 +96,7 @@ define(
* This will prompt for user input first.
* @method
* @memberof CreateAction
* @memberof platform/commonUI/browse.CreateAction#
*/
perform: perform,
@ -107,6 +109,7 @@ define(
* * `context`: The context in which this action will be performed.
*
* @return {object} metadata about the create action
* @memberof platform/commonUI/browse.CreateAction#
*/
getMetadata: function () {
return {
@ -123,4 +126,4 @@ define(
return CreateAction;
}
);
);

View File

@ -33,6 +33,7 @@ define(
* The CreateActionProvider is an ActionProvider which introduces
* a Create action for each creatable domain object type.
*
* @memberof platform/commonUI/browse
* @constructor
* @param {TypeService} typeService the type service, used to discover
* available types
@ -51,6 +52,7 @@ define(
* @memberof CreateActionProvider
* @method
* @returns {CreateAction[]}
* @memberof platform/commonUI/browse.CreateActionProvider#
*/
getActions: function (actionContext) {
var context = actionContext || {},
@ -84,4 +86,4 @@ define(
return CreateActionProvider;
}
);
);

View File

@ -34,6 +34,7 @@ define(
* set of Create actions based on the currently-selected
* domain object.
*
* @memberof platform/commonUI/browse
* @constructor
*/
function CreateMenuController($scope) {
@ -55,4 +56,4 @@ define(
return CreateMenuController;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* @param {TypeImpl} type the type of domain object to be created
* @param {DomainObject} parent the domain object to serve as
* the initial parent for the created object, in the dialog
* @memberof platform/commonUI/browse
* @constructor
* @memberof module:core/action/create-wizard
*/
@ -62,6 +63,7 @@ define(
*
* @return {FormModel} formModel the form model to
* show in the create dialog
* @memberof platform/commonUI/browse.CreateWizard#
*/
getFormStructure: function () {
var sections = [];
@ -100,6 +102,7 @@ define(
* in the structure.
*
* @returns {object} the initial value of the form
* @memberof platform/commonUI/browse.CreateWizard#
*/
getInitialFormValue: function () {
// Start with initial values for properties
@ -116,6 +119,7 @@ define(
* Based on a populated form, get the domain object which
* should be used as a parent for the newly-created object.
* @return {DomainObject}
* @memberof platform/commonUI/browse.CreateWizard#
*/
getLocation: function (formValue) {
return formValue.createParent || parent;
@ -124,6 +128,7 @@ define(
* Create the domain object model for a newly-created object,
* based on user input read from a formModel.
* @return {object} the domain object' model
* @memberof platform/commonUI/browse.CreateWizard#
*/
createModel: function (formValue) {
// Clone
@ -146,4 +151,4 @@ define(
return CreateWizard;
}
);
);

View File

@ -39,6 +39,7 @@ define(
* persisting new domain objects. Handles all actual object
* mutation and persistence associated with domain object
* creation.
* @memberof platform/commonUI/browse
* @constructor
*/
function CreationService(persistenceService, $q, $log) {
@ -131,6 +132,7 @@ define(
* @param {DomainObject} parent the domain object which
* should contain the newly-created domain object
* in its composition
* @memberof platform/commonUI/browse.CreationService#
*/
createObject: createObject
};
@ -139,3 +141,4 @@ define(
return CreationService;
}
);

View File

@ -30,6 +30,7 @@ define(
* Controller for the "locator" control, which provides the
* user with the ability to select a domain object as the
* destination for a newly-created object in the Create menu.
* @memberof platform/commonUI/browse
* @constructor
*/
function LocatorController($scope) {
@ -79,3 +80,4 @@ define(
return LocatorController;
}
);

View File

@ -31,6 +31,7 @@ define(
/**
* The navigate action navigates to a specific domain object.
* @memberof platform/commonUI/browse
* @constructor
*/
function NavigateAction(navigationService, $q, context) {
@ -46,6 +47,7 @@ define(
* Navigate to the object described in the context.
* @returns {Promise} a promise that is resolved once the
* navigation has been updated
* @memberof platform/commonUI/browse.NavigateAction#
*/
perform: perform
};
@ -64,4 +66,4 @@ define(
return NavigateAction;
}
);
);

View File

@ -32,6 +32,7 @@ define(
/**
* The navigation service maintains the application's current
* navigation state, and allows listening for changes thereto.
* @memberof platform/commonUI/browse
* @constructor
*/
function NavigationService() {
@ -68,12 +69,14 @@ define(
return {
/**
* Get the current navigation state.
* @memberof platform/commonUI/browse.NavigationService#
*/
getNavigation: getNavigation,
/**
* Set the current navigation state. Thiswill invoke listeners.
* @param {DomainObject} value the domain object to navigate
* to
* @memberof platform/commonUI/browse.NavigationService#
*/
setNavigation: setNavigation,
/**
@ -82,6 +85,7 @@ define(
* this changes.
* @param {function} callback the callback to invoke when
* navigation state changes
* @memberof platform/commonUI/browse.NavigationService#
*/
addListener: addListener,
/**
@ -89,6 +93,7 @@ define(
* @param {function} callback the callback which should
* no longer be invoked when navigation state
* changes
* @memberof platform/commonUI/browse.NavigationService#
*/
removeListener: removeListener
};
@ -96,4 +101,4 @@ define(
return NavigationService;
}
);
);

View File

@ -35,12 +35,14 @@ define(
/**
* The fullscreen action toggles between fullscreen display
* and regular in-window display.
* @memberof platform/commonUI/browse
* @constructor
*/
function FullscreenAction(context) {
return {
/**
* Toggle full screen state
* @memberof platform/commonUI/browse.FullscreenAction#
*/
perform: function () {
screenfull.toggle();
@ -48,6 +50,7 @@ define(
/**
* Get metadata about this action, including the
* applicable glyph to display.
* @memberof platform/commonUI/browse.FullscreenAction#
*/
getMetadata: function () {
// We override getMetadata, because the glyph and
@ -67,4 +70,4 @@ define(
return FullscreenAction;
}
);
);

View File

@ -33,6 +33,7 @@ define(
/**
* The new tab action allows a domain object to be opened
* into a new browser tab.
* @memberof platform/commonUI/browse
* @constructor
*/
function NewTabAction(urlService, $window, context) {
@ -64,4 +65,4 @@ define(
return NewTabAction;
}
);
);

View File

@ -29,6 +29,7 @@ define(
/**
* Updates the title of the current window to reflect the name
* of the currently navigated-to domain object.
* @memberof platform/commonUI/browse
* @constructor
*/
function WindowTitler(navigationService, $rootScope, $document) {
@ -49,4 +50,4 @@ define(
return WindowTitler;
}
);
);

View File

@ -32,6 +32,7 @@ define(
* The dialog service is responsible for handling window-modal
* communication with the user, such as displaying forms for user
* input.
* @memberof platform/commonUI/dialog
* @constructor
*/
function DialogService(overlayService, $q, $log) {
@ -142,6 +143,7 @@ define(
* user has supplied; this may be rejected if
* user input cannot be obtained (for instance,
* because the user cancelled the dialog)
* @memberof platform/commonUI/dialog.DialogService#
*/
getUserInput: getUserInput,
/**
@ -149,6 +151,7 @@ define(
* which will be shown as buttons.
*
* @param dialogModel a description of the dialog to show
* @memberof platform/commonUI/dialog.DialogService#
*/
getUserChoice: getUserChoice
};
@ -156,4 +159,4 @@ define(
return DialogService;
}
);
);

View File

@ -43,6 +43,7 @@ define(
* particularly where a multiple-overlay effect is not specifically
* desired).
*
* @memberof platform/commonUI/dialog
* @constructor
*/
function OverlayService($document, $compile, $rootScope) {
@ -89,6 +90,7 @@ define(
* @param {object} overlayModel the model to pass to the
* included overlay template (this will be passed
* in via ng-model)
* @memberof platform/commonUI/dialog.OverlayService#
*/
createOverlay: createOverlay
};
@ -96,4 +98,4 @@ define(
return OverlayService;
}
);
);

View File

@ -29,6 +29,8 @@ define(
* The "Cancel" action; the action triggered by clicking Cancel from
* Edit Mode. Exits the editing user interface and invokes object
* capabilities to persist the changes that have been made.
* @constructor
* @memberof platform/commonUI/edit
*/
function CancelAction($location, urlService, context) {
var domainObject = context.domainObject;
@ -62,6 +64,7 @@ define(
*
* @returns {Promise} a promise that will be fulfilled when
* cancellation has completed
* @memberof platform/commonUI/edit.CancelAction#
*/
perform: function () {
return doCancel(getEditorCapability())
@ -84,4 +87,4 @@ define(
return CancelAction;
}
);
);

View File

@ -42,6 +42,7 @@ define(
* mode (typically triggered by the Edit button.) This will
* show the user interface for editing (by way of a change in
* route)
* @memberof platform/commonUI/edit
* @constructor
*/
function EditAction($location, navigationService, $log, context) {
@ -63,6 +64,7 @@ define(
return {
/**
* Enter edit mode.
* @memberof platform/commonUI/edit.EditAction#
*/
perform: function () {
navigationService.setNavigation(domainObject);
@ -87,4 +89,4 @@ define(
return EditAction;
}
);
);

View File

@ -29,6 +29,8 @@ define(
/**
* Add one domain object to another's composition.
* @constructor
* @memberof platform/commonUI/edit
*/
function LinkAction(context) {
var domainObject = (context || {}).domainObject,
@ -58,6 +60,7 @@ define(
return {
/**
* Perform this action.
* @memberof platform/commonUI/edit.LinkAction#
*/
perform: function () {
return selectedId && doLink();
@ -67,4 +70,4 @@ define(
return LinkAction;
}
);
);

View File

@ -38,6 +38,7 @@ define(
* @param {DialogService} dialogService a service which will show the dialog
* @param {DomainObject} object the object to be edited
* @param {ActionContext} context the context in which this action is performed
* @memberof platform/commonUI/edit
* @constructor
*/
function PropertiesAction(dialogService, context) {
@ -77,6 +78,7 @@ define(
* Perform this action.
* @return {Promise} a promise which will be
* fulfilled when the action has completed.
* @memberof platform/commonUI/edit.PropertiesAction#
*/
perform: function () {
var type = object.getCapability('type');
@ -106,3 +108,4 @@ define(
);

View File

@ -37,6 +37,7 @@ define(
* @param {TypeImpl} type the type of domain object for which properties
* will be specified
* @param {DomainObject} the object for which properties will be set
* @memberof platform/commonUI/edit
* @constructor
* @memberof module:common/actions/properties-dialog
*/
@ -47,6 +48,7 @@ define(
/**
* Get sections provided by this dialog.
* @return {FormStructure} the structure of this form
* @memberof platform/commonUI/edit.PropertiesDialog#
*/
getFormStructure: function () {
return {
@ -66,6 +68,7 @@ define(
* Get the initial state of the form shown by this dialog
* (based on the object model)
* @returns {object} initial state of the form
* @memberof platform/commonUI/edit.PropertiesDialog#
*/
getInitialFormValue: function () {
// Start with initial values for properties
@ -77,6 +80,7 @@ define(
},
/**
* Update a domain object model based on the value of a form.
* @memberof platform/commonUI/edit.PropertiesDialog#
*/
updateModel: function (model, formValue) {
// Update all properties
@ -91,4 +95,4 @@ define(
return PropertiesDialog;
}
);
);

View File

@ -37,6 +37,7 @@ define(
*
* @param {DomainObject} object the object to be removed
* @param {ActionContext} context the context in which this action is performed
* @memberof platform/commonUI/edit
* @constructor
* @memberof module:editor/actions/remove-action
*/
@ -47,6 +48,7 @@ define(
* Check whether an object ID matches the ID of the object being
* removed (used to filter a parent's composition to handle the
* removal.)
* @memberof platform/commonUI/edit.RemoveAction#
*/
function isNotObject(otherObjectId) {
return otherObjectId !== object.getId();
@ -55,6 +57,7 @@ define(
/**
* Mutate a parent object such that it no longer contains the object
* which is being removed.
* @memberof platform/commonUI/edit.RemoveAction#
*/
function doMutate(model) {
model.composition = model.composition.filter(isNotObject);
@ -63,6 +66,7 @@ define(
/**
* Invoke persistence on a domain object. This will be called upon
* the removed object's parent (as its composition will have changed.)
* @memberof platform/commonUI/edit.RemoveAction#
*/
function doPersist(domainObject) {
var persistence = domainObject.getCapability('persistence');
@ -74,6 +78,7 @@ define(
* capability.
* @param {ContextCapability} contextCapability the "context" capability
* of the domain object being removed.
* @memberof platform/commonUI/edit.RemoveAction#
*/
function removeFromContext(contextCapability) {
var parent = contextCapability.getParent();
@ -89,6 +94,7 @@ define(
* Perform this action.
* @return {module:core/promises.Promise} a promise which will be
* fulfilled when the action has completed.
* @memberof platform/commonUI/edit.RemoveAction#
*/
perform: function () {
return $q.when(object.getCapability('context'))
@ -113,4 +119,4 @@ define(
return RemoveAction;
}
);
);

View File

@ -30,6 +30,8 @@ define(
* The "Save" action; the action triggered by clicking Save from
* Edit Mode. Exits the editing user interface and invokes object
* capabilities to persist the changes that have been made.
* @constructor
* @memberof platform/commonUI/edit
*/
function SaveAction($location, urlService, context) {
var domainObject = context.domainObject;
@ -57,6 +59,7 @@ define(
*
* @returns {Promise} a promise that will be fulfilled when
* cancellation has completed
* @memberof platform/commonUI/edit.SaveAction#
*/
perform: function () {
return doSave().then(returnToBrowse);
@ -78,4 +81,4 @@ define(
return SaveAction;
}
);
);

View File

@ -35,6 +35,8 @@ define(
* 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 EditableCompositionCapability(
contextCapability,
@ -54,4 +56,4 @@ define(
);
};
}
);
);

View File

@ -35,6 +35,8 @@ define(
* 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 EditableContextCapability(
contextCapability,
@ -72,4 +74,4 @@ define(
return capability;
};
}
);
);

View File

@ -35,6 +35,8 @@ define(
* 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,
@ -115,4 +117,4 @@ define(
return capability;
};
}
);
);

View File

@ -35,6 +35,8 @@ define(
* 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
*/
function EditablePersistenceCapability(
persistenceCapability,
@ -62,4 +64,4 @@ define(
return EditablePersistenceCapability;
}
);
);

View File

@ -35,6 +35,8 @@ define(
* 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 EditableRelationshipCapability(
relationshipCapability,
@ -54,4 +56,4 @@ define(
);
};
}
);
);

View File

@ -39,6 +39,8 @@ define(
* 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 EditorCapability(
persistenceCapability,
@ -83,6 +85,7 @@ define(
* 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#
*/
save: function (nonrecursive) {
return nonrecursive ?
@ -95,6 +98,7 @@ define(
* 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#
*/
cancel: function () {
return resolvePromise(undefined);
@ -102,6 +106,7 @@ define(
/**
* Check if there are any unsaved changes.
* @returns {boolean} true if there are unsaved changes
* @memberof platform/commonUI/edit.EditorCapability#
*/
dirty: function () {
return cache.dirty();
@ -109,4 +114,4 @@ define(
};
};
}
);
);

View File

@ -33,6 +33,7 @@ define(
/**
* Controller which supplies action instances for Save/Cancel.
* @memberof platform/commonUI/edit
* @constructor
*/
function EditActionController($scope) {
@ -51,4 +52,4 @@ define(
return EditActionController;
}
);
);

View File

@ -33,6 +33,7 @@ define(
* Controller which is responsible for populating the scope for
* Edit mode; introduces an editable version of the currently
* navigated domain object into the scope.
* @memberof platform/commonUI/edit
* @constructor
*/
function EditController($scope, $q, navigationService) {
@ -55,6 +56,7 @@ define(
/**
* Get the domain object which is navigated-to.
* @returns {DomainObject} the domain object that is navigated-to
* @memberof platform/commonUI/edit.EditController#
*/
navigatedObject: function () {
return navigatedObject;
@ -64,6 +66,7 @@ define(
* away from Edit mode while unsaved changes are present.
* @returns {string} the warning to show, or undefined if
* there are no unsaved changes
* @memberof platform/commonUI/edit.EditController#
*/
getUnloadWarning: function () {
var editorCapability = navigatedObject &&
@ -79,4 +82,4 @@ define(
return EditController;
}
);
);

View File

@ -28,6 +28,7 @@ define(
/**
* Supports the Library and Elements panes in Edit mode.
* @memberof platform/commonUI/edit
* @constructor
*/
function EditPanesController($scope) {
@ -56,6 +57,7 @@ define(
* Get the root-level domain object, as reported by the
* represented domain object.
* @returns {DomainObject} the root object
* @memberof platform/commonUI/edit.EditPanesController#
*/
getRoot: function () {
return root;
@ -65,4 +67,4 @@ define(
return EditPanesController;
}
);
);

View File

@ -31,6 +31,7 @@ define(
* to this attribute will be evaluated during page navigation events
* and, if it returns a truthy value, will be used to populate a
* prompt to the user to confirm this navigation.
* @memberof platform/commonUI/edit
* @constructor
* @param $window the window
*/
@ -102,4 +103,4 @@ define(
return MCTBeforeUnload;
}
);
);

View File

@ -68,6 +68,8 @@ define(
* which need to behave differently in edit mode,
* and provides a "working copy" of the object's
* model to allow changes to be easily cancelled.
* @constructor
* @memberof platform/commonUI/edit
*/
function EditableDomainObject(domainObject, $q) {
// The cache will hold all domain objects reached from
@ -109,4 +111,4 @@ define(
return EditableDomainObject;
}
);
);

View File

@ -51,6 +51,7 @@ define(
* an argument, and returns an editable domain object as its
* result.
* @param $q Angular's $q, for promise handling
* @memberof platform/commonUI/edit
* @constructor
* @memberof module:editor/object/editable-domain-object-cache
*/
@ -66,6 +67,7 @@ define(
*
* @param {DomainObject} domainObject the regular domain object
* @returns {DomainObject} the domain object in an editable form
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
getEditableObject: function (domainObject) {
var type = domainObject.getCapability('type');
@ -94,6 +96,7 @@ define(
* Check if a domain object is (effectively) the top-level
* object in this editable subgraph.
* @returns {boolean} true if it is the root
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
isRoot: function (domainObject) {
return domainObject === root;
@ -104,6 +107,7 @@ define(
* included in the bulk save invoked when editing completes.
*
* @param {DomainObject} domainObject the domain object
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
markDirty: function (domainObject) {
dirty[domainObject.getId()] = domainObject;
@ -114,12 +118,14 @@ define(
* save operation.)
*
* @param {DomainObject} domainObject the domain object
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
markClean: function (domainObject) {
delete dirty[domainObject.getId()];
},
/**
* Initiate a save on all objects that have been cached.
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
saveAll: function () {
// Get a list of all dirty objects
@ -140,6 +146,7 @@ define(
/**
* Check if any objects have been marked dirty in this cache.
* @returns {boolean} true if objects are dirty
* @memberof platform/commonUI/edit.EditableDomainObjectCache#
*/
dirty: function () {
return Object.keys(dirty).length > 0;
@ -150,3 +157,4 @@ define(
return EditableDomainObjectCache;
}
);

View File

@ -31,6 +31,7 @@ define(
* made editable, to support a group that can be saved all-at-once.
* This is useful in Edit mode, which is launched for a specific
* object but may contain changes across many objects.
* @memberof platform/commonUI/edit
* @constructor
*/
function EditableModelCache() {
@ -47,6 +48,7 @@ define(
* Get this domain object's model from the cache (or
* place it in the cache if it isn't in the cache yet)
* @returns a clone of the domain object's model
* @memberof platform/commonUI/edit.EditableModelCache#
*/
getCachedModel: function (domainObject) {
var id = domainObject.getId();
@ -60,4 +62,4 @@ define(
return EditableModelCache;
}
);
);

View File

@ -30,6 +30,7 @@ define(
* Policy controlling when the `edit` and/or `properties` actions
* can appear as applicable actions of the `view-control` category
* (shown as buttons in the top-right of browse mode.)
* @memberof platform/commonUI/edit
* @constructor
*/
function EditActionPolicy() {
@ -54,6 +55,7 @@ define(
* @param {Action} action the action
* @param context the context
* @returns {boolean} true if not disallowed
* @memberof platform/commonUI/edit.EditActionPolicy#
*/
allow: function (action, context) {
var key = action.getMetadata().key,
@ -79,4 +81,4 @@ define(
return EditActionPolicy;
}
);
);

View File

@ -28,6 +28,7 @@ define(
/**
* Policy controlling which views should be visible in Edit mode.
* @memberof platform/commonUI/edit
* @constructor
*/
function EditableViewPolicy() {
@ -38,6 +39,7 @@ define(
* @param {Action} action the action
* @param domainObject the domain object which will be viewed
* @returns {boolean} true if not disallowed
* @memberof platform/commonUI/edit.EditableViewPolicy#
*/
allow: function (view, domainObject) {
// If a view is flagged as non-editable, only allow it
@ -54,4 +56,4 @@ define(
return EditableViewPolicy;
}
);
);

View File

@ -41,6 +41,7 @@ define(
* and may be reused for different domain objects and/or
* representations resulting from changes there.
*
* @memberof platform/commonUI/edit
* @constructor
*/
function EditRepresenter($q, $log, scope) {
@ -113,10 +114,12 @@ define(
* definition of the representation in use
* @param {DomainObject} domainObject the domain object
* being represented
* @memberof platform/commonUI/edit.EditRepresenter#
*/
represent: represent,
/**
* Release any resources associated with this representer.
* @memberof platform/commonUI/edit.EditRepresenter#
*/
destroy: destroy
};
@ -124,4 +127,4 @@ define(
return EditRepresenter;
}
);
);

View File

@ -38,6 +38,7 @@ define(
*
* @param structure toolbar structure, as provided by view definition
* @param {Function} commit callback to invoke after changes
* @memberof platform/commonUI/edit
* @constructor
*/
function EditToolbar(structure, commit) {
@ -221,6 +222,7 @@ define(
* Set the current selection. Visisbility of sections
* and items in the toolbar will be updated to match this.
* @param {Array} s the new selection
* @memberof platform/commonUI/edit.EditToolbar#
*/
setSelection: function (s) {
selection = s;
@ -231,6 +233,7 @@ define(
* Get the structure of the toolbar, as appropriate to
* pass to `mct-toolbar`.
* @returns the toolbar structure
* @memberof platform/commonUI/edit.EditToolbar#
*/
getStructure: function () {
return toolbarStructure;
@ -239,6 +242,7 @@ define(
* Get the current state of the toolbar, as appropriate
* to two-way bind to the state handled by `mct-toolbar`.
* @returns {Array} state of the toolbar
* @memberof platform/commonUI/edit.EditToolbar#
*/
getState: function () {
return toolbarState;
@ -248,6 +252,7 @@ define(
* @param {number} index the index of the corresponding
* element in the state array
* @param value the new value to convey to the selection
* @memberof platform/commonUI/edit.EditToolbar#
*/
updateState: function (index, value) {
return updateProperties(properties[index], value);
@ -259,3 +264,4 @@ define(
}
);

View File

@ -33,6 +33,7 @@ define(
* The EditToolbarRepresenter populates the toolbar in Edit mode
* based on a view's definition.
* @param {Scope} scope the Angular scope of the representation
* @memberof platform/commonUI/edit
* @constructor
*/
function EditToolbarRepresenter(scope, element, attrs) {
@ -136,10 +137,12 @@ define(
* definition of the representation in use
* @param {DomainObject} domainObject the domain object
* being represented
* @memberof platform/commonUI/edit.EditToolbarRepresenter#
*/
represent: (attrs || {}).toolbar ? represent : noop,
/**
* Release any resources associated with this representer.
* @memberof platform/commonUI/edit.EditToolbarRepresenter#
*/
destroy: (attrs || {}).toolbar ? destroy : noop
};
@ -147,4 +150,4 @@ define(
return EditToolbarRepresenter;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* * The selection, for single selected elements within the
* view.
*
* @memberof platform/commonUI/edit
* @constructor
*/
function EditToolbarSelection() {
@ -106,22 +107,26 @@ define(
/**
* Check if an object is currently selected.
* @returns true if selected, otherwise false
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
selected: isSelected,
/**
* Select an object.
* @param obj the object to select
* @returns {boolean} true if selection changed
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
select: select,
/**
* Clear the current selection.
* @returns {boolean} true if selection changed
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
deselect: deselect,
/**
* Get the currently-selected object.
* @returns the currently selected object
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
get: get,
/**
@ -129,6 +134,7 @@ define(
* the view itself.)
* @param [proxy] the view proxy (if setting)
* @returns the current view proxy
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
proxy: proxy,
/**
@ -136,6 +142,7 @@ define(
* selection proxy. It is generally not advisable to
* mutate this array directly.
* @returns {Array} all selections
* @memberof platform/commonUI/edit.EditToolbarSelection#
*/
all: all
};
@ -143,4 +150,4 @@ define(
return EditToolbarSelection;
}
);
);

View File

@ -29,6 +29,7 @@ define(
/**
* The StyleSheetLoader adds links to style sheets exposed from
* various bundles as extensions of category `stylesheets`.
* @memberof platform/commonUI/general
* @constructor
* @param {object[]} stylesheets stylesheet extension definitions
* @param $document Angular's jqLite-wrapped document element
@ -62,4 +63,4 @@ define(
return StyleSheetLoader;
}
);
);

View File

@ -42,6 +42,7 @@ define(
* * `ungrouped`: All actions which did not have a defined
* group.
*
* @memberof platform/commonUI/general
* @constructor
*/
function ActionGroupController($scope) {
@ -102,4 +103,4 @@ define(
return ActionGroupController;
}
);
);

View File

@ -29,6 +29,7 @@ define(
/**
* Controller for the bottombar template. Exposes
* available indicators (of extension category "indicators")
* @memberof platform/commonUI/general
* @constructor
*/
function BottomBarController(indicators) {
@ -49,6 +50,7 @@ define(
* Get all indicators to display.
* @returns {Indicator[]} all indicators
* to display in the bottom bar.
* @memberof platform/commonUI/general.BottomBarController#
*/
getIndicators: function () {
return indicators;
@ -58,4 +60,4 @@ define(
return BottomBarController;
}
);
);

View File

@ -31,6 +31,7 @@ define(
* menus) where clicking elsewhere in the document while the toggle
* is in an active state is intended to dismiss the toggle.
*
* @memberof platform/commonUI/general
* @constructor
* @param $scope the scope in which this controller is active
* @param $document the document element, injected by Angular
@ -72,6 +73,7 @@ define(
/**
* Get the current state of the toggle.
* @return {boolean} true if active
* @memberof platform/commonUI/general.ClickAwayController#
*/
isActive: function () {
return state;
@ -79,6 +81,7 @@ define(
/**
* Set a new state for the toggle.
* @return {boolean} true to activate
* @memberof platform/commonUI/general.ClickAwayController#
*/
setState: function (newState) {
if (state !== newState) {
@ -88,6 +91,7 @@ define(
/**
* Toggle the current state; activate if it is inactive,
* deactivate if it is active.
* @memberof platform/commonUI/general.ClickAwayController#
*/
toggle: function () {
changeState();
@ -98,4 +102,4 @@ define(
return ClickAwayController;
}
);
);

View File

@ -33,6 +33,7 @@ define(
* Controller for the context menu. Maintains an up-to-date
* list of applicable actions (those from category "contextual")
*
* @memberof platform/commonUI/general
* @constructor
*/
function ContextMenuController($scope) {
@ -49,4 +50,4 @@ define(
return ContextMenuController;
}
);
);

View File

@ -54,6 +54,7 @@ define(
* parameter it received.) Getter-setter functions are never the
* target of a scope assignment and so avoid this problem.
*
* @memberof platform/commonUI/general
* @constructor
* @param {Scope} $scope the controller's scope
*/
@ -87,4 +88,4 @@ define(
return GetterSetterController;
}
);
);

View File

@ -30,6 +30,7 @@ define(
/**
* Controller for the domain object selector control.
* @memberof platform/commonUI/general
* @constructor
* @param {ObjectService} objectService service from which to
* read domain objects
@ -102,6 +103,7 @@ define(
/**
* Get the root object to show in the left-hand tree.
* @returns {DomainObject} the root object
* @memberof platform/commonUI/general.SelectorController#
*/
root: function () {
return rootObject;
@ -109,6 +111,7 @@ define(
/**
* Add a domain object to the list of selected objects.
* @param {DomainObject} the domain object to select
* @memberof platform/commonUI/general.SelectorController#
*/
select: function (domainObject) {
var id = domainObject && domainObject.getId(),
@ -122,6 +125,7 @@ define(
/**
* Remove a domain object from the list of selected objects.
* @param {DomainObject} the domain object to select
* @memberof platform/commonUI/general.SelectorController#
*/
deselect: function (domainObject) {
var id = domainObject && domainObject.getId(),
@ -140,6 +144,7 @@ define(
/**
* Get the currently-selected domain objects.
* @returns {DomainObject[]} the current selection
* @memberof platform/commonUI/general.SelectorController#
*/
selected: function () {
return selectedObjects;
@ -153,4 +158,4 @@ define(
return SelectorController;
}
);
);

View File

@ -32,6 +32,7 @@ define(
/**
* Controller for the splitter in Browse mode. Current implementation
* uses many hard-coded constants; this could be generalized.
* @memberof platform/commonUI/general
* @constructor
*/
function SplitPaneController() {
@ -44,6 +45,7 @@ define(
* Get the current position of the splitter, in pixels
* from the left edge.
* @returns {number} position of the splitter, in pixels
* @memberof platform/commonUI/general.SplitPaneController#
*/
state: function (defaultState) {
// Set the state to the desired default, if we don't have a
@ -58,6 +60,7 @@ define(
* Begin moving the splitter; this will note the splitter's
* current position, which is necessary for correct
* interpretation of deltas provided by mct-drag.
* @memberof platform/commonUI/general.SplitPaneController#
*/
startMove: function () {
start = current;
@ -68,6 +71,7 @@ define(
* This movement is relative to the position of the
* splitter when startMove was last invoked.
* @param {number} delta number of pixels to move
* @memberof platform/commonUI/general.SplitPaneController#
*/
move: function (delta, minimum, maximum) {
// Ensure defaults for minimum/maximum
@ -87,4 +91,4 @@ define(
return SplitPaneController;
}
);
);

View File

@ -30,6 +30,7 @@ define(
* A ToggleController is used to activate/deactivate things.
* A common usage is for "twistie"
*
* @memberof platform/commonUI/general
* @constructor
*/
function ToggleController() {
@ -39,6 +40,7 @@ define(
/**
* Get the current state of the toggle.
* @return {boolean} true if active
* @memberof platform/commonUI/general.ToggleController#
*/
isActive: function () {
return state;
@ -46,6 +48,7 @@ define(
/**
* Set a new state for the toggle.
* @return {boolean} true to activate
* @memberof platform/commonUI/general.ToggleController#
*/
setState: function (newState) {
state = newState;
@ -53,6 +56,7 @@ define(
/**
* Toggle the current state; activate if it is inactive,
* deactivate if it is active.
* @memberof platform/commonUI/general.ToggleController#
*/
toggle: function () {
state = !state;
@ -63,4 +67,4 @@ define(
return ToggleController;
}
);
);

View File

@ -48,6 +48,7 @@ define(
* node expansion when this tree node's _subtree_ will contain
* the navigated object (recursively, this becomes an
* expand-to-show-navigated-object behavior.)
* @memberof platform/commonUI/general
* @constructor
*/
function TreeNodeController($scope, $timeout, $rootScope) {
@ -148,11 +149,13 @@ define(
* This method should be called when a node is expanded
* to record that this has occurred, to support one-time
* lazy loading of the node's subtree.
* @memberof platform/commonUI/general.TreeNodeController#
*/
trackExpansion: trackExpansion,
/**
* Check if this not has ever been expanded.
* @returns true if it has been expanded
* @memberof platform/commonUI/general.TreeNodeController#
*/
hasBeenExpanded: function () {
return hasBeenExpanded;
@ -163,6 +166,7 @@ define(
* An object will be highlighted if it matches
* ngModel.selectedObject
* @returns true if this should be highlighted
* @memberof platform/commonUI/general.TreeNodeController#
*/
isSelected: function () {
return isSelected;
@ -172,4 +176,4 @@ define(
return TreeNodeController;
}
);
);

View File

@ -32,6 +32,7 @@ define(
/**
* Controller for the view switcher; populates and maintains a list
* of applicable views for a represented domain object.
* @memberof platform/commonUI/general
* @constructor
*/
function ViewSwitcherController($scope, $timeout) {
@ -71,3 +72,4 @@ define(
return ViewSwitcherController;
}
);

View File

@ -39,6 +39,7 @@ define(
* plain string attribute, instead of as an Angular
* expression.
*
* @memberof platform/commonUI/general
* @constructor
*/
function MCTContainer(containers) {
@ -96,4 +97,4 @@ define(
return MCTContainer;
}
);
);

View File

@ -44,6 +44,7 @@ define(
* and vertical pixel offset of the current mouse position
* relative to the mouse position where dragging began.
*
* @memberof platform/commonUI/general
* @constructor
*
*/
@ -157,3 +158,4 @@ define(
return MCTDrag;
}
);

View File

@ -49,6 +49,7 @@ define(
* This is an Angular expression, and it will be re-evaluated after
* each interval.
*
* @memberof platform/commonUI/general
* @constructor
*
*/
@ -111,4 +112,4 @@ define(
return MCTResize;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* This is exposed as two directives in `bundle.json`; the difference
* is handled purely by parameterization.
*
* @memberof platform/commonUI/general
* @constructor
* @param $parse Angular's $parse
* @param {string} property property to manage within the HTML element
@ -80,4 +81,4 @@ define(
return MCTScroll;
}
);
);

View File

@ -91,6 +91,7 @@ define(
* etc. can be set on that element to control the splitter's
* allowable positions.
*
* @memberof platform/commonUI/general
* @constructor
*/
function MCTSplitPane($parse, $log) {
@ -213,3 +214,4 @@ define(
}
);

View File

@ -39,6 +39,7 @@ define(
/**
* Implements `mct-splitter` directive.
* @memberof platform/commonUI/general
* @constructor
*/
function MCTSplitter() {
@ -88,3 +89,4 @@ define(
}
);

View File

@ -32,6 +32,8 @@ define(
/**
* The url service handles calls for url paths
* using domain objects.
* @constructor
* @memberof platform/commonUI/general
*/
function UrlService($location) {
// Returns the url for the mode wanted
@ -73,6 +75,7 @@ define(
* for the path
* @param {DomainObject} value of the domain object
* to get the path of
* @memberof platform/commonUI/general.UrlService#
*/
urlForNewTab: urlForNewTab,
/**
@ -83,6 +86,7 @@ define(
* for the path
* @param {DomainObject} value of the domain object
* to get the path of
* @memberof platform/commonUI/general.UrlService#
*/
urlForLocation: urlForLocation
};
@ -90,4 +94,4 @@ define(
return UrlService;
}
);
);

View File

@ -33,4 +33,4 @@ define({
// Max width and margins allowed for bubbles; defined in /platform/commonUI/general/res/sass/_constants.scss
BUBBLE_MARGIN_LR: 10,
BUBBLE_MAX_WIDTH: 300
});
});

View File

@ -30,6 +30,7 @@ define(
* The `info` gesture displays domain object metadata in a
* bubble on hover.
*
* @memberof platform/commonUI/inspect
* @constructor
* @param $timeout Angular's `$timeout`
* @param {InfoService} infoService a service which shows info bubbles
@ -103,6 +104,7 @@ define(
* Detach any event handlers associated with this gesture.
* @memberof InfoGesture
* @method
* @memberof platform/commonUI/inspect.InfoGesture#
*/
destroy: function () {
// Dismiss any active bubble...
@ -119,3 +121,4 @@ define(
}
);

View File

@ -31,6 +31,7 @@ define(
/**
* Displays informative content ("info bubbles") for the user.
* @memberof platform/commonUI/inspect
* @constructor
*/
function InfoService($compile, $document, $window, $rootScope) {
@ -85,6 +86,7 @@ define(
* pixel coordinates.
* @returns {Function} a function that may be invoked to
* dismiss the info bubble
* @memberof platform/commonUI/inspect.InfoService#
*/
display: display
};
@ -93,3 +95,4 @@ define(
return InfoService;
}
);

View File

@ -32,6 +32,8 @@ define(
* which capabilities. This supports composition policy (rules
* for which objects can contain which other objects) which
* sometimes is determined based on the presence of capabilities.
* @constructor
* @memberof platform/containment
*/
function CapabilityTable(typeService, capabilityService) {
var table = {};
@ -64,6 +66,7 @@ define(
/**
* Check if a type is expected to expose a specific
* capability.
* @memberof platform/containment.CapabilityTable#
*/
hasCapability: function (typeKey, capabilityKey) {
return (table[capabilityKey] || {})[typeKey];
@ -73,4 +76,4 @@ define(
return CapabilityTable;
}
);
);

View File

@ -34,6 +34,8 @@ define(
* since it's delegated to a different policy category.
* To avoid a circular dependency, the service is obtained via
* Angular's `$injector`.
* @constructor
* @memberof platform/containment
*/
function ComposeActionPolicy($injector) {
var policyService;
@ -61,6 +63,7 @@ define(
* Check whether or not a compose action should be allowed
* in this context.
* @returns {boolean} true if it may be allowed
* @memberof platform/containment.ComposeActionPolicy#
*/
allow: function (candidate, context) {
if (candidate.getMetadata().key === 'compose') {
@ -77,4 +80,4 @@ define(
return ComposeActionPolicy;
}
);
);

View File

@ -8,12 +8,15 @@ define(
/**
* Policy allowing composition only for domain object types which
* have a composition property.
* @constructor
* @memberof platform/containment
*/
function CompositionModelPolicy() {
return {
/**
* Is the type identified by the candidate allowed to
* contain the type described by the context?
* @memberof platform/containment.CompositionModelPolicy#
*/
allow: function (candidate, context) {
return Array.isArray(
@ -25,4 +28,4 @@ define(
return CompositionModelPolicy;
}
);
);

View File

@ -28,6 +28,7 @@ define(
/**
* Disallow composition changes to objects which are not mutable.
* @memberof platform/containment
* @constructor
*/
function CompositionMutabilityPolicy() {
@ -36,6 +37,7 @@ define(
* Is the type identified by the candidate allowed to
* contain the type described by the context?
* @param {Type} candidate the type of domain object
* @memberof platform/containment.CompositionMutabilityPolicy#
*/
allow: function (candidate) {
// Equate creatability with mutability; that is, users
@ -48,4 +50,4 @@ define(
return CompositionMutabilityPolicy;
}
);
);

View File

@ -28,6 +28,8 @@ define(
/**
* Defines composition policy as driven by type metadata.
* @constructor
* @memberof platform/containment
*/
function CompositionPolicy($injector) {
// We're really just wrapping the containment table and rephrasing
@ -45,6 +47,7 @@ define(
/**
* Is the type identified by the candidate allowed to
* contain the type described by the context?
* @memberof platform/containment.CompositionPolicy#
*/
allow: function (candidate, context) {
return getTable().canContain(candidate, context);
@ -54,4 +57,4 @@ define(
return CompositionPolicy;
}
);
);

View File

@ -37,6 +37,8 @@ define(
* start time (plug-in support means this cannot be determined
* prior to that, but we don't want to redo these calculations
* every time policy is checked.)
* @constructor
* @memberof platform/containment
*/
function ContainmentTable(typeService, capabilityService) {
var types = typeService.listTypes(),
@ -103,6 +105,7 @@ define(
* Check if domain objects of one type can contain domain
* objects of another type.
* @returns {boolean} true if allowable
* @memberof platform/containment.ContainmentTable#
*/
canContain: function (containerType, containedType) {
var set = table[containerType.getKey()] || {};
@ -116,4 +119,4 @@ define(
return ContainmentTable;
}
);
);

View File

@ -31,6 +31,7 @@ define(
* actions for a given context, results from all
* services will be assembled and concatenated.
*
* @memberof platform/core
* @constructor
* @param {ActionProvider[]} actionProviders an array
* of action services
@ -65,6 +66,7 @@ define(
*
* @method
* @memberof ActionAggregator
* @memberof platform/core.ActionAggregator#
*/
getActions: getActions
};
@ -72,4 +74,4 @@ define(
return ActionAggregator;
}
);
);

View File

@ -45,6 +45,7 @@ define(
* which the action will be performed (also, the
* action which exposes the capability.)
*
* @memberof platform/core
* @constructor
*/
function ActionCapability($q, actionService, domainObject) {
@ -92,6 +93,7 @@ define(
* @returns {Promise} the result of the action that was
* performed, or undefined if no matching action
* was found.
* @memberof platform/core.ActionCapability#
*/
perform: performAction,
/**
@ -107,6 +109,7 @@ define(
* be taken as the "key" field to match against
* specific actions.
* @returns {Action[]} an array of matching actions
* @memberof platform/core.ActionCapability#
*/
getActions: getActions
};
@ -114,4 +117,4 @@ define(
return ActionCapability;
}
);
);

View File

@ -35,6 +35,7 @@ define(
* of actions exposed via extension (specifically, the "actions"
* category of extension.)
*
* @memberof platform/core
* @constructor
*/
function ActionProvider(actions) {
@ -145,6 +146,7 @@ define(
*
* @method
* @memberof ActionProvider
* @memberof platform/core.ActionProvider#
*/
getActions: getActions
};
@ -152,4 +154,4 @@ define(
return ActionProvider;
}
);
);

View File

@ -34,6 +34,7 @@ define(
* the actions it exposes always emit a log message when they are
* performed.
*
* @memberof platform/core
* @constructor
*/
function LoggingActionDecorator($log, actionService) {
@ -77,6 +78,7 @@ define(
*
* @method
* @memberof LoggingActionDecorator
* @memberof platform/core.LoggingActionDecorator#
*/
getActions: function () {
return actionService.getActions.apply(
@ -89,4 +91,4 @@ define(
return LoggingActionDecorator;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* require consulting the object service (e.g. to trigger a database
* query to retrieve the nested object models.)
*
* @memberof platform/core
* @constructor
*/
function CompositionCapability($injector, domainObject) {
@ -94,6 +95,7 @@ define(
* Request the composition of this object.
* @returns {Promise.<DomainObject[]>} a list of all domain
* objects which compose this domain object.
* @memberof platform/core.CompositionCapability#
*/
invoke: promiseComposition
};
@ -112,4 +114,4 @@ define(
return CompositionCapability;
}
);
);

View File

@ -36,6 +36,7 @@ define(
* those whose `composition` capability was used to access this
* object.)
*
* @memberof platform/core
* @constructor
*/
function ContextCapability(parentObject, domainObject) {
@ -50,6 +51,7 @@ define(
*
* @returns {DomainObject} the immediate parent of this
* domain object.
* @memberof platform/core.ContextCapability#
*/
getParent: function () {
return parentObject;
@ -72,6 +74,7 @@ define(
* @returns {DomainObject[]} the full composition ancestry
* of the domain object which exposed this
* capability.
* @memberof platform/core.ContextCapability#
*/
getPath: function () {
var parentPath = [],
@ -95,6 +98,7 @@ define(
*
* @returns {DomainObject} the deepest ancestor of the domain
* object which exposed this capability.
* @memberof platform/core.ContextCapability#
*/
getRoot: function () {
var parentContext = parentObject &&
@ -109,4 +113,4 @@ define(
return ContextCapability;
}
);
);

View File

@ -42,6 +42,7 @@ define(
* @param {DomainObject} parentObject the domain object from which
* the wrapped object was retrieved
*
* @memberof platform/core
* @constructor
*/
function ContextualDomainObject(domainObject, parentObject) {
@ -63,4 +64,4 @@ define(
return ContextualDomainObject;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* of constructor functions for capabilities, as
* exposed by extensions defined at the bundle level.
*
* @memberof platform/core
* @constructor
*/
function CoreCapabilityProvider(capabilities, $log) {
@ -84,6 +85,7 @@ define(
* @returns {Object.<string,function|Capability>} all
* capabilities known to be valid for this model, as
* key-value pairs
* @memberof platform/core.CoreCapabilityProvider#
*/
getCapabilities: getCapabilities
};
@ -92,3 +94,4 @@ define(
return CoreCapabilityProvider;
}
);

View File

@ -46,6 +46,7 @@ define(
* capabilities to be delegated.
*
* @param domainObject
* @memberof platform/core
* @constructor
*/
function DelegationCapability($q, domainObject) {
@ -96,6 +97,7 @@ define(
* @param {string} the name of the delegated capability
* @returns {DomainObject[]} the domain objects to which
* responsibility for this capability is delegated.
* @memberof platform/core.DelegationCapability#
*/
invoke: getDelegates,
/**
@ -105,6 +107,7 @@ define(
* @param {string} the name of the delegated capability
* @returns {DomainObject[]} the domain objects to which
* responsibility for this capability is delegated.
* @memberof platform/core.DelegationCapability#
*/
getDelegates: getDelegates,
doesDelegateCapability: doesDelegate
@ -115,4 +118,4 @@ define(
return DelegationCapability;
}
);
);

View File

@ -11,6 +11,8 @@ define(
* @property {string} name the human-readable name of this property
* @property {string} value the human-readable value of this property,
* for this specific domain object
* @constructor
* @memberof platform/core
*/
var TIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
@ -82,6 +84,7 @@ define(
/**
* Get metadata about this object.
* @returns {MetadataProperty[]} metadata about this object
* @memberof platform/core.MetadataCapability#
*/
invoke: getMetadata
};
@ -90,3 +93,4 @@ define(
return MetadataCapability;
}
);

View File

@ -71,6 +71,7 @@ define(
*
* @param {DomainObject} domainObject the domain object
* which will expose this capability
* @memberof platform/core
* @constructor
*/
function MutationCapability(topic, now, domainObject) {
@ -118,6 +119,7 @@ define(
return {
/**
* Alias of `mutate`, used to support useCapability.
* @memberof platform/core.MutationCapability#
*/
invoke: mutate,
/**
@ -146,6 +148,7 @@ define(
* used)
* @returns {Promise.<boolean>} a promise for the result
* of the mutation; true if changes were made.
* @memberof platform/core.MutationCapability#
*/
mutate: mutate,
/**
@ -155,6 +158,7 @@ define(
* invoke the function returned by this method.
* @param {Function} listener function to call on mutation
* @returns {Function} a function to stop listening
* @memberof platform/core.MutationCapability#
*/
listen: listen
};
@ -163,3 +167,4 @@ define(
return MutationCapability;
}
);

View File

@ -40,6 +40,7 @@ define(
* @param {DomainObject} the domain object which shall expose
* this capability
*
* @memberof platform/core
* @constructor
*/
function PersistenceCapability(persistenceService, SPACE, domainObject) {
@ -80,6 +81,7 @@ define(
* @returns {Promise} a promise which will be resolved
* if persistence is successful, and rejected
* if not.
* @memberof platform/core.PersistenceCapability#
*/
persist: function () {
updatePersistenceTimestamp();
@ -94,6 +96,7 @@ define(
* persistence.
* @returns {Promise} a promise which will be resolved
* when the update is complete
* @memberof platform/core.PersistenceCapability#
*/
refresh: function () {
var model = domainObject.getModel();
@ -114,6 +117,7 @@ define(
*
* @returns {string} the name of the space which should
* be used to persist this object
* @memberof platform/core.PersistenceCapability#
*/
getSpace: function () {
return SPACE;
@ -123,4 +127,4 @@ define(
return PersistenceCapability;
}
);
);

View File

@ -38,6 +38,7 @@ define(
* which are not intended to appear in the tree, but are instead
* intended only for special, limited usage.
*
* @memberof platform/core
* @constructor
*/
function RelationshipCapability($injector, domainObject) {
@ -109,6 +110,7 @@ define(
* List all types of relationships exposed by this
* object.
* @returns {string[]} a list of all relationship types
* @memberof platform/core.RelationshipCapability#
*/
listRelationships: listRelationships,
/**
@ -118,6 +120,7 @@ define(
* @param {string} key the type of relationship
* @returns {Promise.<DomainObject[]>} a promise for related
* domain objects
* @memberof platform/core.RelationshipCapability#
*/
getRelatedObjects: promiseRelationships
};
@ -136,4 +139,4 @@ define(
return RelationshipCapability;
}
);
);

View File

@ -30,6 +30,7 @@ define(
* The caching model decorator maintains a cache of loaded domain
* object models, and ensures that duplicate models for the same
* object are not provided.
* @memberof platform/core
* @constructor
*/
function CachingModelDecorator(modelService) {
@ -114,6 +115,7 @@ define(
* containing key-value pairs, where keys are
* ids and values are models
* @method
* @memberof platform/core.CachingModelDecorator#
*/
getModels: function (ids) {
var neededIds = ids.filter(notCached);
@ -133,4 +135,4 @@ define(
return CachingModelDecorator;
}
);
);

View File

@ -30,6 +30,8 @@ define(
* Adds placeholder domain object models for any models which
* fail to load from the underlying model service.
* @implements {ModelService}
* @constructor
* @memberof platform/core
*/
function MissingModelDecorator(modelService) {
function missingModel(id) {
@ -57,3 +59,4 @@ define(
return MissingModelDecorator;
}
);

View File

@ -33,6 +33,7 @@ define(
* Allows multiple services which provide models for domain objects
* to be treated as one.
*
* @memberof platform/core
* @constructor
* @param {ModelProvider[]} providers the model providers to be
* aggregated
@ -77,6 +78,7 @@ define(
* containing key-value pairs,
* where keys are object identifiers and values
* are object models.
* @memberof platform/core.ModelAggregator#
*/
getModels: function (ids) {
return $q.all(providers.map(function (provider) {
@ -90,4 +92,4 @@ define(
return ModelAggregator;
}
);
);

View File

@ -33,6 +33,7 @@ define(
* A model service which reads domain object models from an external
* persistence service.
*
* @memberof platform/core
* @constructor
* @param {PersistenceService} persistenceService the service in which
* domain object models are persisted.
@ -83,6 +84,7 @@ define(
* containing key-value pairs,
* where keys are object identifiers and values
* are object models.
* @memberof platform/core.PersistedModelProvider#
*/
getModels: promiseModels
};
@ -91,4 +93,4 @@ define(
return PersistedModelProvider;
}
);
);

View File

@ -39,6 +39,7 @@ define(
* exposes them all as composition of the root object ROOT,
* whose model is also provided by this service.
*
* @memberof platform/core
* @constructor
*/
function RootModelProvider(roots, $q, $log) {
@ -68,6 +69,7 @@ define(
* containing key-value pairs,
* where keys are object identifiers and values
* are object models.
* @memberof platform/core.RootModelProvider#
*/
getModels: function (ids) {
return baseProvider.getModels(ids).then(addRoot);
@ -77,4 +79,4 @@ define(
return RootModelProvider;
}
);
);

View File

@ -31,6 +31,7 @@ define(
/**
* Loads static models, provided as declared extensions of bundles.
* @memberof platform/core
* @constructor
*/
function StaticModelProvider(models, $q, $log) {
@ -69,6 +70,7 @@ define(
* ids and values are models
* @method
* @memberof StaticModelProvider#
* @memberof platform/core.StaticModelProvider#
*/
getModels: function (ids) {
var result = {};
@ -82,4 +84,4 @@ define(
return StaticModelProvider;
}
);
);

View File

@ -37,6 +37,7 @@ define(
* @param {object} model the "JSONifiable" state of the object
* @param {Object.<string, Capability>|function} capabilities all
* capabilities to be exposed by this object
* @memberof platform/core
* @constructor
*/
function DomainObject(id, model, capabilities) {
@ -45,6 +46,7 @@ define(
* Get the unique identifier for this domain object.
* @return {string} the domain object's unique identifier
* @memberof DomainObject#
* @memberof platform/core.DomainObject#
*/
getId: function () {
return id;
@ -59,6 +61,7 @@ define(
*
* @return {object} the domain object's persistent state
* @memberof DomainObject#
* @memberof platform/core.DomainObject#
*/
getModel: function () {
return model;
@ -73,6 +76,7 @@ define(
* @return {Capability} the named capability, or undefined
* if not present.
* @memberof DomainObject#
* @memberof platform/core.DomainObject#
*/
getCapability: function (name) {
var capability = capabilities[name];
@ -87,6 +91,7 @@ define(
* @param {string} name the name of the capability to
* check for
* @returns {boolean} true if provided
* @memberof platform/core.DomainObject#
*/
hasCapability: function hasCapability(name) {
return this.getCapability(name) !== undefined;
@ -110,6 +115,7 @@ define(
* @param {...*} [arguments] to pass to the invocation
* @returns {*}
* @memberof DomainObject#
* @memberof platform/core.DomainObject#
*/
useCapability: function (name) {
// Get tail of args to pass to invoke
@ -125,4 +131,4 @@ define(
return DomainObject;
}
);
);

View File

@ -38,6 +38,7 @@ define(
* which provides capabilities (dynamic behavior)
* for domain objects.
* @param $q Angular's $q, for promise consolidation
* @memberof platform/core
* @constructor
*/
function DomainObjectProvider(modelService, capabilityService, $q) {
@ -97,6 +98,7 @@ define(
* are string identifiers for domain objects, and
* values are the corresponding domain objects themselves.
* @memberof module:core/object/object-provider.ObjectProvider#
* @memberof platform/core.DomainObjectProvider#
*/
getObjects: getObjects
};
@ -104,4 +106,4 @@ define(
return DomainObjectProvider;
}
);
);

View File

@ -31,12 +31,15 @@ define(
* `Date.now()` which can be injected to support testability.
*
* @returns {Function} a function which returns current system time
* @constructor
* @memberof platform/core
*/
function Now() {
/**
* Get the current time.
* @returns {number} current time, in milliseconds since
* 1970-01-01 00:00:00Z
* @memberof platform/core.Now#
*/
return function () {
return Date.now();
@ -45,4 +48,4 @@ define(
return Now;
}
);
);

View File

@ -42,6 +42,8 @@ define(
* resolve to the returned value of `fn` whenever that is invoked.
*
* @returns {Function}
* @constructor
* @memberof platform/core
*/
function Throttle($timeout) {
/**
@ -52,6 +54,7 @@ define(
* @param {boolean} apply true if a `$apply` call should be
* invoked after this function executes; defaults to
* `false`.
* @memberof platform/core.Throttle#
*/
return function (fn, delay, apply) {
var activeTimeout;
@ -82,3 +85,4 @@ define(
return Throttle;
}
);

View File

@ -44,6 +44,8 @@ define(
* arguments) are private; each call returns a new instance.
*
* @returns {Function}
* @constructor
* @memberof platform/core
*/
function Topic() {
var topics = {};
@ -71,6 +73,7 @@ define(
/**
* Use and (if necessary) create a new topic.
* @param {string} [key] name of the topic to use
* @memberof platform/core.Topic#
*/
return function (key) {
if (arguments.length < 1) {
@ -85,3 +88,4 @@ define(
return Topic;
}
);

View File

@ -64,6 +64,8 @@ define(
* @param b the second object to be merged
* @param merger the merger, as described above
* @returns {*} the result of merging `a` and `b`
* @constructor
* @memberof platform/core
*/
function mergeModels(a, b, merger) {
var mergeFunction;
@ -102,4 +104,4 @@ define(
return mergeModels;
}
);
);

View File

@ -34,6 +34,7 @@ define(
* type directly available when working with that object, by way
* of a `domainObject.getCapability('type')` invocation.
*
* @memberof platform/core
* @constructor
* @param {TypeService} typeService the service which
* provides type information
@ -51,4 +52,4 @@ define(
return TypeCapability;
}
);
);

View File

@ -42,6 +42,8 @@ define(
* key-value pairs describing a type and its
* relationship to other types.
* @memberof module:core/type/type-impl
* @constructor
* @memberof platform/core
*/
function TypeImpl(typeDef) {
var inheritList = typeDef.inherits || [],
@ -60,6 +62,7 @@ define(
*
* @returns {string} the key which identifies this type
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
getKey: function () {
return typeDef.key;
@ -71,6 +74,7 @@ define(
*
* @returns {string} the human-readable name of this type
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
getName: function () {
return typeDef.name;
@ -82,6 +86,7 @@ define(
*
* @returns {string} the human-readable description of this type
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
getDescription: function () {
return typeDef.description;
@ -94,6 +99,7 @@ define(
*
* @returns {string} the glyph to be displayed
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
getGlyph: function () {
return typeDef.glyph;
@ -105,6 +111,7 @@ define(
*
* @return {Array<TypeProperty>} properties associated with
* objects of this type
* @memberof platform/core.TypeImpl#
*/
getProperties: function () {
return (typeDef.properties || []).map(TypeProperty);
@ -114,6 +121,7 @@ define(
* this type.
*
* @return {object} initial domain object model
* @memberof platform/core.TypeImpl#
*/
getInitialModel: function () {
return typeDef.model || {};
@ -126,6 +134,7 @@ define(
*
* @returns {object} the raw definition for this type
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
getDefinition: function () {
return typeDef;
@ -141,6 +150,7 @@ define(
* object, which this
* @returns {boolean} true
* @memberof module:core/type/type-impl.TypeImpl#
* @memberof platform/core.TypeImpl#
*/
instanceOf: function instanceOf(key) {
@ -162,6 +172,7 @@ define(
* the type definition's "feature" field.
* @param {string} feature a string identifying the feature
* @returns {boolean} true if the feature is supported
* @memberof platform/core.TypeImpl#
*/
hasFeature: function (feature) {
return featureSet[feature] || false;
@ -171,4 +182,4 @@ define(
return TypeImpl;
}
);
);

View File

@ -36,6 +36,7 @@ define(
* Instantiate a property associated with domain objects of a
* given type. This provides an interface by which
*
* @memberof platform/core
* @constructor
* @memberof module:core/type/type-property
*/
@ -114,6 +115,7 @@ define(
/**
* Retrieve the value associated with this property
* from a given model.
* @memberof platform/core.TypeProperty#
*/
getValue: function (model) {
var property = propertyDefinition.property ||
@ -133,6 +135,7 @@ define(
/**
* Set a value associated with this property in
* an object's model.
* @memberof platform/core.TypeProperty#
*/
setValue: function setValue(model, value) {
var property = propertyDefinition.property ||
@ -153,6 +156,7 @@ define(
},
/**
* Get the raw definition for this property.
* @memberof platform/core.TypeProperty#
*/
getDefinition: function () {
return propertyDefinition;
@ -162,4 +166,4 @@ define(
return TypeProperty;
}
);
);

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