Thursday, January 29, 2015

Types of Data Sources

When you create a data source, you have 3 different types of data sources.  It is not always clear which type you can use in relation to your license.  Additionally, Oracle makes it just a little bit more obscure by using different namings in the WebLogic Console and the documentation.

Here are the 3 types you can choose in the WebLogic Console:

Generic Data Source

This is the basic type you can use to make a JDBC connection to a single database.
You can use this option in all the license levels: Standard, Enterprise and Suite.


Multi Data Source

Also known as "GridLink for RAC".
If your WebLogic Server is running on an underlying RAC database architecture, you can choose to use multi data sources.  A multi data source is a combination of several generic data sources.  First you have to create the generic data sources seperately and afterwards you can combine them in a multi data source, based on a algorithm type: Failover or Load-Balancing.
You can use this option in all the license levels: Standard, Enterprise and Suite.


GridLink Data Source

Also known as "Active GridLink for RAC".
Here, the JDBC info of your RAC is stored directly in the data source.
In fact it is a combination of the previous types:
* like the generic data source, the JDBC info is stored directly in the data source.
* like the multi data source, you can reach mutiple database nodes.
In this concept, the advantages of the RAC features are better used in your WebLogic architecture.
You can use this option only in the highest license level: Suite.

Modifying / Extending the WebLogic Server Administration Console

Case

You manage multiple development, test and production domains through their particular Administration Console.  Although you defined all your domains in production mode, you notice that sometimes you make changes in the wrong console (e.g. development changes in a production environment) because of time pressure and a lack of attention by yourself.  Oops...  Well, another nice advice is to implement console extensions in your Administration Console, e.g. especially for the real production environments.


Solution

You can change the login page and some colors in the console itself to accentuate the production environment.

I tested this out on a Windows Server 2008 machine.

Normally, when you navigate to your Administration Console, you see this screen:




In the console itself, you have always a light blue toolbar (Home | Log Out | Preferences | ...) and after executing an action, you see thereunder a light gray message box:




Now, we will change a bit this layout.

(1)
Open a MS-DOS session and execute the setDomainEnv.cmd script from your domain.

(2)
Go to the templates directory for the console extensions:
cd %WL_HOME%\server\lib\console-ext\templates

Here, you will normally find 2 files:
build-new-laf.xml
laftemplate.zip

Execute this command to create an exploded format of your console extensions war-file:
ant -f build-new-laf.xml -Dname=myConsoleExt -Ddir=C:\myConsoleExt

(3)
In the WEB-INF subdirectory, create a classes directory, go to this new directory and create global.properties file by executing this command:
jar -xf %WL_HOME%\server\lib\consoleapp\webapp\WEB-INF\lib\console.jar global.properties

(4)
When you open this file in a text editor, you can see here all the labels, titles etc that are displayed in the console.
For the login page, for example, we want to change the subtitle of the login box from "Log in to work with the WebLogic Server domain" to "Log in to this PRODUCTION domain".
In the global.properties locate this line:
login.welcome2=Log in to work with the WebLogic Server domain
And change it to:
login.welcome2=Log in to this PRODUCTION domain

(5)
To change the colors in the console, we are going to modify a stylesheet.
Locate this stylesheet:
C:\myConsoleExt\css\content.css
In the ".toolbar"-tag, change the property value for "background-color" from "#D2E5F9" to "#FF0000".
In the ".messagesbox"-tag, change the property value for "background-color" from "#F6F6F6" to "#00FFFF".

(6)
Create a war from the exploded directory.
cd C:\myConsoleExt
jar -cf myConsoleExt.war *
And move the war-file to the console-ext directory of your domain:
move myConsoleExt.war %LONG_DOMAIN_HOME%\console-ext\
On the server restart the administration server.
When this is done, restart your browser or clean the browser history on the client pc.

(7)
Test now your new Administration Console look and feel!




Monday, January 5, 2015

Reports : Barcodes in a Windows Server Environment

The barcode font is not a default font on Windows.
The intention is that you first install this font on your server machine.
How can you install a font?  Well, this is really simple on Windows.  I tested my setup on Windows Server 2008 R2.
Just copy your ttf file(s) (downloaded from the www, or supplied by a third party) to the "C:\Windows\Fonts" directory and restart your server machine.

When this is done, you will see your barcode font(s) in Reports Builder.

And you can start using your barcode font type.

If you run afterwards your report, you will not see the desired output.
That's because you'll have to so some other additional modifications.

(1)
The default Fonts directory has to be added to the REPORTS_PATH variable.
If you work with reports environements, then go to the "Basic Configuration" section and add "C:\Windows\Fonts\" to the REPORTS_PATH variable:

(2)
In the "Forms/Reports Common Configuration", add the barcode font to the "PDF Subsetting":
The data defined here are written to the "%INSTANCE_HOME%\config\FRComponent\frcommon\tools\COMMON\uifont.ali" file.
This file must be copied to the "%ORACLE_HOME%\tools\common\" directory.


Then, run your report and see that the barcode shows up correctly in your report: