Total Commander, Irfanview and Open Workbench in Wine

A few weeks ago I installed Wine Doors, that helps you with installing Windows applications under Wine. I found that it should install Total Commander, my favorite File management tool under Windows. I work with it for years, even bought a license for it. Unfortunately there is a bug in Wine-doors so that Total Commander and also Irfanview do not install correctly.
Luckily it is not to hard to install those tools by hand.

First Totalcommander. Download it from: http://www.ghisler.com/. Then start the installer by typing 'wine tcmdr703.exe' in the terminal. Or start tcmdr703.exe with wine.
This installs Total commander in the default wine-bottle. By default Total Commander installs in the c:\totalcmd folder. I don't like that, so I always change it to c:\Program Files\totalcmd.
The installer then turns out have difficulties in creating the menu-items. So you have to take care with that yourself. The command that you should provide in the menu-item is: 'wine ~/.wine/drive_c/Program\ Files/totalcmd/TOTALCMD.EXE'.

Irfanview was my favorite Graphics viewer under windows. It's nice to have it under Linux too.
To install irfanview is also easy. You could install it the same way you did with TotalCommander. But I found it easier to start TotalCommander and then just doubleclick on the irfanview installer. Easy does it.

The same counts for Open Workbench. Besides Microsoft Project (that is licensed) Open workbench is the only serious project managers tool that I know. I tried a few Linux tools (Ganttproject, KPlato) but they lack some basic functionalities. Like give in how much a task costs in terms of hours and doing baselining, scheduling etc. Ganttproject however does have an export to Microsoft Project, but I did not try that. It's in java so it should work in Linux aswell as under Windows (a bat file is provided).
To install Open workbench is also very simple. Double click on it from Total Commander. It appears neatly in your menu. You should also install a Java Runtime Engine. I just installed JRE 6 update 7 from http://java.sun.com/javase/downloads/index.jsp. For me there is no need to install the complete jdk. That I have available under Linux. After installing that one under Wine Open Workbench starts fine.

Now I should try to install Notepad++. A fine ascii-editor that is much more usefull then Notepad and a real advantage to have it the default editor of Total Commander.

Save your searches in an ADF Query panel

Edwin Biemond | Jul 9, 2008 01:30 -0600
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.

The new WebLogic Developers Conference

shay.shmeltzer | Jul 8, 2008 18:30 -0600

Now that BEA and WebLogic are part of Oracle, what is going to happen to the yearly conference BEA held for developers?

Well it got merged into the Oracle Develop conference this year at OOW.

Last month when I posted my previous entry on this year's Oracle Develop conference, I said we have 135 sessions in the conference - turns out we actually have 188 sessions according to the content catalog.

Most of the sessions that got added have to do with WebLogic/BEA products.
A quick search on "WebLogic" brings back over 25 sessions and hands-on labs and seraching for JRockit will bring more.

So if you are a WebLogic developer, we hope you'll join us this year at Oracle Develop and OOW.

iBatis: calling a plsql stored procedure with an object type parameter

Andrej Koelewijn | Jul 8, 2008 16:10 -0600

The ROWTYPE example will have to wait a bit, as i got a question for an example using an object type parameter when calling a stored procedure. So here goes…

I’ll admit upfront, i haven’t gotten this working the way i want it yet. I would like iBatis to map my object to the oracle object, but i couldn’t get that working. Instead i have kind of a workaround: i’ll instantiate the object type in some plsql code in my sqlMap configuration.

Here’s the sql code i’m going to execute. First the object type:

CREATE OR REPLACE type employee_obj
AS
  object (
    id             NUMBER(10)
  , name           VARCHAR2(100)
  , date_of_birth  DATE 
  )
/

The plsql stored procedure looks like this:

procedure save_employee_obj (
    p_emp in employee_obj
  ) is 
  begin
    insert into employees (
      id
    , name 
    , date_of_birth
    ) values (
      p_emp.id
    , p_emp.name
    , p_emp.date_of_birth
    );
  end;

The workaround in the sqlMap configuration file looks like this:

<procedure id="insertEmployeeObj"
             parameterClass="nl.iteye.ibatis.example1.Employee">
    <![CDATA[
      { call
          declare
            l_emp employee_obj := employee_obj(#id#,#name#,#dateOfBirth#);      
          begin
            employee_pkg.save_employee_obj(l_emp);
          end
      }
    ]]>
  </procedure>

I use iBatis’ # notation to map to parameterClass properties to a new object type instance.

Now i can call the stored procedure in my java application like this:

Employee emp = new Employee(
    new Long(5)
  , "Stefan"
  , (new GregorianCalendar(1992,Calendar.JUNE,15)).getTime()
  );
sqlMapper.insert("insertEmployeeObj", emp);

Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Java, Database, Oracle, ORM, Open Source

Manually Editing Translations within Apex without Exporting and Importing XLIFF File

Everyone already knows that translating an application built with Apex involves the following steps:
  1. Map your primary language application to a translated application
  2. Seed and export the translation text of your application into an translation file (XLIFF file)
  3. Translate text identified in translation file
  4. Apply your translation file and publish
Joel Kallman referred to a less know feature in this context during his presentation last month - “Go Global with Oracle Application Express!”- at the ODTUG Conference in New Orleans. Since Apex version 2.2 it is possible to perform your translations even more rapidly, without the need to export and import the XLIFF file again. Via Apex you can manually edit their translations within the repository. But, you still have to follow the same globalization process: mapping, seeding (without exporting the XLIFF file), translating and publishing (without applying the XLIFF file first).

So, to manually edit a translatable text, navigate to “Shared Components” > “Globalization” > “Translate Application” and follow these steps:
  1. Map your primary language application to a translated application.
    This 1st step is unchanged.

  2. Seed the translatable text (without exporting the XLIFF file).
    Click step 2. Choose your “Language Mapping” and press “Seed Translatable Text”. A message like “Translatable application 143 text seed complete for fr.” appears. Seeding is succeeded now. You may end this step because we don’t want to export an XLIFF file.

  3. Manually edit translation.
    From the “Translation Utilities” list (right on your page), choose “Manually Edit Translations”. The “Translatable Text” page appears. Within the search bar you can enter some search criteria.


    To edit translatable text, click the “Edit” icon; translate your text and press “Apply changes”.


  4. Publish the application (without applying the XLIFF file first).
    From the “Navigate” list (right on your page), choose “Publish Application”. Select the correct language mapping in “Create Application” and press “Publish Application”.

Finished!

This is an alternative and quick manner to achieve translations after small application changes due to bug fixing or other small modifications.

Last remark : Suppose you do have an application to translate using the XLIFF file, then you can edit your XLIFF file either by using a simple text-editor, MS-Word or an XML Editor (XML Spy or JDeveloper)... To avoid the repetitive work with these editors you can always use our own free utility, the XLIFF Translator.
Within this translator we provide a kind of a dictionary, so it will be possible to automate a part of the translation process for words/sentences that are repeatedly used. For more information read the blogs about the XLIFF Translator from January 2007 and February 2007.

There’s a cook in JDev’s development team indeed

Eduardo Rodrigues | Jul 8, 2008 13:50 -0600
Sometime ago I was surprised with a peculiar "tip of the day" which simply mentioned a traditional angel cake recipe.

Well, today I got the confirmation. There's certainly a cook amongst JDev's developers!

Look at the "tip" showed to me today:



Hmmmm... interesting... :)

ADF in Action: Building the Model Layer with ADF BC (BC4J)

olaf.heimburger | Jul 8, 2008 10:51 -0600
It has been a while. Being busy is a lame excuse, I was also investigating some other things and worked a lot with Oracle Application Diagnostics for Java (AD4J)...

Oracle ADF Business Components

The first version of Oracle ADF Business Components say the light of the world with JDeveloper 3. It was created to address the deficiencies of the EJB 1.1 specification. Although named Business Components this is a framework to create Business Components (for Java). ADF Business Components are usually referred ADF BC or BC4J. I will try be consistent but bear with me if I mix both.

Entities and Views and Application Modules

Like any other ORM framework ADF BC has its own names for the same concepts. The primary concepts are Entities, Views and Application Modules. Entities are usually considered as the representation of a table row in the database, while Views are manipulating the Entities (creating, updating, retrieving, and deleting). While Views work on Entities you need an Application Module to work with the Views and with the data in the database. The Application Module contains all the Views that are need for this module and the necessary information of the underlying database.

Implementing the ADF BC Model Layer

As in the two previous model layers we are reusing the data model created in the database. This is also a strength of ADF BC, working with existing database model instead of creating it from scratch. (As both approaches have their pros and cons, a seperate entry to show these is quite likely.) Like before we're following the same order of steps for JDeveloper 10.1.3 and 11g:

  • Create a Model Layer Project
  • Import the Database Objects

Steps for JDeveloper 10.1.3

Step 1: Create a Model Layer Project

  • To create a new Model Layer Project select OnlineSurvey in the Application Navigator, open the Context Menu and chose the New Project... menu entry.
  • In the New Gallery select an Empty Project and click on OK.
  • In the Create Project window set the Project Name to ModelBC and click on the OK button.
  • Select the newly created ModelBC project in the Application Navigator and open the Project Properties window with a double-click.
  • In the Project Properties window, check the values of Project Content and make sure that the Default Package is set to demo.survey.model.bc. Click OK to close this window.
  • Click on the Connections Navigator. Expand the Database folder, select the survey entry and open the Context Menu. From it select the Properties... entry to open the Edit Database Connection window. Click on the Authentication tab and check whether the Deploy Password check box is checked. If not, make sure that it is checked! ADF BC relies on it.

Step 2: Import Business Components from Tables

Select the ModelBC project in the Application Navigator. Open the New Gallery from the Context Menu -> New .... In the New Gallery expand the Business Tier and select ADF Business Components. On the right-hand side select Business Components From Tables and click on the OK button.

  • In the Initialize Business Components Project window select the survey connection and accept the default values for the SQL Flavor and Type Map (both should be Oracle). Click OK and the OK button on the Login window.
  • In the Create Business Components From Tables wizard step 1, click on the Query button to get all available tables. Once the table names appear, select all of them. Move all entries from Available to Selected, by clicking on the >> button. Like in the other model projects we change the names from plural to singular names. Best is to do it right now by selecting each line in the list and change the appearing value in the Entity Name text field, eg Answers to Answer.
  • Click Finish to end this wizard.

The wizard will now create the Entities and Association files in a single package. This is quite good at the first sight but really tedious if return to the project in three weeks. The naming for the Associations is hardly readable or memorable. Therefore we need to do two things:

  1. Move the Associations and the Entities in separate package.
  2. Rename the Associations with better readable names.

Move the files in separate packages is quite easy. Select all Entities, the ones without the Assoc suffix (Click on the file while holding the Ctrl-key). From the Context Menu select Refactor->Move... and type in the name demo.survey.model.bc.entities. After clicking on OK all files will be moved in the new package. You might be asked for creating the new package directory. This is perfectly OK. Repeat this for the Associations and move them into the package demo.survey.model.bc.links.

Warning! In JDeveloper 11g TP4 this might not finish. If this happens to you, the easiest bet is to kill JDeveloper 11g TP 4 and continue where it stopped.

Renaming the Associations to better readable names is as simple as moving the files. Only difference is that must do it file by file. In the demo.survey.model.bc.links package we select an Association, open the Context Menu, select Refactor, select Rename..., enter the new name and click on OK. We repeat this for all entries in the package and rename them according to the table below.

Old Name New Name
AnswersResponsesFKAssoc AnswersPerResponse
ItemsQuestionsFKAssoc ItemsPerQuestion
QuestionsSurveyFKAssoc QuestionsPerSurvey
RepsonseSurveysFKAssoc ResponsesPerSurvey
SurveysAuthorsFKAssoc SurveysPerAuthor

Steps for JDeveloper 11g

Note: During the course of this series a new version of the JDeveloper 11g has been released on OTN. I will follow every official release and you should do the same. If you've created the projects with an earlier version of JDeveloper 11g and reopen them in a newer release, it is possible that the project files have to be migrated. if JDeveloper asks you to do this, simply accept it.

Step 1: Create a Model Layer Project

  • To create a new Model Layer Project select OnlineSurvey in the Application Navigator, click on the Applications Menu on the right-hand side select the New Project... menu entry.
  • In the New Gallery select an Empty Project and click on OK.
  • In the Create Project window set the Project Name to ModelBC and click on the OK button.
  • Select the newly created ModelBC project in the Application Navigator and open the Project Properties window with a double-click.
  • In the Project Properties window, check the values of Project Content and make sure that the Default Package is set to demo.survey.model.bc. Click OK to close this window.
  • Expand the Application Resources accordion, expand the Connections folderm andexpand the Database folder, select the survey entry and open the Context Menu. From it select the Properties... entry to open the Edit Database Connection window. Check whether the Deploy Password check box is checked. If not, make sure that it is checked! ADF BC relies on it.

Step 2: Import Business Components from Tables

Select the ModelBC project in the Application Navigator. Open the New Gallery from the Context Menu -> New .... In the New Gallery expand the Business Tier and select ADF Business Components. On the right-hand side select Business Components From Tables and click on the OK button.

  • In the Initialize Business Components Project window select the survey connection and accept the default values for the SQL Flavor and Type Map (both should be Oracle). Click OK and the OK button on the Login window.
  • In the Create Business Components From Tables wizard step 1, click on the Query button to get all available tables. Once the table names appear, select all of them. Move all entries from Available to Selected, by clicking on the >> button. Like in the other model projects we change the names from plural to singular names. Best is to do it right now by selecting each line in the list and change the appearing value in the Entity Name text field, eg Answers to Answer.
  • Click Finish to end this wizard.

The wizard will now create the Entities and Association files in a single package. This is quite good at the first sight but really tedious if return to the project in three weeks. The naming for the Associations is hardly readable or memorable. Therefore we need to do two things:

  1. Move the Associations and the Entities in separate package.
  2. Rename the Associations with better readable names.

Move the files in separate packages is quite easy. Select all Entities, the ones without the Assoc suffix (Click on the file while holding the Ctrl-key). From the Context Menu select Refactor->Move... and type in the name demo.survey.model.bc.entities. After clicking on OK all files will be moved in the new package. You might be asked for creating the new package directory. This is perfectly OK. Repeat this for the Associations and move them into the package demo.survey.model.bc.links.

Renaming the Associations to better readable names is as simple as moving the files. Only difference is that must do it file by file. In the demo.survey.model.bc.links package we select an Association, open the Context Menu, select Refactor, select Rename..., enter the new name and click on OK. We repeat this for all entries in the package and rename them according to the table below.

Old Name New Name
AnswersResponsesFkAssoc AnswersPerResponse
ItemsQuestionsFkAssoc ItemsPerQuestion
QuestionsSurveyFkAssoc QuestionsPerSurvey
RepsonseSurveysFkAssoc ResponsesPerSurvey
SurveysAuthorsFkAssoc SurveysPerAuthor

The final step in JDeveloper 11g is click on the Save All button in the button bar to save all the modified files.

New: the POPoToPi!

The very main reason for me to write this blog-entry is to introduce a new word: Popotopi. I would love to see this home-made word pop-up in upcoming discussions over the world. To be honest, I used another word for it: PoJo: Plain Old Java Object. The word PoPoTopI means Plain Old Point To Point Interface. I like the word, because of its cadens, how it rolls over your lips.

Ok, another reason then: to explain one of the questions I'm currently involved in. My current customer has just celebrated the first aniversary of their EAI department. That means they have been busy with integration for quite some years. Mainly on Tibco. But now they have some projects going around introducing two other ESB/Soa platforms, one of them being Oracle SoaSuite. This drives them to think about integrating the integration platforms. How to exchange services, what is the scope of one integration environment, how to define bridges etc.

Looking into this I also discovered that they have several environments of their current Tibco Platform, because of having several domains. One of the colleagues I have in this department is catagolizing the services of one of the domains. His impression is that about 80 percent is just point to point. Although most of them are neatly defined using a so-called Canonical Data Model.

Having a Canonical Data Model is nice. It's just like the Hub-and-Spoke architecture of Oracle's Industrial Archeology Artefact: InterConnect. InterConnect was technical not a very sophisticated product. But the whole idea behind InterConnect I do like still. The Common View in InterConnect, that is the Canonical Data Model, is the abstraction on message level between end-points. It is based on Logical Entities on which you map the physical entities of your Enterrpise Information Systems (EIS).

But if you conclude that 80% of your integrations is point to point then you should think about how successfull you were in implementing EAI (Enterprise Application Integration).
A coupling is point-to-point if the two end-points are not re-used anywhere. Although the coupling uses a Canonical Data Model, the business event that is based on the CDM is not re-used. The reuse and thus the advantage of this approach only pays-off when you subscribe another end-point to the business event in the hub, if you have another application publish the business event or when you decide to replace one of the end-points without modifying the CDM.

Although the couplings are based on a CDM it is very interesting to compare the different CDM's (the message definitions) of the different integrations. As said: a CDM should be based on logical entities. This Logical Entities should also be reused over the different integrations. For example: an order in the "CreateOrder" integration should be the same in the "UpdateOrder" integration.

Drilling down in to the Logical Entities, it should also be interesting to reuse parts of the Logical Entities. For example: the address of a person, a customer, a supplier or an organization, be it a home, billing or shipping address, should be allways the same in structure. Actually a person being a customer or a supplier or a TradingPartner's contactperson is allways the same in structure.

It would be very interesting to see to what extent the standardization on CDM's is put through. Honestly, it would surprise me if there are not more then one definition of whatever Logical Entity in the different interfaces.
Every coupling, integration is defined and implemented in different projects. Only if a project-member does know of the existance of a reusable artefact and/or if there is budget to make artefacts generic enough, a project might leverage the advantage of EAI or feed the potential of it.

If every Logical Entity is neatly defined only once ever, especially when it is describe in a central library of artefacts, that would be great. Then you could say that you were quite succesfull in implementing a sufficient EAI.

If not, I you can't speak of a succesfull, efficient EAI. Then, to me, you have implemented Popotopi's on a modern platform, where so-called services are not much more then simple building blocks (not services). But ask yourself and decide for yourself if it was worth the investment.

It is too bad, because a good EAI with uniquely, accurately, correctly and completely described buildingblocks, triggers, CDMs and message-object-mappings could be a very good base for the implementation of a SOA. Where a buildingblock could really be a service, a trigger could really be a Business Event in your Event Driven Architecture and the CDM's and mappings a base for your Enterprise Business Objects with their transformations.

I used to do Quick Scans on the performance of Custom Development Applications. It would be nice to do such a scan on EAI implementation to see what the impact on the implementation of SOA is in such a case. Or at least to think about it along with a customer.

Updated Asynchronous Web Service slides from Jazoon’08

Gerard Davison | Jul 8, 2008 01:50 -0600

It contain a whole bunch of updates from the JavaOne'08 version. In particular a section on rolling your own version of part of the @AsyncWebService proposal using the RI.

Calling a plsql packaged function using iBatis

Andrej Koelewijn | Jul 8, 2008 00:10 -0600

Ok, one more basic example before we get into the interesting oracle specific stuff. In the previous example i illustrated how to call a plsql stored procedure using ibatis, in this example i’ll show you how you can call a stored function.

Here’s the plsql function that we’re going to call:

create or replace package body employee_pkg
is
  ...
  function get_name_by_id (
    p_id in number
  ) return varchar2 is
    l_name varchar2(100);
  begin
    select name
    into   l_name
    from   employees
    where  id = p_id;
    return l_name;    
  end;
  ...
end;

The sqlMap configuration entry you need for this is as follows:

<parameterMap id="parameters1" class="map">
    <parameter property="name" jdbcType="VARCHAR" javaType="java.lang.String"
               mode="OUT"/>
    <parameter property="id" jdbcType="NUMERIC" javaType="java.lang.Long"
               mode="IN"/>
  </parameterMap>
  <procedure id="selectNameByIdFunc" parameterMap="parameters1">
    <![CDATA[
    { ? = call employee_pkg.get_name_by_id( ? ) }
    ]]>
  </procedure>

Using this bit of configuration, you can now call the plsql function in your java program as follows:

Long id = new Long(3);
Map pars = new HashMap();
pars.put("id", id);
sqlMapper.queryForObject("selectNameByIdFunc", pars);
System.out.println("Query by id " + id + ": " + pars);

The next example will be a bit more interesting, it will demonstrate a way to handle ROWTYPE parameters returned by a stored function.


Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Java, Database, Oracle, ORM, Open Source

ADF BC: EO/VO initial state post create() explained

Chris Muir | Jul 7, 2008 23:30 -0600
Thanks to Steve Muench, Olivier and Rob on the JDev OTN Forums, I learnt some valuable lessons about the state of ADF Business Component (ADF BC) Entity Objects (EOs) after the create() method is called. I thought I'd share this new knowledge for others to benefit.

In JDeveloper's ADF BC Entity Objects (EOs) and View Objects (VOs), on instantiating an EO/VO, it's possible to set the default value for the EO/VO attributes declaratively or programmatically through code. The declarative fashion is done by setting the Default property to simple literals for the individual EO/VO attributes in the associated EO/VO editor. Within JDev 11g this has been expanded to support Groovy expressions.

Alternatively both the EntityImpl and ViewRowImpl that represent the EO/VOs in code, the programmer can override the create() method to programmatically set the EO/VO attributes. For example you may wish to set an attribute to the next sequence number from a sequence in the Oracle database, and some other attribute to a static value:

public MyEntityImpl extends EntityImpl {

  public void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl seq = new SequenceImpl("my_db_seq", getDBTransaction());
    setSomeId(seq.getSequenceNumber());
    setSomeField("some value");
  }
  .. and so on ..
}


Thus in the Business Components Browser if you open the associated VO, and create a record, you'll see the defaulted attributes set to the values above.

As per section "9.2.5 Understanding Entity Object Row States" in the 10g JDev guide for Forms/4GL Programmers (this also exists in the 11g guide, but at the time of writing this article the 11g guide is still in draft), on creating a new record the EO's state should be set to STATUS_NEW. STATUS_NEW says that at least 1 of the attributes of the EO has been updated, and thus the record is a candidate to be inserted to the database.

There are other alternative statuses for an EO, including STATUS_INITIALIZED. This status indicates a new record that is not yet a candidate to insert into the database as no changes have yet occurred to its attributes, it's basically just empty. Again to be clear, ADF BC will only mark the record to be a candidate to insert into the database (STATUS_NEW) when either the user sets a value, or programmatically overrides the status of the new row. (The user in this case means the consumer, or the program that is interfacing to the ADF BC project; this won't be a real human user directly, at the very least an UI will sit in front and provide access to the user)

So from our example above, given that we've programmatically updated attributes, is it reasonable to assume the EO's status will be STATUS_NEW once the user has created the record and we've programmatically defaulted the values?

If we consider the Business Components Browser (the Tester), and we consider JDev 10.1.3 the answer is Yes. However if we consider JDev 11g the answer is No. (Groan I hear you say ;)

Why? The key is the statement above:

"ADF BC will only mark the record to be a candidate to insert into the database (STATUS_NEW) when either the user sets a value manually, or programmatically overrides the status of the new row. (The user in this case means the consumer, or the program that is interfacing to the ADF BC project; this won't be a real human user directly, at the very least an UI will sit in front and provide access to the user)"

Note my emphasis, that the calling program can override the EO state if desired.

In JDev 10.1.3 the Business Components Browser (known as the Tester), as confirmed by Steve Muench is a "cheater" and doesn't actually implement a full blown ADFm binding layer, acting like a true ViewController to the ADF BC Model project. Instead it directly invoked the ADF BC project with its own functionality.

In JDev 11g the Business Components Browser sits on a real ADFm binding layer and as such acts like any ADF Faces/RC page.

The ADFm binding layer being the calling program to the ADF BC layer in this case, actually has code in it to override the status of an EO record if it can't detect any attribute changes by the real "human" user, regardless of the programmatic defaultedv values in the code above. And it sets the EO status back to STATUS_INITIALIZED, marking the record as a non-candidate for database inserts.

Conversely the 10.1.3 Business Components Browser because of its own custom functionality didn't.

This means in 10.1.3 when you commit the new-programmatically-defaulted but not user changed EO record, it will be inserted into the database. Conversely in 11g even though you commit the new record, unless you as the user make a change to one or more of the attributes, the 11g ADFm binding layer will override the status of the EO and it won't be written to the database.

Obviously this functionality isn't always desired. To override this default behaviour such that the record is inserted into the database regardless, you can override the ViewRowImpl's setNewRowState() method as follows:

@Override
public void setNewRowState(byte b) {
  if (b != Row.STATUS_INITIALIZED || getNewRowState() != Row.STATUS_NEW) {
  super.setNewRowState(b);
  }
}


It's this method that's called by the ADFm binding layer, so effectively you're intercepting the status set.

Ideally I'd like to see this as a property on the EO/VO editor, but at the very least ADF BC gives us the ability to override the default functionality by code.

Please note for the simplification of the discussion above, when I say that the ADFm binding layer sets the EO status, it can't actually do this directly. It needs to interface with the parent Application Module, then the View Object that represents the EO. Thus why we override the setNewRowState() method in the VO rather than the EO.

Thanks to Steve, Olivier and Rob for their assistance with this post.

This post was written against JDev 10.1.3 and JDev 11gTP4. As usual check everything under your specific version as your mileage may vary.

How to find, share and back up JDeveloper code templates

Brenden Anstey | Jul 7, 2008 20:40 -0600

JDeveloper code templates are stored in the JDevHome folder in an XML file called java.tpl. This is one file worth backing up if you have a lot of custom code templates.

The file is in [Drive:]\JDevHome[Version]\system\oracle.jdeveloper.[version] eg.

C:\JDev\IDE\JDevHome10.1.3.3_1\system\oracle.jdeveloper.10.1.3.41.57

New Free Fusion Development Workshops

shay.shmeltzer | Jul 7, 2008 18:00 -0600

For the past several years we've been running the OTN Developer Days across the US and Canada with great success.
Well the time has come for an update of the material, so Lynn from our team did an update of the content to be based on the upcoming 11g version - and we ran the first pilot event here in HQ last week - and now we are ready to roll it to the rest of the world.

The workshop is built from two half days - the first half consist of presentations and demos that will introduce you to the concepts of development used for Fusion Applications development. In the second half of the day you'll be running through hands-on labs and actually experience building a complete application.

We are covering the ADF stack used by the Fusion Applications inside Oracle (ADF Business Components, ADF Controller and ADF Faces Rich Client Components).

This workshop is a great introduction to the future of application development in the Oracle world.
Beyond our regular Java audience, we expect to see also Apps customers (EBS, PeopleSoft, Siebel etc), Forms customers and of course BEA customers who won't to see a more productive approach to Java based application development.

Check out the current schedule here.

If you don't see an event coming to your town - contact your local Oracle office and ask them to make sure this roadshow comes to your location. (They can call me if they need details on how to get this going).

I'll be doing the event in Pennsylvania on July 22nd - drop by and say hello.

How not to ask a question

John Stegeman | Jul 7, 2008 09:00 -0600

Well, I’m back to the blog after a long hiatus. Much like Tom Kyte, I seem to be getting much grouchier lately. No, it isn’t age, the weather, or the fact that <insert name of sports team here> didn’t win the <insert name of major sporting event here>, it’s the fact that quality of the questions over on the JDeveloper Forum seem to be going downhill lately. Yes, there are some people who still take their time to post well thought-out questions that include versions, a description of what they are trying to do, what they have tried, what they found when googling, etc.; however, there seems to be a growing number who:

  • Obviously haven’t or are too lazy to click the “search” button or use Google to find the solution.
  • Clearly think their time is too valuable to waste over posting more than one sentence plus the obligatory “PLZZZ its URGENT.”
  • Post to the wrong forum. The OA Framework people seem to be pretty notorious for this.
  • Don’t want to try to solve the problem themselves. Sometimes, I’ll drop a hint for such questioners, but it’s usually firmly ignored.

Now, I know we all don’t have scads of free time, but it seems to me just common courtesy to invest at least some time in researching and debugging on your own before posting a question and similarly investing some time in phrasing a proper question with details, use case, etc? The people who are answering questions on the forum are usually doing so on their own time and really do want to help, but I am finding that I’m less and less motivated to answer questions when I see more and more people commiting blunders like this. I’m guessing that I’m starting to sound like an old f*rt on the forums now. Sure, it’s fun posting sarcastic replies (depending upon my mood at the time), but I really do start to notice my blood pressure going up nowadays.

Is it just me?

Introduction to EclipseLink

Doug Clarke has written a nice article that introduces EclipseLink.

Calling a plsql packaged procedure using iBatis

Andrej Koelewijn | Jul 7, 2008 04:00 -0600

In the previous example, Simple delete and insert statements with iBatis, i already demonstrated how you can call a oracle stored procedure. That example used a class to specify all the procedure parameters. Ibatis is often smart enough to know how to map the class properties to the parameters in your sql call. But sometimes you need to do the mapping between the properties and the sql parameters yourself. I’ll illustrate this here.

The following plsql procedure queries the employee with the specified id, and returns the employees name and date of birth:

procedure get_employee_by_id (
    p_id   in out number
  , p_name in out varchar2
  , p_date_of_birth in out date
  ) is 
  begin
    select name
    ,      date_of_birth
    into   p_name
    ,      p_date_of_birth
    from   employees
    where  id = p_id;
  end;

Using a parameterMap element in my sqlMap i can specify that the sql parameters are INOUT parameters:

<parameterMap id="parameters0" class="nl.iteye.ibatis.example1.Employee">
    <parameter property="id" jdbcType="NUMERIC" javaType="java.lang.Long"
               mode="INOUT"/>
    <parameter property="name" jdbcType="VARCHAR" javaType="java.lang.String"
               mode="INOUT"/>
    <parameter property="dateOfBirth" jdbcType="DATE" javaType="java.util.Date"
               mode="INOUT"/>
  </parameterMap>
  <procedure id="selectEmployeeById" parameterMap="parameters0">
    <![CDATA[
    { call employee_pkg.get_employee_by_id( ?, ?, ? ) }
    ]]>
  </procedure>

Now i can call my stored procedure as follows:

Long id = new Long(4);
  Employee emp = new Employee();
  emp.setId(id);
  sqlMapper.queryForObject("selectEmployeeById", emp);
  System.out.println("Query by id " + id + ": " + emp);

In the next example i’ll show an plsql packages function call.


Permalink | No comments | del.icio.us | Technorati | digg | dzone | StumbleUpon | Java, Database, Oracle, ORM

Customize and personalize your jsf pages with MDS

Edwin Biemond | Jul 5, 2008 17:10 -0600
This large blog entry is about MDS (Metadata Services) which was introduced jdev 10.1.3.2 but for this MDS example I use JDeveloper 11g TP4. In 11g you can use mds in your jsf applications. In this blog I will show you, how to customize a table in a jsf page for a particular user. This is called seeded customization. For this you have to start jdeveloper in the customize mode and change the properties of the jsf components for this particular user. The changes are saved in a separate xml file. Off course this should never be done for a user ( use a role ). When this particular user start the web application the customized page is shown. Other users will only see the original page.
We can also use MDS to personalize the jsf pages. The user can change the jsf pages at runtime. This is called User Customization or change persistence. In the web application we have to define what the user can change. In this blog I will allow the user to change the order of columns in a table and the user can change the width of a column. The changes are saved in a MDS repository ( I will use a file based mds repository).
Step 1 is to create a fusion web application. Add database table to the bc4j model project. So we can use this as table in a jsf page then we have to change the mds properties of the viewcontroller project. See the picture what to change.
  • We have to enable Enable User customations then Across Sessions using MDS and at last Enable Seeded Customizations. Across sessions will store the changes in the mds repository, so the next time the user still sees the changes.
    Step 2 is the configuration of the adf-config.xml file

    In this file we have to add three things. The first thing we have to do is to define a mds repository. Make sure that you add the following folders ViewController/public_html , ViewController/adfmsrc and Model/src to the metadata-path property.
    The second thing are the customizations classes. You can use different classes at the same time. I use in this blog only one ( UserCC ) . You can also use SiteCC or SecurityRoleCC.

  • Now we only have to define which changes are stored in the mds repository


      In my case you can change the order of culumns in a table and the width of the column.
      Here is my adf-config.xml

      <?xml version="1.0" encoding="windows-1252" ?>
      <adf-config xmlns="http://xmlns.oracle.com/adf/config"
      xmlns:sec="http://xmlns.oracle.com/adf/security/config">
      <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
      <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
      credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
      <sec:JaasSecurityContext initialContextFactoryClass="oracle.adf.share.security.JAASInitialContextFactory"
      jaasProviderClass="oracle.adf.share.security.providers.jps.JpsSecurityContext"
      authorizationEnforce="true"
      authenticationRequire="true"/>
      </sec:adf-security-child>
      <app-config type="MDS" name="default"
      xmlns="http://xmlns.oracle.com/adf/mds/config">
      <mds-config version="11.1.1.000" xmlns="http://xmlns.oracle.com/mds/config">
      <persistence-config>
      <metadata-namespaces>
      <namespace path="/" metadata-store-usage="one"/>
      </metadata-namespaces>
      <metadata-store-usages>
      <metadata-store-usage id="one">
      <metadata-store name="mymetadatastore"
      class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
      <property name="metadata-path"
      value="D:/projecten/workspace/11g/mds_user_cc/ViewController/public_html;D:/projecten/workspace/11g/mds_user_cc/ViewController/adfmsrc;D:/projecten/workspace/11g/mds_user_cc/Model/src"/>
      </metadata-store>
      </metadata-store-usage>
      </metadata-store-usages>
      </persistence-config>
      <cust-config>
      <match>
      <customization-class name="oracle.adf.share.config.UserCC"/>
      </match>
      </cust-config>
      </mds-config>
      </app-config>
      <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/config">
      <persistent-change-manager>
      <persistent-change-manager-class>
      oracle.adf.view.rich.change.MDSDocumentChangeManager
      </persistent-change-manager-class>
      </persistent-change-manager>
      <taglib-config>
      <taglib uri="http://xmlns.oracle.com/adf/faces/rich">
      <tag name="column">
      <attribute name="displayIndex">
      <persist-changes>true</persist-changes>
      </attribute>
      <attribute name="width">
      <persist-changes>true</persist-changes>
      </attribute>
      </tag>
      </taglib>
      </taglib-config>
      </adf-faces-config>
      </adf-config>

      We are ready with the MDS settings. Now we can add security to the project and add some example users. I use the ADF Security wizard for this. The wizard is located in the tools menu. This are the wizard steps. 1. enforce authorization 2. no identity store 3. Enable Credential store 4. No policy store 5. No anomymous providor 6. Select idstore.loginmodule 7. HTTP Basic authentication with jazn.com as realm and press finish.
      Let's create two test users named test and test1. Go the tools menu and select the preferences menu item.

      Open the embedded oc4j server preferences and add the user test and test1 to the jazn.com identity store. Create a new role users and those users to this role.
      At last we can create the jsf page with a table ( drag a viewobject from the datacontrol and drop this on the page select a readonly table). You have to add a button with no action to the page too. This is necessary else the changes are not submitted to mds repository.

      We have to check if the customization is enabled on the page. Select the jsp:root in the structure window and see in the property window if customization is allowed. The second thing we have to check if there is a unique customizationId on every table column. Select the table column, go to the property window -> behavior -> advanced -> customizationId
      Now we can go the page definition to add security to this page. Select the page definition permission value by the permission class combobox and select the view action to all the operations.

      We have to add the view permission to the users role. go to the structure window of the pagedef and the select the pagedef. Use the right button to select edit authorization menu item.

      Select all the options by the users role.

      Finally we can run the web application. If we log in as test or test1 and change the size of a column ( press the submit button) or the change the column order we will see that these setting are stored in the public_html folder. Every user has it's own folder and page xml.

      This is how a mds xml looks like for a particular user.


      The second part is about seeded customizations. Here can the developer customize the page for a particular user. In this blog I will make sure the salary column has a red background with white characters for only the user test. First we have to change the CustomizationLayerValues.xml in the jdev folder. Here we have to add the users test and test1 to the user custimatization layer.

      Startup jdeveloper and select the customization developer. If you don't get this option you have to go the preferences windows ( tools menu) and go to the roles entry. Here you can change the role.

      We can see a new window called Customizations. In this window we can select the test user.

      If we open the jsf page and change the properties of the jsf components then these changes are stored in the mds repository under the selected user in the customizations window.
      We can start the web application again. First we use the test user.

      Now we use the test1 user.

      I hope you got a good impression what MDS can do for you.

      Declarative Security in JDeveloper/ADF 11g

      In JDeveloper 11g, with a help of Oracle ADF framework you can in easy and straightforward way add security to your application. And this way is based on declarative approach, no coding is needed. Main goal of this post is not to describe about how to configure security, but more about how it can be applied in your applications.

      Let's take a case when there is a requirement to open the same form in different modes (editable/read-only) for users with different sets of roles assigned. With JDeveloper 11g you can implement this requirement in 3 quick steps. I will describe those steps here, also you can download developed sample application - DeclarativeSecurity.zip. In order to run this sample, you need to have standard HR schema in your database. Additionally, you need to use this system-jazn-data.xml file, where two users are defined - john (managers) and scott (clerks). For both users password - welcome is defined.

      Three steps you need to use in order to implement declarative security:

      1. Entity Object level security

      This step will allow to secure row data. In Entity Object wizard, define Security Operation Mapping. I have secured two standard Actions - Update and Delete for Jobs Entity:


      When security options are defined, specify authorization for Jobs Entity. In my sample, I allowed Update and Delete actions only for users with managers role:


      2. Page Definition level security

      In this step we will secure Actions defined in Page Definition:


      Example of Security definition for Delete action:


      In Authorization settings, I have specified Delete action availability only for managers role:


      3. Expression Language

      And last step is to specify using EL, disabled property for button component. This will allow to have button in disabled state, when user is not authorized to perform associated action. EL expression is pointing to Action security in Page Definition:


      All 3 steps are explained, now will show how it works. At first, let's login as scott user, this user have clerks role assigned:


      Security definition in Entity Object makes row data read-only, since clerks are not allowed to modify it. Delete button also appears disabled:


      But, what is nice, when Search Find button is pressed, Oracle ADF automatically puts form into Find mode:


      And finally, when entering using john account:


      Since john is granted with permission to update and delete existing rows, form appears in edit mode with Save and Delete buttons enabled:

      Should ADFUtils and JSFUtils be included in the JDev base release?

      Chris Muir | Jul 4, 2008 08:50 -0600
      I raised the following question on the OTN JDev 11gTP4 forums today:

      "A question came up from a client the other day, is how come ADFUtils and JSFUtils that appear in many of the Oracle JDev demos aren't included in the base JDev release? They seem like such obvious things to include in a base ADF Faces/RC project and for Oracle to expand upon, yet we currently have to "steal" the code for our own projects and include them."

      We've already had some interesting replies from Timo, Kuba and Simon. We'd love to hear your opinion too. Please head over to the JDev 11gTP4 forum and add your thoughts to the post.

      Install WCF under IIS7 in Vista

      broersa | Jul 4, 2008 07:40 -0600

      To create start WCf webservices in Vista under IIS7 some registration has to be done. When I publish from Vistual Studio 2008 the .svc doesn’ work. The sollution was starting “servicemodelreg -i” from

      c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation

      After this the .svc works.