tag:blogger.com,1999:blog-5898347084781844872024-03-14T05:02:12.216+05:30Dare to Code...This blog is run by an Oracle employee working on ADF and JSF technologies with the intention of spreading awareness and posting some tips and hints to work with the various components quickly. Further this blog is open for all the discussions, suggestions feedback about this blog and JAVA, J2EE technology based frameworks like ADF, JSF etc and other technological aspects like tools, languages etcAnonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.comBlogger120125tag:blogger.com,1999:blog-589834708478184487.post-57260289661614032712017-02-16T06:35:00.003+05:302017-02-16T06:35:58.124+05:30Oracle Linux 7 docker image updateToday I added few more utilities to my oracle linux 7 with utilities docker image.<br />
<br />
New additions are: jdk 1.8 and groovy 2.4.8<br />
<br />
To pull you can use<br />
<br />
docker pull vikceo/oraclelinux7withutils<br />
<br />
Enjoy!Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-44298689092892873952017-02-10T13:10:00.000+05:302017-02-10T22:47:35.618+05:30Docker for BeginnersDocker is the hottest celebrity in the tech World. Everyone around you might be jumping over it. And you might wonder what the hype is about?<br />
<br />
In simplest form, I would say it is much like a virtulbox or vm but very light weight. Reason? It eliminates an entire OS layer and uses most of the required components from the host OS. I would let you read more firm definition from official <a href="https://docs.docker.com/" target="_blank">docker documentation</a><br />
<br />
I started playing with it very recently and thought to put up some very basic getting started steps. I am using a mac pro with Sierra 10.12.3 as host OS.<br />
<br />
<h2>
<b>Installation</b></h2>
<br />
<ol>
<li>Head over to https://docs.docker.com/engine/getstarted/step_one/#/docker-for-mac and just hit "Get Docker for Mac".</li>
<li>Install like any other OSX app and you are done.</li>
<li>As a confirmation you should see a whale icon in your mac toolbar.</li>
</ol>
<h2>
<b>Create Your First Image</b></h2>
<div>
Before you create your first docker image, lets check what we already have. </div>
<h3>
images</h3>
<blockquote class="tr_bq">
This list out all the docker images you already have. e.g.</blockquote>
<script src="https://gist.github.com/vikceo/3266664ce484f134e8de7a66e2717f8e.js"></script>
Above lists out the repository where image exists (if not pushed then local), a tag which works like a version, the unique image id. Instead of re-inventing the wheel you should first check if someone already created an image you need and published on docker hub. If not exactly what you want but may be a starting point that you can extend further. To mention docker hub is like a marketplace where you can look for images built by other devs like you. You can simply pull these images if there exists one that does your job. Likewise, once you extend or customize and existing image, then you can push your flavor for other's use. To push or pull you would need to create a <a href="https://hub.docker.com/account/signup" target="_blank">docker hub account</a>.<br />
<br />
<br />
<div>
<br /></div>
<div>
For this post, we are extending a Oracle Enterprise Linux 7 image with some of the handy utilities/scripts. To do that, you need to pull the base image as the first step and then start downloading and installing the required utils/scripts. This sequence of steps need to be defined in a file called Dockerfile. To store your docker file and any additional resources, lets start with a new dir.</div>
<div>
<br /></div>
<br />
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/3d3dd86967320e99b4a901976ab2480a.js"></script></blockquote>
<div>
<span style="font-variant-ligatures: no-common-ligatures;">Create a text file and name it Dockerfile using your favorite editor. I use <a href="https://www.sublimetext.com/" target="_blank">sublime</a>. The very first instruction would be to pull the base image (Oracle Enterprise Linux 7 in this case). The file will look like:</span><br />
<span style="font-variant-ligatures: no-common-ligatures;"><script src="https://gist.github.com/vikceo/590f05a9a49d554ccfa2e5250d423766.js"></script></span></div>
Save it and lets build our first image. In this case, we are literally pulling and building an image as is.<br />
<h3>
build</h3>
<div>
<script src="https://gist.github.com/vikceo/74ff4f901918d44432f98ef8b502a9b1.js"></script></div>
<blockquote class="tr_bq">
The -t option is to give a tag to the image you just built. The first line sends the data to docker demon. 2nd line prints the step from Dockerfile it executed. 3rd line is a layer identifier (every step is executed as a layer and cached for reuse when you rebuild). Final line shows the image built with its image id.</blockquote>
<br />
Let's check what images do we have now:<br />
<script src="https://gist.github.com/vikceo/361ff4be720d877e936437a35e35bba8.js"></script><br />
You will notice a new image (2nd last) which we just created. Next step is to run it. And we run an image by initiating a docker container. Let's do that<br />
<br />
<h3>
run</h3>
<div>
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/16a9195641abd29ff71e9399571e14d6.js"></script></blockquote>
</div>
So, the last word bash here along with option i and t makes the container interactive with bash open. Lets try to run some simple commands.<br />
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/bf4a766f105c69cd30e4eb864c55997f.js"></script></blockquote>
If you notice ls worked just fine as it's a base linux image. However, unzip did not. The reason? Well Oracle Linux 7 docker image that you pulled doesn't include that. Options? You have 2 options. First, you go ahead install in the container. Secondly, you can extend this original image and have instructions to install unzip and build an image.<br />
<br />
Though both options will work but 2nd option helps you avoid installing manually every time you have a new container. And this becomes super productive when you need a complete development environment for multiple developers to build and test their work. For example, you can configure with some additional utilities and a node or have a docker container for hosting a db.<br />
<br />
Assuming you are convinced with the requirement of having your own image, lets extend our image and rebuild. The modified Dockerfile will look like below:<br />
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/cd381d7a64ec6a47ee2373bd901f5d13.js"></script></blockquote>
And on building, and starting a new container and trying the same will look like below:<br />
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/3b5121eae4bd39b73d3dc061528aac86.js"></script></blockquote>
So, this time you have an enhanced image with unzip installed. Before we go ahead and push it to docker hub lets see how to see all the running containers and stop any if we want.<br />
<h3>
stop</h3>
<div>
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/92c579575969d3bdabd98fcb3e6f91c1.js"></script></blockquote>
So, that how we list and stop a container by its id. Lets now push the image to docker hub. For pushing there are 3 steps. 1 tag your image 2 login 3 push<br />
<br />
<blockquote class="tr_bq">
<script src="https://gist.github.com/vikceo/4ca5c36db0903eac86d3d0a0eda81dc7.js"></script></blockquote>
<br />
<div>
That's it. Your new image is ready for you and World (if you like) to consume. To see how it appears on docker hub here is a screenshot:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-PuwaCWvqmU4/WJ1uJInxfOI/AAAAAAAB8BE/68EX-Pon5Xsvs3_OxQWnm4enPFDTclRMQCLcB/s1600/Screenshot%2B2017-02-09%2B23.38.47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="128" src="https://3.bp.blogspot.com/-PuwaCWvqmU4/WJ1uJInxfOI/AAAAAAAB8BE/68EX-Pon5Xsvs3_OxQWnm4enPFDTclRMQCLcB/s320/Screenshot%2B2017-02-09%2B23.38.47.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Congratulations!!! Hope you find it useful.</div>
<div>
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-6299586417252759772015-10-29T02:39:00.002+05:302015-10-29T02:39:57.993+05:30Oracle ADF Jdeveloper 12c Groovy Expression to Generate Sequence no longer worksUntil Jdeveloper 12c for supplying primary key to your entity creation you could simply add a groovy expression in the primary key attribute's default expression like:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">(new oracle.jbo.server.SequenceImpl("<your name="" seq=""><your name="" sequence="">", adf.object.getDBTransaction())).getSequenceNumber()</your></your></span><br />
<span style="font-family: Courier New, Courier, monospace;"><your name="" sequence=""><br /></your></span>
<your name="" sequence=""><span style="font-family: inherit;">However, running the same code in Jdeveloper 12 will throw following runtime exception:</span></your><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">General error during semantic analysis: JBO-25152: Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;"><b>Solution:</b></span><br />
<br />
<ul>
<li><span style="font-family: inherit;">Open EO in the source view.</span></li>
<li><span style="font-family: inherit;">Search for trustMode="untrusted"</span></li>
<li><span style="font-family: inherit;">Change it to trustMode="trusted"</span></li>
</ul>
<div>
<span style="font-family: inherit;">This should work now.</span></div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-21688856593892314122015-10-27T08:21:00.002+05:302015-10-27T08:21:36.260+05:30Installing Oracle XE on Virtual Box and Accessing it on Mac OS X Yosemite<a href="http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html" target="_blank">Oracle XE </a> is not yet supported on Mac OS X and if you are planning to do any development and required a local DB then you are pretty much out of luck to install it.<br />
<br />
<b>Solution? </b> Install Virtual Box with linux or windows machine and run oracle XE on it. Access it locally from your host os Yosemite in this case. There are two major steps in this.<br />
<br />
<ol>
<li>Installing Virtual box, guest OS and Oracle XE</li>
<li>Configuring it to access Oracle XE from the Mac Yosemite. </li>
</ol>
<div>
<br /></div>
<h3>
Step 1</h3>
<br />
<ol>
<li> Download latest version of <a href="http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html" target="_blank">virtual box</a>. </li>
<li>For the guest OS and DB either you can individual download the images and install all that or you can use one of the Oracle prebuilt images. They will be a bit larger in size due to some more stuff but will do the job as one step solution. I used <a href="http://www.oracle.com/technetwork/apps-tech/sdp-vm-2121008.html">Downloads and Instructions</a></li>
<li>Once you have a everything installed and the image imported you will need to make sure that you can run your XE DB in the guest OS first. Do the following:</li>
<ol>
<li>from the Applications menu click on "Oracle XE DB --> Start Oracle Database". Wait for few min.</li>
<li>From the same place click on "Run SQL lite terminal"</li>
<li>In the terminal type connect / sysdba and this should connect if DB is up and running. </li>
<li>by default HR schema is installed and locked. So run the following </li>
<ol>
<li>alter user hr account unlocked identified by hr</li>
</ol>
<li>This should do the job and will ensure that it all works fine.</li>
</ol>
</ol>
<h3>
Step 2</h3>
<div>
<ol>
<li>Click on the top right corner and enable network on your guest OS (eth0 by default)</li>
<li>Go to Virtual box and installed image settings. Click Network tab and click on Port Forwarding.</li>
<li>Add a new entry here marking as: Host ip: 127.0.0.1 port 1522 guest ip: blank port: 1521 and do ok.</li>
<li>This should now connect to the XE running in guest OS as hr/hr@localhost:1522:XE (service name)</li>
</ol>
<div>
NOTE: The pre-built image I used in step 1 has the port 1521 unblocked by default. If you are manually doing the step 1 then you would need to unblock the 1521 port by guest OS firewall. You can do that following: <a href="http://www.thatjeffsmith.com/archive/2014/03/connecting-to-oracle-from-your-host-to-a-virtualbox-oel-guest/">http://www.thatjeffsmith.com/archive/2014/03/connecting-to-oracle-from-your-host-to-a-virtualbox-oel-guest/</a></div>
</div>
<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-58888323129419271202013-11-07T00:06:00.005+05:302013-11-07T00:06:46.964+05:30Fusion Concepts: Fusion Database SchemasI authored another post at our official blog FADEVREL on explaining different Fusion Database Schemas.<br />
You can read on this at <a href="https://blogs.oracle.com/fadevrel/entry/fusion_concepts_fusion_database_schemas">https://blogs.oracle.com/fadevrel/entry/fusion_concepts_fusion_database_schemas</a>Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-22224582818805172422013-07-12T00:33:00.002+05:302013-07-12T00:33:58.900+05:30ADF How-To #1: Exposing an Existing VO Attribute in the UI A post to describe step by step how to add a new attribute to af:table from a VO using JDeveloper design time customizations<br />
<br />
https://blogs.oracle.com/fadevrel/entry/adf_how_to_1_exposingAnonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-86048592440345173732013-04-13T05:53:00.002+05:302013-04-13T05:53:29.319+05:30Tip of the Week#2A new tip is posted on Fusion Applications Developer Relations blog at:<br />
<h3 class="entry-title" style="background-color: white; color: red; font-family: Arial, Verdana, sans-serif; font-size: 20px; font-weight: normal; line-height: 25px; margin: 0px 0px 3px;">
<a href="https://blogs.oracle.com/fadevrel/entry/tip_of_the_week_2">https://blogs.oracle.com/fadevrel/entry/tip_of_the_week_2</a></h3>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-20593135744389984862013-03-23T00:19:00.000+05:302013-03-23T00:19:00.256+05:30Fusion Applications: Tip of the Week #1A reference to the Fusion Apps Developer Relations blog's new post Tip of the week ...<br />
<br />
https://blogs.oracle.com/fadevrel/entry/tip_of_the_week_1Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-23514550891267771032013-03-22T07:51:00.001+05:302013-03-22T07:51:48.577+05:30How to find if weblogic server is running in production or development modeWith only weblogic console access if you wish to find if the weblogic server is running in development or production mode then here is the way:<br />
<br />
1. Login to weblogic console at http://server:port/console<br />
2. On the left side under domain structure click on the domain name<br />
3 Click on Configuration --> General tab on the right side<br />
4. There will be a check box Production Mode. If is unchecked then it means it is running in development mode.Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-48446441384402855652013-03-12T03:33:00.003+05:302013-03-12T03:33:43.136+05:30Tailor, Customize, Extend, Personalize, Localize, and Integrate – All ExplainedOracle Fusion Developer Relations Team has posted a new entry on their blog at https://blogs.oracle.com/fadevrel/entry/tailor_customize_extend_personalize_localize talking about various terms used in Fusion Applications.<br />
<br />
Please do read and leave a comment there.Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-58755039044700196222013-03-07T12:50:00.004+05:302013-03-07T12:50:49.858+05:30Secrets of Google IO 13 Home Page Codes #io13Though this is not the place where I post these things but there was no point to create a new blog for just one such post.<br />
<br />
Here are all the graphical mystery pages that gets generated from google i/o 2013 home page live at http://google.com/io<br />
<br />
A space animation<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-PnHl4ASLKTg/UTg8O3A28xI/AAAAAAAA33U/gRUoMDUdBy8/s1600/00101010.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="345" src="http://2.bp.blogspot.com/-PnHl4ASLKTg/UTg8O3A28xI/AAAAAAAA33U/gRUoMDUdBy8/s640/00101010.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The hotdog and the burger<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-ORbCZekOD-Q/UTg8kT6CLbI/AAAAAAAA33c/MLbFrvCR4Cs/s1600/00111001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="354" src="http://1.bp.blogspot.com/-ORbCZekOD-Q/UTg8kT6CLbI/AAAAAAAA33c/MLbFrvCR4Cs/s640/00111001.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The space</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-HK6Em7NAqBg/UTg8wdugQAI/AAAAAAAA33k/dmRn3UTpyAQ/s1600/01000101.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="http://3.bp.blogspot.com/-HK6Em7NAqBg/UTg8wdugQAI/AAAAAAAA33k/dmRn3UTpyAQ/s640/01000101.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Random graphics</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-OvT4zeKNuig/UTg9A7lWORI/AAAAAAAA33s/veluLSrIyMg/s1600/01010011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="336" src="http://2.bp.blogspot.com/-OvT4zeKNuig/UTg9A7lWORI/AAAAAAAA33s/veluLSrIyMg/s640/01010011.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
the bowling</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-tmlqaMBY0gI/UTg9Le4unBI/AAAAAAAA330/YHeBUCmTNPk/s1600/01110101.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="http://4.bp.blogspot.com/-tmlqaMBY0gI/UTg9Le4unBI/AAAAAAAA330/YHeBUCmTNPk/s640/01110101.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The console</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-7BORVGJpENM/UTg9Vpwkp8I/AAAAAAAA338/LxLryWE-Vfg/s1600/01111111.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="356" src="http://4.bp.blogspot.com/-7BORVGJpENM/UTg9Vpwkp8I/AAAAAAAA338/LxLryWE-Vfg/s640/01111111.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
A simple game to control ball using the paddle</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-o-S9hs8sQs0/UTg9yXwFeSI/AAAAAAAA34M/M29xhw9SPsQ/s1600/Screen+Shot+2013-03-06+at+11.11.30+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://3.bp.blogspot.com/-o-S9hs8sQs0/UTg9yXwFeSI/AAAAAAAA34M/M29xhw9SPsQ/s640/Screen+Shot+2013-03-06+at+11.11.30+PM.png" width="594" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The amazing frequency control</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-vq0AmVgs7UU/UTg-PPwlb7I/AAAAAAAA34U/oQY7vzZ03f8/s1600/Screen+Shot+2013-03-06+at+11.13.26+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="314" src="http://1.bp.blogspot.com/-vq0AmVgs7UU/UTg-PPwlb7I/AAAAAAAA34U/oQY7vzZ03f8/s640/Screen+Shot+2013-03-06+at+11.13.26+PM.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The Omelette </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-T8xnkHlTiJg/UTg9h3Ar2YI/AAAAAAAA34I/D5f5-RnsvUc/s1600/10010000.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="http://1.bp.blogspot.com/-T8xnkHlTiJg/UTg9h3Ar2YI/AAAAAAAA34I/D5f5-RnsvUc/s640/10010000.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Nice follow me game to test your memory</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-wyGoCQlnxIc/UTg-cntMq8I/AAAAAAAA34c/588uasRfkHc/s1600/11010011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="388" src="http://1.bp.blogspot.com/-wyGoCQlnxIc/UTg-cntMq8I/AAAAAAAA34c/588uasRfkHc/s640/11010011.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Funky music band</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-qkyZ0Ds0KCw/UTg-jjl7FfI/AAAAAAAA34k/9q9rzwsVWBw/s1600/11011011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="414" src="http://1.bp.blogspot.com/-qkyZ0Ds0KCw/UTg-jjl7FfI/AAAAAAAA34k/9q9rzwsVWBw/s640/11011011.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Caturday :)</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-xyNgZSd0q6w/UTg-sNNHxhI/AAAAAAAA34s/6SMKO9pLX_A/s1600/11100111.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="336" src="http://3.bp.blogspot.com/-xyNgZSd0q6w/UTg-sNNHxhI/AAAAAAAA34s/6SMKO9pLX_A/s640/11100111.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com1tag:blogger.com,1999:blog-589834708478184487.post-88614124618783298372013-02-28T04:37:00.002+05:302013-02-28T04:37:51.051+05:30Tailoring Fusion Applications in the Cloud ExplainedHere is an another useful post from Fusion Apps Developer Relations Team about tailoring fusion applications in the cloud<br />
<br />
https://blogs.oracle.com/fadevrel/entry/tailoring_fusion_applications_in_theAnonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-87130064308379320952012-12-04T07:28:00.001+05:302012-12-04T07:29:03.842+05:30ADF 11g: Lessons Learned in View Object refactoringThough this is not a common usecase and a lot of you might think why someone will ever do that? But, while implementing solutions which are not tried earlier by developer there might be switches from creating a entity based view object to transient view object or other way round that is, starting with a transient view object and then later decide to make it entity based. Lets take the later case:<br />
<br />
Converting a Transient View Object to Entity base View Object: Overall not a very commonly done activity but for those who may need to do it in future to save some efforts. It is just to go to 'Entity Objects' section on your view definition and then to shuttle the required entity object on which you want to base your view object. After this you may add required attributes from your entity using the option 'Add from entity' and can delete the transient attributes no longer needed.<br />
<br />
So, what't the issue?<br />
<br />
Well, if you go ahead with that view object definition and create a table based on a view instance of this view object you will see if coming nice. Try CRUD operations like create, update etc. and should be working as expected. However, when I tried deleting a row it didn't work at all! So, I decided to debug it and one of the obvious way is set a debug point at remove() method of View object's row impl class and entity object's impl class. On debugging, what I found was: it was hitting the remove method in View Object's row Impl but was not stopping at entity object's impl. This indicated me some sort of configuration issues and I decided to create another view object based on the same entity object but this time in the natural expected way. On doing so in less than 2 minutes and spending some 5 minutes in comparing both the VO definitions carefully I found that in my original view object a property is set in the EntityUsages as follows:<br />
<br />
<br />
<entityusage p="p"> Name="CreditReceiverEO"<br />
Entity="myapps.model.entity.CreditReceiverEO"<br />
DeleteParticipant="false"/><br />
<br />
And this explained everything. So, this property was probably set during the transient view creation and didnt get removed when I switched the VO to base on an entity object.<br />
<br />
<b>Conclusions: </b><br />
<br />
1. Avoid shortcuts in creating ADF BC objects unless you really understand the in and out of xml files generated.<br />
<br />
2. Whenever you see and awkward behavior try to do the things in natural way by keeping a backup of your existing app so that you can revert back later if needed.<br />
<br />
3. If point 2 is not a valid option all the time then just to create a copy or sample project with the same setup but in the natural manner and compare the generated xmls to see if you can find a clue.<br />
<br />
</entityusage>Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-43850603506691760682012-11-29T00:59:00.003+05:302012-11-29T00:59:57.924+05:30ADF 11g: Deleting customizations metadata from MDSADF 11g offers powerful ways to change or override the pieces of fusion applications via customization and personalization. It can be done in many ways like by administrator at run time to show hide certain components at different levels or layers like at site level, global lever etc. For meeting more specific needs the consultants can do the design time customizations by opening jdeveloper and then bundle them to override the behavior or application flow. Another interesting possibility is to extend fusion applications. One of the example for extension is say the application offers a Task flow showing employee and department data in a tree table structure. You may want to manipulate this data in a totally different way and hence this may not be satisfied by customizing. At this point, extension comes to the rescue. What you can do is simply create a new bounded task flow with a new view activity as per your requirements. Then you can customize the existing task flow by dropping your created bounded task flow and making it a default activity. To be able to ship it you will need to package your task flow artifacts as a adf library jar and the customization done as a mar file. Then the packaged adf library jar will be required to place in the exploded ear of your application in the WEB-INF/lib folder (assuming you only created a UI artifacts and reused existing model).<br />
<br />
For the mar file deployment, you will need to login to Enterprise Manager of your application server which is usually at http://your server:port/em location. In the em, after choosing your deployed application you will need to select MDS from the menu and have to import the mar file. On bouncing the server the newly created task flow will be launched instead of the one that was earlier present.<br />
<br />
There are situations when you may have to revert back to the original task flow so to be able to do you will need to delete the imported metadata. Two of the ways to do that is by:<br />
1. Customization Manager which can be accessed by anyone with administrator privileges.<br />
2. By using the wlst console<br />
<br />
The focus of this post is on point 2 and here is how you can do that:<br />
<br />
To start the wlst console use:<br />
<wlst location="location">/wlst.sh </wlst><br />
<br />
There are many places where wlst.sh may exist depending upon the weblogic version. Fusion applications also provide its own version of wlst.sh through the shipped libraries during the installation. Some of the typical locations are in<br />
<br />
<br />
<div>
<span style="background-color: white; font-family: tahoma, verdana, sans-serif; text-align: -webkit-auto;">atgpf/common/bin/wlst.sh</span></div>
<div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">DefaultDomain/config/fmwconfig/wlst.sh</span></div>
</div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">wlst commands need either online or offline mode for them to work. So, the one being discussed here to delete metadata it needs the online mode. Which means you need to connect to the server on wlst console before running the command. So to connect you need to use:</span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">connect('weblogic userna,e','weblogic1 password,'t3://server name:port')</span></div>
</div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">Once connected you can first see the imported meta data and then delete it. To get the metadata imported into the app you can use:</span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<br />
<br />
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">exportMetadata(application='You Deployed App name',</span><span style="font-family: Tahoma; text-align: -webkit-auto;">server='wls server name',toLocation='/tmp/myrepos',docs='/**')</span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">This will export all the mds meta data . You can selectively export by changing the docs option. </span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;">Finally, to delete the metadata like in this case we want to delete just for the customized task flow you can use:</span></div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
<div>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve">deleteMetadata(application='<span style="font-family: Tahoma; white-space: normal;">You Deployed App name</span>',server='<span style="font-family: Tahoma; white-space: normal;">wls server name</span>', docs='/WEB-INF/.../ExistingTaskFlow.xml.xml')</pre>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve">
</pre>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve"><span style="font-family: Tahoma; white-space: normal;">This should do the job and as I mentioned earlier the docs option can be changed to delete more than one artifact or all by using /**</span></pre>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve"><span style="font-family: Tahoma; white-space: normal;">
</span></pre>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve"><span style="font-family: Tahoma; white-space: normal;">Reference: </span><span style="background-color: transparent; white-space: normal;"><span style="font-family: Tahoma;">http://docs.oracle.com/cd/E14571_01/web.1111/e13813/custom_mds.htm</span></span></pre>
<pre style="background-color: white; text-align: -webkit-auto;" xml:space="preserve">
</pre>
</div>
<div>
<span style="font-family: Tahoma; text-align: -webkit-auto;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-20117522325331659742012-11-21T13:32:00.001+05:302012-11-21T13:32:20.886+05:30ADF 11g: Getting Selected values from a LOVI had a table in the UI where one of the column is a LOV. The requirement was to default another field say PayeeName in the same row based on value selected from the LOV only when the PayeeName field does not have a value already.<br />
<br />
To accomplish that the simplest idea is to bind the ReturnPopupEvent to a managed bean method and some how get one of the returned value from LOV in this method. Then check if the PayeeName field is null. If yes then update it otherwise just ignore. This can be done quite easily as follows:<br />
<br />
1. Go to the ReturnPopupEvent property of the LOV and bind it to a manged bean method.<br />
2. In the bean method you can write the code as below:<br />
<br />
<br />
public void myLOVListener(ReturnPopupEvent returnPopupEvent) { <br />
List lst= (List)returnPopupEvent.getReturnValue();<br />
String value = null;<br />
for(Object obj : lst{<br />
value = ((Map)obj).get("RoleName"));<br />
if(value != null)<br />
break;<br />
}<br />
<br />
//get the iterator binding to get handle of the current row <br />
DCBindingContainer bc =<br />
(DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();<br />
DCIteratorBinding profItr =<br />
bc.findIteratorBinding("MyTableVOIterator");<br />
Row rw = profItr.getViewObject().getCurrentRow();<br />
if(rw != null && rw.getAttribute("PayeeName") == null){<br />
rw.setAttribute("PayeeName", value);<br />
}<br />
}<br />
<br />
<br />
Please note that I am not really checking for null etc. as my intention is just to show how to use returned values from the returnPopupEvent.<br />
<br />
<br />
Another important point to note down is that the LOV must have RoleName as one of the return attributes in its configuration in the model.<br />
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-35609049548972920172012-11-08T03:14:00.001+05:302012-11-08T03:14:46.283+05:30Mass Refactoring ADF ApplicationThere are occasions when you may need to refactor the entire adf application including model and view projects to align to certain standards based on your organizational requirements or as a developmental decision.<br />
<br />
Dev guide already covers on how to refactor different BC4J and UI artifacts like entity objects, task flows etc. You may refer the <b>fusion applications developer guide</b> for the individual refactoring requirements at <a href="http://docs.oracle.com/cd/E15051_01/web.1111/b31974/refactoring.htm">http://docs.oracle.com/cd/E15051_01/web.1111/b31974/refactoring.htm</a><br />
<br />
However, doing this object based refactoring could be just too painful depending upon the size of your application and yes of course time consuming as well. So, to make a change everywhere like converting the package name com.mycompany.<b>app</b>.blawblaw to com.mycompany.<b>newapp</b>.blawblaw it will be required to change all the references of app to newapp in all the application files and also to rename the physical directory structure of the directory app to newapp. Here, are the steps you may find useful:<br />
<br />
<b>Assumptions</b><br />
1. Used jdeveloper 11g version 11.1.1.6.2<br />
2. Used on windows 7<br />
3. Your JDeveloper is closed (not essentially harmful to keep it open but not recommended)<br />
<br />
1. Take a good backup of your application before you start. Source control is a good way. However, I will still recommend to take a physical backup by just copy paste the app folder to somewhere else. Sometimes, source control might get crazy to figure out mass changes from outside the jdeveloper.<br />
2. Download a good search and replace tool like I used http://www.divlocsoft.com/index.htm<br />
3. Browse the tool to the root of your adf workspace and do a search with a filter mask *.jpr; *.jpx; *.java; *.xcfg; *.xlf; *.xml; *.cpx; *.adfc_diagram; *.dcx<br />
4. Above will make sure to capture all the relevant files from workspace from model and view controller project. Then search and replace the following:<br />
<br />
<ul>
<li>.app. to .newapp. for fixing all the packages</li>
<li>_app_ to _newapp_ to fix databindings.cpx with correct usageIds </li>
<li>/app/ to /newapp/ to fix taskflow path references etc</li>
</ul>
<div>
5. Once file content refactoring is done there comes a bit manual work. Now, you need to rename all the directories with name app to newapp</div>
<div>
<br /></div>
<div>
Now, start your jdeveloper and you should be all set. </div>
<div>
A point to not forget is to use jdeveloper based refactoring if there are very less number of artifacts and not really a need of moving jpx, jpr files etc.</div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-50876857327411013022012-10-27T03:42:00.000+05:302012-10-27T03:42:29.049+05:30Jdeveloper 11g: Enabling SVN If you are using RUP1 or RUP3(Rel4) versions of jdeveloper from edelivery.oracle.com for the development and wish to use svn (subversion) for the source control (which you must unless you are using another version control program). Then you will find that svn is disabled by default. You will see it in preferences as available but no way to use it.<br />
<br />
This is intentionally done to fix some bugs in the past about startup hanging issues for jdeveloper. Here, is the solution for the same.<br />
<br />
<br />
<ul>
<li>Go to <mw_home>/jdeveloper/jdev/roles/oracle.apps.role.xml</mw_home></li>
<li>Delete line 17 which disables subversion</li>
<li>Restart jdeveloper </li>
</ul>
<div>
Now, you should see the options to provide svn repository.</div>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-45802195553823160482012-10-19T08:52:00.000+05:302012-10-19T08:52:20.274+05:30Jdeveloper 11g: Could not reserve enough space for object heapToday morning, all of sudden my application running on jdeveloper 11.1.1.5.3 on a windows 7 64 bit machine stopped running. To be more precise I was hitting the following exception during the application deployment:<br />
<br />
GC overhead exceeded<br />
<br />
So, the natural answer was to look for permgen space and related memory jvm parameters for the possible issues. On looking into setDomain.env at jdeveloper/<system directoy="directoy">/DefaultDomain/bin I found the following:</system><br />
<br />
<br />
MEM_MAX_PERM_SIZE_64BIT="-XX:MaxPermSize=256M"<br />
export MEM_MAX_PERM_SIZE_64BIT<br />
<br />
<br />
So, I bumped it to 1024M. I started my server again and it did not help. So, next thing to look was to check the jvm parameters at wls startup in jdev console and I found as follows:<br />
<br />
C:\Oracle\Middleware11153\jdk160_24\bin\java -client -Xms32M -Xmx512M -XX:CompileThreshold=8000 -XX:PermSize=64M -XX:MaxPermSize=1024M -D<br />
<br />
Looking into it string gave me another hint on parameter -Xmx512M which is also not quite enough and could be the cause of issue. So, I decided to bump it to 1024M. To change this parameter I had options to update it in my jdev launch script which looks like as follows:<br />
<br />
myjdev.cmd<br />
============================<br />
<br />
set MW_HOME=C:\Oracle\Middleware11153<br />
set JAVA_HOME=%MW_HOME%\jdk1.6.0_34<br />
set PATH =%JAVA_HOME%\bin;%PATH%<br />
set JDEV_USER_HOME=C:\Users\vskumar\AppData\Roaming\JDeveloper<br />
set FADEV_VERBOSE=true<br />
set USER_MEM_ARGS=-Xms256m -Xmx256m -XX:MaxPermSize=1024m -XX:CompileThreshold=8000<br />
%MW_HOME%\jdeveloper\jdeveloper.exe<br />
<br />
<br />
So, I went ahead and modified the line starting with set USER_MEM_ARGS to look like as follows:<br />
set USER_MEM_ARGS=-Xms256m <b>-Xmx1024m</b> -XX:MaxPermSize=1024m -XX:CompileThreshold=8000<br />
<br />
and fired this command. After jdev launch I started the integrated wls and it failed with error as follows:<br />
<br />
<br />
Error occurred during initialization of VM<br />
Could not reserve enough space for object heap<br />
<br />
<br />
as I had changed Xmx param as the last thing so kind of guessed it as the issue and reduced it to 768M. And the same problem. So, I reduced it further to 640M and this I did not see the error. Though 640M was not satisfactory but was higher than previous 512M so, I thought its ok to go ahead and hopefully the error will go away as well. And, after couple of minutes later against my expectations it failed again with a new error this time. It was as follows:<br />
<br />
<br />
<br />
**************************************************************************<br />
The WebLogic Server encountered a critical failure<br />
Reason: unable to create new native thread<br />
***************************************************************************<br />
<oct 18="18" 1:05:14="1:05:14" 2012="2012" pdt="pdt" pm="pm"> <notice> <weblogicserver> <bea -000365="-000365"> <server changed="changed" force_shutting_down="force_shutting_down" state="state" to="to"> </server></bea></weblogicserver></notice></oct><br />
Throwing I/O exception: "MapViewOfFile: handle=7212 hiOffset=0 loOffset=0 size=1114112, Not enough storage is available to process this command., errno=8" errno = 8<br />
Throwing I/O exception: "MapViewOfFile: handle=7212 hiOffset=0 loOffset=0 size=1114112, Not enough storage is available to process this command., errno=8" errno = 8<br />
Throwing I/O exception: "MapViewOfFile: handle=7212 hiOffset=0 loOffset=0 size=1048576, Not enough storage is available to process this command., errno=8" errno = 8<br />
<br />
This kind of indicated me a physical memory issue with RAM or harddisk. I have 8gb ram on my machine with no app running so was sure that certainly I do not have low memory. I had more than 10 gig free space on my c drive where all this was running. So, what to do next? I reviewed my setDomain.env, ide.conf and jdev.conf files and changed all the places mem related parameters to 1024M but all with no results. I then changed my cmd script Xmx parameter back to 1024M as I thought this error is just an effect of error above it and will go away if I can fix that one. Hence, I was back to error<br />
<br />
<br />
Error occurred during initialization of VM<br />
Could not reserve enough space for object heap<br />
<br />
<br />
I decided to google for it and bumped into a thread talking about the possible reason that windows tries to allocate a contiguous memory to run vm and it fails to do so due to fragmentation etc and hence causes it. One of the solution in the same thread suggested to switch to a 64 bit jdk as a possible fix. Having no other options I downloaded<a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html" target="_blank"> jdk6 64bit</a> at location c:\proram files\java\jdk1.6.0_34 and updated my launch script JAVA_HOME line as follows:<br />
<br />
set JAVA_HOME = C:\Program Files\Java\jdk1.6.0_34<br />
<br />
Hoping all goes well i started jdev and then integrated wls. During startup I observed it is still picking up the old 32 bit version which was strange. So, I started looking again what is the issue for not picking the 64 bit jdk. I looked into jdev.conf and found an entry like:<br />
<br />
SetJavaHome C:\Program Files\Java\jdk1.6.0<br />
<br />
So, thinking this could be the issue I closed my jdev and commented this line. I kicked my jdev again and on startup as expected it asked me to provide java.exe location. I provided the 64 bit version java.exe location and finally jdev started. However, on starting the integrated WLS I was seeing the same old 32 bit version picked. I thought it might be picking it from setDomain.env and opened it but found its referring JAVA_HOME param rather a hard coded value. I thought to give it a try and added the value manually to it as follows:<br />
<br />
set JAVA_HOME = "C:\Program Files\Java\jdk1.6.0_34"<br />
<br />
I kicked my domain startup again but was still seeing the old jdk used and was frustrated on whats going on. I had no guesses left here and all of a sudden a friend suggested could it be that it doesn't like spaces? With no other options left we thought to give that too a try and i removed spaces to look it like:<br />
<br />
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_34"<br />
<br />
And, that was the culprit here! The spaces which my friend discovered as a possible issue was the least expected thing to be causing this particular issue. So, I then removed this hardcoded value and fixed my script launcher values as well accordingly.<br />
<br />
Needless to say, all my issues related memory got resolved and things worked fine after spending almost a day on this issue.<br />
<br />
<b>Key Takeaways</b><br />
<b>===========================</b><br />
1. Make sure not to have extra spaces in the set parameters in case of using windows.<br />
2. It is strongly recommended to use a 64 bit jdk. I am not sure why oracle ships 32 bit jdk with jdeveloper when this is recommended in dev guide as well.<br />
3. Have a launcherScript to set jvm params on startup rather launching jdev directly from program menu.<br />
<b><br /></b>
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com3tag:blogger.com,1999:blog-589834708478184487.post-79783937711239199662012-10-16T22:48:00.002+05:302012-10-19T07:28:39.839+05:30ADF 11g: Entity Object (EO) Insert cycleIt is quite important to understand entity lifecycle which involved different types of validations firing at different stages. It typically starts when an entity is created in the middletier when you invoke a vo.createRow() via UI or programmatically. The entity lifecyle is over at the time it is properly committed to the database. This cycle gets quite complex if there are multiple entities involved. If entities are associated like in a master-detail then validation cycles are extended to validate child entity as well during master entity validation. The best way to depict this is via a diagram as below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-PkeDM4NMUfg/UH2Wh3H_dwI/AAAAAAAA274/pevGg9XtnLg/s1600/entity+inserts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="http://4.bp.blogspot.com/-PkeDM4NMUfg/UH2Wh3H_dwI/AAAAAAAA274/pevGg9XtnLg/s640/entity+inserts.png" width="640" /></a></div>
I am not really spending time to explain each and every phase of this lifecycle as documentation does a good job for that. This post should be useful as a quick reference to the readers and quite important to understand to be able to handle some situations where it is required to decide where to place certain code.Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-8641926067457323772012-10-16T07:08:00.004+05:302012-10-16T07:08:51.956+05:30ADF 11g: CreateAndInitRow<br />
This one is rather a quite small post but might be useful for people quickly looking for a way to initialize a vo row at the time of creation. This method like createRow() only creates a new row but does not actually inserts into the vo. So, you will still need to call vo.insertRow(row). Here, is the syntax<br />
<br />
Row myRow = ruleAttrIter.createAndInitRow(new NameValuePairs(new String[] { "AttributeName" }, new Object[] { "AttributeValue" }));<br />
<br />
More than one attribute can be supplied comma separated.<br />
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-267097723994326172012-10-13T10:48:00.000+05:302012-10-13T10:48:33.982+05:30Refreshing Table Components for LOV bindingsThough this post is applicable for other type of bindings as well but just mentioning the use case where I found the issue and solved it. So, here is the scenario:<br />
<br />
1. Create a VO having a at least one string attribute<br />
2. Drop it on a page as a table from data control as a result a popup window will open up for selecting the type of component to use for table columns. In string type attribute choices will be like input text w/label, output text.<br />
3. On clicking ok a table will be created on your page.<br />
4. On trying to create a new row in the table you will see an input box for the string type column. So far so good.<br />
5. Now, say you want this field to be a List of Values (LOV). So, you go ahead and enable LOV on the attribute in the VO, set UI hints accordingly.<br />
6. On coming to page and clicking on the component the edit icon will be enabled. Clicking on this icon will bring the same popup which comes in step 2. However, in the list of components you will still see the old choices and no lov component.<br />
<br />
So, the worst case fix for this problem is to delete the table and recreate it. However, this is not a good choice when you have already built your page and have made some changes etc to the table as all will be gone on delete. How to fix then?<br />
<br />
There is a very useful option that comes to the rescue in this case. Right click on the table component on your page and select the "Rebind to another ADF control". This will open a popup window from where you can chose the same VO instance again and boom! All will work fine. Only drawback is, if you had deleted some attributes previously then you have to redo that and things like order of display of the columns.<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-43277338824000743652012-09-12T21:51:00.001+05:302012-09-12T21:51:54.599+05:30Hooking up Pivotal Tracker to Google App Engine for javaThough this post is no where related to ADF but I dont want to create a new blog for just one post. Sorry for that !<br />
<br />
<br />
<a href="http://www.pivotaltracker.com/" target="_blank">Pivotal Tracker</a> is an amazing agile development supporting bug/feature/story tracker system well suited for fast result oriented developments. We at <a href="http://www.sakshum.org/" target="_blank">Sakshum</a> recently started using it for our development environment. Sakshum web application is hosted on Google's amazing cloud platform called <a href="https://appengine.google.com/" target="_blank">Google App Engine</a> . A natural requirement came up to be able to create stories to pivtoalTracker from google app engine when exceptional situations occur time to time. PivotalTracker's api page list only curl commands to show how a HTTP request may work to do that. We struggled quite a bit to make it work and thought to put the code here for the people who might be facing the same problem.<br />
<br />
<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>String pivotalUrl = "http://www.pivotaltracker.com/services/v3/projects/<your id="id" project="project">/stories"; </your><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>String body = "<story><story_type>bug</story_type><name>" + storyTitle + "</name><description>" + storyDesc + "</description><requested_by>TEAM MEMBER NAME </requested_by></story>";<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>try{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>URLFetchService fetchService = URLFetchServiceFactory.getURLFetchService();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>HTTPRequest request = new HTTPRequest(new URL(pivotalUrl), HTTPMethod.POST, FetchOptions.Builder.withDeadline(30));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>request.addHeader(new HTTPHeader("X-TrackerToken","YOUR TOKEN"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>request.addHeader(new HTTPHeader("Content-type","application/xml"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>request.setPayload(body.getBytes());<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>HTTPResponse response = fetchService.fetch(request);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>if (response.getResponseCode() != 200) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>log.info("Could not create story as response code is:" + response.getResponseCode());<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>} <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}catch(Exception e){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> e.printStackTrace();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<br />
Make sure to have the TEAM MEMBER NAME a valid team member in the pivotal tracker else this wont work at all.<br />
<br />
PivotalTracker api page for reference is <a href="https://www.pivotaltracker.com/help/api?version=v3#get_activity" target="_blank">here</a><br />
Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-56657855150440825662012-09-08T01:12:00.001+05:302012-09-08T01:12:27.777+05:30QBE behavior in ADF 11gQBE - Query By Example is an awesome feature for ADF 11g tables and a number of times can eliminate the need of a search panel completely if you are limited to search the data based on a particular column values.<br />
<br />
I am not saying anything new here but just highlighting this feature. So, also does not make sense to copy paste from dev guide etc. All the supported operators are well documented at http://docs.oracle.com/cd/E23943_01/web.1111/e16272/databound_forms.htm#ADFJE389<br />
<br />
For those who want to change the QBE behavior for more advance requirements then there is a way to do that well. There is an excellent whitepaper on that and can be followed at <a href="https://docs.google.com/viewer?url=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fdeveloper-tools%2Fadf%2Flearnmore%2F30-table-filter-queries-169172.pdf" style="font-family: Tahoma; text-align: -webkit-auto;">https://docs.google.com/viewer?url=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fdeveloper-tools%2Fadf%2Flearnmore%2F30-table-filter-queries-169172.pdf</a><br />
<br />Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com5tag:blogger.com,1999:blog-589834708478184487.post-46781582354352867112012-07-18T03:51:00.001+05:302012-07-18T03:51:07.437+05:30Creating a Clickable Text Declarative Component in ADF 11gThis post is on how to create a clickable text declarative component in ADF 11g. Let me explain a bit on the exact requirements here.<br />
<br />
So, we need a text component which shows a small cross icon on the top right corner. This cross icon on click should hide the component from the page. The rich adf faces libraries does not provide any component with this capability. However, it is very easy to create such components using the concept of 'Declarative Components'. I don't want to copy paste the steps from the dev guide which I followed to build this one. Here is the <a href="http://docs.oracle.com/cd/E26098_01/web.1112/e16181/af_reuse.htm#ADFUI678" target="_blank">link for dev guide</a><br />
<br />
Broader steps are:<br />
1. Create a new project for your component. Choose option 'JSF Declarative Component'<br />
2. Select or create a new tag library to contain the component.<br />
3. Choose custom component class checkbox if you want to add some custom login in the component.<br />
4. Add facets, attributes and methods to design the look and feel and behavior of your component.<br />
<br />
Once you are done with your declarative component then it behind scene creates a metadata definition of the component. Once the component is created it can be deployed by packaging it as a ADF library jar. The details are again mentioned in the same section on the above provided link.<br />
<br />
Let's talk about a bit on the design of the 'Clickable Text' component. Let call it Text comp for the simplicity.<br />
1. Text Comp is designed by defining two attributes textValue (for holding the text value) and partialSubmit to expose the partialSubmit property of the close icon.<br />
2. For design panelGroupLayout with default property is taken.<br />
3. An outputText and a commandLink component is then dropped on it. CommandLink component further embeds the close icon.<br />
4. To get the required alignment outputText is set with a top margin 50px in this case.<br />
5. Another attribute of type method is created in the component definition with signature void method(javax.faces.event.ActionEvent) and bound to the action of the commandLink.<br />
<br />
The resultant component looks like as follows:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-w6ON3gE4MWM/UAXj43vZAfI/AAAAAAAA0Oo/DHeY2MEEm_w/s1600/custComp.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-w6ON3gE4MWM/UAXj43vZAfI/AAAAAAAA0Oo/DHeY2MEEm_w/s1600/custComp.PNG" /></a></div>
<br />
You can grab this workspace for using this component or for a detailed reference of implementation <a href="https://docs.google.com/open?id=0BwMHadroX7nQUTk2ZXRDOVkybVU" target="_blank">here</a>.<br />
<br />
The target application where you want to use this component will need you to provide some default text for this component and binding the actionListener.Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com0tag:blogger.com,1999:blog-589834708478184487.post-67445147927864700942012-07-17T01:03:00.003+05:302012-07-17T01:03:36.953+05:30ADF Anti PatternsI was looking into some of the anti patterns followed by developers while build applications for the enterprise World. I came across one of the useful doc in this direction by ADF-EMG group at https://sites.google.com/site/oracleemg/adf/files<br />
<br />
I would still like to summarize the covered anti-patterns here for a quick review:<br />
<br />
1. Do not use Composite Primary Keys. Better to use sequences as single attribute primary keys.<br />
2. Do not set Read Permissions on Entity Object. Better to prevent the view access to such pages.<br />
3. Do not mark associations as Composite better to handle it by marking foreign key as not null.<br />
4. Do no call Application Module from inside Entity Object code.<br />
5. Do not call Application Module from inside View Object code that can be found using View Accessors.<br />
6. Do not call setter method of an attribute from the getter method of another attribute.<br />
7. Do not use FacesContext or any other View Layer code in the model layer.<br />
<br />
Some, of these might sound quite obvious but developers do ignore these quite often. Most of these anti-patterns usually hints for avoiding either due to performance reasons or due to breaking the standard Object Oriented design principles one of those guides as "Do not invoke anything from the outer layer in any of the inner layers". Another supporting theory is called as '<a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/" target="_blank">Onion Architecture</a>'Anonymoushttp://www.blogger.com/profile/12027032736055922650noreply@blogger.com3