You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ko...@apache.org on 2014/08/12 13:52:17 UTC

git commit: [OLINGO-400] add supporet for jsdoc

Repository: olingo-odata4-js
Updated Branches:
  refs/heads/master 04b0c4460 -> c5b93e9de


[OLINGO-400] add supporet for jsdoc


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/c5b93e9d
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/c5b93e9d
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/c5b93e9d

Branch: refs/heads/master
Commit: c5b93e9de4128af01bf2a110c1e3f9954dee7ad8
Parents: 04b0c44
Author: Sven Kobler <sv...@sap.com>
Authored: Tue Aug 12 13:50:29 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Tue Aug 12 13:50:29 2014 +0200

----------------------------------------------------------------------
 datajs/Gruntfile.js           | 11 ++++++++++-
 datajs/package.json           |  1 +
 datajs/src/lib/cache.js       |  4 ++++
 datajs/src/lib/odata/utils.js | 18 +++++++++---------
 4 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/c5b93e9d/datajs/Gruntfile.js
----------------------------------------------------------------------
diff --git a/datajs/Gruntfile.js b/datajs/Gruntfile.js
index 3898ebd..5f09b66 100644
--- a/datajs/Gruntfile.js
+++ b/datajs/Gruntfile.js
@@ -122,6 +122,14 @@ module.exports = function(grunt) {
         }
       },
     },
+    jsdoc : {
+        dist : {
+            src: ['src/**/*.js'], 
+            options: {
+                destination: 'build/doc'
+            }
+        }
+    }
   };
   
   //join local configuration for proxies and local test servers
@@ -141,6 +149,7 @@ module.exports = function(grunt) {
   grunt.loadNpmTasks("grunt-contrib-connect");
   grunt.loadNpmTasks("grunt-contrib-copy");
   grunt.loadNpmTasks("grunt-contrib-concat");
+  grunt.loadNpmTasks("grunt-jsdoc");
   grunt.loadNpmTasks('grunt-node-qunit');/*TODO replace by grunt contrib-qunit*/
 
   //load the task from the grunt-config directory
@@ -148,7 +157,7 @@ module.exports = function(grunt) {
   grunt.loadTasks('grunt-config');
   
 
-
+  grunt.registerTask('doc', ['jsdoc']);
   grunt.registerTask('build', ['browserify:datajs', 'uglify:build', 'concat','copy:forDemo']);
   grunt.registerTask('test-browser', ['configureProxies:test-browser', 'connect:test-browser']);
   grunt.registerTask('test-node', ['node-qunit:default-tests']);

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/c5b93e9d/datajs/package.json
----------------------------------------------------------------------
diff --git a/datajs/package.json b/datajs/package.json
index ad71cf2..32ae996 100644
--- a/datajs/package.json
+++ b/datajs/package.json
@@ -31,6 +31,7 @@
     "grunt-contrib-connect": "^0.7.1",
     "grunt-contrib-copy": "^0.5.0",
     "grunt-contrib-uglify": "^0.4.0",
+    "grunt-jsdoc": "^0.5.6",
     "grunt-node-qunit": "^2.0.2",
     "through": "^2.3.4"
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/c5b93e9d/datajs/src/lib/cache.js
----------------------------------------------------------------------
diff --git a/datajs/src/lib/cache.js b/datajs/src/lib/cache.js
index 78536f2..1df5a60 100644
--- a/datajs/src/lib/cache.js
+++ b/datajs/src/lib/cache.js
@@ -17,6 +17,8 @@
  * under the License.
  */
 
+ /** @module cache */
+
 var utils = require('./datajs.js').utils;
 
 
@@ -40,6 +42,8 @@ var sliceJsonValueArray = utils.sliceJsonValueArray;
 var concatJsonValueArray = utils.concatJsonValueArray;
 var storeReq = require('./datajs.js').store;
 
+
+/** Appending a page appendPage */
 var appendPage = function (operation, page) {
     /// <summary>Appends a page's data to the operation data.</summary>
     /// <param name="operation" type="Object">Operation with (i)ndex, (c)ount and (d)ata.</param>

http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/c5b93e9d/datajs/src/lib/odata/utils.js
----------------------------------------------------------------------
diff --git a/datajs/src/lib/odata/utils.js b/datajs/src/lib/odata/utils.js
index f92e9f7..b42e57e 100644
--- a/datajs/src/lib/odata/utils.js
+++ b/datajs/src/lib/odata/utils.js
@@ -16,6 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+ /** @module odata/utils */
 
 var utils    = require('./../datajs.js').utils;
 
@@ -28,16 +29,15 @@ var isDate = utils.isDate;
 var isObject = utils.isObject;
 var parseInt10 = utils.parseInt10;
 
-var dataItemTypeName = function (value, metadata) {
-    /// <summary>Gets the type name of a data item value that belongs to a feed, an entry, a complex type property, or a collection property.</summary>
-    /// <param name="value">Value of the data item from which the type name is going to be retrieved.</param>
-    /// <param name="metadata" type="object" optional="true">Object containing metadata about the data tiem.</param>
-    /// <remarks>
-    ///    This function will first try to get the type name from the data item's value itself if it is an object with a __metadata property; otherwise
-    ///    it will try to recover it from the metadata.  If both attempts fail, it will return null.
-    /// </remarks>
-    /// <returns type="String">Data item type name; null if the type name cannot be found within the value or the metadata</returns>
 
+/** Gets the type name of a data item value that belongs to a feed, an entry, a complex type property, or a collection property
+ * @param {string} value - Value of the data item from which the type name is going to be retrieved.
+ * @param {object} [metadata] - Object containing metadata about the data tiem.
+ * @returns {string} Data item type name; null if the type name cannot be found within the value or the metadata
+ * This function will first try to get the type name from the data item's value itself if it is an object with a __metadata property; otherwise
+ * it will try to recover it from the metadata.  If both attempts fail, it will return null.
+ */
+var dataItemTypeName = function (value, metadata) {
     var valueTypeName = ((value && value.__metadata) || {}).type;
     return valueTypeName || (metadata ? metadata.type : null);
 };