What if all Weblogic Consoles look the same

What if all your Weblogic Consoles look the same and you are an Administrator responsible for more than a dozen domains? Probably you will recognize this; Just a few moments before you are about to finish the configuration of a Weblogic domain in development somebody requests you to  investigate an issue in production immediately. You only have to restart the Managed Server in Development to finish it, but there is no time. After solving the issue quickly, you get your well deserved cup coffee and return to you desk. Here you continue where you left of before the incident. You shutdown the managed server to finalize the configuration, well done! Only you forgot that you did not close the Production Admin Console used while investigating the issue in production. I know, it won’t happen to you … but it will probably to me i cannot differentiate the Weblogic Consoles for all the DTAP environments we have.

The good news is that you can rebrand the Weblogic Consoles. And it is documented by Oracle in the document ‘Extending the Administration Console for Oracle Weblogic Server‘. The instructions sometimes unfortunately leave you with a hint like ‘You must precompile JSPs before deploying the extension.’ or a syntactically incorrect example of the netuix-extension.xml. While building my own rebranded version and solving the ambiguities in the available documentation i wrote an Ant script to ease the proces of building a customized Weblogic Console look and feel. Here a step-by-step instruction how to use the ant script to build a customized Weblogic Console look and feel.

Prerequisites

To be able to build a custom look and feel you have to meet the following prerequisites before continuing.

  • Weblogic Server installation. You can find good instructions how to install Weblogic Server at oracle-base.com. Make sure that you install the version of Weblogic for which you want to create your customized look and feel. You will need to copy some version dependent files from your Weblogic Home to your project home later on. Also jsp taglibraries and tag library descriptors in the WL_HOME are needed for compilation of the JSPs.
  • Ant 1.8.2 or higher. When you installed Weblogic version 12.1.2 you can use ant available at $MW_HOME/oracle_common/modules/org.apache.ant_1.8.4, otherwise you have to get it from ant.apache.org and install is seperately.

Setup

In the following steps you will setup the project structure. The file laftemplate.zip containing the initial Look and Feel files for the extension will be copied from the Weblogic MW_HOME . Also the ant build file build-laf.xml and the deployment descriptor netuix-extension.xml will be copied to the project structure. By executing the ant target laf.project.initialize the extension source will be prepared.

  • Set the JAVA_HOME variable, e.g.;
  • Create a directory for containing the console extension project files
  • Copy the laftemplate.zip to the project root
  • Download wl_laf_build_files.zip and extract the files to the project root. The zip file contains the ant build file and deployment descriptor for the look and feel.
  • Now open the build-laf.xml with a text editor and change the following property.
    • [21] wl.home
  • Change the  property to the Weblogic Home of your local Weblogic installation.Optionally you can change the following netuix properties which will replace the values in the corresponding elements in the netuix-extension.xml deployment descriptor when building the look and feel.
    • [26] netuix.title
    • [27] netuix.version
    • [28] netuix.description
    • [30] netuix.author
    • [31] netuix.url
  • Documentation for all (other) properties is included in the comments of the build-laf.xml file.
  • Initialize the project by executing the task laf.project.initialize. This ask will create the extsource subdirectory containing your look and feel files.
  • The project structure will now look similar like the example below.

Adjust

You are now ready to make your first customization to the Weblogic Administration Console! Chapter Rebranding the Administration Console of the Oracle document Extending the Administration Console for Oracle Weblogic Server is a good starting point to find out how to change the look and feel.

To start small here an example how to change the logon screen of the Weblogic Console by making the login area red colored.

  • Change to the directory extsource/css in your project folder
  • Open the login.css with text editor
  • At approximately line 44 you will find the ID-selector #login

    Change the style declaration in login.css for the background property using the the example below.

 

Build

When done making customizations to the Weblogic Console look and feel the JSPs have to be compiled and the war file has to be build. You can execute the following steps repeatedly after each customization untill you are satisfied with the result.

  • Now change back to the projects root folder
  • Use the ant task laf.build to compile and build the new Weblogic Console look and feel.

    The ant task compiles the JSP files in a temporary directory jspcompile and then updates the look and feel source directory with the classes inWEB-INF/classes. After updating and adding the deployment descriptor netuix-extension.xml in WEB-INF the war file is build in the dist directory.
  • Now copy the war file to the console-ext directory of your weblogic domain and restart the Managed Server.
  • Refresh your Weblogic console to show the results.

 

build-laf.xml

The ant build file simplifies the process of building a custom Weblogic Console look and feel. All other tasks then laf.project.initialize and laf.build are internal tasks used by the two previously mentioned tasks. If you are wondering what the  laf.set.properties.netbeans task is for. This task sets the extension name based on the war name in nbprojects/project.properties. When running the ant task from the Netbeans IDE the extension name can be changed by changing the WAR File property in the project properties.

 

netuix-extension.xml

This is a correct example of the netuix-extension.xml. A complete schema reference can be found here.

0 You found this article helpful? Please recommend it.
Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: