Author: erinnp
Date: Thu Aug 15 21:39:17 2013
New Revision: 1514506

URL: http://svn.apache.org/r1514506
Log:
Update  to account for context and have correct /api/rest pathing

Removed:
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/Context.js
Modified:
    
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/directives/Base.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/CategoriesResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesForRenderResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PeopleResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionWidgetsResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionsResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/UsersResource.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/index.js

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
 Thu Aug 15 21:39:17 2013
@@ -33,7 +33,7 @@
         require = {
             paths: {}
         };
-    </script>>
+    </script>
 <%--
     check to see if the javaScriptDebugMode is on, if so render the individual 
JS files,
     otherwise render the minified single file

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/directives/Base.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/directives/Base.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/directives/Base.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/directives/Base.js
 Thu Aug 15 21:39:17 2013
@@ -18,18 +18,19 @@
  */
 
 define([], function () {
-    return [ 'Context',
-        function (context) {
+    return [ 'constants',
+        function (constants) {
             return {
                 restrict: 'E',
                 link: function link(scope, el, attrs) {
                     var href = attrs.href;
 
+                    //TODO: this currently accounts for 'angular' in the root 
path. Once we bump it, needs to become splice(-3)
                     href = href.split('/')
                     href.splice(-4);
                     href = href.join('/');
 
-                    context.setContext(href);
+                    constants.hostedPath = href;
                 }
             }
         }

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/CategoriesResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/CategoriesResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/CategoriesResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/CategoriesResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-    return ['$resource', function($resource){
-        return $resource('/categories/:id', {id: '@id'});
+    return ['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + '/api/rest/categories/:id', 
{id: '@id'});
     }];
 });
 

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesForRenderResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesForRenderResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesForRenderResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesForRenderResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,9 +18,9 @@
  */
 
 define(['underscore'], function (_) {
-    return ['$resource', 'Pages', 'Regions', 'RegionWidgets', 'Context',
-        function ($resource, Pages, Regions, RegionWidgets, Context) {
-            var res = 
$resource(Context.getContext()+'/api/rest/pages/render/:context/:identifier/:id',
 {},
+    return ['$resource', 'Pages', 'Regions', 'RegionWidgets', 'constants',
+        function ($resource, Pages, Regions, RegionWidgets, constants) {
+            var res = 
$resource(constants.hostedPath+'/api/rest/pages/render/:context/:identifier/:id',
 {},
                 {
                     _query: { method: 'GET', isArray: true }
                 });

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-    return ['$resource', function($resource){
-        return $resource('/pages/:id', {id: '@id'});
+    return ['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + '/api/rest/pages/:id', {id: 
'@id'});
     }];
 })
 

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PeopleResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PeopleResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PeopleResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PeopleResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-     return['$resource', function($resource){
-        return $resource('/people/:id', {id: '@id'});
+     return['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + '/api/rest/people/:id', {id: 
'@id'});
     }];
 
 //    var friendResource = ['$resource', function($resource){

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionWidgetsResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionWidgetsResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionWidgetsResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionWidgetsResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-    return ['$resource', function($resource){
-        return $resource('/pages/:pageId/regions/:regionId/regionWidgets/:id',
+    return ['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + 
'/api/rest/pages/:pageId/regions/:regionId/regionWidgets/:id',
             {id: '@id', regionId: '@regionId'});
     }];
 });

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionsResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionsResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionsResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/RegionsResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-    return ['$resource', function($resource){
-        return $resource('/pages/:pageId/regions/:id', {id: '@id'});
+    return ['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + 
'/api/rest/pages/:pageId/regions/:id', {id: '@id'});
     }];
 })
 

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/UsersResource.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/UsersResource.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/UsersResource.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/UsersResource.js
 Thu Aug 15 21:39:17 2013
@@ -18,8 +18,8 @@
  */
 
 define([], function(){
-    return ['$resource', function($resource){
-        return $resource('/users/:id', {id: '@id'});
+    return ['$resource', 'constants', function($resource, constants){
+        return $resource(constants.hostedPath + '/api/rest/users/:id', {id: 
'@id'});
     }];
 });
 

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/index.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/index.js?rev=1514506&r1=1514505&r2=1514506&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/index.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/services/index.js
 Thu Aug 15 21:39:17 2013
@@ -17,10 +17,12 @@
  * under the License.
  */
 
-define(['angular', 'common/services/Context', 'common/directives/index'], 
function (angular, context) {
+define(['angular', 'common/directives/index'], function (angular) {
     var services = angular.module('common.services', ['common.directives']);
 
-    services.service('Context', context);
+    services.constant('constants', {
+        hostedPath: ''
+    });
 
     return services;
 });
\ No newline at end of file


Reply via email to