Repository: incubator-stratos
Updated Branches:
  refs/heads/master f8ab5d426 -> 2e80654cb


Fixing STRATOS-591 (Adding an error page)


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/2e80654c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/2e80654c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/2e80654c

Branch: refs/heads/master
Commit: 2e80654cb34b7fe5fceffbe7a9d18f50901526ba
Parents: f8ab5d4
Author: Chanaka Jayasena <[email protected]>
Authored: Wed Apr 16 15:46:43 2014 +0530
Committer: Chanaka Jayasena <[email protected]>
Committed: Wed Apr 16 15:46:43 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/router.jag              |   4 +-
 .../console/default_page.jag                    |  25 ----
 .../console/error-404.html                      | 110 +++++++++++++++++
 .../console/error.html                          | 118 +++++++++++++++++++
 .../console/jaggery.conf                        |   7 +-
 .../console/themes/theme1/partials/404.hbs      |  52 --------
 .../themes/theme1/renderers/default_page.js     |  59 ----------
 7 files changed, 236 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/controllers/router.jag
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/controllers/router.jag 
b/components/org.apache.stratos.manager.console/console/controllers/router.jag
index bf9739a..46bee99 100644
--- 
a/components/org.apache.stratos.manager.console/console/controllers/router.jag
+++ 
b/components/org.apache.stratos.manager.console/console/controllers/router.jag
@@ -120,13 +120,13 @@
         }
 
 
-        var defaultPath='/default_page.jag';
+        /*var defaultPath='/default_page.jag';
         //Set the default path
         request.getMappedPath = function() {
             return defaultPath; // setting path for caramel framework
         };
         include(defaultPath);
-        return;
+        return; */
     }
 
     response.sendError(404,MSG_404);

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/default_page.jag
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/default_page.jag 
b/components/org.apache.stratos.manager.console/console/default_page.jag
deleted file mode 100644
index 4aa7209..0000000
--- a/components/org.apache.stratos.manager.console/console/default_page.jag
+++ /dev/null
@@ -1,25 +0,0 @@
-<%
-/*
- *
- * 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.
- *
- */
-var caramel = require('caramel')
-caramel.render({
-});
-%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/error-404.html
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/error-404.html 
b/components/org.apache.stratos.manager.console/console/error-404.html
new file mode 100644
index 0000000..71ad847
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/error-404.html
@@ -0,0 +1,110 @@
+<!--
+
+ 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.
+
+-->
+
+<!DOCTYPE html>
+<!--[if lt IE 7]>
+<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>
+<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>
+<html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js"> <!--<![endif]-->
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <title>Apache Stratos - Error </title>
+    <meta name="description" content="">
+    <meta name="viewport" content="width=device-width">
+    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' 
rel='stylesheet' type='text/css'>
+    <link href="themes/theme1/ui/css/bootstrap.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/bootstrap-theme.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/bootstrap-missing.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/main.css" rel="stylesheet">
+    <link rel="shortcut icon" href="themes/theme1/ui/img/favicon.png">
+</head>
+<body>
+
+<div id="dcontainer"></div>
+
+<!--[if lt IE 7]>
+<p class="chromeframe">You are using an <strong>outdated</strong> browser. 
Please <a href="http://browsehappy.com/";>upgrade
+    your browser</a> or <a 
href="http://www.google.com/chromeframe/?redirect=true";>activate Google Chrome 
Frame</a> to
+    improve your experience.</p>
+<![endif]-->
+
+
+<!-- Part 1: Wrap all page content here -->
+<div id="wrap">
+
+    <div class="top-blue-strip"></div>
+    <style>
+        body {
+            padding-top: 0;
+            padding-bottom: 0;
+        }
+    </style>
+
+
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-12">
+                <a style="margin-top: 20px;display: inline-block"  
href="/"><img src="themes/theme1/ui/img/logo-login.png"/></a>
+
+                <h1>OOPS!</h1>
+            </div>
+        </div>
+    </div>
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-12">
+                <div class="h2-wrapper"><h2>We are really sorry but the page 
you requested cannot be found.</h2></div>
+            </div>
+        </div>
+        <div class="row">
+
+            <div class="col-md-12">
+                It seems that the a page you were trying to reach doesn't 
exist anymore, or maybe it has just moved. We think that the best thing to do 
is to start again from the <a  href="{{url "/"}}">home page</a>. Feel free to 
contact us if the problem persist or if you definitely can't find what you are 
looking for. Thank you very much.
+            </div>
+        </div>
+    </div>
+
+
+
+    <!-- /container -->
+    <div id="push"></div>
+</div>
+
+<footer id="footer">
+    <div class="container">
+        <div class="pull-left"><img src="themes/theme1/ui/img/egg-logo.png" 
/></div>
+        <div class="pull-right footer-right">
+            Copyright © 2014 The Apache Software Foundation, Licensed under 
the Apache License, Version 2.0.
+            Apache Stratos, Apache, the Apache feather logo are trademarks of 
The Apache Software Foundation.
+        </div>
+        <div style="clear:both"></div>
+    </div>
+</footer>
+
+
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/error.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/error.html 
b/components/org.apache.stratos.manager.console/console/error.html
new file mode 100644
index 0000000..a03d00b
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/error.html
@@ -0,0 +1,118 @@
+<!--
+
+ 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.
+
+-->
+
+<!DOCTYPE html>
+<!--[if lt IE 7]>
+<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>
+<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>
+<html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js"> <!--<![endif]-->
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <title>Apache Stratos - Error </title>
+    <meta name="description" content="">
+    <meta name="viewport" content="width=device-width">
+    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' 
rel='stylesheet' type='text/css'>
+    <link href="themes/theme1/ui/css/bootstrap.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/bootstrap-theme.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/bootstrap-missing.css" rel="stylesheet">
+    <link href="themes/theme1/ui/css/main.css" rel="stylesheet">
+    <link rel="shortcut icon" href="themes/theme1/ui/img/favicon.png">
+</head>
+<body>
+
+<div id="dcontainer"></div>
+
+<!--[if lt IE 7]>
+<p class="chromeframe">You are using an <strong>outdated</strong> browser. 
Please <a href="http://browsehappy.com/";>upgrade
+    your browser</a> or <a 
href="http://www.google.com/chromeframe/?redirect=true";>activate Google Chrome 
Frame</a> to
+    improve your experience.</p>
+<![endif]-->
+
+
+<!-- Part 1: Wrap all page content here -->
+<div id="wrap">
+
+    <div class="top-blue-strip"></div>
+    <style>
+        body {
+            padding-top: 0;
+            padding-bottom: 0;
+        }
+    </style>
+
+
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-12">
+                <a style="margin-top: 20px;display: inline-block"  
href="/"><img src="themes/theme1/ui/img/logo-login.png"/></a>
+
+                <h1>OOPS!</h1>
+            </div>
+        </div>
+    </div>
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-12">
+                <div class="h2-wrapper"><h2>We're sorry, the Apache Stratos 
have encountered an error.</h2></div>
+            </div>
+        </div>
+        <div class="row">
+
+            <div class="col-md-12">
+                <p>
+                We apologize for the interruption to your work. Apache Stratos 
had a problem processing your request.
+                We take these problems seriously.
+                </p>
+                <p>Please report your problem by creating a JIRA at <a 
href="https://issues.apache.org/jira/browse/STRATOS";>https://issues.apache.org/jira/browse/STRATOS</a>.</p>
+                <p>
+                    Or drop a mail to our developer list as described in
+                    <a 
href="http://stratos.incubator.apache.org/community/mailing-lists.html";>http://stratos.incubator.apache.org/community/mailing-lists.html</a>
+                </p>
+            </div>
+        </div>
+    </div>
+
+
+
+    <!-- /container -->
+    <div id="push"></div>
+</div>
+
+<footer id="footer">
+    <div class="container">
+        <div class="pull-left"><img src="themes/theme1/ui/img/egg-logo.png" 
/></div>
+        <div class="pull-right footer-right">
+            Copyright © 2014 The Apache Software Foundation, Licensed under 
the Apache License, Version 2.0.
+            Apache Stratos, Apache, the Apache feather logo are trademarks of 
The Apache Software Foundation.
+        </div>
+        <div style="clear:both"></div>
+    </div>
+</footer>
+
+
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/jaggery.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/jaggery.conf 
b/components/org.apache.stratos.manager.console/console/jaggery.conf
index d742b11..b8ac217 100644
--- a/components/org.apache.stratos.manager.console/console/jaggery.conf
+++ b/components/org.apache.stratos.manager.console/console/jaggery.conf
@@ -18,5 +18,10 @@
                      "url":"/login",
                      "path":"/controllers/login.jag"
                 }
-            ]
+            ],
+    "errorPages":
+    {
+        "500":"/error.html",
+        "404":"/error-404.html"
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/themes/theme1/partials/404.hbs
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/404.hbs
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/404.hbs
deleted file mode 100644
index 8cd05a0..0000000
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/404.hbs
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-
- 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.
-
--->
-
-<div class="top-blue-strip"></div>
-<style>
-body {
-    padding-top: 0;
-    padding-bottom: 0;
-}
-</style>
-
-
-<div class="container">
-    <div class="row">
-        <div class="col-lg-12">
-            <a style="margin-top: 20px;display: inline-block"  href="{{url 
"/"}}"><img src="{{url "/themes/theme1/ui/img/logo-login.png"}}"/></a>
-
-            <h1>OOPS!</h1>
-        </div>
-    </div>
-</div>
-<div class="container">
-    <div class="row">
-        <div class="col-lg-12">
-            <div class="h2-wrapper"><h2>We are really sorry but the page you 
requested cannot be found.</h2></div>
-        </div>
-    </div>
-    <div class="row">
-
-        <div class="col-md-12">
-            It seems that the a page you were trying to reach doesn't exist 
anymore, or maybe it has just moved. We think that the best thing to do is to 
start again from the <a  href="{{url "/"}}">home page</a>. Feel free to contact 
us if the problem persist or if you definitely can't find what you are looking 
for. Thank you very much.
-        </div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2e80654c/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js
deleted file mode 100644
index f2745f3..0000000
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-var render = function (theme, data, meta, require) {
-      // Re-create the data structure of the cartridges.
-
-    theme('plain', {
-        body: [
-            {
-                partial: '404',
-                context: {
-                    title: 'My Cartridges'
-                }
-            }
-        ],
-        header: [
-            {
-                partial: 'header',
-                context: {
-                    title: 'My Cartridges',
-                    my_cartridges: true,
-                    button: {
-                        link: '/cartridges.jag',
-                        name: 'Subscribe to Cartridge',
-                        class_name: 'btn-important'
-                    },
-                    has_help: true,
-                    help: 'Create cartridges like PHP, Python, Ruby etc.. Or 
create data cartridges with mySql, PostgreSQL. Directly install applications 
like Drupal, Wordpress etc..'
-                }
-            }
-        ],
-        title: [
-            {
-                partial: 'title',
-                context: {
-                    title: "My Cartridges"
-                }
-            }
-        ]
-    });
-};

Reply via email to