1. In this blog entry, I'm sharing a possible solution for propagating combo box selection down the ADF tree table.



    Related: documentation on how to enable ADS

    Sample project: http://bit.ly/LXmqxx 


    Note: the sample project uses slightly modified HR schema, please run the script on it:

    ALTER TABLE DEPARTMENTS
    ADD (DEPARTMENT_CONFIRMED VARCHAR2(1 BYTE));

    ALTER TABLE EMPLOYEES
    ADD (EMPLOYEE_CONFIRMED VARCHAR2(1 BYTE));
    ALTER TABLE LOCATIONS
    ADD (LOCATION_CONFIRMED VARCHAR2(1 BYTE));
    ALTER TABLE COUNTRIES
    ADD (COUNTRY_CONFIRMED VARCHAR2(1 BYTE));

    0

    Add a comment

  2. Oracle Fusion Applications datasheets are now available

    Fusion Apps are probably the biggest ADF project out there and they showcase the ability and strategic value of ADF for Oracle.

     

    0

    Add a comment

  3. Out of the box ADF BC provides at least two options for assigning sequence values to ID fields:

    DBSequence assigns temporary unique values to newly created entities and fetches the actual ID (assigned by a database trigger) by using returning clause.
    This works quite OK, but I had situations, where DBSequence misbehaved, specially in master-detail scenarios where you create parent and child record(s) in one transaction. Also, working with integers is simpler.

    Using groovy expression like the one below gets rid of DBSequence, but introduces an extra round-trip at the time when a new row is created, which might not be the best idea performance-wise.

    Using In-memory singleton sequencer
    As an alternative, we can use an In-memory singleton sequencer initialized from DB sequence used across entities.

    First, we need to define a database sequence. Since we are not querying it for each and every value, we increment it in reasonable steps, let's say 100.

    Next, we create a singleton for serving sequences to our entities

    And a custom base EntityImpl exposing singleton to entity.
    Don't forget to configure Business components to use custom base class in project properties!

    Usage is very simple, just add the groovy expression below as attribute's Default value expression.


    Some thoughts about this method
    First of all, the singleton might not really be singleton. If you package the same class in multiple EARs, you will get more than one instance. Also, running on multiple servers will result in multiple instances. The instances can also die or are garbage collected before they serve all the sequences they reserve.
    But none of that should be a problem. Remember, you can get gaps in sequences even in the database anyway, so you should not count on them being sequential. The singleton will server unique numbers regardless how many instances there actually are.

    Download sample code
    SequencerSampleApp
    0

    Add a comment

  4. This is a life changing Open World for ADF!


    ADF Mobile will change the way how we develop business apps for mobile. The big news here is that it's supposed to include a small JVM that Apple will allow on iOS! Fallback is HTML5.

    The supported platforms are Android and iPhone/iPad (required version unknown at this time).

    It will be possible to access device features like GPS, SMS etc.. It will support offline mode with SQLite storage.

    I can wait to get my hands on this!


    Some examples: (photos courtesy of Wilfred vander Deijl):


    ADF Mobile data sheet is nov available. According to it, the planned release date for ADF Mobile is in 2012.

    Run ADF apps in a cloud

    with Oracle Public Cloud. This is huge. Again, this opens a whole new range of possibilities, for everybode, from  independent developers and large ISVs. Check http://cloud.oracle.com/mycloud/f?p=service:java_features:0::::: for details.


    The Word has it that ADF Community Edition is around the corner. It's supposed to include almost anything but DVT components and will run on Glassfish among other app servers. It's not clear yet if it is going to be available for free or not.



    Disclaimer: I'm not @ OOW, just trying to compile all the cool stuff that's out there. This information could be completely wrong :-)
    0

    Add a comment

  5. Last week (September 19-21), there was annual Slovenian OUG conference and I'm happy to see ADF being more and more present as ADF community grows around here.


    The highlight (for the ADF part) were 2 sessions by Frank Nimphius, one was an overview and the business benefits of ADF, and the other more technical, focused on task flows.

    I presented two sessions, showing how using ADF expands your opportunities to mobile market, while the other was about WebCenter and Enterprise 2.0.






    Andrej Maver and Uroš Furlič presented their experience with porting ADF 10g application to an alternative application server.


    I know of some interesting ADF projects currently going on in Slovenia and I'm sure next year we'll have even more sessions success stories. As I heard, one partner just ditched WebSphere + Eclipse in favor of WebLogic+ADF+JDev, and their productivity has increased  by a factor of 6!

    See you all next year!

    0

    Add a comment

  6. JDeveloper 11.1.2 has been released and it brings so many changes that it could easily be called 12g.

    I'll go over new capabilities in the next few weeks, but for today a change that really changes the developer experience tremendously.

    Hot Deployment

    With JDeveloper 11.1.2 "I'm redeploying" excuse is no more!

    Hot deployment enables us to make changes to any layer in the project - be it model, bindings or view, recompile and simply refresh the page to get the results!

    See it in action:
    1

    View comments

  7. Some keyboard layouts (Slovenian, Croatian and Serbian) use AltGr-n for } and AltGr-f for [ characters.
    By default, these characters are not accessible in JDeveloper, which is quite annoying.

    Fix
    Go to Tools->Preferences, navigate to "Shortcut Keys".
    In the search box, enter "ctrl-alt-f" and remove assigned actions. Repeat for "ctrl-alt-n" combination.

    0

    Add a comment

  8. A few versions ago ADF introduced a loopback script which is returned to client the first time an URL is accessed.
    ADF Loopback script

    The problem is, when you want to serve binary content -such as images- from a servervlet, and you need access to FacesContext in that servlet, you need to call the servlet from within /faces/ URL, or FacesContext.getCurrentIstance() returns null:

    Pointing browser to http://localhost:7101/myapp/imageservlet?empId=72
    Accessing imageservlet without /faces leaves us with null faces context.


    The obvious thing to do is to access the servlet using http://localhost:7101/myapp/faces/imageservlet?empId=72 . But if we do this, the loopback script is returned to client by ADF framework.

    Now imagine having a html page with <img src="http://localhost:7101/myapp/faces/imageservlet?empId=72"> tag. The image will not be rendered, since it will receive loopback script as image source.

    The workaround is quite simple. Turns out adf loopack script is not generated for some requests, including requests for jpg, png, js, css... So all we need to do is change the request url a bit (assuming the servlet listens to /imageservlet/*). Just append a dummy "/image.jpg" after the servlet url and voila, loopback is gone.

    <img src="http://localhost:7101/myapp/faces/imageservlet/image.jpg?empId=72">

    Note that the first request will still generate 302 redirect, but that will not affect image rendering.
    2

    View comments

  9. Do you see an opportunity to sell a product or a custom software solution to an IBM WebSphere customer?

    Would you like to beat the competitors by providing:
    - much better time to market
    - an agile solution that you will be able to rapidly tailor to customer's ever changing needs
    - low maintenance costs
    - future-proof technology?

    Do you already have an ADF 11g solution that you can only bundle with WebLogic?

    Since version 11.1.1.4.0 (11g R1 patch set 3), ADF is certified for IBM WebShpere!

    If you would like to try and evaluate what ADF can do for you, go to ADF Reviewer's Guide to get started.
    0

    Add a comment

  10. WebLogic virtual edition, or rather, WebLogic on top of JRockit VE is an amazing technology. It makes operating system in virtualized environment obsolete.

    Forget about setting up latest OS version, patches, drivers, packages, firewall, anti-virus. Forget about configuring OS for application server. In short, forget about managing OS all together.

    With JRockit VE, managing OS is the thing of the past.

    How is it used

    You deploy a file based file system onto Oracle VM server, type
    xm create -c vm.cfg
    and you are good to go.

    How to get it running - step by step

    1.  Download and install Oracle VM
      Don't worry, If you don't have a server available, you can actually install Oracle VM inside VirtualBox! I'm not sure which settings are required, but I have:
      - System/Motherboard/Enable IO APIC = yes
      - System/Processor/Enable PAE/NX = no
      - System/Acceleration/Enable VT-x/AMD-V = yes
      - System/Acceleration/Enable Enable Nested Paging = yes
      There's nothing special regarding Oracle VM installation, you can use default settings.
      OracleVM inside Oracle VirtualBox
    2. Download WebLogic with JRockit VE
      Unpack the zip somewhere on your disk. You'll find a folder wlsvePackage with a wlsveimagetool.jar tool and wlsve folder with the actual disk image and  config file for the virtual machine.
    3. If you don't have it, also download and install Java runtime
    4. Prepare machine to run with default domain
      - Open command line / terminal and go to the wlsvePackage folder where you unpacked the WebLogic VE and run
      java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg get config wlsve.xml
      to extract default WebLogic configuration from the system.img file
      - open the wlsve.xml file with your favorite editor and change the java-arguments element to -cp $JAVA_HOME/lib/tools.jar:/jrockitve/lib/common.jar:/application/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/application/wlserver_10.3/server/lib/weblogic.jar -Dweblogic.Name=WlsveAdmin -Dweblogic.Domain=wlsve_domain -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic1 -Dweblogic.management.GenerateDefaultConfig=true weblogic.Server This config will create the default wlsve_domain. Without the Dweblogic.management.GenerateDefaultConfig=true option, the domain isn't found and it won't work.
    5. Write the config back to the virtual machine with java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg set config wlsve.xml
    6. Transfer server.img and vm.cfg from ./wlsve folder to the Oracle VM
      You can either use ssh file transfer or copy the image to USB drive and connect and mount usb drive to the virtual machine.
      - Make sure you copy system.img and vm.cfg to the /OVS/seed_pool/wlsve_domain_WlsveAdmin/ folder on the Oracle VM server as this is the location specified in vm.cfg by default.
    7. Start virtual machine with xm create -c vm.cfg
    Booting JRockit VE
    With this configuration you will create a new weblogic domain and run it. You can connect to console and deploy standard Java EE applications, but not ADF, since the bundled WebLogic is not extended for ADF.

    Extending WebLogic Virtual Edition for ADF

    For this step you absolutely need linux. If you don't have it, I suggest downloading Ubuntu and installing it into VirtualBox virtual machine.

    Why linux? It turns out that system.img is file-based file system, and that's what we are going to exploit*.

    1. Start with a fresh system.img and wlsve.xml. Unpack the system.img again if you made the above changes
    2. Open command line / terminal and go to the wlsvePackage folder where you unpacked the WebLogic VE and run java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg get config wlsve.xml
    3. Replace wlsve.xml with<?xml version="1.0" encoding="UTF-8"?>

      <jrockitve-imagetool-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jrockitve-imagetool-config.xsd" version="5.1">
      <jrockitve-config memory="1024" cpus="1">
      <storage>
      <disks>
      <disk id="root" size="3072 MB"/>
      </disks>
      <mounts>
      <mount>
      <mount-point>/</mount-point>
      <disk>root</disk>
      </mount>
      </mounts>
      </storage>
      <vm-name>wlsve</vm-name>
      <working-dir>/application/user_projects/domains/wlsve_domain</working-dir>
      <java-arguments>-cp /application/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/jrockitve/jrockit/jre/lib/tools.jar:/application/utils/config/10.3/config-launch.jar:/application/wlserver_10.3/server/lib/weblogic_sp.jar:/application/wlserver_10.3/server/lib/weblogic.jar:/application/modules/features/weblogic.server.modules_10.3.2.0.jar:/application/wlserver_10.3/server/lib/webservices.jar:/application/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/application/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/application/oracle_common/modules/oracle.jrf_11.1.1/jrf.jar:/application/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/application/wlserver_10.3/server/lib/xqrl.jar -Dweblogic.Name=AdminServer -Djava.security.policy=/application/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/application/wlserver_10.3 -Dwls.home=/application/wlserver_10.3/server -Dweblogic.home=/application/wlserver_10.3/server -Ddomain.home=/application/user_projects/domains/wlsve_domain -Dcommon.components.home=/application/oracle_common -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Djrockit.optfile=/application/oracle_common/modules/oracle.jrf_11.1.1/jrocket_optfile.txt -Doracle.domain.config.dir=/application/user_projects/domains/wlsve_domain/config/fmwconfig -Doracle.server.config.dir=/application/user_projects/domains/wlsve_domain/config/fmwconfig/servers/AdminServer -Doracle.security.jps.config=/application/user_projects/domains/wlsve_domain/config/fmwconfig/jps-config.xml -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Digf.arisidbeans.carmlloc=/application/user_projects/domains/wlsve_domain/config/fmwconfig/carml -Digf.arisidstack.home=/application/user_projects/domains/wlsve_domain/config/fmwconfig/arisidprovider -Dweblogic.alternateTypesDirectory=/modules/oracle.ossoiap_11.1.1,/modules/oracle.oamprovider_11.1.1 -Dweblogic.jdbc.remoteEnabled=false -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/application/patch_wls1032/profiles/default/sysext_manifest_classpath weblogic.Server</java-arguments>
      <network>
      <nics>
      <nic type="bridged"/>
      </nics>
      </network>
      <locale-data>
      <locale>en_US</locale>
      <timezone>America/New_York</timezone>
      <encoding>ISO-8859-1</encoding>
      </locale-data>
      </jrockitve-config>
      </jrockitve-imagetool-config>

    4. run java -jar wlsveimagetool.jar -r ./wlsve/vm.cfg set config wlsve.xmlto write the changes to the system.img. This will:
      - enlarge the disk size to 3GB
      - run WebLogic with all the ADF libraries once we install them
    5. If you use linux on VirtualBox, I suggest sharing your windows folder where you unpacked WebLogic with shared folders feature. You need to install vbox additions for it to work properly.
      - Share the folder, open terminal and mount it withsudo mount -w -t vboxsf share_name /media/oracle/ where share_name is the name of your vbox shared folder and oracle is your mount point inside /media
    6. cd to wlsve folder with system.img file and check and resize the filesystem in the image file sudo e2fsck -f ./system.img
      sudo resize2fs ./system.img
    7. Mount the file system with sudo mount -o loop=/dev/loop0 ./system.img /media/wlsve.img/ where wlsve.img is your mount point
    8. Since we can only extend the domain as non-root user, we need to change permissions on the filesystem sudo chown -R jernej /media/wlsve.img/ jernej is your linux username. To my knowledge this is harmless, as it seems permissions are not used by JRockitVM at all (of course, there is no OS to handle security, remember).
    9. I found no easy way of extending the mounted WebLogic home. Symbolic link doesn't work since installer writes the whole path with /media/wlsve.img. The easiest seem to be copying home to the /, extend it, create domain and copy it back
      - Copy weblogic home to root folder sudo cp -R /media/wlsve.img/application /application
      sudo chown -R user /application 

      - Copy jrockit home to root folder to simulate runtime environment sudo cp -R /media/wlsve.img/jrockitve /jrockitve
      sudo chown -R user /jrockitve
    10. Now download and run Application Development Runtime (11.1.1.2.0) . Note that the bundled WebLogic does not support 11.1.1.3 runtime.
      - When installing the runtime, make sure you chose /application as your WebLogic home
    11. Execute the domain configuration wizard sudo chmod +x /application/wlserver_10.3/common/bin/config.sh
      /application/wlserver_10.3/common/bin/config.sh

      - Create a new domain called wlsve_domain inside /application/user_projects/domains
      - When choosig JRE, make sure you select the one under /jrockitve
    12. Move your local copy of the domain back to the system.img rm -rf /media/wlsve.img/application
      cp -R /application /media/wlsve.img/application
    13. Unmount the image file sudo umount /media/wlsve.img
    14. Copy system.img to Oracle VM, and start the domain
    If everything is OK, your ADF-extended domain should be up and running inside JRockitVM! How cool is that!




    *The documentation suggests a bit different approach, but I found this the easiest way of doing it.
    1

    View comments

Picture
Picture
About Me
About Me
Jernej Kase works as an independent Oracle Consultant, focusing on boosting development productivity with Oracle ADF and Fusion Middleware stack.
Blog Archive
Labels
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.