Pages

Showing posts with label MDS. Show all posts
Showing posts with label MDS. Show all posts

Saturday, February 25, 2012

Use MySQL 5.5 as MDS database repository in FMW 11g R1 PS5

One of the new features of Fusion Middleware 11G R1 PatchSet 5 (PS5) is the support for MySQL 5.5 as Meta Data Services (MDS) repository. This means you can use MySQL database as a store for ADF personifications or as policies store for your OWSM domain. For MDS you just need a small database which store these configurations. For the SOA infra repository ( not supported on MySQL )  I think the Oracle Database will always be the best choice ( tuning, transactions, RAC ).
This way you add the MySQL database on the same machine as your WebLogic Domain without taking a lot of machine resources, less maintenance or thinking about licensing costs.

In this blogpost I will show you the steps how to create a MDS repository for OWSM and ADF.  

First we start with downloading MySQL 5.5 and install it on a machine. I will use InnoDb as database engine and UTF8 as character set ( this is probably best tested by Oracle).

Add or change the following database settings in the my.cnf of the MySQL database.


innodb_file_per_table
innodb_file_format=Barracuda
innodb_large_prefix
log_bin_trust_function_creators

sql-mode=NO_BACKSLASH_ESCAPES
max_sp_recursion_depth=10

The first 4 settings are required by the RCU installer ( Repository Creation Utility )
The sql-mode is necessary in OWSM else you will get a SQL error ( escape ' \'  on a like ) when you start the WebLogic Domain.
the max_sp_recursion_depth=10 else you will get this error Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine mds_internal_createPackageRecursive

Start the RCU installer and select MySQL Database as database type. I will use root as username cause it needs to create a table ( schema_version_registry)  in the test database  and it wants to create a new database.


MySQL does not support all options but for us, the Metadata Services option is enough. Besides MDS, MySQL is also supports ODI ( Oracle Data Integrator ) and Enterprise Performance Management, I personally don't know these products so I can't test them for you .


RCU creates a dev_mds database and an user dev_mds user.




It will create the following tables


For OWSM, I also created a dev1_mds database with the RCU which I will use in the WebLogic Domain creation ( EM, JRF and OWSM as domain options ) . I used the dev1_mds as database and DEV1_MDS as MySQL username



Now we can start the OWSM WebLogic domain and deploy our protected Web Services.

We can also use it in ADF, for this we need to open the Enterprise Manager application, select your domain and go to Metadata Repositories. Click on Register.


I create a new MySQL user which has access to the test and dev_mds database.


grant all on dev_mds.* to mds@'%' identified by 'welcome';
grant all on test.* to mds@'%' identified by 'welcome';

the test database contains the RCU schema_version_registry table which contains all the entries.

use mds as username and test as service name.


Now you can register  you own MDS database repository.



That's all.

Wednesday, July 22, 2009

Using Shared Object in Soa Suite 11g with MDS

Inspired by Eric Elzinga , who was wondering how MDS can work in Soa Suite 11g , I made some screenshots how you can use a XSD from a central MDS repository in your composite application. Clemens already blogged about re-using common metadata and he made a great ant utility to import or delete MDS files. For 11G R1 PS1 or higher use this instead of the Clemens utility
First I make a local MDS repository. If you install the Soa plugin you already have a seed folder in the integration folder. Under this folder create an new folder called apps. ( this have has to be apps else you will get a permission denied error ) . Under this apps folder we can create our own definitions.


To use my local SOA-MDS repository I create a new MDS File Connection

I want to re-use these common objects in every Soa project so I choose for the resource palette option

select the seed folder in the integration folder


Here we can see our common application objects.
Open the application resources window and open the adf-config.xml

Here we define a new metadata namespace with apps as path. And use the integration folder as metadata-path value.


We are ready to use these common objects in a mediator.. Here I will use a schema from the local MDS as input parameter for the mediator.

Import a new schema
Select the resource browser and here we can select our schema from the local MDS

I uncheck the Copy to project option, because this XSD already exists in the MDS

Our Project is ready but If we want to deploy this Soa project, we will receive a error, it can't find the schema. So we need to export the local MDS files to the SOA Suite database MDS.
To do this we have 2 options , the first option is to create a MAR deployment ( Application properties ) or do this with Ant.
I stripped the Clemens ant project so this ant build file has only two tasks , add and delete. It uses the adf-config.xml ( config folder) for the location of the target MDS and I use the local MDS as source.

Here is the target adf-config.xml which is located in the config folder

Change the build.properties so it matches your environment

This will import your local MDS object to the remote MDS. After this you can deploy your Soa Suite project.
Here you can download my ant project. Thanks to Clemens.

Tuesday, July 21, 2009

MDS repository for ADF 11G

With Fusion Middleware 11G the MDS repository plays a important role for ADF customizations and SOA shared objects. In this blog I explain how you can create a MDS database repository, deploy customizations to this MDS database and what you can do with MDS in the Enterprise manager website.

First we need to download the RCU repository creation utility and install a MDS repository in a Oracle Database.
Use a sysdba account

We only have to select the Metadata Services and provide a prefix

Next we need to install Weblogic with the Soa, Webcenter or Application development runtime extension. This extension gives us the Enterprise Manager website where we can configure the MDS repository. Select your Weblogic domain and select the MDS menu option.

Register the just created MDS repository. In my case I will call this repository adf

The EM website automatically create a datasource which we can use later.

If we have an ADF application with customizations and we deploy this to the Weblogic Server then JDeveloper detects the MDS repository

JDeveloper automatically creates a new MDS partition and uses your ear deployment name as partition name. It also uses the just created datasource to fill the MDS database. Just press deploy

When we go back to the EM website we can see the just created MDS partition.

The EM website also provides MBeans with some MDS operations.


For example we can query the partitions of a MDS repository.
When we select our just deployed ADF application and go to the MDS menu option, we can administer the MDS partition of this application.


We can export the MDS customization and import this to a different Weblogic server which has the same ADF application.
At last we can take a look at the MDS repository, here we can see that all the customizations entries are registered in the database. But the customizations xml are still located on the server, a bit strange I would suspect that with a MDS repository in the database that everything is loaded in the database.

Thursday, July 2, 2009

Customize and personalize your JSF pages with MDS / FMW 11G

In a previous post ( TP4 ) I already showed how you an application user can personalize the JSF pages of the ADF 11G application and that ADF will persists these username, role or site changes in a file or database. In TP4 I had to configure MDS manually. With the July release of JDeveloper 11g we can do this with a few wizards.

First we need to enable Customizations the viewcontroller project options. Enable User and Seeded Customizations
Open the adf-config.xml where we have to select the type of customization. We can choose user , role or site. You can always make your own customization class and select this class instead of the default options.

I choose for UserCC, this means I need to enable and configure ADF Security


Select Tag Configuration and choose for example column. This mean the user can change the properties of a table column.
In this case I want to enable that the user can change the column order and the width of the column.

The last step is to configure MDS or the Metadata repository. for this we need to go the application properties.

Make a new MAR deployment profile.



Select the MDS option where we can select the just created MAR profile.
Finally we can run your ADF application and change the column order of a ADF table. We can see these changes on our file system. ( JDEV_USER_HOME JDeveloper\system11.1.1.1.33.54.07\o.mds.dt\adrs )

Wednesday, July 9, 2008

Save your searches in an ADF Query panel

Probably your already know the ADF Search form in Jdeveloper 11G . You can get this choice when you drag a viewobject from the datacontrol to the page. This is nice but it can be lot cooler and better. In 11g you can use Query panels. This panel not only looks better but the user can personalize this panel and save its searches. So the next time the user can use them again. The query panel also give you more search options like greater than or between.

In this blog I will show you what you need to do to make this work. You need to know a litte bit about MDS and ADF security, for more info read my previous blog.
The ADF Query panel not only displays the attributes of the viewobject but also the viewobject criteria's. For this I created a new criteria called SalaryCriteria. To do this yourself we have to open the viewobject, go to the query part and there we see the defined criteria's.
In this editor you can create a complex where clause. The bind variables you use in this criteria are displayed as search attributes in the ADF Query Panel.


When you open the viewobject in the datacontrol there is a sub folder called Named Criteria. You can drag one of the criteria's to the page. If you use All Queriable Attributes then you get as default, a query panel with all the queriable attributes of the viewobject. When we use the SalaryCriteria then only the salary bind variable is displayed, off course you can still use the other attributes for a search operation.
When you drag a named criteria on the jsf page you get a chioce to select a particular query panel. I now use the ADF Query Panel with Table. With Table means with a search result table.

Here you see result when we drag the all queriable attributes named criteria from the datacontrol. Now if we want to save the search we have to use the ADF Security wizard and add security to the page definition of this search page. The last step is to configure MDS in this web application. We have to enable MDS on the viewcontroller project and pages and of course. configure adf-config.xml for MDS, you can use the adf-config of my previous blog, you only have to change the folders of the metadata path.


When we press save in the Query Panel we get a dialog where we can save the search

In the top right of the Query Panel you can select your own saved searches or the view criteria's




Here you see what is happening when you save a search. ADF creates a persdef folder and in this folder ADF makes a copy of the used viewobject and adds the new search criteria to it. ADF does the same thing as we did manually in the viewobject.