Skip to content

Commit

Permalink
Merge pull request #6614 from jpruiz114/SP-5069
Browse files Browse the repository at this point in the history
[SP-5069] Adding Backport of logic for PDI-17863 and PDI-18039
  • Loading branch information
smmribeiro committed Jun 3, 2019
2 parents bfccc92 + 8cb0649 commit b44e442
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Expand Up @@ -318,7 +318,7 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
if ( isJettyMode() ) {
out.println( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/carte.css\" />" );
} else {
out.print( StatusServletUtils.getPentahoStyles() );
out.print( StatusServletUtils.getPentahoStyles( root ) );
}
out.println( "</HEAD>" );
out.println( "<BODY style=\"overflow: auto;\">" );
Expand Down
4 changes: 2 additions & 2 deletions engine/src/main/java/org/pentaho/di/www/GetStatusServlet.java
Expand Up @@ -249,7 +249,7 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
if ( isJettyMode() ) {
out.println( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/carte.css\" />" );
} else {
out.print( StatusServletUtils.getPentahoStyles() );
out.print( StatusServletUtils.getPentahoStyles( root ) );
out.println( "<style>" );
out.println( ".pentaho-table td, tr.cellTableRow, td.gwt-MenuItem, .toolbar-button:not(.toolbar-button-disabled) {" );
out.println( " cursor: pointer;" );
Expand Down Expand Up @@ -294,7 +294,7 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
out.println( "<table cellspacing=\"0\" cellpadding=\"0\" class=\"toolbar\" style=\"width: 100%; height: 26px; margin-bottom: 2px; border: 0;\">" );
out.println( "<tbody><tr>" );
out.println( "<td align=\"left\" style=\"vertical-align: middle; width: 100%\" id=\"trans-align\"></td>" );
out.println( "<td " + setupIconEnterLeaveJavascript( "pause" ) + " align=\"left\" style=\"vertical-align: middle;\"><div style=\"padding: 2px;\" onClick=\"resumeFunction( this )\" class=\"toolbar-button toolbar-button-disabled\" id=\"pause\"><img style=\"width: 22px; height: 22px\" src=\"" + prefix + "/images/run_option.svg\" title=\"" + run + "\"/></div></td>" );
out.println( "<td " + setupIconEnterLeaveJavascript( "pause" ) + " align=\"left\" style=\"vertical-align: middle;\"><div style=\"padding: 2px;\" onClick=\"resumeFunction( this )\" class=\"toolbar-button toolbar-button-disabled\" id=\"pause\"><img style=\"width: 22px; height: 22px\" src=\"" + prefix + "/images/run.svg\" title=\"" + run + "\"/></div></td>" );
out.println( "<td " + setupIconEnterLeaveJavascript( "stop" ) + " align=\"left\" style=\"vertical-align: middle;\"><div style=\"padding: 2px;\" onClick=\"stopFunction( this )\" class=\"toolbar-button toolbar-button-disabled\" id=\"stop\"><img style=\"width: 22px; height: 22px\"src=\"" + prefix + "/images/stop.svg\" title=\"" + stop + "\"/></div></td>" );
out.println( "<td " + setupIconEnterLeaveJavascript( "cleanup" ) + " align=\"left\" style=\"vertical-align: middle;\"><div style=\"padding: 2px; margin-left: 10px !important;\" onClick=\"cleanupFunction( this )\" class=\"toolbar-button toolbar-button-disabled\" id=\"cleanup\"><img style=\"width: 22px; height: 22px\"src=\"" + prefix + "/images/cleanup.svg\" title=\"" + cleanup + "\"/></div></td>" );
out.println( "<td " + setupIconEnterLeaveJavascript( "view" ) + " align=\"left\" style=\"vertical-align: middle;\"><div style=\"padding: 2px; margin-left: 0 !important;\" onClick=\"viewFunction( this )\" class=\"toolbar-button toolbar-button-disabled\" id=\"view\"><img style=\"width: 22px; height: 22px\" src=\"" + prefix + "/images/view.svg\" title=\"" + view + "\"/></div></td>" );
Expand Down
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -342,7 +342,7 @@ public void doGet( HttpServletRequest request, HttpServletResponse response ) th
if ( isJettyMode() ) {
out.println( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/carte.css\" />" );
} else {
out.print( StatusServletUtils.getPentahoStyles() );
out.print( StatusServletUtils.getPentahoStyles( root ) );
}

out.println( "</HEAD>" );
Expand Down
15 changes: 8 additions & 7 deletions engine/src/main/java/org/pentaho/di/www/StatusServletUtils.java
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2018 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -34,7 +34,7 @@ public class StatusServletUtils {
public static final String STATIC_PATH = "/static";
public static final String PENTAHO_ROOT = "/pentaho";

public static String getPentahoStyles() {
public static String getPentahoStyles( String root ) {
StringBuilder sb = new StringBuilder();
String themeName = "ruby"; // default pentaho theme
String themeCss = "globalRuby.css";
Expand Down Expand Up @@ -75,8 +75,7 @@ public static String getPentahoStyles() {
relativePathSeparator = relativePathSeparator.replaceFirst( "(\\.\\.\\\\)", "" );

// Get mantle theme CSS file
String mantleThemeDirStr = relativePathSeparator + "webapps" + File.separator
+ "pentaho" + File.separator + "mantle" + File.separator
String mantleThemeDirStr = relativePathSeparator + "webapps" + root + File.separator + "mantle" + File.separator
+ "themes" + File.separator + themeName + File.separator;
File mantleThemeDir = new File( mantleThemeDirStr );
for ( File fName : mantleThemeDir.listFiles() ) {
Expand All @@ -89,9 +88,11 @@ public static String getPentahoStyles() {
// log here
}

sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/pentaho/content/common-ui/resources/themes/" + themeName + "/" + themeCss + "\"/>" );
sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/pentaho/mantle/themes/" + themeName + "/" + mantleThemeCss + "\"/>" );
sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/pentaho/mantle/MantleStyle.css\"/>" );
sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + root
+ "/content/common-ui/resources/themes/" + themeName + "/" + themeCss + "\"/>" );
sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + root
+ "/mantle/themes/" + themeName + "/" + mantleThemeCss + "\"/>" );
sb.append( "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + root + "/mantle/MantleStyle.css\"/>" );
return sb.toString();
}
}

0 comments on commit b44e442

Please sign in to comment.