You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by er...@apache.org on 2013/07/17 18:57:44 UTC

svn commit: r1504201 - in /rave/trunk/rave-portal-resources: ./ src/main/webapp/WEB-INF/jsp/views/ src/main/webapp/static/script/core/

Author: erinnp
Date: Wed Jul 17 16:57:44 2013
New Revision: 1504201

URL: http://svn.apache.org/r1504201
Log:
Integrated jsdoc3 maven plugin, documented rave state manager.

Modified:
    rave/trunk/rave-portal-resources/pom.xml
    rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
    rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
    rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_state_manager.js
    rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_widget_manager.js

Modified: rave/trunk/rave-portal-resources/pom.xml
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/pom.xml?rev=1504201&r1=1504200&r2=1504201&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/pom.xml (original)
+++ rave/trunk/rave-portal-resources/pom.xml Wed Jul 17 16:57:44 2013
@@ -208,6 +208,25 @@
                     </skip>
                 </configuration>
             </plugin>
+            <!-- js doc plugin -->
+            <plugin>
+                <groupId>com.github.phasebash</groupId>
+                <artifactId>jsdoc3-maven-plugin</artifactId>
+                <version>1.0.4</version>
+                <configuration>
+                    <recursive>true</recursive>
+                    <directoryRoots>
+                        <directoryRoot>${basedir}/src/main/webapp/static/script/core</directoryRoot>
+                    </directoryRoots>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>jsdoc3</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <profiles>

Modified: rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp?rev=1504201&r1=1504200&r2=1504201&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp Wed Jul 17 16:57:44 2013
@@ -414,9 +414,7 @@
 
             rave.setDefaultView('home');
             rave.setPage({
-                id: "${page.id}",
-                ownerId: "${page.ownerId}",
-                viewerId: "<sec:authentication property="principal.id" />"
+                id: "${page.id}"
             });
             rave.getViewer().editor =<c:out value="${pageUser.editor}"/>;
             rave.setExportEnabled(${applicationProperties['portal.export.ui.enable']});

Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js?rev=1504201&r1=1504200&r2=1504201&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js Wed Jul 17 16:57:44 2013
@@ -19,9 +19,21 @@
 
 
 /*
-    By default rave uses jquery as its ajax library. If you want to use another ajax library overlay this file
-    and return a function that conforms with the api of jquery's ajax() function - http://api.jquery.com/jQuery.ajax/
+
+ */
+
+/**
+ Wraps the rave client's ajax functionality.
+ By default rave uses jquery as its ajax library. If you want to use another ajax library overlay this file
+ and return a function that conforms with the api of jquery's ajax() function - http://api.jquery.com/jQuery.ajax/
+ @module rave_ajax
  */
 define(['jquery'], function($){
-    return $.ajax;
+
+    /**
+    Function ajax
+     */
+    var ajax = $.ajax;
+
+    return ajax;
 })

Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_state_manager.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_state_manager.js?rev=1504201&r1=1504200&r2=1504201&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_state_manager.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_state_manager.js Wed Jul 17 16:57:44 2013
@@ -17,6 +17,11 @@
  * under the License.
  */
 
+
+/**
+ * Manages the state of page-level variables.
+ * @module rave
+ */
 define([], function () {
 
     var page,
@@ -31,74 +36,166 @@ define([], function () {
 
     var exports = {};
 
+    /**
+     * @typedef Page
+     * @type {object}
+     * @property {string} id - the page's id.
+     * @property {string} ownerId - the id of the page owner
+     * @property {number} viewerId - the id of the page viewer
+     */
+
+    /**
+     * Sets the current page
+     * @param {Page} p
+     */
     exports.setPage = function(p){
         page = p;
     }
 
+    /**
+     * Gets the current page
+     * @return {Page}
+     */
     exports.getPage = function(){
         return page;
     }
 
+    /**
+     * @typedef User
+     * @type {object}
+     * @property {string} id - the user's id.
+     * @property {string} username - the user's name
+     */
+
+    /**
+     * Sets the currently authenticated user (the page viewer)
+     * @param v {User}
+     */
     exports.setViewer = function(v){
         viewer = v;
     }
 
+    /**
+     * Gets the currently authenticated user (the page viewer)
+     * @return {User}
+     */
     exports.getViewer = function(){
         return viewer;
     }
 
+    /**
+     * Sets the current page owner
+     * @param o {User}
+     */
     exports.setOwner = function(o){
         owner = o;
     }
 
+    /**
+     * Gets the current page owner
+     * @return {User}
+     */
     exports.getOwner = function(){
         return owner;
     }
 
+    /**
+     * Sets the base url that the rave api is being hosted from.
+     * @example If the api is hosted at localhost:8080/portal/app/api, then the context is "/portal/app/"
+     *
+     * @param ctx {string}
+     */
     exports.setContext = function(ctx){
         context = ctx;
     }
 
+    /**
+     * Gets the base url that the rave api is being hosted from.
+     * @return {string}
+     */
     exports.getContext = function(){
         return context;
     }
 
+    /**
+     * Sets whether export is enabled
+     * @param e {boolean}
+     */
     exports.setExportEnabled = function(e){
         exportEnabled = e;
     }
 
+    /**
+     * Gets whether export is enabled
+     * @return {boolean}
+     */
     exports.getExportEnabled = function(){
         return exportEnabled;
     }
 
+    /**
+     * Sets the default height of widgets on a page
+     * @param height {number}
+     */
     exports.setDefaultHeight = function(height){
         defaultHeight = height;
     }
 
+    /**
+     * Gets the default height of widgets on a page
+     * @return {number}
+     */
     exports.getDefaultHeight = function(){
         return defaultHeight;
     }
 
+    /**
+     * Sets default widget of widgets on a page
+     * @param width {number}
+     */
     exports.setDefaultWidth = function(width){
         defaultWidth = width;
     }
 
+    /**
+     * Gets default widget of widgets on a page
+     * @return {number}
+     */
     exports.getDefaultWidth = function(){
         return defaultWidth;
-    }    
+    }
 
+    /**
+     * Sets the default view that widgets will render into on a page. In opensocial this
+     * corresponds to the "view" render param. In wookie this feature is not yet supported.
+     * @see http://opensocial-resources.googlecode.com/svn/spec/trunk/Core-Gadget.xml#gadgets.views.ViewType
+     * @param view {string}
+     */
     exports.setDefaultView = function(view){
         defaultView = view;
     }
 
+    /**
+     * Sets the default view that widgets will render into on a page
+     * @return {string}
+     */
     exports.getDefaultView = function(){
         return defaultView;
     }
 
+    /**
+     * Sets the javascript debug mode. This determines whether the
+     * scripts from opensocial features are concatenated and minified.
+     * @param b {boolean}
+     */
     exports.setDebugMode = function(b) {
         debugMode = b;
     }
 
+    /**
+     * Gets the javascript debug mode.
+     * @return {boolean}
+     */
     exports.getDebugMode = function(){
         return debugMode;
     }

Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_widget_manager.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_widget_manager.js?rev=1504201&r1=1504200&r2=1504201&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_widget_manager.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_widget_manager.js Wed Jul 17 16:57:44 2013
@@ -17,8 +17,10 @@
  * under the License.
  */
 
+/**
+ * Manages region widgets on a page, including registration and retrieval
+ */
 define(['underscore', 'core/rave_widget'], function (_, regionWidget) {
-    //hash of widgets by regionWidgetId
     var regionWidgets = {};
 
     var rave = {};