Author: erinnp
Date: Fri Apr 12 00:32:58 2013
New Revision: 1467152
URL: http://svn.apache.org/r1467152
Log:
first angular commit
Added:
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
- copied, changed from r1464166,
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ChangePasswordController.java
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
- copied, changed from r1464166,
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/login.jsp
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_core_js.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_css.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_portal_js.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/third_party_js.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/404.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/defaultView.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/profile.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/index.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/app.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/controllers.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/directives.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/routing.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/services.js
Modified:
rave/branches/angular/rave-portal-resources/pom.xml
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_widget.js
Copied:
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
(from r1464166,
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ChangePasswordController.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?p2=rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java&p1=rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ChangePasswordController.java&r1=1464166&r2=1467152&rev=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ChangePasswordController.java
(original)
+++
rave/branches/angular/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/AngularController.java
Fri Apr 12 00:32:58 2013
@@ -19,81 +19,24 @@
package org.apache.rave.portal.web.controller;
-import org.apache.rave.portal.model.impl.UserImpl;
-import org.apache.rave.model.User;
-import org.apache.rave.portal.service.UserService;
-import org.apache.rave.portal.web.controller.util.ModelUtils;
-import org.apache.rave.portal.web.model.UserForm;
-import org.apache.rave.portal.web.util.ModelKeys;
-import org.apache.rave.portal.web.util.ViewNames;
-import org.apache.rave.portal.web.validator.ChangePasswordValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-/**
- * Controller which processes change password requests.
- * Only requests that have a valid (matched) forgotPasswordHash will be honored
- *
- * @version "$Id$"
- * @see org.apache.rave.model.User#getForgotPasswordHash()
- */
@Controller
-public class ChangePasswordController {
+public class AngularController {
+ private final Logger logger = LoggerFactory.getLogger(getClass());
-
- private static Logger log =
LoggerFactory.getLogger(ChangePasswordController.class);
- private final UserService userService;
- private final ChangePasswordValidator passwordValidator;
- @Value("#{messages['page.newpassword.message.success']}")
- private String messagePasswordChanged;
-
-
- @Autowired
- public ChangePasswordController(UserService userService,
ChangePasswordValidator passwordValidator) {
- this.userService = userService;
- this.passwordValidator = passwordValidator;
+ public AngularController() {
}
-
- @RequestMapping(value = {"/changepassword/{passwordHash:.*}"}, method =
RequestMethod.GET)
- public String initialize(Model model, @PathVariable("passwordHash") String
passwordHash) {
- log.debug("Requesting user for hash: {}", passwordHash);
- User user = new UserImpl();
- model.addAttribute(ModelKeys.USER, user);
- user.setForgotPasswordHash(passwordHash);
- return ViewNames.PASSWORD_CHANGE;
- }
-
-
- @RequestMapping(value = {"/changepassword", "/changepassword/**"}, method
= RequestMethod.POST)
- public String update(@ModelAttribute UserForm user, BindingResult results,
Model model, RedirectAttributes redirectAttributes) {
- log.debug("updating user password for hash {}",
user.getForgotPasswordHash());
- model.addAttribute(ModelKeys.USER, user);
- passwordValidator.validate(user, results);
-
- if (results.hasErrors()) {
- log.info("changepassword, request contains validation errors");
- return ViewNames.PASSWORD_CHANGE;
- }
- try {
- log.debug("Submitted passwords were valid");
- userService.updatePassword(ModelUtils.convert(user));
- redirectAttributes.addFlashAttribute(ModelKeys.REDIRECT_MESSAGE,
messagePasswordChanged);
- return ViewNames.REDIRECT_LOGIN ;
- } catch (Exception ex) {
- results.reject("Unable to change password:" + ex.getMessage(),
"Unable to change password.");
- return ViewNames.PASSWORD_CHANGE;
- }
-
+ @RequestMapping(value = {"/angular/{context}/**"}, method =
RequestMethod.GET)
+ public String renderAngularApp(Model model, @PathVariable String context) {
+ model.addAttribute("context", context);
+ return "angular";
}
}
Modified: rave/branches/angular/rave-portal-resources/pom.xml
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/pom.xml?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
--- rave/branches/angular/rave-portal-resources/pom.xml (original)
+++ rave/branches/angular/rave-portal-resources/pom.xml Fri Apr 12 00:32:58 2013
@@ -136,10 +136,6 @@
</execution>
</executions>
</plugin>
- <!--
- wro4j maven plugin is used for optimization (concatenation,
minification, etc) of our static resources
- it is invoked as part of the compile phase of the maven
lifecycle
- -->
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
@@ -153,19 +149,12 @@
</execution>
</executions>
<configuration>
- <!-- wro.properties defines which pre and post processors
to execute -->
<extraConfigFile>${basedir}/src/main/resources/wro.properties</extraConfigFile>
- <!-- wro.xml defines the resource groups -->
<wroFile>${basedir}/src/main/resources/wro.xml</wroFile>
- <!-- targetGroups is the set of resource groups, defined
in wro.xml, that you want to process -->
<targetGroups>rave.core.min,rave.portal.min,rave</targetGroups>
- <!-- minimize instructs the processors to handle their
minimization work -->
<minimize>true</minimize>
- <!-- location of the javascript after processing -->
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/static/script/</jsDestinationFolder>
- <!-- location of the CSS after processing -->
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/static/css/</cssDestinationFolder>
- <!-- location of webapp directory that wro4j uses for its
location context -->
<contextFolder>${basedir}/src/main/webapp/</contextFolder>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<ignoreMissingResources>false</ignoreMissingResources>
Copied:
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
(from r1464166,
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/login.jsp)
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp?p2=rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp&p1=rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/login.jsp&r1=1464166&r2=1467152&rev=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/login.jsp
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/angular.jsp
Fri Apr 12 00:32:58 2013
@@ -1,120 +1,40 @@
-<%--
- 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.
- --%>
-<%@ page language="java" trimDirectiveWhitespaces="true" %>
<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
-<fmt:setBundle basename="messages"/>
-<%-- Note: This page has the body definition embedded so we can reference it
directly from the security config file. --%>
-<tiles:insertDefinition name="templates.base">
- <%-- Override the default pageTitleKey and then export it to the request
scope for use later on this page --%>
- <tiles:putAttribute name="pageTitleKey" value="page.login.title"/>
- <tiles:importAttribute name="pageTitleKey" scope="request"/>
-
- <tiles:putAttribute name="body">
-
- <rave:login_navbar hideButton="loginButton" />
-
- <div class="container-fluid">
- <c:if test="${not empty message}">
- <div class="alert alert-info">${message}</div>
- </c:if>
-
- <h1><fmt:message key="${pageTitleKey}"/></h1>
- <div class="row-fluid" id="loginOptions">
- <div id="loginBlock" class="clearfix well">
- <div class="span6">
- <%--
- //############################################
- // LOGIN FORM
- //############################################
- --%>
- <form class="form-horizontal" id="loginForm"
name="loginForm" action="j_spring_security_check" method="post">
- <fieldset>
- <legend><fmt:message
key="page.login.usernamepassword"/></legend>
- <c:if test="${param['authfail'] eq 'form'}">
- <div class="alert
alert-error"><fmt:message key="page.login.usernamepassword.fail"/></div>
- </c:if>
- <div class="control-group">
- <label class="control-label"
for="usernameField"><fmt:message key="page.general.username"/></label>
- <div class="controls">
- <input class="input-large"
id="usernameField" type="text" name="j_username" autofocus="autofocus"
autocapitalize="off" autocorrect="off"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"
for="passwordField"><fmt:message key="page.general.password"/></label>
- <div class="controls">
- <input class="input-large"
id="passwordField" type="password" name="j_password"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"
for="remember_me">
- <fmt:message
key="page.login.rememberme"/>
- </label>
- <div class="controls">
- <input type='checkbox'
name='_spring_security_remember_me' id="remember_me" value="true"/>
- </div>
- </div>
- </fieldset>
- <fieldset>
- <fmt:message
key="page.login.usernamepassword.login" var="loginButtonText"/>
- <div class="controls">
- <button class="btn btn-primary"
type="submit" value="${loginButtonText}">${loginButtonText}</button>
- </div>
- </fieldset>
- </form>
- </div>
- <div class="span4">
- <%--
- //############################################
- // OPENID LOGIN
- //############################################
- --%>
- <form class="form-horizontal" id="openIdForm"
name='oidf' action='j_spring_openid_security_check' method='POST'>
- <fieldset>
- <legend><fmt:message
key="page.login.openid"/></legend>
- <c:if test="${param['authfail'] eq 'openid'}">
- <div class="alert
alert-error"><fmt:message key="page.login.openid.fail"/></div>
- </c:if>
- <div class="control-group">
- <label class="control-label"
for="openid_identifier"><fmt:message
key="page.login.openid.identifier"/></label>
- <div class="controls">
- <input class="input-large" type="text"
id="openid_identifier" name="openid_identifier" autocapitalize="off"
autocorrect="off"/>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"
for="remember_me">
- <fmt:message
key="page.login.rememberme"/>
- </label>
- <div class="controls">
- <input type='checkbox'
name='_spring_security_remember_me' id="remember_me_openid" value="true"/>
- </div>
- </div>
- </fieldset>
- <fieldset>
- <fmt:message key="page.login.openid.button"
var="openidButtonText"/>
- <div class="controls">
- <button class="btn btn-primary"
type="submit" value="${openidButtonText}">${openidButtonText}</button>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- </div>
- </div>
- </tiles:putAttribute>
-</tiles:insertDefinition>
+
+<!DOCTYPE html>
+<html ng-app="rave">
+<head>
+ <base href="/portal/app/angular/portal/">
+ <link
href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css"
rel="stylesheet">
+ <link rel="stylesheet" href="/portal/static/css/rave.css"/>
+</head>
+<body>
+<div class="wrapper" ng-include="'/portal/static/html/portal.html'" ng-cloak>
+
+</div>
+
+<script
src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
+<script
src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
+<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
+<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
+<script
src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min.js"></script>
+
+
+<script
src="/gadgets/js/container:pubsub-2:open-views.js?c=1&container=default&debug=1"></script>
+
+<script src="/portal/static/script/core/rave_core.js"></script>
+<script src="/portal/static/script/core/rave_ajax.js"></script>
+<script src="/portal/static/script/core/rave_api.js"></script>
+<script src="/portal/static/script/core/rave_widget.js"></script>
+<script src="/portal/static/script/core/rave_opensocial.js"></script>
+<script src="/portal/static/script/core/rave_wookie.js"></script>
+
+
+<script src="/portal/static/script/angular-portal/controllers.js"></script>
+<script src="/portal/static/script/angular-portal/directives.js"></script>
+<script src="/portal/static/script/angular-portal/services.js"></script>
+<script src="/portal/static/script/angular-portal/routing.js"></script>
+<script src="/portal/static/script/angular-portal/app.js"></script>
+
+
+</body>
+</html>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_core_js.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_core_js.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_core_js.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_core_js.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,8 @@
+<script
src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
+<script
src="/gadgets/js/container:pubsub-2:open-views.js?c=1&container=default&debug=1"></script>
+<script src="script/core/rave_core.js"></script>
+<script src="script/core/rave_ajax.js"></script>
+<script src="script/core/rave_api.js"></script>
+<script src="script/core/rave_widget.js"></script>
+<script src="script/core/rave_opensocial.js"></script>
+<script src="script/core/rave_wookie.js"></script>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_css.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_css.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_css.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_css.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,5 @@
+<style>
+ body, .wrapper {
+ background: blue;
+ }
+</style>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_portal_js.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_portal_js.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_portal_js.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/rave_portal_js.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1 @@
+<script src="script/angular-portal/controllers.js"></script>
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/third_party_js.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/third_party_js.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/third_party_js.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/partials/third_party_js.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,2 @@
+<script
src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
+<script
src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min.js"></script>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,20 @@
+<div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand"><span ng-show="user.username">Hello
{{user.username}}. </span>Welcome to Rave!</a>
+ <ul class="nav pull-right">
+ <li ng-show="user.username"><a
href="/portal/app/person/id/1">{{user.username}}'s Profile</a>
+ </li>
+ <li ng-show="user.username"><a href="/portal/app/store">Widget
Store</a></li>
+ <li ng-show="user.admin"><a href="/portal/app/admin">Admin
Interface</a></li>
+ <li ng-show="user.username"><a ng-click="logout()"
href="#">Logout</a></li>
+ <li ng-hide="user.username"><a ng-click="login()"
href="#">Login/Register</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+<div class="logo-wrapper"></div>
+<div id="pageContent" class="container-fluid">
+ <ng-include src="templateUrl"></ng-include>
+</div>
+
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/404.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/404.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/404.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/404.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1 @@
+404
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/defaultView.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/defaultView.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/defaultView.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/defaultView.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1 @@
+This is the default view!
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,100 @@
+<div ng-controller="tabsController">
+ <nav>
+ <ul class="nav nav-tabs">
+ <script type="text/ng-template" id="currentTab">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ {{page.name}}<b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu">
+ <li class=""><a href="#">Edit Page</a></li>
+ <li class=""><a href="#">Delete Page</a></li>
+ <li class=""><a href="#">Move Page</a></li>
+ <li class="hidden"><a href="#">Export Page</a></li>
+ <li class=""><a href="#sharePageDialog"
data-toggle="modal">Share Page</a></li>
+ <li class="menu-item-disabled"><a href="#">Remove
share</a></li>
+ </ul>
+ </script>
+ <script type="text/ng-template" id="otherTab">
+ <a href="{{page.id}}">
+ {{page.name}}
+ </a>
+ </script>
+ <li ng-repeat="page in pages" ng-class="{active:page.isCurrent,
dropdown:page.isCurrent}"
+ ng-include="page.template">
+ </li>
+ <li id="addPageButton"><a href="#"><i
class="icon-plus"></i></a></li>
+ </ul>
+ </nav>
+ <div class="row-fluid">
+ <div class="tab-content">
+ <div ng-repeat="(regionIndex, region) in currentPage.regions"
ng-class="currentPage.pageLayoutCode">
+ <div ng-repeat="regionWidget in region.regionWidgets">
+
+ <div class="widget-wrapper">
+ <div class="widget-title-bar
widget-title-bar-draggable">
+ <div class="widget-toolbar-toggle-collapse"
title="Collapse/Restore Widget" style="">
+ <i class="icon-chevron-down"></i>
+ </div>
+ <div class="widget-title">
+ {{regionWidget.widgetUrl}}
+ </div>
+ <div class="widget-toolbar ">
+ <div class="dropdown widget-menu-wrapper"
style="">
+ <a class="dropdown-toggle">
+ <i class="icon-cog"></i>
+ </a>
+ <ul class="dropdown-menu widget-menu">
+ <li class="">
+ <a href="#">
+ Edit Preferences
+ </a>
+ </li>
+ <li>
+ <a href="#">
+ Maximize
+ </a>
+ </li>
+ <li>
+ <a href="#">
+ Move to Page
+ </a>
+ </li>
+ <li>
+ <a href="#">
+ Delete Widget
+ </a>
+ </li>
+ <li class="divider"></li>
+ <li>
+ <a href="#">
+ About this Widget
+ </a>
+ </li>
+ <li>
+ <a href="#">
+ Comment on this Widget
+ </a>
+ </li>
+ <li>
+ <a href="#">
+ Rate this Widget
+ </a>
+ </li>
+ </ul>
+ </div>
+ <span class="widget-toolbar-btn
widget-toolbar-btn-min" style="display: none;">
+ <i class="icon-resize-small"></i>
+ </span>
+ </div>
+ </div>
+
+ <div class="widget-prefs"></div>
+ <div class="widget">
+ {{regionWidget.widgetUrl}}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/profile.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/profile.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/profile.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/profile.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title></title>
+</head>
+<body>
+
+</body>
+</html>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/index.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/index.html?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/index.html
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/index.html
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html ng-app="rave">
+<head>
+ <link
href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css"
rel="stylesheet">
+ <link rel="stylesheet" href="css/rave.css"/>
+</head>
+<body>
+<div class="wrapper" ng-cloak>
+
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand"><span ng-show="user.username">Hello
{{user.username}}. </span>Welcome to Rave!</a>
+ <ul class="nav pull-right">
+ <li ng-show="user.username"><a
href="/portal/app/person/id/1">{{user.username}}'s Profile</a>
+ </li>
+ <li ng-show="user.username"><a
href="/portal/app/store">Widget Store</a></li>
+ <li ng-show="user.admin"><a href="/portal/app/admin">Admin
Interface</a></li>
+ <li ng-show="user.username"><a ng-click="logout()"
href="#">Logout</a></li>
+ <li ng-hide="user.username"><a ng-click="login()"
href="#">Login/Register</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="logo-wrapper"></div>
+ <div ng-view></div>
+
+ <script
src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
+ <script
src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
+ <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
+ <script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
+ <script
src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min.js"></script>
+
+ <script
src="/gadgets/js/container:pubsub-2:open-views.js?c=1&container=default&debug=1"></script>
+
+ <script src="script/core/rave_core.js"></script>
+ <script src="script/core/rave_ajax.js"></script>
+ <script src="script/core/rave_api.js"></script>
+ <script src="script/core/rave_widget.js"></script>
+ <script src="script/core/rave_opensocial.js"></script>
+ <script src="script/core/rave_wookie.js"></script>
+
+
+ <script src="script/angular-portal/controllers.js"></script>
+ <script src="script/angular-portal/directives.js"></script>
+ <script src="script/angular-portal/services.js"></script>
+ <script src="script/angular-portal/routing.js"></script>
+ <script src="script/angular-portal/app.js"></script>
+
+
+</body>
+</html>
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/app.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/app.js?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/app.js
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/app.js
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,3 @@
+angular.module('rave', ['rave.controller', 'rave.directive', 'rave.service',
'rave.routing'])
+
+
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/controllers.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/controllers.js?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/controllers.js
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/controllers.js
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,29 @@
+angular.module('rave.controller', [])
+ .controller('tabsController', ['$scope', 'rave', 'pages', '$routeParams',
function ($scope, rave, pages, $routeParams) {
+ $scope.pages;
+ $scope.currentPage;
+
+ $scope.$on('$routeChangeSuccess', function(oldRoute, newRoute){
+ setCurrentPage(newRoute.params.tabId);
+ });
+
+ pages.then(function(pages){
+ $scope.pages = pages;
+ setCurrentPage($routeParams.tabId);
+ });
+
+ function setCurrentPage(pageId) {
+ if(_.isUndefined(pageId)) {
+ pageId = $scope.pages[0].id;
+ }
+ _.each($scope.pages, function(page) {
+ page.template = 'otherTab'
+ page.isCurrent = false;
+ if(page.id == pageId) {
+ page.isCurrent = true;
+ page.template = 'currentTab'
+ $scope.currentPage = page;
+ }
+ })
+ }
+ }]);
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/directives.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/directives.js?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/directives.js
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/directives.js
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,4 @@
+angular.module('rave.directive', [])
+ .directive('renderWidget', function(){
+
+ });
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/routing.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/routing.js?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/routing.js
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/routing.js
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,47 @@
+angular.module('rave.routing', [])
+ .config(['$routeProvider', '$locationProvider', '$httpProvider', function
($routeProvider, $locationProvider, $httpProvider) {
+
+ //The routes that our angular app will handle
+ $routeProvider
+ .when('/', { templateUrl: "/portal/static/html/portal/tabs.html"})
+ .when('/:tabId', { templateUrl:
"/portal/static/html/portal/tabs.html"})
+ .otherwise({ templateUrl: '/portal/static/html/portal/404.html'});
+
+
+ //gets rid of the # in urls
+ $locationProvider.html5Mode(true);
+
+ /*
+ Set up an interceptor to watch for 401 errors.
+ The server, rather than redirect to a login page (or whatever), just
returns a 401 error
+ if it receives a request that should have a user session going.
Angular catches the error below
+ and says what happens - in this case, we just redirect to a login
page. You can get a little more
+ complex with this strategy, such as queueing up failed requests and
re-trying them once the user logs in.
+ Read all about it here:
http://www.espeo.pl/2012/02/26/authentication-in-angularjs-application
+ */
+ var interceptor = ['$q', '$location', '$rootScope', function ($q,
$location, $rootScope) {
+ function success(response) {
+ return response;
+ }
+
+ function error(response) {
+ var status = response.status;
+ if (status == 401) {
+ $rootScope.redirect = $location.url(); // save the current
url so we can redirect the user back
+ $rootScope.user = {}
+ $location.path('/login');
+ }
+ return $q.reject(response);
+ }
+
+ return function (promise) {
+ return promise.then(success, error);
+ }
+ }];
+ $httpProvider.responseInterceptors.push(interceptor);
+ }])
+ .run(['$route', '$rootScope', function ($route, $rootScope) {
+ $rootScope.$on('$routeChangeSuccess', function (oldRoute, newRoute) {
+ $rootScope.templateUrl = newRoute.templateUrl;
+ });
+ }]);
\ No newline at end of file
Added:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/services.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/services.js?rev=1467152&view=auto
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/services.js
(added)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/angular-portal/services.js
Fri Apr 12 00:32:58 2013
@@ -0,0 +1,8 @@
+angular.module('rave.service', [])
+ .value('rave', rave)
+ .value('context')
+ .service('pages', ['$http', function($http){
+ return
$http.get('/portal/api/rest/pages/portal/@self').then(function(response){
+ return response.data.Page;
+ });
+ }]);
\ No newline at end of file
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_ajax.js
Fri Apr 12 00:32:58 2013
@@ -17,7 +17,7 @@
* under the License.
*/
-rave = rave || {};
+var rave = rave || {};
/*
The rave.ajax function is a simple wrapper for jquery's ajax function.
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_api.js
Fri Apr 12 00:32:58 2013
@@ -21,7 +21,7 @@ var rave = rave || {};
* Namespace that provides client access to Rave server APIs.
* Note required jquery libraries must be imported by the containing page.
*/
-rave.api = rave.api || (function () {
+rave.api = (function () {
//stores virtual host context of application execution
var context = "";
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_core.js
Fri Apr 12 00:32:58 2013
@@ -16,8 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+var rave = rave || {};
-rave = (function () {
+_.extend(rave, (function () {
var INITIALIZED = false,
//providers - opensocial, wookie...
providers = {},
@@ -190,4 +191,5 @@ rave = (function () {
return exports;
-})();
\ No newline at end of file
+})()
+);
\ No newline at end of file
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
Fri Apr 12 00:32:58 2013
@@ -27,7 +27,8 @@ rave.registerProvider(
exports.init = function () {
var containerConfig = {};
containerConfig[osapi.container.ServiceConfig.API_PATH] = "/rpc";
- containerConfig[osapi.container.ContainerConfig.RENDER_DEBUG] =
rave.getJavaScriptDebugMode();
+ //TODO: if we want to support js debug mode in core, figure it out.
+ //containerConfig[osapi.container.ContainerConfig.RENDER_DEBUG] =
rave.getJavaScriptDebugMode();
container = new osapi.container.Container(containerConfig);
gadgets.pubsub2router.init({
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_widget.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_widget.js?rev=1467152&r1=1467151&r2=1467152&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_widget.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/core/rave_widget.js
Fri Apr 12 00:32:58 2013
@@ -17,7 +17,7 @@
* under the License.
*/
-rave = rave || {};
+var rave = rave || {};
/*
Rave RegionWidget Interface