Alexander Wels has uploaded a new change for review.

Change subject: core: i18n splash with branding
......................................................................

core: i18n splash with branding

- Updated splash page to take branding into account.
- Added ability to add multiple sections with links.
- Updated styles to take branding into account.
- Created new resource bundle for splash page based on
branding manager.
- Added new application type to BrandingTheme, 'splash'
- Added ability to put header text at top of splash page.

Change-Id: I9987ed58c2e0ead9b25c5f46fb974a96bfd46d30
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=838456
Signed-off-by: Alexander Wels <aw...@redhat.com>
---
M README.branding
M 
backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
D 
backend/manager/modules/root/src/main/resources/org/ovirt/engine/core/messages.properties
M backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
M backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingManager.java
R 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingServlet.java
A 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingSplashResourceBundle.java
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingTheme.java
R 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/branding/BrandingServletTest.java
M 
frontend/webadmin/modules/frontend/src/main/resources/META-INF/web-fragment.xml
M packaging/branding/ovirt.brand/branding.properties
R packaging/branding/ovirt.brand/images/splash/bg_head.gif
R packaging/branding/ovirt.brand/images/splash/bg_main.gif
R packaging/branding/ovirt.brand/images/splash/logo.png
R packaging/branding/ovirt.brand/images/triangle_down_gray.gif
M packaging/branding/ovirt.brand/messages.properties
R packaging/branding/ovirt.brand/ovirt-engine-style.css
18 files changed, 239 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/59/16359/1

diff --git a/README.branding b/README.branding
index 5a13a69..05c9c78 100644
--- a/README.branding
+++ b/README.branding
@@ -18,6 +18,7 @@
 
     user_portal_css - Css to inject into user portal (required, can be empty).
     web_admin_css - Css to inject into web admin (required, can be empty).
+    splash_css - Css for the splash page (root) (required, can be empty).
     messages - Standard java message bundle (required).
     version - The version of the branding in the package. Only versions
       that match the one defined in the engine will be loaded (required,
@@ -31,10 +32,11 @@
 CSS are injected in the same order of how the branding packages are declared,
 this way the last css's styles are defined in the correct order.
 
-The oVirt UI is broken up into three distinct modules at this point.
+The oVirt UI is broken up into four distinct modules at this point.
  * User Portal
  * Web Admin
  * Common widgets
+ * splash page (root)
 
 Each of those modules contain some widgets that we can style using CSS
 clases. Refer to EXAMPLE to see a listing of available classes categorized
@@ -51,7 +53,8 @@
    the branding properties.
 2. user_portal.css, The user portal style sheet file.
 3. web_admin.css, The web admin style sheet file.
-4. messages.properties, A java message bundle in many different locales.
+4. ovirt-engine-style.css, The styles associated with the splash page.
+5. messages.properties, A java message bundle in many different locales.
 
 Note that images are background images instead of image tags so we can use
 style sheets to replace them.
diff --git 
a/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
 
b/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
index b2f0532..6d6e228 100644
--- 
a/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
+++ 
b/backend/manager/modules/root/src/main/java/org/ovirt/engine/core/SplashServlet.java
@@ -1,7 +1,9 @@
 package org.ovirt.engine.core;
 
 import java.io.IOException;
+import java.util.List;
 import java.util.Locale;
+import java.util.ResourceBundle;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
@@ -9,8 +11,13 @@
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.jstl.core.Config;
+import javax.servlet.jsp.jstl.fmt.LocalizationContext;
 
 import org.apache.log4j.Logger;
+import org.ovirt.engine.core.utils.branding.BrandingManager;
+import org.ovirt.engine.core.utils.branding.BrandingSplashResourceBundle;
+import org.ovirt.engine.core.utils.branding.BrandingTheme;
 import org.ovirt.engine.core.utils.servlet.LocaleFilter;
 
 /**
@@ -33,17 +40,34 @@
      */
     private static final String LOCALE_KEYS = "localeKeys";
 
+    /**
+     * The request attribute containing the section map.
+     */
+    private static final String SECTION_MAP = "sectionMap";
+
+    private static final String THEMES_KEY = "brandingStyle";
+
+    private static final String APPLICATION_TYPE = "applicationType";
+
     @Override
     protected void doGet(final HttpServletRequest request, final 
HttpServletResponse response) throws IOException,
         ServletException {
         Locale userLocale = (Locale) request.getAttribute(LocaleFilter.LOCALE);
         log.info("Detected Locale: " + userLocale.toLanguageTag());
         request.setAttribute(LOCALE_KEYS, LocaleFilter.getLocaleKeys());
+        request.setAttribute(SECTION_MAP, 
BrandingSplashResourceBundle.getSectionKeyMap());
+        List<BrandingTheme> brandingThemes = 
BrandingManager.getInstance().getBrandingThemes();
+        request.setAttribute(THEMES_KEY, brandingThemes);
+        request.setAttribute(APPLICATION_TYPE, 
BrandingTheme.ApplicationType.SPLASH);
         RequestDispatcher dispatcher = 
request.getRequestDispatcher("/WEB-INF/ovirt-engine.jsp");
         response.setContentType("text/html;charset=UTF-8");
+        // Load the appropriate resource bundle with the right locale.
+        ResourceBundle bundle = ResourceBundle.getBundle("BrandingBundle", 
userLocale,
+                BrandingSplashResourceBundle.getBrandingControl());
+        // Pass the loaded resource bundle to the jsp.
+        Config.set(request, Config.FMT_LOCALIZATION_CONTEXT, new 
LocalizationContext(bundle, userLocale));
         if (dispatcher != null) {
             dispatcher.include(request, response);
         }
     }
-
 }
diff --git 
a/backend/manager/modules/root/src/main/resources/org/ovirt/engine/core/messages.properties
 
b/backend/manager/modules/root/src/main/resources/org/ovirt/engine/core/messages.properties
deleted file mode 100644
index 49e17f9..0000000
--- 
a/backend/manager/modules/root/src/main/resources/org/ovirt/engine/core/messages.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-splash.welcome.text=Welcome to Open Virtualization Manager.
-splash.version=Version
-splash.browser.javascript1=* Your current browser settings prevent displaying 
this page correctly\!
-splash.browser.javascript2=Please allow Javascript to run on your browser (for 
example, by adding this site to 'Trusted Sites') and then refresh the page.
-splash.menu.main=Portals
-splash.menu.userportal=User Portal
-splash.menu.adminportal=Administrator Portal
-splash.menu.reportsportal=Reports Portal
-splash.title=Ovirt-Engine
diff --git 
a/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
index 8f592e0..8b4d27d 100644
--- a/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
+++ b/backend/manager/modules/root/src/main/webapp/WEB-INF/ovirt-engine.jsp
@@ -1,53 +1,66 @@
 <%@ page pageEncoding="UTF-8" session="false" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
-<fmt:setBundle basename="org.ovirt.engine.core.languages" var="lang" />
-<fmt:setLocale value="${requestScope['locale']}" />
-<fmt:setBundle basename="org.ovirt.engine.core.messages"/>
+<fmt:setBundle basename="languages" var="lang" />
 <!DOCTYPE html>
 <html>
 <head>
     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-    <title><fmt:message key="splash.title" /></title>
-    <link rel="stylesheet" href="ovirt-engine-style.css" type="text/css" 
media="screen, projection"/>
+    <title><fmt:message key="title" /></title>
+    <c:if test="${requestScope['brandingStyle'] != null}">
+        <c:forEach items="${requestScope['brandingStyle']}" var="theme">
+            <c:if 
test="${theme.getThemeStyleSheet(requestScope['applicationType']) != null}">
+    <link rel="stylesheet" type="text/css" 
href="${pageContext.request.contextPath}/theme${theme.path}/${theme.getThemeStyleSheet(requestScope['applicationType'])}">
+            </c:if>
+        </c:forEach>
+    </c:if>
     <script src="engineVersion.js" type="text/javascript"></script>
     <script src="splash.js" type="text/javascript"></script>
 </head>
 <body onload="pageLoaded()">
     <div>
         <div class="left">
+            <div class="header_nav">
+                <fmt:message key="header.main" />
+            </div>
+        </div>
+        <div class="right">
         </div>
         <div class="center">
         </div>
     </div>
     <div class="main">
-        <div class="welcome"><fmt:message key="splash.welcome.text" /></div>
+        <div class="welcome"><fmt:message key="welcome.text" /></div>
         <div class="welcome">
              <script type="text/JavaScript">
             <!--
-            document.write('<fmt:message key="splash.version" />' + myVersion)
+            document.write('<fmt:message key="version"><fmt:param 
value="myVersion" /> </fmt:message>')
             //-->
             </script>
         </div>
 
         <noscript id="warningMessage" class="warningMessage">
-            <b><fmt:message key="splash.browser.javascript1" /></b>
-            <fmt:message key="splash.browser.javascript2" />
+            <b><fmt:message key="browser.javascript1" /></b>
+            <fmt:message key="browser.javascript2" />
         </noscript>
-
         <div id='dynamicLinksSection' style="display: none;">
-            <div>
-            <h2>
-                <span class="fakeH2"><fmt:message key="splash.menu.main" 
/></span>
-            </h2>
-                <c:set var="localeParam" 
value="?locale=${requestScope['locale'].toString()}"/>
-                <c:if test="${requestScope['locale'].toString() == 'en_US'}">
-                    <c:set var="localeParam" value=""/>
-                </c:if>
-                <div><a 
href="/UserPortal/org.ovirt.engine.ui.userportal.UserPortal/UserPortal.html${localeParam}"><fmt:message
 key="splash.menu.userportal" /></a></div>
-                <div><a 
href="/webadmin/webadmin/WebAdmin.html${localeParam}"><fmt:message 
key="splash.menu.adminportal" /></a></div>
-                <div><a 
href="/OvirtEngineWeb/RedirectServlet?Page=Reports"><fmt:message 
key="splash.menu.reportsportal" /></a></div>
-            </div>
+            <c:forEach items="${requestScope['sectionMap']}" 
var="sectionEntry">
+                   <div>
+                   <h2>
+                       <span class="fakeH2"><fmt:message 
key="section${sectionEntry.key}.main" /></span>
+                   </h2>
+                <c:forEach items="${sectionEntry.value}" var="rowEntry">
+                       <div>
+                          <a href="<fmt:message 
key='${rowEntry.value[\'url\']}'><fmt:param 
value='${requestScope[\"locale\"].toString()}'/> </fmt:message>">
+                             <fmt:message key='${rowEntry.value[\'text\']}' />
+                          </a>
+                          <c:if test="${rowEntry.value['extra.url'] != null}">
+                          &nbsp;[<a href="<fmt:message 
key='${rowEntry.value[\'extra.url\']}'><fmt:param 
value='${requestScope[\"locale\"].toString()}'/> </fmt:message>"><fmt:message 
key='${rowEntry.value[\'extra.text\']}' /></a>]
+                          </c:if>
+                       </div>
+                   </c:forEach>
+                   </div>
+            </c:forEach>
         </div>
         <div class="locale_select_panel">
             <select class="gwt-ListBox locale_list_box" 
onchange="localeSelected(this)">
diff --git a/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml
index f0c4c85..f4c3897 100644
--- a/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml
+++ b/backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml
@@ -220,6 +220,16 @@
     <url-pattern>/OvirtEngineWeb/ValidateSession</url-pattern>
   </servlet-mapping>
 
+  <!-- Branding Servlet -->
+  <servlet>
+    <servlet-name>BrandingServlet</servlet-name>
+    
<servlet-class>org.ovirt.engine.core.utils.branding.BrandingServlet</servlet-class>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>BrandingServlet</servlet-name>
+    <url-pattern>/theme/*</url-pattern>
+  </servlet-mapping>
+
   <!-- Filters -->
   <filter>
     <filter-name>LocaleFilter</filter-name>
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingManager.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingManager.java
index 83a4d20..5b02c09 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingManager.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingManager.java
@@ -164,7 +164,7 @@
      * @param locale The locale to get the messages for.
      * @return A {@code Map} of keys and values.
      */
-    private Map<String, String> getMessageMap(final String prefix, final 
Locale locale) {
+    Map<String, String> getMessageMap(final String prefix, final Locale 
locale) {
         List<BrandingTheme> messageThemes = getBrandingThemes();
         // We need this map to remove potential duplicate strings from the 
resource bundles.
         Map<String, String> keyValues = new HashMap<String, String>();
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServlet.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingServlet.java
similarity index 95%
rename from 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServlet.java
rename to 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingServlet.java
index cc0aa9a..9c2dd88 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServlet.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingServlet.java
@@ -1,4 +1,4 @@
-package org.ovirt.engine.ui.frontend.server.gwt;
+package org.ovirt.engine.core.utils.branding;
 
 import java.io.File;
 import java.io.IOException;
@@ -9,7 +9,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
-import org.ovirt.engine.core.utils.branding.BrandingManager;
 import org.ovirt.engine.core.utils.servlet.ServletUtils;
 
 /**
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingSplashResourceBundle.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingSplashResourceBundle.java
new file mode 100644
index 0000000..70b2c08
--- /dev/null
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingSplashResourceBundle.java
@@ -0,0 +1,128 @@
+package org.ovirt.engine.core.utils.branding;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.ListResourceBundle;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+/**
+ * This is a resource bundle containing the messages for the 'splash' page.
+ * The messages come from the ovirt branding package.
+ */
+public class BrandingSplashResourceBundle extends ListResourceBundle {
+
+    /**
+     * The prefix of the keys in the properties.
+     */
+    public static final String SPLASH = "splash";
+
+    public static final String SECTION = "section";
+
+    public static final String ROW = "row";
+
+    public static final String EXTRA = "extra";
+
+    @Override
+    protected Object[][] getContents() {
+        BrandingManager brandingManager = BrandingManager.getInstance();
+        Map<String, String> messageMap = brandingManager.getMessageMap(SPLASH, 
getLocale());
+        String[][] result = new String[messageMap.size()][2];
+        int i = 0;
+        for (Map.Entry<String, String> entry: messageMap.entrySet()) {
+            result[i][0] = entry.getKey();
+            result[i][1] = entry.getValue();
+            i++;
+        }
+        return result;
+    }
+
+    /**
+     * Get the {@code ResourceBundle.Control} needed to properly initialize 
the branding resource bundle.
+     * @return A {@code ResourceBundle.Control}
+     */
+    public static ResourceBundle.Control getBrandingControl() {
+        return new ResourceBundle.Control() {
+            @Override
+            public ResourceBundle newBundle(final String baseName, final 
Locale locale, final String format,
+                    final ClassLoader loader, final boolean reload) throws 
IllegalAccessException,
+                    InstantiationException, IOException {
+                return new BrandingSplashResourceBundle();
+            }
+        };
+    }
+
+    /**
+     * Get a map of sections based on the section/row elements in branding 
messages file.
+     * @return A Map of message keys.
+     */
+    public static Map<Integer, Map<Integer, Map<String, String>>> 
getSectionKeyMap() {
+        Map<Integer, Map<Integer, Map<String, String>>> headings =
+                new HashMap<Integer, Map<Integer, Map<String, String>>>();
+        // The locale doesn't matter, we want the keys
+        BrandingSplashResourceBundle resourceBundle = 
(BrandingSplashResourceBundle) BrandingSplashResourceBundle.
+                
getBundle("org.ovirt.engine.core.utils.branding.BrandingSplashResourceBundle");
+        String[][] contents = (String[][]) resourceBundle.getContents();
+        for (String[] items: contents) {
+            String key = items[0];
+            if (key.startsWith(SECTION)) {
+                // Split on dot, section1.row2.url [0] = section1, [1] = row2, 
[2] = url.
+                String[] menuSplit = key.split("\\."); //$NON-NLS-1$
+                // Locate the menu index.
+                int menuIndex = 
Integer.valueOf(menuSplit[0].replaceFirst(SECTION, "")); //$NON-NLS-1$
+                Map<Integer, Map<String, String>> rows = 
getSectionRows(headings, menuIndex);
+                try {
+                    // Locate the row index
+                    int rowIndex = 
Integer.valueOf(menuSplit[1].replaceFirst(ROW, "")); //$NON-NLS-1$
+                    Map<String, String> rowKeys = getRowKeys(rows, rowIndex);
+                    if (!EXTRA.equals(menuSplit[2])) {
+                        rowKeys.put(menuSplit[2], key);
+                    } else {
+                        rowKeys.put(menuSplit[2] + "." + menuSplit[3], key);
+                    }
+                } catch (NumberFormatException nfe) {
+                    // Do nothing, we found a key we don't care about.
+                }
+            }
+        }
+        resourceBundle.getKeys().toString();
+        return headings;
+    }
+
+    /**
+     * Gets a map of indexes and lists. The index is the order of the rows, 
and the list contains all the
+     * items that go in the row.
+     * @param headings The master map
+     * @param menuIndex The index of the section
+     * @return A map of rows part of the section denoted by the index.
+     */
+    private static Map<Integer, Map<String, String>> getSectionRows(
+            final Map<Integer, Map<Integer, Map<String, String>>> headings, 
final int menuIndex) {
+        Map<Integer, Map<String, String>> rows;
+        if (headings.get(menuIndex) == null) {
+            rows = new HashMap<Integer, Map<String, String>>();
+            headings.put(menuIndex, rows);
+        } else {
+            rows = headings.get(menuIndex);
+        }
+        return rows;
+    }
+
+    /**
+     * Gets a list of strings. The strings are message keys.
+     * @param rows The map containing all the rows.
+     * @param rowIndex The index in the map.
+     * @return A list of strings
+     */
+    private static Map<String, String> getRowKeys(final Map<Integer, 
Map<String, String>> rows, final int rowIndex) {
+        Map<String, String> rowKeys;
+        if (rows.get(rowIndex) == null) {
+            rowKeys = new HashMap<String, String>();
+            rows.put(rowIndex, rowKeys);
+        } else {
+            rowKeys = rows.get(rowIndex);
+        }
+        return rowKeys;
+    }
+}
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingTheme.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingTheme.java
index 1095b6f..218fa02 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingTheme.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/branding/BrandingTheme.java
@@ -30,7 +30,9 @@
         /** Web admin application. */
         WEBADMIN("webadmin", "web_admin_css"), //$NON-NLS-1$ //$NON-NLS-2$
         /** User portal application. */
-        USER_PORTAL("userportal", "user_portal_css"); //$NON-NLS-1$ 
//$NON-NLS-2$
+        USER_PORTAL("userportal", "user_portal_css"), //$NON-NLS-1$ 
//$NON-NLS-2$
+        /** Splash page. */
+        SPLASH("splash", "splash_css"); //$NON-NLS-1 //$NON-NLS-2$
 
         /**
          * Prefix associated with application type.
diff --git 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.java
 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/branding/BrandingServletTest.java
similarity index 90%
rename from 
frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.java
rename to 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/branding/BrandingServletTest.java
index 312183e..4b68889 100644
--- 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.java
+++ 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/branding/BrandingServletTest.java
@@ -1,4 +1,4 @@
-package org.ovirt.engine.ui.frontend.server.gwt;
+package org.ovirt.engine.core.utils.branding;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -21,7 +21,6 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
-import org.ovirt.engine.core.utils.branding.BrandingManager;
 
 @RunWith(MockitoJUnitRunner.class)
 public class BrandingServletTest {
@@ -53,7 +52,7 @@
         when(mockRequest.getPathInfo()).thenReturn("/test/something.txt"); 
//$NON-NLS-1$
         
when(mockResponse.getOutputStream()).thenReturn(mockResponseOutputStream);
         testFile = new File(this.getClass().getClassLoader().
-                
getResource("./org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.class")
 //$NON-NLS-1$
+                
getResource("./org/ovirt/engine/core/utils/branding/BrandingServletTest.class") 
//$NON-NLS-1$
                 .getFile());
     }
 
@@ -74,7 +73,7 @@
     @Test
     public void testDoGet_ExistingFile() throws IOException, ServletException {
         when(mockRequest.getPathInfo())
-            
.thenReturn("/org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.class");
 //$NON-NLS-1$
+            
.thenReturn("/org/ovirt/engine/core/utils/branding/BrandingServletTest.class"); 
//$NON-NLS-1$
         
when(mockFile.getAbsolutePath()).thenReturn(this.getClass().getClassLoader().
                 getResource(".").getFile()); //$NON-NLS-1$
         testServlet.doGet(mockRequest, mockResponse);
diff --git 
a/frontend/webadmin/modules/frontend/src/main/resources/META-INF/web-fragment.xml
 
b/frontend/webadmin/modules/frontend/src/main/resources/META-INF/web-fragment.xml
index 397c37a..70f5977 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/resources/META-INF/web-fragment.xml
+++ 
b/frontend/webadmin/modules/frontend/src/main/resources/META-INF/web-fragment.xml
@@ -67,6 +67,6 @@
 
     <servlet>
         <servlet-name>BrandingServlet</servlet-name>
-        
<servlet-class>org.ovirt.engine.ui.frontend.server.gwt.BrandingServlet</servlet-class>
+        
<servlet-class>org.ovirt.engine.core.utils.branding.BrandingServlet</servlet-class>
     </servlet>
 </web-fragment>
diff --git a/packaging/branding/ovirt.brand/branding.properties 
b/packaging/branding/ovirt.brand/branding.properties
index 5e59539..f5ff7f7 100644
--- a/packaging/branding/ovirt.brand/branding.properties
+++ b/packaging/branding/ovirt.brand/branding.properties
@@ -12,9 +12,13 @@
 # style sheets. (required, but the files can be empty)
 user_portal_css=user_portal.css
 web_admin_css=web_admin.css
+splash_css=ovirt-engine-style.css
 
 # text (optional, this overrides the default messages)
 messages=messages.properties
 
+#Splash page layout.
+splash_layout=splash.properties
+
 # version (required, the theme will not be applied without this property)
 version=1
diff --git a/backend/manager/modules/root/src/main/webapp/images/bg_head.gif 
b/packaging/branding/ovirt.brand/images/splash/bg_head.gif
similarity index 100%
rename from backend/manager/modules/root/src/main/webapp/images/bg_head.gif
rename to packaging/branding/ovirt.brand/images/splash/bg_head.gif
Binary files differ
diff --git a/backend/manager/modules/root/src/main/webapp/images/bg_main.gif 
b/packaging/branding/ovirt.brand/images/splash/bg_main.gif
similarity index 100%
rename from backend/manager/modules/root/src/main/webapp/images/bg_main.gif
rename to packaging/branding/ovirt.brand/images/splash/bg_main.gif
Binary files differ
diff --git a/backend/manager/modules/root/src/main/webapp/images/logo.png 
b/packaging/branding/ovirt.brand/images/splash/logo.png
similarity index 100%
rename from backend/manager/modules/root/src/main/webapp/images/logo.png
rename to packaging/branding/ovirt.brand/images/splash/logo.png
Binary files differ
diff --git 
a/backend/manager/modules/root/src/main/webapp/triangle_down_gray.gif 
b/packaging/branding/ovirt.brand/images/triangle_down_gray.gif
similarity index 100%
rename from backend/manager/modules/root/src/main/webapp/triangle_down_gray.gif
rename to packaging/branding/ovirt.brand/images/triangle_down_gray.gif
Binary files differ
diff --git a/packaging/branding/ovirt.brand/messages.properties 
b/packaging/branding/ovirt.brand/messages.properties
index fb8f435..0753fa4 100644
--- a/packaging/branding/ovirt.brand/messages.properties
+++ b/packaging/branding/ovirt.brand/messages.properties
@@ -30,3 +30,21 @@
 obrand.webadmin.doc=ENGINE Web Admin Documentation
 # The text at the top of the main user page.
 obrand.webadmin.main_header_label=
+
+#The splash page
+#{0} is the current locale
+obrand.splash.header.main=
+obrand.splash.welcome.text=Welcome to Open Virtualization Manager.
+obrand.splash.version=Version {0}
+obrand.splash.title=Ovirt-Engine
+obrand.splash.browser.javascript1=* Your current browser settings prevent 
displaying this page correctly\!
+obrand.splash.browser.javascript2=Please allow Javascript to run on your 
browser (for example, by adding this site to 'Trusted Sites') and then refresh 
the page.
+
+#splash page main section
+obrand.splash.section1.main=Portals
+obrand.splash.section1.row1.text=User Portal
+obrand.splash.section1.row1.url=/UserPortal/org.ovirt.engine.ui.userportal.UserPortal/UserPortal.html?locale={0}
+obrand.splash.section1.row2.text=Administrator Portal
+obrand.splash.section1.row2.url=/webadmin/webadmin/WebAdmin.html?locale={0}
+obrand.splash.section1.row3.text=Reports Portal
+obrand.splash.section1.row3.url=/OvirtEngineWeb/RedirectServlet?Page=Reports
diff --git 
a/backend/manager/modules/root/src/main/webapp/ovirt-engine-style.css 
b/packaging/branding/ovirt.brand/ovirt-engine-style.css
similarity index 83%
rename from backend/manager/modules/root/src/main/webapp/ovirt-engine-style.css
rename to packaging/branding/ovirt.brand/ovirt-engine-style.css
index d92a638..74ce730 100644
--- a/backend/manager/modules/root/src/main/webapp/ovirt-engine-style.css
+++ b/packaging/branding/ovirt.brand/ovirt-engine-style.css
@@ -2,7 +2,7 @@
 {
        margin: 0;
        padding: 0;
-       background-image: url(images/bg_main.gif);
+       background-image: url(images/splash/bg_main.gif);
        color: #111111;
 }
 
@@ -22,7 +22,7 @@
 
 .left
 {
-       background-image: url(images/logo.png);
+       background-image: url(images/splash/logo.png);
        background-repeat: no-repeat;
        float: left;
        height: 73px;
@@ -32,14 +32,14 @@
 
 .center
 {
-       background-image: url(images/bg_head.gif);
+       background-image: url(images/splash/bg_head.gif);
        background-repeat: repeat-x;
        height: 73px;
 }
 
 .right
 {
-       background-image: url(images/header_right.jpg);
+       background-image: url(images/splash/header_right.jpg);
        background-repeat: no-repeat;
        background-position: right; 
        float: right;
@@ -94,7 +94,7 @@
 
 /*The locale selection box.*/
 .locale_select_panel {
-    background: url("/triangle_down_gray.gif") no-repeat scroll right center;
+    background: url("images/triangle_down_gray.gif") no-repeat scroll right 
center;
     float: right;
     margin-left: 270px;
     margin-right: 25px;


-- 
To view, visit http://gerrit.ovirt.org/16359
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9987ed58c2e0ead9b25c5f46fb974a96bfd46d30
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <aw...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to