Author: erinnp
Date: Tue Aug 13 21:44:07 2013
New Revision: 1513663

URL: http://svn.apache.org/r1513663
Log:
Setting up portal context and router

Added:
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/controllers.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/main.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/portal.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/routes.js
Modified:
    
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
    
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/resources/category_resources.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/resources.js
    
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/requireConfig.js

Modified: 
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java?rev=1513663&r1=1513662&r2=1513663&view=diff
==============================================================================
--- 
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
 (original)
+++ 
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
 Tue Aug 13 21:44:07 2013
@@ -29,7 +29,6 @@ import org.springframework.web.bind.anno
 
 @Controller
 public class AngularController {
-    private final Logger logger = LoggerFactory.getLogger(getClass());
 
     public AngularController() {
     }

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=1513663&r1=1513662&r2=1513663&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
 Tue Aug 13 21:44:07 2013
@@ -1,13 +1,50 @@
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"; %>
+<%@ taglib prefix="portal" uri="http://www.apache.org/rave/tags"; %>
+<c:set var="jsDebugMode"><portal:render-js-debug-mode/></c:set>
+
 <!DOCTYPE html>
 <html>
 <head>
-    <base href="/portal/app/angular/${context}/">
+    <base href="<spring:url value="/app/angular/${context}/"/>">
     <link 
href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css"
 rel="stylesheet">
     <link 
href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css"; 
rel="stylesheet">
-    <link rel="stylesheet" href="/portal/static/css/rave.css"/>
+    <link rel="stylesheet" href="<spring:url value="/static/css/rave.css"/>"/>
+
+    <%--
+    check to see if the javaScriptDebugMode is on, if so render the individual 
JS files,
+    otherwise render the minified single file
+    --%>
+    <c:choose>
+        <c:when test="${jsDebugMode == '1'}">
+            <script data-main="<spring:url 
value="/static/script/${context}/main.js"/>"
+                    
src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.min.js"></script>
+        </c:when>
+        <c:otherwise>
+       <script data-main="<spring:url 
value="/static/script-built/${context}/main.js"/>"
+               
src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.min.js"></script>
+   </c:otherwise>
+</c:choose>
 
-    <script data-main="/portal/static/script/${context}/main.js"
-            
src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.min.js"></script>
 </head>
 <body>
 <div class="wrapper" ng-include="'/portal/static/html/${context}/index.html'" 
ng-cloak>

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/category_resources.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/category_resources.js?rev=1513663&r1=1513662&r2=1513663&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/category_resources.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/category_resources.js
 Tue Aug 13 21:44:07 2013
@@ -25,5 +25,5 @@ define([], function(){
     return {
         Category: categoryResource
     }
-})
+});
 

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/resources.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/resources.js?rev=1513663&r1=1513662&r2=1513663&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/resources.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/resources.js
 Tue Aug 13 21:44:07 2013
@@ -21,9 +21,9 @@ define(['common/resources/category_resou
     function(category, page, person, region, regionWidget, user, _) {
         'use strict';
         var servicesModule =  angular.module('common.resources', 
['ngResource'], ['$httpProvider', function($httpProvider){
-            $httpProvider.defaults.transformResponse = function(data, headers) 
{
+            $httpProvider.defaults.transformResponse.push(function(data, 
headers) {
                 return data.data;
-            };
+            });
         }]);
 
         //Array of services

Added: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/controllers.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/controllers.js?rev=1513663&view=auto
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/controllers.js
 (added)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/controllers.js
 Tue Aug 13 21:44:07 2013
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+define(['angular'], function (angular) {
+    var controllers = angular.module('portal.controllers', []);
+
+    return controllers;
+});
\ No newline at end of file

Added: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/main.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/main.js?rev=1513663&view=auto
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/main.js
 (added)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/main.js
 Tue Aug 13 21:44:07 2013
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+requirejs.config({
+    "paths":{
+        
"backbone":"//cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.10/backbone-min",
+        "bootstrap": 
'//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min',
+        "clientMessages": "../../app/messagebundle/rave_client_messages",
+        
"handlebars":"//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.2/handlebars.min",
+        "jquery": "//ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.min",
+        "jqueryUi":"//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min",
+        
"jqueryValidate":"//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min",
+        
"jqueryHashChange":'//cdnjs.cloudflare.com/ajax/libs/jquery-hashchange/v1.3/jquery.ba-hashchange.min',
+        "jqueryTouchPouch": 
'//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min',
+        "angular": 
'//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min',
+        "angularResource": 
'//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular-resource.min',
+        "osapi":"//placeholder.url.will.be.replaced.by.opensocial.environment",
+        "rave": "core/main",
+        "underscore": 
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min"
+    },
+    shim: {
+        backbone: {
+            deps: ['underscore', 'jquery'],
+            exports: 'Backbone'
+        },
+        bootstrap:{
+            deps:['jquery']
+        },
+        handlebars:{
+            exports:'Handlebars'
+        },
+        jquery:{
+            exports:'$'
+        },
+        jqueryUi:{
+            deps: ['jquery']
+        },
+        jqueryValidate:{
+            deps:['jquery']
+        },
+        jqueryHashChange:{
+            deps:['jquery']
+        },
+        jqueryTouchPouch:{
+            deps:['jquery']
+        },
+        underscore: {
+            exports: '_'
+        },
+        angular:{
+            deps: ['jquery'],
+            exports: 'angular'
+        },
+        angularResource:{
+            deps: ['angular']
+        }
+    }
+});
+
+require(['angular', './portal'], function(angular, app){
+    angular.bootstrap(document, [app.name]);
+});
\ No newline at end of file

Added: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/portal.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/portal.js?rev=1513663&view=auto
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/portal.js
 (added)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/portal.js
 Tue Aug 13 21:44:07 2013
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+define(['angular', './routes', './controllers'], function (angular) {
+    return angular.module('portal', ['portal.routes', 'portal.controllers']);
+});
\ No newline at end of file

Added: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/routes.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/routes.js?rev=1513663&view=auto
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/routes.js
 (added)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/portal/routes.js
 Tue Aug 13 21:44:07 2013
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+define(['angular'], function () {
+    var router = angular.module('portal.routes', []);
+
+    router.config(['$routeProvider', '$locationProvider', '$httpProvider',
+        function ($routeProvider, $locationProvider, $httpProvider) {
+
+            $routeProvider
+                .when('/', {
+                    controller: 'TabsController',
+                    resolve: {
+                        pages: ['PagesService', function (PagesService) {
+                            return PagesService.get('portal', '@self');
+                        }]
+                    },
+                    templateUrl: "/portal/static/html/portal/tabs.html"
+                })
+                .when('/:tabId', {
+                    controller: 'TabsController',
+                    resolve: {
+                        pages: ['PagesService', function (PagesService) {
+                            return PagesService.get('portal', '@self');
+                        }]
+                    },
+                    templateUrl: "/portal/static/html/portal/tabs.html"
+                })
+                .otherwise({ templateUrl: 
'/portal/static/html/portal/404.html'});
+
+            $locationProvider.html5Mode(true);
+
+
+        }
+    ]);
+
+    return router;
+});
\ No newline at end of file

Modified: 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
URL: 
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/requireConfig.js?rev=1513663&r1=1513662&r2=1513663&view=diff
==============================================================================
--- 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
 (original)
+++ 
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
 Tue Aug 13 21:44:07 2013
@@ -32,7 +32,7 @@ requirejs.config({
         "angularResource": 
'//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular-resource.min',
         "osapi":"//placeholder.url.will.be.replaced.by.opensocial.environment",
         "rave": "core/main",
-        "underscore": 
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min
+        "underscore": 
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min"
     },
     shim: {
         backbone: {


Reply via email to