<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: models/File.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/File.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>var assign = require('object-assign'); var Node = require('./Node'); require('../polyfill'); /** * Create a file from the server's object representation. * * @param {Object} obj Data from the server, which doesn't follow typical * javaScript naming conventions. * @constructor * @memberof models */ function File(obj) { this._data = obj || {}; var self = this; Object.defineProperties(this, { /** * The absolute depot path of the file * * @type string * @name models.File#depotFile * @memberOf models.File */ 'depotFile': { get: function() { return self._data['DepotFile']; }, set: function(x) { self._data['DepotFile'] = x; } }, /** * File's revision number. * * @type number * @name models.File#revision * @memberOf models.File * @readonly */ 'revision': { get: function() { var n = self._data['Revision']; if (typeof n == 'string') { n = parseInt(n); } return n; } }, /** * ID of the changelist that created this file revision. * * @type string * @name models.File#change * @memberOf models.File * @readonly */ 'change': { get: function() { return self._data['Change']; } }, /** * Action taken at the head, one of 'add', 'edit', 'delete', 'branch', * 'move_add', 'move_delete', 'integrate', 'import', 'purge', or 'archive'. * * @type string * @name models.File#action * @memberOf models.File * @readonly */ 'action': { get: function() { return self._data['Action']; } }, /** * File type - one of 'text', 'binary', 'symlink', 'apple', 'resource', * 'unicode', 'utf16' * * @type string * @name models.File#type * @memberOf models.File * @readonly */ 'type': { get: function() { return self._data['Type']; } }, /** * Date of when the file revision was created * * @type Date * @name models.File#date * @memberOf models.File * @readonly */ 'date': { get: function() { return new Date(self._data['Date']); } }, /** * For consistency with Node operations * * @type string * @name models.File#name * @memberOf models.File * @readonly */ 'name': { get: function() { return this.pathId[this.pathId.length - 1]; } }, /** * For consistency with Node operations * * @type Array<string> * @name models.File#pathId * @memberOf models.File * @readonly */ 'pathId': { get: function() { var path = this.depotFile; if (path.startsWith('//')) { path = path.substring(2); } return path.split('/'); } } }); } assign(File.prototype, Node, { }); module.exports = File; </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_File.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. |