<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: models/Depot.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: models/Depot.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>var assign = require('object-assign'); var Node = require('./Node'); /** * Initialize a new depot instance. * * @param {Object} obj Data from the server, which doesn't follow typical * javaScript naming conventions. * @constructor * @memberof models */ function Depot(obj) { this._data = obj || {}; /** * The immediate directories and files under this depot. * * @type {Array<PathItem>} */ this.children = []; var self = this; Object.defineProperties(this, { /** * The name of the Depot * * @type string * @name models.Depot#depot * @memberOf models.Depot */ 'depot': { get: function() { return self._data['Depot']; }, set: function(x) { self._data['Depot'] = x; return x; } }, /** * The created date of the depot * * @type Date * @name models.Depot#date * @memberOf models.Depot * @readonly */ 'date': { get: function() { if (self._data['Date']) { return new Date(self._data['Date']); } } }, /** * The Depot type, one of 'local', 'remote', 'spec', 'stream', 'unload', or * 'archive'. * * @type string * @name models.Depot#type * @memberOf models.Depot */ 'type': { get: function() { return self._date['Type']; }, set: function(x) { // TODO validate x self._date['Type'] = x; } }, /** * If `type` is 'remote', this is the P4PORT address of the remote server. * * @type string * @name models.Depot#address * @memberOf models.Depot */ 'address': { get: function() { return self._date['Address']; }, set: function(x) { self._date['Type'] = x; } }, /** * If `type` is 'local', 'spec', or 'archive', this points to the relative * location of the depot subdirectory. * * @type string * @name models.Depot#map * @memberOf models.Depot */ 'map': { get: function() { return self._date['Map']; }, set: function(x) { self._date['Map'] = x; return x; } }, /** * A short description of the depot's purpose. * * @type string * @name models.Depot#description * @memberOf models.Depot */ 'description': { get: function() { return self._date['Description']; }, set: function(x) { self._date['Description'] = x; return x; } }, /** * The user login that owns the Depot. * * @type string * @name models.Depot#owner * @memberOf models.Depot */ 'owner': { get: function() { return self._data['Owner']; }, set: function(x) { self._data['Owner'] = x; return x; } }, /** * If the `type` is 'spec', this holds an optional suffix for generated * paths to objects in the spec depot. * * @type string * @name models.Depot#suffix * @memberOf models.Depot */ 'suffix': { get: function() { return self._data['Suffix']; }, set: function(x) { self._data['Suffix'] = x; return x; } }, /** * When type is 'spec', this an optional description of what specs should * be saved. * * @type string * @name models.Depot#specMap * @memberOf models.Depot */ 'specMap': { get: function() { return self._data['SpecMap']; } }, /** * The representation of the depot suitable to POST back to the Helix * Web Services Perforce API. * * @type object * @name models.Depot#data * @memberOf models.Depot * @readonly */ 'data': { get: function() { return self._data; } }, /** * Used by our underlying Node representation * * @type string * @name models.Depot#name * @memberOf models.Depot * @readonly */ 'name': { get: function() { return self.depot; } }, /** * Used by our underlying Node representation * * @type string * @name models.Depot#pathId * @memberOf models.Depot * @readonly */ 'pathId': { get: function() { return [self.depot]; } } }); } assign(Depot.prototype, Node); module.exports = Depot; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="HelixWebServicesClient.html">HelixWebServicesClient</a></li><li><a href="models.Depot.html">Depot</a></li><li><a href="models.Dir.html">Dir</a></li><li><a href="models.File.html">File</a></li></ul><h3>Mixins</h3><ul><li><a href="Node.html">Node</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addSessionExpiredHandler">addSessionExpiredHandler</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0-dev</a> on Wed Jun 24 2015 12:48:35 GMT-0700 (PDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/build/doc/helix_web_services_client_js/models_Depot.js.html | |||||
#2 | 14151 | tjuricek |
Add depot tree control and selection to the create projects page. Styling and error checking is kept to a minimum for the time being. Our goal is just internal workflow and feedback. |
||
#1 | 14108 | tjuricek |
Added models for handling Perforce server depot listing and traversal. This is not complete, however, the models are a start to making it easy to generate a tree control. (Most tree controls in the wild assume you know the tree structure from the start, which is not true in our case.) The tricky bit is making it easy to build the tree out given that you're visiting only one directory at a time. |