<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1908110696125487216</id><updated>2012-02-03T09:51:07.748+02:00</updated><category term='Screen Programming'/><category term='Fedora'/><category term='SQL'/><category term='SAPRFC'/><category term='Samba'/><category term='PL/SQL'/><category term='AJAX'/><category term='skype'/><category term='sqlplus'/><category term='Windows'/><category term='NVidia'/><category term='Chromium'/><category term='JDeveloper'/><category term='Code'/><category term='SAP'/><category term='SQLDeveloper'/><category term='Oracle Database 11g'/><category term='GoogleEarth 4.3'/><category term='Delphi'/><category term='Flash player'/><category term='Oracle ias10g'/><category term='SAP-Classification'/><category term='Android'/><category term='CakePHP'/><category term='MySQL'/><category term='CentOS'/><category term='C/C++'/><category term='OEL'/><category term='etc'/><category term='RealPlayer'/><category term='bash'/><category term='SuSE'/><category term='Java'/><category term='LDAP'/><category term='PHP'/><category term='RedHat-CentOS'/><category term='Firefox'/><category term='FreeTDS'/><category term='Active Directory'/><category term='Linux'/><category term='EMail'/><category term='ABAP'/><category term='Oracle ADF'/><category term='HTML'/><category term='bash scripts'/><category term='JSF'/><category term='JavaScript'/><category term='amarok'/><category term='SAP-Tables'/><category term='SAPJCo'/><category term='Oracle Database 10g'/><category term='.NET'/><title type='text'>Thanassis Bakalidis's Programming and DBA Scratch Pad</title><subtitle type='html'>All things relative to everyday programming and DBA practices, This blog will not give you the ET staff, just little remindings about how things work. Subjects are relative to Oracle, Linux, SAP/ABAP, Windows and ... you name it. 

I used to have a notepad onto which I put down anything I thought I might need again. Hopefully this is going to be as good as the paper with the added value of being able to paste from.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default?start-index=101&amp;max-results=100'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>150</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5713293609282764845</id><published>2011-12-13T18:53:00.003+02:00</published><updated>2011-12-13T20:09:30.105+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Java enums: A complete example</title><content type='html'>&lt;p&gt;
I started programming with Pascal, so I have deep feelings for enumerated types. To be honest I feel that they are a much more easy going approach to modeling that the long lists of constants we used in the C programming language or in the pre JDK5 versions of Java. 
&lt;/p&gt;
&lt;p&gt;
Java enums are so very flexible and the &lt;a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/enums.html" title="See the original Java documentation"&gt;guide&lt;/a&gt; on the Oracle website says it all. What I wanted to do in this post is to provide a full working example, as a reference to myself and hopefully any ... &lt;i&gt;lost soul&lt;/i&gt;, that demonstrates how to bind data with each enum type value and also how to implement the previous and next methods,
&lt;/p&gt;
&lt;pre&gt;
package gr.abakalidis.sample.model;

/**
 * Possible image states and relative sizes regarding the actual bitmaps
 * loaded from a Web server.
 * 
 * @author Thanassis Bakalidis
 * @version 1.0
 */
public enum ImageState {
 NOT_LOADED(0, 0), SMALL(320, 240), MEDIUM(800, 600), LARGE(1024, 768);

 private final int width;
 private final int height;

 ImageState(int width, int height)
 {
  this.width = width;
  this.height = height;
 }

 public int getHeight()
 {
  return this.height;
 }

 public int getWidth()
 {
  return this.width;
 }

 /**
  * Get the next value ion the series of enumeration 
  * 
  * @return the next value in the series or null if already at end of values
  */
 public ImageState getNext()
 {
  return this.ordinal() &lt; ImageState.values().length - 1 
    ? ImageState.values()[this.ordinal() + 1] 
    : null;
 }
 
 /**
  * Get the previous value in the series of enumeration
  * 
  * @return the next value in the series on null if called for the first va;ue 
  */
 public ImageState getPrevious()
 {
  return this.ordinal() == 0 
    ? null 
    : ImageState.values()[this.ordinal() - 1];
 }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5713293609282764845?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5713293609282764845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5713293609282764845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5713293609282764845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5713293609282764845'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/12/java-enums-complete-example.html' title='Java enums: A complete example'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2190945109763635526</id><published>2011-11-15T09:53:00.001+02:00</published><updated>2011-11-15T12:34:13.188+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><title type='text'>CentOS: Specifying DDNS hostname</title><content type='html'>&lt;p&gt;
A quick reminder. When using a CentOS machine on network with a DDNS then in order for the host name to appear correctly on the DDNS managed local zones, create or edit the file &lt;code&gt;/etc/sysconfig/network-scripts/ifcfg-deviceID&lt;/code&gt; where deviceID is the actual device name of your network interface e.g. eth0, wlan0 etc. Make sure that the line DHCP_HOSTNAME appears as shown below
&lt;/p&gt;
&lt;pre&gt;
DEVICE="eth0"
NM_CONTROLLED="yes"
&lt;spam style="Color:#cc0000"&gt;DHCP_HOSTNAME="my-machine"&lt;/spam&gt;
NAME="System eth0"
BROADCAST=255.255.255.255
ONBOOT=yes
&lt;/pre&gt;
&lt;p&gt;
There can be one &lt;code&gt;ifcfg-XXX&lt;/code&gt; file per network interface. That way you can have two different names for the same machine connecting to the same network using different network cards like Ethernet and Wi-fi.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2190945109763635526?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2190945109763635526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2190945109763635526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2190945109763635526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2190945109763635526'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/11/centos-specifying-ddns-hostname.html' title='CentOS: Specifying DDNS hostname'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1510416512916938500</id><published>2011-11-05T19:21:00.000+02:00</published><updated>2011-11-08T17:03:53.321+02:00</updated><title type='text'>CakePHP: Storing multi-dimentional arrays in cookies</title><content type='html'>&lt;p&gt;
II didn't know that cookies are basically plain text data. This makes it impossible to store complex data structures directly inside a cookie. More information can be found in the archives of the CakePHP google group following this &lt;a target = "_blank" title="View the original postings" href="http://cakephp.1045679.n5.nabble.com/Cookie-With-Multi-Dimensional-Array-Cannot-Be-Read-Sometimes-Is-This-A-Bug-td1282228.html"&gt;link&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The bottom line is that complex data need to be serialized  before being saved in a cookie and unserialized after they are read from one. The &lt;code&gt;serialize()&lt;/code&gt; and &lt;code&gt;unserialize()&lt;/code&gt; PHP functions are here to do the job and last but not least the third parameter of the Cookie::write call -- the one that instructs cake to encrypt the cookie data -- should be set to true.
&lt;/p&gt;
&lt;p&gt;
So to save a controller's form data you need to write something like this:
&lt;/p&gt;
&lt;pre&gt;
    $dataToSave = serialize($this-&gt;data);
    $this-&gt;Cookie-&gt;write( self::SEARCH_DATA_KEY, $dataToSave, true, '1 year');
&lt;/pre&gt;
&lt;p&gt;
and to read them back ....
&lt;/p&gt;
&lt;pre&gt;
        if (empty($this-&gt;data)) {
            // try to see if we have a stored cookie
            $cookieData = $this-&gt;Cookie-&gt;read(self::SEARCH_DATA_KEY);                        
            if (empty($cookieData)) {
               // provide default values here 
               ...
            } else 
                $this-&gt;data = unserialize($cookieData);            
        }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1510416512916938500?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1510416512916938500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1510416512916938500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1510416512916938500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1510416512916938500'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/11/cakephp-storing-multi-dimentional.html' title='CakePHP: Storing multi-dimentional arrays in cookies'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-6149736892317540836</id><published>2011-11-01T13:43:00.000+02:00</published><updated>2011-11-01T13:48:46.150+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>CakePHP: An edit form with a cancel button</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
When developing database CRUD applications with CakePHP, sooner or later you end up writing view code looking more or less like
&lt;br /&gt;
&lt;pre&gt;&amp;lt;div class="my model form"&amp;gt;
&amp;lt;?php echo $this-&amp;gt;Form-&amp;gt;create('MyModel');?&amp;gt;
 &amp;lt;fieldset&amp;gt;
  &amp;lt;legend&amp;gt;&amp;lt;/legend&amp;gt;
 &amp;lt;?php
  echo $this-&amp;gt;Form-&amp;gt;input('id');
  echo $this-&amp;gt;Form-&amp;gt;input('name');
 ?&amp;gt;
 &amp;lt;/fieldset&amp;gt;
&amp;lt;?php echo $this-&amp;gt;Form-&amp;gt;end(__('Submit', true));?&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
This creates a nice form with a submit button at the end that every self respecting user can press to create a new record or modify the data of an existing one. It is also logical that you place a link to the index page somewhere near the form, so your users know where to go in case they change their mind about altering the database data.
&lt;br /&gt;
With my users this time is was different. The form had to contain a cancel button. So how does one do it? If you are using the cake bake script and wish to have two nice round green buttons right at the bottom of your form then replace the last two lines of the previous code fragment with the following:
&lt;br /&gt;
&lt;pre&gt;     ...
     &amp;lt;div class="submit"&amp;gt;
         &amp;lt;?php echo $this-&amp;gt;Form-&amp;gt;submit(__('Submit', true), array('name' =&amp;gt; 'ok', 'div' =&amp;gt; false)); ?&amp;gt;
         &amp;lt;?php echo $this-&amp;gt;Form-&amp;gt;submit(__('Cancel', true), array('name' =&amp;gt; 'cancel','div' =&amp;gt; false)); ?&amp;gt;
     &amp;lt;/div&amp;gt;
     &amp;lt;/fieldset&amp;gt;                   
 &amp;lt;?php echo $this-&amp;gt;Form-&amp;gt;end();?&amp;gt;
&lt;/pre&gt;
The next thing to know from inside the controller code, is which button was pressed before the data were posted and that is available inside the &lt;code&gt;'form'&lt;/code&gt; array of the &lt;code&gt;Controller::params&lt;/code&gt; property. So a simple modification like the one on the following code :
&lt;br /&gt;
&lt;pre&gt;        public function edit($id = null)
        {
            if (!$id &amp;amp;&amp;amp; empty($this-&amp;gt;data)) {
               $this-&amp;gt;Session-&amp;gt;setFlash(__('Invalid property', true));
               $this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
            }&lt;/pre&gt;
&lt;pre&gt;            if (!empty($this-&amp;gt;data)) {
                // abort if cancel button was pressed      
                if (isset( $this-&amp;gt;params['form']['cancel'])) {
                    $this-&amp;gt;Session-&amp;gt;setFlash(__('Changes were not saved. User cancelled.', true));
                    $this-&amp;gt;redirect( array( 'action' =&amp;gt; 'index' ));
                }

                // proceed to save changes as usual
        }
&lt;/pre&gt;
... and everyone is happy.
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-6149736892317540836?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/6149736892317540836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=6149736892317540836' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6149736892317540836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6149736892317540836'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/11/cakephp-form-with-cancel-button.html' title='CakePHP: An edit form with a cancel button'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7560152898288107277</id><published>2011-10-19T11:51:00.000+02:00</published><updated>2011-10-24T09:43:30.702+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>A new version of the CakePHP QBE component</title><content type='html'>&lt;p&gt;
I have just developed and started testing of a new version of my QBE component.
&lt;/p&gt;
&lt;p&gt;
Major changes are that the component now accepts the model name as an initialization parameter, it provides a new &lt;strong&gt;~ X Y&lt;/strong&gt; operator
to implement the between clause and that support for a different search and results page is now more clear.
&lt;/p&gt;
The code for the component, along with usage details can be found in my GitHub repository available from 
&lt;a href="https://github.com/abakalidis/CakePHP-QBE-Component"&gt;this link&lt;/a&gt;:.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7560152898288107277?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7560152898288107277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7560152898288107277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7560152898288107277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7560152898288107277'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/10/new-version-of-cakephp-qbe-component.html' title='A new version of the CakePHP QBE component'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7157926724353765898</id><published>2011-09-14T07:32:00.000+02:00</published><updated>2011-09-14T08:30:19.469+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP: Check if a customer is blocked for sales support</title><content type='html'>&lt;p&gt;This is relatively simple, but it's best to keep it here for future use. &lt;/p&gt;&lt;pre&gt;FORM check_if_customer_is_blocked USING a_cust_id TYPE kunnr.
 DATA :
   is_blocked TYPE cassd_x.

 SELECT SINGLE cassd
   INTO is_blocked
   FROM kna1
   WHERE kunnr = a_cust_id.

 IF NOT is_blocked IS INITIAL.
   MESSAGE e888(sabapdocu) WITH 'Customer is blocked!'.
 ENDIF.

 SELECT SINGLE cassd
  INTO is_blocked
  FROM knvv
  WHERE kunnr = a_cust_id.

 IF NOT is_blocked IS INITIAL.
   MESSAGE e888(sabapdocu) WITH 'Customer is blocked!'.
 ENDIF.
ENDFORM.
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7157926724353765898?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7157926724353765898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7157926724353765898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7157926724353765898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7157926724353765898'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/09/abap-check-if-customer-is-blocked-for.html' title='ABAP: Check if a customer is blocked for sales support'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2247161432845653321</id><published>2011-09-13T17:53:00.003+02:00</published><updated>2011-10-14T18:43:30.210+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android Development on Fedora 15 Howto</title><content type='html'>&lt;p&gt;
Here are the steps I followed in order to start developing android applications on my Fedora 15 x86_64 box. The actual list is a collection from various sources that I am listing at the end of this post put together in a &lt;q&gt;start-to-finsh&lt;/q&gt; manner, so we can start developing &lt;i&gt;almost&lt;/i&gt; right away. &lt;/p&gt;

&lt;h2&gt;
Step 1: Install the Sun Java &lt;/h2&gt;
&lt;p&gt;
Download the appropriate rpm for your architecture by visiting the Oracle Java SE Downloads site. Follow &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank" title="Goto Java SE downloads"&gt;this&lt;/a&gt; link. Select the latest Java SE 6 Update and download it on your machine. 
&lt;/p&gt;
&lt;p&gt;
After download is complete, open a terminal window, cd to your downloads directory and enter the following command :
&lt;/p&gt;
&lt;pre&gt;[thanassis@nb-thanassis Downloads]$ sudo sh jdk-6u27-linux-x64-rpm.bin 
&lt;/pre&gt;

&lt;h2&gt;
Step 2: Make Sun Java the default Java for your machine
&lt;/h2&gt;
&lt;p&gt;
Using the alternatives command -- thanks to &lt;a title="Fedora 14 personal installation guide"  href="http://www.mjmwired.net/resources/mjm-fedora-f14.html#java" target="_blank"&gt;Mauriat Miranda&lt;/a&gt; -- you may change the default java used by your system like this : 
&lt;pre&gt;sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000
&lt;/pre&gt;
&lt;p&gt;
To test,  try the following:
&lt;/p&gt;
&lt;pre&gt;[thanassis@nb-thanassis Downloads]$ java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
&lt;/pre&gt;

&lt;h2&gt;
Step 3: Download and install the Android SDK core support
&lt;/h2&gt;
&lt;p&gt;
Start from this page &lt;a href="http://developer.android.com/sdk/index.html" target="_blank" title="Vist the Download the Android SDK page"&gt;here&lt;/a&gt;:
&lt;/p&gt;
&lt;p&gt;
Download the latest android SDK and unpack it in a directory of your choosing. We will need to modify our path variable based on that, so I recommend that you change the base name from &lt;code&gt;android-sdk-linux_x86&lt;/code&gt; to &lt;code&gt;AndrodSDK&lt;/code&gt; and move it to &lt;code&gt;/opt&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
Next, edit your .bashrc file and modify your path variable to include AndroidSDK/tools and AndroidSDK/platform-tools. The corresponding PATH statement should more or less look like this: 
&lt;/p&gt;
&lt;pre&gt;export PATH=$PATH:/opt/AndroidSDK/platform-tools:/opt/AndroidSDK/tools
&lt;/pre&gt;
&lt;p&gt;
To start the android emulator on a 64 bit machine we need some additional 32bit packages. These can be installed using the command
&lt;/p&gt;
&lt;pre&gt;sudo yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
&lt;/pre&gt;

&lt;h2&gt;
Step 4: Start the android application, download the SDK files and build a virtual device
&lt;/h2&gt;
&lt;p&gt;
Run command &lt;code&gt;/opt/AndroidSDK/tools/android&lt;/code&gt;. From the available packages select the SDK version and the documentation for the versions you are planning to work with. Click the install selected button on the right and then accept the licesnse terms and complete the installation of the selected software.
&lt;/p&gt;
&lt;p&gt;
Next create an AVD device. Click the New button and fill in information about the new device
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-_7bMy1YLMtk/Tm9pN8pFdkI/AAAAAAAAAR4/BiGMVyPEHvE/s1600/new-avd.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="400" width="268" src="http://2.bp.blogspot.com/-_7bMy1YLMtk/Tm9pN8pFdkI/AAAAAAAAAR4/BiGMVyPEHvE/s400/new-avd.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;
Click create AVD to create your device. After device creation is complete, close the android application and log out and in again to make the paths work.
&lt;/p&gt;
&lt;p&gt;
When you are back in, start the android application directly from a terminal window and start your new device just to be 100% sure that everything works fine.
&lt;/p&gt;

&lt;h2&gt;
Step 5: Install eclipse and the ADT plug-in
&lt;/h2&gt;
&lt;p&gt;
The minimal requirement in order to install eclipse for developing java applications to use with Android is the &lt;code&gt;eclipse-jdt&lt;/code&gt; package, so a : 
&lt;/p&gt;
&lt;pre&gt;sudo yum install eclipse-jdt
&lt;/pre&gt;
&lt;p&gt;
... will be enough to get you started.
&lt;/p&gt;
&lt;p&gt;
After eclipse is installed on our Linux box we need to install the android development plug-in. This is done by selecting Help &amp;rarr; Install new software from the eclipse main window menu. Click the Available software sites link and make sure that the entry &lt;strong&gt;http://download.eclipse.org/releases/helios&lt;/strong&gt; is enabled. Otherwise install it by clicking the add button and create a new software repository like this:
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-R-jGYz_2f5c/Tm94YkpiuzI/AAAAAAAAASA/Q-n2QAP6F-o/s1600/eclipse-install-helios-updates.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="157" width="400" src="http://2.bp.blogspot.com/-R-jGYz_2f5c/Tm94YkpiuzI/AAAAAAAAASA/Q-n2QAP6F-o/s400/eclipse-install-helios-updates.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
While you are there click the add button again, in order to create the android plug in repository. The repo URL is &lt;b&gt;https://dl-ssl.google.com/android/eclipse/ &lt;/b&gt; and the add repository window should be filled like this:
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-x7CvixACdp4/Tm98DMD_ZnI/AAAAAAAAASQ/M7jPGPRSEuk/s1600/eclipse-add-adt-plugin-repo.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="157" width="400" src="http://1.bp.blogspot.com/-x7CvixACdp4/Tm98DMD_ZnI/AAAAAAAAASQ/M7jPGPRSEuk/s400/eclipse-add-adt-plugin-repo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;
Make sure that both repositories are enabled, by activating the check box on the right and press Ok to dismiss the dialog. Now we are ready to perform the actual plug-in installation. Select the ADT plug-in on the Work with field and then check all available software. Click Next accept the license agreement and after download and install is over restart eclipse..
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-r7w-9ST3sMg/Tm97n6MaaNI/AAAAAAAAASI/zy4zf9rdUXY/s1600/eclipse-install-adt-plugin.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="323" width="400" src="http://3.bp.blogspot.com/-r7w-9ST3sMg/Tm97n6MaaNI/AAAAAAAAASI/zy4zf9rdUXY/s400/eclipse-install-adt-plugin.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;
There is one final detail. Select the Preferences command from the Window menu. Click the Android category from the left of the dialog and then fill the SDK base directory as shown iin the next image:
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Y3KxCTH3j5M/Tm9-Vgfbi6I/AAAAAAAAASY/49xZjGHzqeY/s1600/android-sdk-setup.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="225" width="400" src="http://3.bp.blogspot.com/-Y3KxCTH3j5M/Tm9-Vgfbi6I/AAAAAAAAASY/49xZjGHzqeY/s400/android-sdk-setup.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;h2&gt;
Step 6: Create the Hello world application
&lt;/h2&gt;
&lt;p&gt;
At this point we shall create a simple hello world application and deploy it first on the android emulator and next to an actual android device connected via USB. Start the eclipse IDE, click File &amp;rarr; New &amp;rarr; Project and then select Android project from the dialog that pops up. Click next and fill in the Project name and package name fields wth the values &lt;code&gt;HelloWorld&lt;/code&gt; and &lt;code title="any valid java package name will do"&gt;org.example.hello&lt;/code&gt; respectively. Click Finish to create the project.
&lt;/p&gt;
&lt;p&gt;
Just to spice up things a bit more, open the &lt;code&gt;res/values/strings.xml&lt;/code&gt; file and change the value of the hello string to &lt;code&gt;Hello Android from Fedora&lt;/code&gt;. Save the file and run the application; the android emulator will eventually load and the application will be deployed and run on it, so you 'll probably end up seeing something like this:
&lt;/p&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-omJx3vCHGoQ/Tm-GqbX9vKI/AAAAAAAAASg/vucSZURndKE/s1600/hello-world-emulator.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="372" width="400" src="http://4.bp.blogspot.com/-omJx3vCHGoQ/Tm-GqbX9vKI/AAAAAAAAASg/vucSZURndKE/s400/hello-world-emulator.png" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;h2&gt;
Step 7: Connect your android device to Linux.
&lt;/h2&gt;
&lt;p&gt;
Our last job will be to connect an actual android device to our Linux box and deploy our &lt;code&gt;HelloWorld&lt;/code&gt; application onto that device.
&lt;/p&gt;
&lt;p&gt;
Remember that before we connect the actual device we need to change the following settings on the device:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Menu Settings &amp;rarr; Applications, enable Unknown (or Untrusted) sources.&lt;/li&gt;
&lt;li&gt;Menu Settings &amp;rarr; Applications &amp;rarr; Development, enable USB debugging.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The last part comes directly from Peter Kirns &lt;a title="Link to the original page" target="_blank" href="http://android.noisepages.com/2010/02/developing-on-android-on-fedora/"&gt;blog post&lt;/a&gt;. We need to configure Fedora’s udev rules to support our device in debugging mode. 
&lt;/p&gt;
&lt;p&gt;
As the super user create or edit the file &lt;code&gt;/etc/udev/rules.d/51-android.rules&lt;/code&gt; and place the following line in it:
&lt;/p&gt;
&lt;pre&gt;SUBSYSTEM=="usb",&lt;span style="color:maroon; text-weight-bold;" title="Change that to your device manufacturer ID"&gt;0bb4&lt;/span&gt;",SYMLINK+="android_adb",MODE="0666"
&lt;/pre&gt;
&lt;p&gt;
The &lt;code&gt;SYSFS{idVendor}=="xxxx"&lt;/code&gt; entry must be filled with the USB Vendor ID of your device manufacturer. (the example here assumes you are using HTC). The list of all devices is available from Google's Using Hardware Devices Android Developer's page via this &lt;a href="http://developer.android.com/guide/developing/device.html#setting-up" target=_blank" title="Using Hardware Devices Android Developer's page"&gt;link&lt;/a&gt;.  There is one last thing though: &lt;strong&gt;Vendor Ids must be typed in small letters&lt;/strong&gt;, although Google's table lists them in capital.
&lt;/p&gt;
&lt;p&gt;
You can even set up your environment to allow connections to multiple devices by adding more than one line in the &lt;code&gt; 51-android.rules&lt;/code&gt; file. 
As an example have a look at my setup that allows me to connect to a Samsung, a Sony Ericson and an HTC device :
&lt;/p&gt;
&lt;pre&gt;
[athanassios@hades rules.d]$ cat 51-android.rules 
SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",SYMLINK+="android_adb",MODE="0666"
SUBSYSTEM=="usb",SYSFS{idVendor}=="0fce",SYMLINK+="android_adb",MODE="0666"
SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"
&lt;/pre&gt;
&lt;/p&gt;
Finally, reload rules by using:
&lt;/p&gt;
&lt;pre&gt;udevadm control --reload-rules
&lt;/pre&gt;
&lt;p&gt;
Connect your device. In case it prompts for a connection mode specify that it should act as a USB storage unit (disk drive).
&lt;/p&gt;
&lt;p&gt;
Testing connection can be done by using:
&lt;/p&gt;
&lt;pre&gt;[thanassis@nb-thanassis ~]$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
SH16ERT01652    device
&lt;/pre&gt;
&lt;p&gt;
Start eclipse and run your hello project again. This time the ADT plugin will detect your device deploy your application onto it and you will see the hello world message right onto your android's screen.
&lt;/p&gt;

&lt;h2&gt;
Notes&lt;/H2&gt;&lt;p&gt;
In order to compile this list I used the following links. Thanks and credits go to the original authors.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://developer.android.com/sdk/installing.html" target+_blank"&gt;
Installing the SDK. Android Developer's Page
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://developer.android.com/guide/developing/device.html#setting-up" target+_blank"&gt;
Using Hardware Devices. Android Developer's Page
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://android.noisepages.com/2010/02/developing-on-android-on-fedora/" target+_blank"&gt;
Developing on Android on Fedora by Peter Kirn
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://fedoraproject.org/wiki/HOWTO_Setup_Android_Development" target+_blank"&gt;
Fedora Project: HOWTO Setup Android Development
&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
  &lt;a href="http://www.mjmwired.net/resources/mjm-fedora-f14.html" target="_blank"&gt;
        Mauriat Miranda's Personal Fedora 14 Installation Guide
  &lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2247161432845653321?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2247161432845653321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2247161432845653321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2247161432845653321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2247161432845653321'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/09/android-development-on-fedora-15-howto.html' title='Android Development on Fedora 15 Howto'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-_7bMy1YLMtk/Tm9pN8pFdkI/AAAAAAAAAR4/BiGMVyPEHvE/s72-c/new-avd.png' height='72' width='72'/><thr:total>0</thr:total><georss:featurename>Komotini 69100, Greece</georss:featurename><georss:point>41.11887 25.405528</georss:point><georss:box>40.927478 25.089671 41.310262 25.721385</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5341790605513460072</id><published>2011-08-29T08:40:00.003+02:00</published><updated>2011-09-02T18:01:45.562+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='JDeveloper'/><title type='text'>JDeveloper 10.1.3.4 on CentOS 6 x86_64</title><content type='html'>&lt;p&gt;
Last Thursday I formated my CentOS 5 workstation at work and reinstalled version 6 from scratch. Although we have stopped developing new application with JDeveloper 10.1.x, I still require the old jdev  IDE, as existing applications need maintenance and even new features. 
&lt;/p&gt;
&lt;p&gt;
Making  jdev 10.1.3.4 work on a 64bit Linux is discussed 
  &lt;a href="http://darwin-it.blogspot.com/2009/07/jdeveloper-10134-under-64-bit-opensuse.html"  title="See the Original discussion by Martien van den Akker" target="_blank"&gt;
    here
  &lt;/a&gt;, 
n the Darwin-It blog, to whom I own a very big thank you 
&lt;/p&gt;
&lt;p&gt;
Finally, I would like to offer my own piece of wisdom to whoever trying to resurrect JDeveloper 10.1 inside a new OS: &lt;strong&gt;Keep your paths exactly the same as the previous installation&lt;/strong&gt; :^)
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5341790605513460072?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5341790605513460072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5341790605513460072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5341790605513460072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5341790605513460072'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/08/jdeveloper-10134-on-centos-6-x8664.html' title='JDeveloper 10.1.3.4 on CentOS 6 x86_64'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2849168449176697361</id><published>2011-08-22T11:09:00.006+02:00</published><updated>2011-08-25T08:02:05.242+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><title type='text'>SELinux and CakePHP on Fedora and CentOS</title><content type='html'>&lt;p&gt;
The first time I installed CakePHP, on a machine with SELinux enabled, I run into two big problems:
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Cake was unable to write to the application's tmp directory
  &lt;li&gt;Cake was unable to connect tot the database, hosted on an 
      other machine
   &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The first thing that comes to mind, is to disable SELinux completely, and I did more than once &lt;a href="http://abakalidis.blogspot.com/2011/08/how-to-disable-selinux-on-fedora-centos.html" title="See previous post..."&gt;:^)&lt;/a&gt;. This time however, I said to myself that if so many people say SELinux is good, why not give it a try and see if we can both live peacefully on the same machine.
&lt;p&gt;
The first thing we need to deal with is allow access to the $APP/tmp directory. This can be accomplished by issuing :
&lt;/p&gt;
&lt;pre&gt;
# cd $APP
# chcon -Rv --type=httpd_user_content_rw_t tmp
&lt;/pre&gt;
&lt;p&gt;
Next will be to allow httpd to connect to a database hosted on a different machine than the one running the web server in case your setup use different machines for Database and web servers. This is allowed by issuing the following command again as the root user.
&lt;/p&gt;
&lt;pre&gt;
setsebool -P httpd_can_network_connect_db 1
&lt;/pre&gt;
&lt;p&gt;
For the moment my CakePHP server seems to be running fine. If any problems arise, I will update this post accordingly.
&lt;/p&gt;
&lt;p&gt;
Finally a couple of links on SELinux
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    CentOS Wiki :
    &lt;br/&gt;
    &lt;a href="http://wiki.centos.org/HowTos/SELinux" target="_blank"&gt;
      http://wiki.centos.org/HowTos/SELinux 
    &lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
    Fedora Wiki :
    &lt;br/&gt;
    &lt;a href="http://fedoraproject.org/wiki/SELinux" target="_blank"&gt;
       http://fedoraproject.org/wiki/SELinux
    &lt;/a&gt;
    &lt;br/&gt;
    The SELinux for dummies seems to be the perfect place to start.
  &lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2849168449176697361?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2849168449176697361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2849168449176697361' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2849168449176697361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2849168449176697361'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/08/selinux-and-cakephp-on-fedora-and.html' title='SELinux and CakePHP on Fedora and CentOS'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-583645477193291440</id><published>2011-08-22T08:17:00.008+02:00</published><updated>2011-08-22T09:12:25.000+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to disable SELinux on Fedora, CentOS and  the like</title><content type='html'>&lt;p&gt;
This is only a quick note, on how to disable SELinux on a system using command line tools: Open file &lt;code&gt;/etc/sysconfig/selinux&lt;/code&gt; and find the line saying
&lt;/p&gt;
&lt;div align="center"&gt;
    &lt;code&gt;SELINUX=enforcing&lt;/code&gt;
&lt;/div&gt;
&lt;p&gt;
replace it with
&lt;/p&gt;
&lt;div align="center"&gt;
    &lt;code&gt;SELINUX=disabled&lt;/code&gt;
&lt;/div&gt;
&lt;p&gt;
save and reboot.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-583645477193291440?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/583645477193291440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=583645477193291440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/583645477193291440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/583645477193291440'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/08/how-to-disable-selinux-on-fedora-centos.html' title='How to disable SELinux on Fedora, CentOS and  the like'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4450703708630457640</id><published>2011-08-11T11:19:00.006+02:00</published><updated>2011-08-11T12:42:10.624+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>CentOS: Manual IP network configuration</title><content type='html'>&lt;p&gt;
Just installed my first CentOS 6.0 test server. In order to save bandwidth, I downloaded the minimal installation ISO which produced a Linux system that was able to boot correctly, but provided none of the standard system-config-... tools.  So in order to continue installation, I had to setup IP information for the systems network card by manually editing files. This is a summary of the steps I followed.
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    Go to /etc/sysconfig/network-scripts/ and edit file ifcfg-eth0. 
     Then, make sure you provide the following keys
     &lt;pre&gt;
         DEVICE=eth0
         HWADDR=00:1f:29:c3:22:16
         BOOTPROTO=static         
         NM_CONTROLLED=yes
         ONBOOT=yes
         IPADDR=10.5.0.6
         NETMASK=255.255.255.0
     &lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    Open file /etc/sysconfig//network and add information for host name and 
    default gateway like this :
    &lt;pre&gt;
         NETWORKING=yes
         HOSTNAME=barbara.shelman.int
         GATEWAY=10.5.0.1
    &lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
     The DNS servers are defined in /etc/resolv.conf. Typically the file
     looks like this:
     &lt;pre&gt;
         nameserver 10.5.1.1
         nameserver 10.5.1.2
     &lt;/pre&gt;
  &lt;/li&gt; 
  &lt;li&gt;
    Network manager should pick up the changes immediately. In case it does
    not, restart the netwrok service like this :
    &lt;pre&gt;
         /etc/init.d/network restart
    &lt;/pre&gt;
  &lt;/li&gt;   
&lt;/ol&gt;
&lt;p&gt;
This is the minimal setup that worked for me. After I was able to set up 
my yum proxy and begin installation of CentOS packages, I was able to run system-config-network, which changed many of the previous entries. For example the gateway information in now stored in ifcfg-eth0, along with the DNS information. The previous setup however, is what go me started.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4450703708630457640?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4450703708630457640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4450703708630457640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4450703708630457640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4450703708630457640'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/08/centos-manual-ip-network-configuration.html' title='CentOS: Manual IP network configuration'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-429600203184495466</id><published>2011-08-05T13:47:00.005+02:00</published><updated>2011-08-10T09:35:27.181+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>CakePHP The Query by Example Component</title><content type='html'>&lt;p&gt;
After the &lt;a href="http://abakalidis.blogspot.com/2011/06/cakephp-turn-input-form-into-query-form.html"&gt;previous&lt;/a&gt; post, regarding how to  create and use a input QBE form, here is my simple QBE component. 
&lt;/p&gt;
&lt;p&gt;
To use it, paste the following code in a file named &lt;code&gt;qbe.php&lt;/code&gt; into your &lt;code&gt;APP/controllers/components&lt;/code&gt; directory.
&lt;/p&gt;

&lt;pre&gt;
&amp;lt;?php
/**
 * @class QbeComponent
 * Convert posted data entered in a pseudo Query by Example fashion
 * from a CakePHP Form into Model::find() acceptable conditions.
 *
 * @author: Thanassis Bakalidis
 * @version: 1.0
 */
class QbeComponent extends Object {
    // sesion keys for saving and retrieving controller data
    const CONDITIONS_SESSION_KEY = 'SRCH_COND';
    const FORM_DATA_SESSION_KEY = 'SRCH_DATA';

    // supported SQL operators
    private $SQL_OPERATORS = array(
        'IN', '&lt;&gt;', '&gt;=', '&lt;=',
        '&gt;', '&lt;'
    );

    var $owner;     // the controller using the component

    /**
     * @name initialize
     * The initialize method is called before the controller's
     * beforeFilter method.
     */
    function initialize(&amp;$controller, $settings=array())
    {
        $this-&gt;owner =&amp; $controller;
    }

    /**
     * @name: getSearchConditions()
     * Return an array to be used as search conditions in a find
     * based on the controller's current data
     * @param : string $modelName name of the model to search controller data
     * @version: 1.3
     */
    function getSearchConditions($modelName = null)
    {
        if ($modelName == null)
            return null;

        // create speciffic keys for the model andcontroller
        $sessionConditionsKey = sprintf("%s-%s-%s",
                                self::CONDITIONS_SESSION_KEY,
                                $this-&gt;owner-&gt;name,
                                $modelName
                            );
        $sessionDataKey = sprintf("%s-%s-%s",
                                self::FORM_DATA_SESSION_KEY,
                                $this-&gt;owner-&gt;name,
                                $modelName
                            );

        if (empty($this-&gt;owner-&gt;data)) {
            // attempt to read conditions from sesion
            $conditions = $this-&gt;owner-&gt;Session-&gt;check($sessionConditionsKey)
                ? $this-&gt;owner-&gt;Session-&gt;read($sessionConditionsKey)
                : array();
            $this-&gt;owner-&gt;data = $this-&gt;owner-&gt;Session-&gt;check($sessionDataKey)
                ? $this-&gt;owner-&gt;Session-&gt;read($sessionDataKey)
                : array();
        } else {
            // we have posted data. Atempt to rebuild conditons
            // array
            $conditions = array();
            foreach( $this-&gt;owner-&gt;data[$modelName] as $key =&gt; $value) {
                if (empty($value))
                    continue;

                $operator = $this-&gt;extractOperator($value);

                if (is_array($value)) {
                    // this can only be a date field

                    $month = $value['month'];
                    $day = $value['day'];
                    $year = $value['year'];

                    // We want all three variables to be numeric so we 'll check their
                    // concatenation. After all PHP numbers as just strings with digits
                    if (is_numeric($month.$day.$year) &amp;&amp; checkdate( $month, $day, $year)) {
                        $conditionsKey ="$modelName.$key";
                        $conditionsValue = "$year-$month-$day";
                    } else
                        continue;
                } else {
                    // we have normal input, remove any leading and trailing blanks
                    $value = trim($value);                          
                    // and check the operator given
                    if ($operator === '' &amp;&amp; !is_numeric($value)) {
                        // turn '='' to 'LIKE' for non numeric data
                        // numeric data will be treated as if they
                        // have an wquals operator
                        $operator = 'LIKE';
                        $value = str_replace('*', '%',  $value);
                        $value = str_replace('?', '.',  $value);
                    } else if ($operator === 'IN') {
                        // we need to convert the input string to an aray
                        // of the designated values
                        $operator = '';
                        $value = array_filter(explode( ' ', $value));
                    }

                    $conditionsValue = $value;
                    $conditionsKey = "$modelName.$key $operator";
                }

                // add the new condition entry
                $conditions[trim($conditionsKey)] = $conditionsValue;
            }

            // if we have some criteria, add them in the sesion
            $this-&gt;owner-&gt;Session-&gt;write($sessionConditionsKey, $conditions);
            $this-&gt;owner-&gt;Session-&gt;write($sessionDataKey, $this-&gt;owner-&gt;data);
        }

        return $conditions;
    }

    private function extractOperator(&amp;$input)
    {
        if (is_array($input))
            return '';

        $operator = strtoupper(strtok($input, ' '));

        if (in_array($operator, $this-&gt;SQL_OPERATORS)) {
            $opLength = strlen($operator);
            $inputLength = strlen($input);
            $input = trim(substr( $input, $opLength, $inputLength - $opLength));
        } else {
            $operator = '';
        }

        return $operator;
    }
}
&lt;/pre&gt;
&lt;p&gt;
Next modify your &lt;code&gt;AppController&lt;/code&gt; to use the component by adding 'Qbe' to the $components array. An example would be:
&lt;/p&gt;
&lt;pre&gt;
    var $components = array(
        'RequestHandler',
        'Auth',
        'Session',
        'Qbe'
    );
&lt;/pre&gt;
&lt;p&gt;
Now crate a query form before the results table into your index view. Copying the form from the corresponding model's create or edit pages is usually enough to get you started.
&lt;/p&gt;
&lt;p&gt;
Finally, modify the corresponding controller method to use the posted data in order to create search conditions. A typical example for a model named Product would be something like that:
&lt;/p&gt;
&lt;pre&gt;
    function index()
    {        
        $this-&gt;Product-&gt;recursive = 0;
        $conditions = $this-&gt;Qbe-&gt;getSearchConditions($this-&gt;Product-&gt;name);
        $products = $this-&gt;paginate('Product', $conditions);

        $this-&gt;set( 'products', $products);
        $this-&gt;prepareCombos();
    }
&lt;/pre&gt;
&lt;p&gt;
The &lt;code&gt;prepareCombos()&lt;/code&gt; method is a simple private function I created by copying all the &lt;code&gt;find)'list', ...)&lt;/code&gt; commands that the cake bake script created after the add() and edit() controller methods, so that all foreign key fields have correct value ranges, when the input form gets displayed. For more information and example code, see the previous post which presents the same functionality, by adding code to the AppController.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-429600203184495466?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/429600203184495466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=429600203184495466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/429600203184495466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/429600203184495466'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/08/cakephp-query-by-example-component.html' title='CakePHP The Query by Example Component'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2440018918098694247</id><published>2011-06-28T12:49:00.026+02:00</published><updated>2011-08-05T13:16:00.520+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>CakePHP: Turn an input form into a query form (Version 2)</title><content type='html'>&lt;p&gt;
CakePHP makes constructing input forms easy. The &lt;code&gt;Form&lt;/code&gt; helper object's &lt;code&gt;input()&lt;/code&gt; methods provides us with the necessary intelligence, to display and get input data from our users, then store it into the controller's &lt;code&gt;$this-&gt;data&lt;/code&gt; property using the format required by the framework's &lt;code&gt;Model-&gt;save()&lt;/code&gt; method, so they can eventually be written to the database, with no need for any elaborate code. Furthermore, given the fact that cake's &lt;code&gt;cake&lt;/code&gt; script will bake all that standard code in a flash. it becomes a matter of minutes to create a full featured CRUD application, starting from just a good database design.
&lt;/p&gt;
&lt;p&gt;
One thing I find missing from the baked code, is the ability to create input forms whose data will be used as search criteria -- in a QBE fashion -- in an index or display page. My solution requires us to convert the submitted data into a form that is compatible with the &lt;code&gt;Model-&gt;find()&lt;/code&gt;'s &lt;code&gt;$conditions&lt;/code&gt; parameter and then feed this to the &lt;code&gt;Model-&gt;find()&lt;/code&gt; or the &lt;code&gt;Controller-&gt;paginate()&lt;/code&gt; methods in order to limit the number of returned items.
&lt;/p&gt;
&lt;p&gt;
As &lt;a title="Blogger profile" target="__blank" href="http://www.blogger.com/profile/00765316834312840069"&gt;Richard&lt;/a&gt; pointed out during the first version of this post, cake offers the &lt;code&gt;postConditions()&lt;/code&gt; method, which does this out of the box and the truth of the matter is that I had completely missed that when I started coding. After looking at the CakePHP &lt;a href="http://api13.cakephp.org/view_source/controller/#line-995" title="The postConditions() code from CakePHP 1.3"&gt;code&lt;/a&gt; and comparing it with my approach, I can only say that with the code below, you don't have to worry about operators and providing complex parameters. The latest version will allow users to type their desired operator before the value in a QBE like fashion. The standard Cake approach gives more accurate control over the entire process, but I am not sure how to create a UI that will allow users to change operators dynamically .
&lt;/p&gt;
&lt;p&gt;
So, to get started with my alternative version, the typical &lt;code&gt;index()&lt;/code&gt; method, for a model named &lt;code&gt;Product&lt;/code&gt;, using this approach will have to look somehow like this:
&lt;/p&gt;
&lt;pre&gt;
    function index()
    {        
        $this-&gt;Product-&gt;recursive = 0;
        $conditions = $this-&gt;getSearchConditions($this-&gt;Product-&gt;name);
        $products = $this-&gt;paginate('Product', $conditions);

        $this-&gt;set( 'products', $products);
        $this-&gt;prepareCombos();
    }
&lt;/pre&gt;
&lt;p&gt;
The important part here s obviously the &lt;code&gt;$this-&gt;getSearchConditions()&lt;/code&gt; function that will get the controllers &lt;code&gt;$data&lt;/code&gt; property and transform it into the &lt;code&gt;$conditions&lt;/code&gt; array. The perfect place to put the code for that would be our application's controller.
&lt;/p&gt;
&lt;pre&gt;
class AppController extends Controller {
    const CONDITIONS_SESSION_KEY = 'SRCH_COND';
    const FORM_DATA_SESSION_KEY = 'SRCH_DATA';

    private $SQL_OPERATORS = array(
        'IN', '&lt;&gt;', '&gt;=', '&lt;=',
        '&gt;', '&lt;'        
    );

    /**
     * @name: getSearchConditions()
     * @access: protected
     * @author: Thanassis Bakalidis
     * @param : string $modelName name of the model to search controller data
     * Return an array to be used as search conditions in a Model's find 
     * method based on the controller's current data
     * @version: 1.4
     */
    protected function getSearchConditions($modelName = null)
    {
        if ($modelName == null)
            return null;

        // create speciffic keys for the model andcontroller
        $sessionConditionsKey = sprintf("%s-%s-%s",
                                self::CONDITIONS_SESSION_KEY,
                                $this-&gt;name,
                                $modelName
                            );
        $sessionDataKey = sprintf("%s-%s-%s",
                                self::FORM_DATA_SESSION_KEY,
                                $this-&gt;name,
                                $modelName
                            );

        if (empty($this-&gt;data)) {
            // attempt to read conditions from sesion
            $conditions = $this-&gt;Session-&gt;check($sessionConditionsKey)
                ? $this-&gt;Session-&gt;read($sessionConditionsKey)
                : array();
            $this-&gt;data = $this-&gt;Session-&gt;check($sessionDataKey)
                ? $this-&gt;Session-&gt;read($sessionDataKey)
                : array();
        } else {
            // we have posted data. Atempt to rebuild conditons
            // array
            $conditions = array();
            foreach( $this-&gt;data[$modelName] as $key =&gt; $value) {
                if (empty($value))
                    continue;

                $operator = $this-&gt;extractOperator($value);
                
                if (is_array($value)) {
                    // this can only be a date field

                    $month = $value['month'];
                    $day = $value['day'];
                    $year = $value['year'];

                    // We want all three variables to be numeric so we 'll check their
                    // concatenation. After all PHP numbers as just strings with digits
                    if (is_numeric($month.$day.$year) &amp;&amp; checkdate( $month, $day, $year)) {
                        $conditionsKey ="$modelName.$key";
                        $conditionsValue = "$year-$month-$day";
                    } else
                        continue;                        
                } else {
                    // we have normal input check the operator given                    
                    if ($operator == '' &amp;&amp; !is_numeric($value)) {
                        // turn '=' to 'LIKE' for non numeric data
                        // numeric data will be treated as if they
                        // have an wquals operator
                        $operator = 'LIKE';
                        $value = str_replace('*', '%',  $value);
                        $value = str_replace('?', '.',  $value);                        
                    } else if ($operator === 'IN') {
                        // we need to convert the input string to an aray
                        // of the designated values
                        $operator = '';
                        $value = array_filter(explode( ' ', $value));
                    } 
                    
                    $conditionsValue = $value;
                    $conditionsKey = "$modelName.$key $operator";                    
                }

                // add the new condition entry
                $conditions[trim($conditionsKey)] = $conditionsValue;
            }

            // if we have some criteria, add them in the sesion
            $this-&gt;Session-&gt;write($sessionConditionsKey, $conditions);
            $this-&gt;Session-&gt;write($sessionDataKey, $this-&gt;data);
        }

        return $conditions;
    }

    private function extractOperator(&amp;$input)
    {     
        $operator = strtoupper((strtok($input, ' '));
        
        if (in_array($operator, $this-&gt;SQL_OPERATORS)) {
            $opLength = strlen($operator);
            $inputLength = strlen($input);
            $input = trim(substr( $input, $opLength, $inputLength - $opLength));                        
        } else {            
            $operator = '';
        }
        
        return $operator;
    }
&lt;/pre&gt;
&lt;p&gt;
This was the hard part. The next ones have to do with only copy and paste. So get the form that cake created from your add or edit views and copy it before the table in the index view page. You may possibly wish to remove some unwanted input fields and change the value of the &lt;code&gt;$this-&gt;Form-&gt;end()&lt;/code&gt; function's parameter from "Submit" to "Search". 
&lt;/p&gt;
&lt;p&gt;
So we are almost there. One last stroke and we are ready. Remember the &lt;code&gt;$this-&gt;prepareCombos();&lt;/code&gt; last comand on the index action? Well, that is a simple private method I created by copying all the &lt;code&gt;find)'list', ...)&lt;/code&gt; commands that the cake bake script created after the &lt;code&gt;add()&lt;/code&gt; and &lt;code&gt;edit()&lt;/code&gt; methods, so that all foreign key fields have correct value ranges, when the input form gets displayed. For my product's controller for example the function looks like this:
&lt;/p&gt;
&lt;pre&gt;
    private function prepareCombos()
    {
        $productTypes = $this-&gt;Product-&gt;ProductType-&gt;find('list');
        $productCategories = $this-&gt;Product-&gt;ProductCategory-&gt;find('list');
        $suppliers = $this-&gt;Product-&gt;Supplier-&gt;find(
                                                'list',
                                                array(
                                                    'order' =&gt; array(
                                                        'id' =&gt; 'asc'
                                                    )
                                                )
                                            );
        $qualities = $this-&gt;Product-&gt;Quality-&gt;find('list');        
        $this-&gt;set(compact('productTypes', 'productCategories', 'suppliers', 'qualities'));
    }
&lt;/pre&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
   &lt;li&gt; 
      In case your model contains validation rules like &lt;code&gt;range&lt;/code&gt; 
      then the default input element that the form helper creates , will 
      contain an appropriate &lt;code&gt;maxlength&lt;/code&gt; attribute, that will
      not allow your users to type more than the maximum allowed characters
      for the field. Say, for example that you have a rule for a field
      named width, that looks like this
      &lt;pre&gt;
       'width' =&gt; array (
            'rule' =&gt; array('range', 1, 999),
            'message' =&gt; 'Width must be between 1 and 999 mm',
            'last' =&gt; true
       )
      &lt;/pre&gt;
      ... then the actual HTML input element will have a maxlength
      attribute of 3.  This is not going to make your query UI very 
      usable, so make sure that 
      the search form's &lt;code&gt;echo $this-&gt;Form-&gt;input( ... &lt;/code&gt; 
      statement provides an appropriate hardcoded value for maxlength.
   &lt;/li&gt;
   &lt;li&gt;
     The next thing to consider, is what will happen when our users provide 
     wrong inputs, say they type &lt;code&gt;=&lt; 13&lt;/code&gt; instead of 
     &lt;code&gt; &gt;= 13&lt;/code&gt;. In that case the code -- as it is now -- will
     create an SQL statement of the form &lt;code&gt; select ... where Model.Field
     LIKE '=&lt; 13' &lt;/code&gt;, that will provide an empty result set, but is 
     still valid SQL. Any workaround for this type of situation would make
     our code even more complicated than it is now, so I am not going to 
     spend any more thought on this.
   &lt;/li&gt;
   &lt;li&gt;
     After going this far, I believe that the next reasonable thing would
     be to move the functionality into a new component, that will take away 
     all the complexity from the &lt;code&gt;AppController&lt;/code&gt; class, but this
     is probably going to be the subject of a forthcoming post.
   &lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2440018918098694247?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2440018918098694247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2440018918098694247' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2440018918098694247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2440018918098694247'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/06/cakephp-turn-input-form-into-query-form.html' title='CakePHP: Turn an input form into a query form (Version 2)'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4221062569535704046</id><published>2011-06-07T12:52:00.016+02:00</published><updated>2011-06-23T13:32:34.688+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Active Directory'/><title type='text'>CakePHP: Authenticating against Microsoft Active Directory</title><content type='html'>&lt;p&gt;
My work environment uses Windows. Everyone logs on to an Active Directory based domain and this is how security is managed. When you have web applications running on Linux and you need some sort of authentication service, then you can either implement your own user data store or you can use an exiting. The good news is that MS AD is actually an LDAPv3 server, so getting data to and from LDAP is not that difficult in the world of both PHP and Cake.
&lt;/p&gt;
&lt;p&gt;
The following &lt;em&gt;"howto"&lt;/em&gt; will list the steps I followed in order to perform authentication from the company's Windows 2003 servers. I will also explain one approach for deciding how to grant users admin privileges on a CakePHP application based on membership of a Windows user group. Many might argue that I am oversimplifying, but I believe that on most occasions, this will be more than adequate.
&lt;/p&gt;
&lt;p&gt;
In order to get started, remember that building an authentication system on a CakePHP application starts with creating a &lt;code&gt;User&lt;/code&gt; model. Only difference will be here that the model in question will not get its data from an ordinary database table, but rather from an LDAP data source.
&lt;/p&gt;
&lt;h2&gt; Get the LDAP datasource component&lt;/h2&gt;
&lt;p&gt;
So this brings as to the first issue, which is: Get a datasource to read LDAP data. Fortunately the bakery has just what we need. The actual article that contains the code I am still using is &lt;a href="http://bakery.cakephp.org/articles/analogrithems/2009/11/08/ldap-data-source-with-full-crud-support" target="_blank"&gt;this&lt;/a&gt;. 
&lt;/p&gt;
&lt;/p class="note"&gt;
&lt;a href="http://www.analogrithems.com/" target="_blank"&gt;Analogrithems&lt;/a&gt;, however, the author of the datasource code, is providing new updates on github accessible via this &lt;a href="https://github.com/analogrithems/idbroker/tree/master/models/datasources"&gt;link&lt;/a&gt;. The truth is that I have yet to test the new version, so if you are to follow the tutorial better stick with the one in the bakery.
&lt;/p&gt;
&lt;p&gt;
No matter the version you choose you will end up with a file named &lt;code&gt;ldap_source.php&lt;/code&gt;, that you will need to place in your &lt;code&gt;APP/models/datasources/&lt;/code&gt; directory.
&lt;/p&gt;
&lt;h2&gt;Set up a connection using the new datasource&lt;/h2&gt;
&lt;p&gt;
The next thing that needs to be done is to create a new connection that will use the new datasource. Open &lt;code&gt;APP/config/database.php&lt;/code&gt; and add a new entry looking more or less like this
&lt;/p&gt;
&lt;pre&gt;
    var $ldap = array (
        'datasource' =&gt; 'ldap',
         // list of active directory hosts
        'host' =&gt; array(
                    'ldap1.example.com',
                    'ldap2.example.com',
                    'ldap3.example.com'
                ),
        'port' =&gt; 389,
         // location (root) in LDAP tree to start searching 
        'basedn' =&gt; 'DC=example,DC=com',
         // user to authenticate on AD server with
        'login' =&gt; 'cn=LDAPBindUser,cn=Users,dc=example,dc=com',
        'password' =&gt; 'abABa@332',
        'database' =&gt; '',
        'tls'      =&gt; false,
        'version'  =&gt; 3
    );
&lt;/pre&gt;
&lt;p&gt;
Verify with your network administrator that &lt;span style="font-weight:bold;"&gt;LDAPBindUser&lt;/span&gt; in created on the correct OU and that the base DN is correct, according to where you placed the user account. (Needless to say that the user must have next to no privileges at all)
&lt;/p&gt;
&lt;h2&gt;Set up the &lt;code&gt;User&lt;/code&gt; model class&lt;/h2&gt;
&lt;p&gt;
The next step is our user model. This should be like any model, you have except that it will be based on the &lt;code&gt;$ldap&lt;/code&gt; database config, its primary key will be the LDAP &lt;code&gt;dn&lt;/code&gt; attribute and that it will need no table.
&lt;pre&gt;
class User extends AppModel {
    var $name = 'User';
    var $useDbConfig = 'ldap';

    var $primaryKey = 'dn';
    var $useTable = '';

    /**
     * return true if the userName is a member of the groupName
     * Active Directory group
     */
    function isMemberOf($userName, $groupName)
    {
        // trivial check for valid names
        if (empty($userName) || empty($groupName))
            return false;

        // locate the user record
        $userData = $this-&gt;find('first',
                                array(
                                    'conditions' =&gt; array(
                                        'samaccountname' =&gt; $userName
                                    )
                                )
                            );
        // no user by that name exists
        if (empty($userData))
            return false;

        // check if the userin question belongs to any groups
        if (!isset($userData['User']['memberof']))
            return false;

        // search all groups that our user if a meber
        $groups = $userData['User']['memberof'];
        foreach( $groups as $index =&gt; $group)
            if (strpos( $group, $groupName) != false)
                return true;

        return false;
    }
}
&lt;/pre&gt;
&lt;p&gt;
We have also added a member function which allows us to determine if a user-name belongs to an Active directory group that will be very handy when checking for application privileges later on.
&lt;/p&gt;
&lt;h2&gt;Set up the &lt;code&gt;LdapAuth&lt;/code&gt; Component&lt;/h2&gt;
&lt;p&gt;
And finally the "auth" part. The standard CakePHP &lt;code&gt;Auth&lt;/code&gt; component will not work for us so we need a specialized version that thanks to analogthemes again is accessible from his web site through &lt;a href="http://www.analogrithems.com/rant/2009/06/13/ldapauth-component-for-cakephp/" target="_blank"&gt;here&lt;/a&gt;. Just place &lt;code&gt;ldap_auth.php&lt;/code&gt; to your &lt;code&gt;APP/controllers/components/&lt;/code&gt; directory and change your &lt;code&gt;AppController&lt;/code&gt; so that it uses &lt;code&gt;LdapAuth&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
This however is not enough. There is one little thing that needs to be changed in the &lt;code&gt;LdapAuth&lt;/code&gt; code, so that authenticating in AD works:  Locate the &lt;code&gt;login()&lt;/code&gt; function in line 153 of &lt;code&gt;ldao_auth.php&lt;/code&gt; and change line 156 so that it looks like this:
&lt;/p&gt;
&lt;pre&gt;
     ...

     function login($uid, $password) {
        $this-&gt;__setDefaults();
        $this-&gt;_loggedIn = false;
        // $dn = $this-&gt;getDn('uid', $uid);
        $dn = $this-&gt;getDn('samaccountname', $uid);
        $loginResult = $this-&gt;ldapauth($dn, $password); 
        ...
&lt;/pre&gt;
&lt;p&gt;
My simple approach to security says that an application has two types of users. Readers (i.e. everyone) and writers (admins only). We set the administrative users to be the members of a specific group in the active directory server. That way our application controller looks like this :
&lt;pre&gt;
class AppController extends Controller {
    const ADMIN_KEY  = 'myApp-Admin';
    const AUTH_GROUP = 'MyApp-Admins';

    var $components = array('RequestHandler', 'LdapAuth', 'Session');
    var $helpers = array(
                        'Form', 'Html', 'Locale', 'Session',
                        'Js' =&gt; array('Jquery')
                    );
    var $isAdmin;

    function beforeFilter()
    {
        // pr($this-&gt;referer());
        $this-&gt;isAdmin = false;
        $this-&gt;LdapAuth-&gt;authorize = 'controller';
        $this-&gt;LdapAuth-&gt;allowedActions = array(
                                            'index',
                                            'view',
                                            'details'
                                        );

        $this-&gt;LdapAuth-&gt;loginError = "Invalid credentials";
        $this-&gt;LdapAuth-&gt;authError  = "Not authorized!";

        $userInfo = $this-&gt;LdapAuth-&gt;user();

        if (!empty($userInfo)) {
            $user = $userInfo['User'];
            // setup display username and user's full name
            $this-&gt;set('loggedInUser', $user['samaccountname']);
            $this-&gt;set('loggedInFullName', $user['cn']);

            // if we already have the admin role stored in the session
            if ($this-&gt;Session-&gt;check(self::ADMIN_KEY))
                $this-&gt;isAdmin = $this-&gt;Session-&gt;read(self::ADMIN_KEY);
            else {
                // determine the admin role from wheither the current 
                // user is a member of the AUTH group
                $this-&gt;LoadModel('User');
                $this-&gt;isAdmin = $this-&gt;User-&gt;isMemberOf(
                                                $user['samaccountname'],
                                                self::AUTH_GROUP);
                $this-&gt;Session-&gt;write(self::ADMIN_KEY, $this-&gt;isAdmin);
            }
        } else {
            $this-&gt;Session-&gt;delete(self::ADMIN_KEY);
        }

        $this-&gt;set('admin', $this-&gt;isAdmin);
    }

    function isAuthorized()
    {
        // Only administrators have access to the CUD actions
        if ($this-&gt;action == 'delete' ||
            $this-&gt;action == 'edit' ||
            $this-&gt;action == 'add')
          return $this-&gt;isAdmin;

        return true;                
    }
}
&lt;/pre&gt;
&lt;p&gt;
That way, everyone can access our view, details and index actions of all the application controllers, but will need to enter the user name and password of an ADMIN_GROUP member to gain access to the rest of our controller methods. This tutorial however  is has gone long enough. To finish it, please remember to create your user controller and you login user view ...
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4221062569535704046?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4221062569535704046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4221062569535704046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4221062569535704046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4221062569535704046'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/06/cakephp-authenticating-against.html' title='CakePHP: Authenticating against Microsoft Active Directory'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5911762431593866113</id><published>2011-06-02T12:07:00.008+02:00</published><updated>2011-06-02T13:39:59.875+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C/C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>C and UTF-8 data in Linux</title><content type='html'>&lt;p&gt;
During the last few days, I found myself struggling to create a PHP extension what would allow PHP to convert common characters between Greek and Latin, so that typed codes would for instance, always use the same version of 'A' no matter the language that the user keyboard is switched to. You see whether you type a Latin 'A' (U+0041) or a Greek 'Α' (U+0391) the two letters appear to be the same despite the difference in their internal representation. The same applies to other common letters like 'E', 'P' and 'Y'
&lt;/p&gt;
&lt;p&gt;
I reckoned that this conversion and translation of characters based on their position on some given string would be an excellent chance to remember string pointers from my student C days, so I set out to create a library with functions called &lt;code&gt;latinToGreek()&lt;/code&gt; and &lt;code&gt;greekToLatin()&lt;/code&gt; that would do the conversion and return the new string.
&lt;/p&gt;
&lt;p&gt;
Like most people in similar positions, I tried googling for C and Unicode howtos and run into some very good articles but nothing was in the form of a recipe that I could follow. I did read many of them and managed to get the work done. The basic idea here is that since UTF-8 uses a variable number of bytes per character, we need to convert UTF-8 strings into wchat_t strings, then process them like they were ordinary constant length null terminated character arrays and finally convert them back to UTF-8 single byte character strings in order for them to display correctly.
&lt;/p&gt;
&lt;p&gt;
Following is the check list of things to do before actually playing with UTF-8 encoded Unicode.
&lt;p&gt;
&lt;ol&gt;
  &lt;li&gt; 
    Use &lt;a href="http://www.cplusplus.com/reference/clibrary/clocale/setlocale/" target="_blank"&gt;setlocale&lt;/a&gt; to set the current program locale to something that supports UTF-8. For example 'en_US.UTF-8' is just fine. 
    &lt;br/&gt;
    Bear in mind, that the default locale for C programs in the "C" locale and unless you set the locale correctly nothing will work as expected.
  &lt;/li&gt;
  &lt;li&gt;
     Read your input using normal &lt;code&gt;char[]&lt;/code&gt; arrays. Just make sure that hey are big enough. Remember that UTF-8, uses one, two or even more bytes per individual character, so a logical guess would be to allocate an array at least twice the size of your maximum anticipated input.
  &lt;br/&gt;
  Do not forget that good old &lt;code&gt;strlen()&lt;/code&gt; will still give you the size of your input in bytes, but not in characters.
  &lt;/li&gt;
  &lt;li&gt;
     Convert multibyte input to &lt;code&gt;wchar_t[]&lt;/code&gt; input in order to perform any processing. Remember that wchar_t constants need to be prefixed by an L, so '\0' is now L'\0'. 
     &lt;br/&gt;
     Functions &lt;a href="http://www.cplusplus.com/reference/clibrary/cstdlib/mbstowcs/" target="_blank"&gt;mbstowcs&lt;/a&gt; and &lt;a href="http://www.cplusplus.com/reference/clibrary/cstdlib/wcstombs/" target="_blank"&gt;wcstombs&lt;/a&gt; can be used to perform the conversion to and from.
  &lt;/li&gt;
  &lt;li&gt;Perform your processing as you would ordinarily do using wchat_t data and wchar_t speciffic functions. For example toupper() for wchar_t is now &lt;a herf="http://pubs.opengroup.org/onlinepubs/007908799/xsh/towupper.html" target="_blank"&gt;towupper()&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;
    Convert your data back to multibyte format using &lt;a href="http://www.cplusplus.com/reference/clibrary/cstdlib/wcstombs/" target="_blank"&gt;wcstombs&lt;/a&gt; and return them to the user.
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
  ... and that's about it. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5911762431593866113?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5911762431593866113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5911762431593866113' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5911762431593866113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5911762431593866113'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/06/c-and-utf-8-data-in-linux.html' title='C and UTF-8 data in Linux'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1952485634028426844</id><published>2011-05-17T15:42:00.001+02:00</published><updated>2011-05-17T15:43:02.687+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='FreeTDS'/><title type='text'>CakePHP and FreeTDS on CentOS 5</title><content type='html'>&lt;p&gt;
We are almost finished with a project using CakePHP 1.3.8 running on a CentOS 5 box that accesses a Microsoft SQL Server 2008 database, using PHP 5.3.6-4 and the freetds driver, all available from &lt;a href="http://rpms.famillecollet.com/"&gt;Remi's&lt;/a&gt; repository.
&lt;/p&gt;
&lt;p&gt;
This is a report of all the little problems we faced and the solutions we came up with :
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
     The first thing that hit us, was he encoding of the saved data. 
     Although we used &lt;code&gt;NVARCHAR&lt;/code&gt; columns for all character 
     fields, we ended up seeing gibberish inside the SQL Server 
     Management Studio, whenever we had to enter anything that was not 
     Latin.  Both the server and the application are using UTF-8 locales
     and data entered via Cake would be returned correctly, however there
     was no way to get the MSSQL Management Studio to display UTF-8 data.
     &lt;br /&gt;
     After some dispute about whether or not to leave things as they are we
     decided to utilize a behavior that converted data to and from
     different character sets before storing and retrieving them 
     from the database.
     The relevant post from back 2009 is accessible via the following
     &lt;a herf="http://abakalidis.blogspot.com/2009/12/cakephp-behavior-for-acessing-non-utf.html"&gt; link&lt;/a&gt;.
     &lt;br/&gt;
     This approach kept &lt;em title="(except me of course)"&gt;almost&lt;/em&gt; 
     everyone happy.
  &lt;/li&gt;
  &lt;li&gt;
     Second issue was the length of the Model's visual fields. I have
     blogged about this a few days &lt;a href="http://abakalidis.blogspot.com/2011/04/cakephp-length-of-virtual-fields-name.html"&gt;ago&lt;/a&gt; and it turns 
     out that the maximum number of characters allowed to a virtual 
     field name is 14.
  &lt;/li&gt;
  &lt;li&gt;
     And finally the stored procedure issue. Up until now, we have been
     unable to &lt;em&gt;properly&lt;/em&gt; call a T-SQL stored procedure using 
     &lt;a href="http://gr.php.net/manual/en/function.mssql-init.php"&gt;
       &lt;code&gt;mssql_init()&lt;/code&gt;&lt;/a&gt; and 
     &lt;a href="http://gr.php.net/manual/en/function.mssql-bind.php"&gt;
       &lt;code&gt;mssql-bind()&lt;/code&gt;&lt;/a&gt;.
     The only workarround for doing the job is to use the 
     &lt;a href="http://gr.php.net/manual/en/function.mssql-query.php"&gt;
       &lt;code&gt;mssql_query()&lt;/code&gt;&lt;/a&gt;
     function and execute an "EXEC ... " query.
     &lt;br/&gt;
     The code we use -- as a Model method -- is more or less like this :
  &lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;
        /**
         * Execute the T-SQL stored procedure named "dbo.storedProcName"
         * and return execution status.
         *
         * NOTE: if the stored proc uses the T-SQL RAISERROR statement
         *       to trigger some sort of error condition, then
         *       mssql_query still returns true but the 
         *       mssql_get_last_message() will contain the actual error
         *       text that will be returned to the caller.
         */
        function callStoredProc($procParam, &amp;$errorMessage = '')
        {
            // get the low level database connection from the model data
            $conn = $this-&gt;getDataSource()-&gt;connection;

            // execute a query that calls the stored proc
            $sqlResult = mssql_query(
                          " EXEC dbo.storedProcName
                            @procParam = $procParam;",
                          $conn
                        );

            $errorMessage = mssql_get_last_message();
                
            if ($sqlResult == false) {
                // something went wrong 
                $result = false;              
            } else {                    
                // stay on the safe side            
                if (is_resource($sqlResult))
                    mssql_free_result($sqlResult);
                // if the stored procedure error message is empty then all
                // is well
                $result = $errorMessage == '' ? true : false;
            }

            // return success
            return $result;
        }
&lt;/pre&gt;

&lt;p&gt;
   As always, I try to update the list if anything new comes up.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1952485634028426844?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1952485634028426844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1952485634028426844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1952485634028426844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1952485634028426844'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/05/cakephp-and-freetds-on-centos-5.html' title='CakePHP and FreeTDS on CentOS 5'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7852876109777417690</id><published>2011-05-05T15:06:00.001+02:00</published><updated>2011-05-05T15:07:51.878+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Firefox4 on CentOS 5</title><content type='html'>&lt;p&gt;
Yes it runs! Much faster than 3.6. Check out this &lt;a href="http://wiki.centos.org/TipsAndTricks/Firefox4onCentOS5" target="_blank"&gt;CentOS wiki post&lt;/a&gt; for all the &lt;em&gt;... scary&lt;/em&gt; details.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7852876109777417690?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7852876109777417690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7852876109777417690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7852876109777417690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7852876109777417690'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/05/firefox4-on-centos-5.html' title='Firefox4 on CentOS 5'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7346316649753315090</id><published>2011-05-03T09:21:00.002+02:00</published><updated>2011-05-05T08:41:56.061+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>CakePHP: Dynamicaly disabling links</title><content type='html'>&lt;p&gt;
Sometimes we get buried so deeply into ... &lt;em&gt;nuclear science&lt;/em&gt; that we forget that after all CakePHP is just PHP, the resulting pages are just HTML and you don't need JQuery to disable a link. Setting it's &lt;code&gt;onlick&lt;/code&gt; event to &lt;code&gt;return false&lt;/code&gt;, &lt;em&gt;usually&lt;/em&gt; does it.
&lt;/p&gt;
&lt;p&gt;
The problem was simple: Given a list of records, (arrivals) selectively enable an action link for each record, (create a purchase order in our case). based on a record attribute (that is whether the purchase order has already been created).
&lt;/p&gt;
&lt;p&gt;
Now, that is now so hard. Well, if you already have something like :
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;?php echo $this-&gt;Html-&gt;link(
                    $this-&gt;Html-&gt;image('actions/upload.png'),
                    array(
                          'action' =&gt; 'createPurchasOorder',
                          $arrival['Arrival']['id']
                    ),
                    array(
                      'escape' =&gt; false,
                      'title' =&gt; 'Create purchase order for the arrival.'
                    )
                ); ?&gt; 
&lt;/pre&gt;
&lt;p&gt;
inside a PHP &lt;code&gt;foreach&lt;/code&gt; loop, then it's not that difficult to transform it into :
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;?php 
         $canCreatePO = empty($arrival['Arrival']['purchase_order_code']);
         echo $this-&gt;Html-&gt;link(
                    $this-&gt;Html-&gt;image('actions/upload.png'),
                    array(
                          'action' =&gt; 'createPurchasOorder',
                          $arrival['Arrival']['id']
                    ),
                    array(
                      'escape' =&gt; false,
                      'onclick' =&gt; $canCreatePO 
                              ? 'return true;'
                              : 'return false',
                      'title' =&gt; $canCreatePO 
                              ? 'Create purchase order for the arrival.'
                              : 'Purchase order has already been created.'
                    )
                ); ?&gt; 
&lt;/pre&gt;
&lt;p&gt;
So, why the hell did it take me an entire morning to figure this out....
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7346316649753315090?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7346316649753315090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7346316649753315090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7346316649753315090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7346316649753315090'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/05/cakephp-dynamicaly-disabling-links.html' title='CakePHP: Dynamicaly disabling links'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4530392646881394202</id><published>2011-04-21T10:19:00.006+02:00</published><updated>2011-05-17T12:16:53.363+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><title type='text'>CakePHP: Length of a virtual field's name</title><content type='html'>&lt;p&gt;
Perhaps the fact that I am accessing an MS SQL 2008 server from Linux using the &lt;a href="http://www.freetds.org/" target="__blank" title="Go to the freetds home page"&gt;freetds driver&lt;/a&gt; could be the cause of my troubles. 
&lt;/p&gt;
&lt;p&gt;
What I did find out today, is that when using the &lt;code&gt;$virualFields&lt;/code&gt; property of a model the size of the virtual field's name, cannot exceed &lt;strong&gt;14&lt;/strong&gt; characters.
&lt;/p&gt;
&lt;p&gt;
My setup here is: CakePHP 1.3.8, running on CentOS 5.6 x86_64 using PHP  5.3.6-3 from Remi's repository.
&lt;/p&gt;
&lt;p&gt; 
And here is my case: My Model looks pretty much like this
&lt;p&gt;
&lt;pre&gt;
class ArrivalPackage extends AppModel {
 var $name = 'ArrivalPackage';
 var $belongsTo = array('Arrival', 'Product', 'PackageType');
 var $hasMany = 'PackageLine';

 var $virtualFields = array(
   'reserved_date_gr' =&gt; 'CONVERT(NVARCHAR(10), ArrivalPackage.reserved_date, 105)',  // &lt;strong&gt; not good &lt;/strong&gt;
   'loaded_date_gr'   =&gt; 'CONVERT(NVARCHAR(10), ArrivalPackage.loaded_date, 105)',
   'sold_date_gr'     =&gt; 'CONVERT(NVARCHAR(10), ArrivalPackage.sold_date, 105)'
 );
}
&lt;/pre&gt;
&lt;p&gt;
After I baked a view and controller for PackageLines I added a &lt;code&gt;pr($packageLine);&lt;/code&gt; on the top of my view.ctp view file. The result was :
&lt;/p&gt;
&lt;pre&gt;
Array
(
    [ArrivalPackage] =&gt; Array
        (
            [id] =&gt; 3
            [arrival_id] =&gt; 3
            [product_id] =&gt; C2ΕLΙLΤ075000000075DULW4
            [supplier_package_number] =&gt; 345345345
            [shelman_package_number] =&gt; 1099228
            [SSCC] =&gt; 
            [min_length] =&gt; 2600
            [max_length] =&gt; 2600
            [package_type_id] =&gt; 1
            [expected_m3] =&gt; 0
            [total_pcs] =&gt; 20
            [total_m3] =&gt; 0.015
            [total_m] =&gt; 2
            [loaded] =&gt; 0
            [sold] =&gt; 1
            [reserved] =&gt; 1
            [loaded_date] =&gt; 
            [sold_date] =&gt; 2011-04-21
            [reserved_date] =&gt; 2011-04-18
            [reserved_user] =&gt;  
            [loaded_date_gr] =&gt; 
            [sold_date_gr] =&gt; 21-04-2011
        )
    &lt;font color="#660000"&gt;
    [0] =&gt; Array
        (
            [ArrivalPackage__reserved_date_] =&gt; 18-04-2011
        )
    &lt;/font&gt;
)
&lt;/pre&gt;
&lt;p&gt;
Only after I shortened the name of the &lt;code&gt;reserved_date_gr&lt;/code&gt; field to &lt;code&gt;rsvd_date_gr&lt;/code&gt;, did I get my expected
&lt;/p&gt;
&lt;pre&gt;
Array
(
    [ArrivalPackage] =&gt; Array
        (
            [id] =&gt; 3
            [arrival_id] =&gt; 3
            [product_id] =&gt; C2ΕLΙLΤ075000000075DULW4
            [supplier_package_number] =&gt; 345345345
            [shelman_package_number] =&gt; 1099228
            [SSCC] =&gt; 
            [min_length] =&gt; 2600
            [max_length] =&gt; 2600
            [package_type_id] =&gt; 1
            [expected_m3] =&gt; 0
            [total_pcs] =&gt; 20
            [total_m3] =&gt; 0.015
            [total_m] =&gt; 2
            [loaded] =&gt; 0
            [sold] =&gt; 1
            [reserved] =&gt; 1
            [loaded_date] =&gt; 
            [sold_date] =&gt; 2011-04-21
            [reserved_date] =&gt; 2011-04-18
            [reserved_user] =&gt;  
            &lt;font color="#000066"&gt;[resvd_date_gr] =&gt; 18-04-2011&lt;/font&gt;
            [loaded_date_gr] =&gt; 
            [sold_date_gr] =&gt; 21-04-2011
        )
)
&lt;/pre&gt;
&lt;p&gt;
Funny thing is that the actual sql statement produced by Cake, no matter what you name the field is valid for SQL Server, still unless the field name becomes smaller than 14 characters things don't work as you would expect them.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4530392646881394202?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4530392646881394202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4530392646881394202' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4530392646881394202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4530392646881394202'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/04/cakephp-length-of-virtual-fields-name.html' title='CakePHP: Length of a virtual field&apos;s name'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8360683201016168408</id><published>2011-04-19T08:31:00.005+02:00</published><updated>2011-04-21T10:28:27.091+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>CakePHP: Storing paging info in the Session</title><content type='html'>&lt;p&gt;
There is no way you can miss it. Sooner or later you 'll end up having baked your controllers and views only to discover that when you edit a record from the 4&lt;small&gt;&lt;sup&gt;th&lt;/sup&gt;&lt;/small&gt; page and press submit on the edit page, much to your annoyance you end up on page one. Needless to say that whatever sort order was there is now gone with the wind.
&lt;/p&gt;
&lt;p&gt;
I have googled a bit and found out the &lt;a href="http://stackoverflow.com/questions/1055359/maintaining-page-number-after-redirect-in-cakephp" target="_blank"&gt;following article&lt;/a&gt; in Stack Overflow. The solutions provided over there seemed rather complicated to me, so I decided to craft my own.
&lt;p&gt;
&lt;p&gt;
Now here is the deal: From what I have seen in cake 1.3, paging is controlled by the value of three parameters: &lt;strong&gt;page&lt;/strong&gt;, &lt;strong&gt;sort&lt;/strong&gt; and &lt;strong&gt;direction&lt;/strong&gt;. All we need to do is provide a way to store them in the session and then have the controller's redirect method inject these back into the URL parameters when they are not present.
&lt;/p&gt;

&lt;pre&gt;
&amp;lt;?php
     
class AppController extends Controller {
    const SESSION_KEY = 'PagingInfo.%s.%s';
        
    var $components = array('Session');
        
    function redirect($url, $status = null, $exit = true)
    {
        if (is_array($url)) {
            // attempt to determine if we have saved paging data into the sesion
            $sessionKey = $this-&gt;buildSessionKey($url['action']);
            
            if ($this-&gt;Session-&gt;check( $sessionKey)) {
                // if so retrieve them
                $argsToMergs = $this-&gt;Session-&gt;read($sessionKey);
                // and merge these into the url parameters
                foreach( $argsToMergs as $key =&gt; $value)
                    // if the param is not there ...
                    if (!isset( $this-&gt;passedArgs[$key]))
                        $url[$key] = $value;
            }
        }
            
        return parent::redirect($url, $status, $exit);
    }

    protected function savePagingInfo()
    {
        // create an array to hold the paging info
        $argsToSave = array();

        // remove paging info from passed args
        foreach( $this-&gt;passedArgs as $key =&gt; $value)
            if ($key == 'page' || $key == 'sort' || $key == 'direction')
                $argsToSave[$key] = $value;

        // abort if any paging info was found
        $sessionKey = $this-&gt;buildSessionKey();
        if (!empty($argsToSave)) {
            $this-&gt;Session-&gt;write( $sessionKey, $argsToSave);
            return;
        }
        
        // no paging info let's see if we have something in the sesion
        if ($this-&gt;Session-&gt;check($sessionKey)) {
                $pagingInfo = $this-&gt;Session-&gt;read($sessionKey);
                $this-&gt;passedArgs = array_merge( $this-&gt;passedArgs, $pagingInfo);
        }
    }
                        
    private function buildSessionKey($action = NULL)
    {
        if (empty($action))
            $action = $this-&gt;action;
            
        return sprintf( self::SESSION_KEY, $this-&gt;name, $action);
    }
}
     
?&gt;    
&lt;/pre&gt;
&lt;p&gt;
This approach may be simplistic but in my case it worked. All I had to was call &lt;code&gt;$this-&gt;savePagingInfo();&lt;/code&gt; from my &lt;code&gt;index()&lt;/code&gt; action and then let the rest of the baked code do its work.
&lt;/p&gt;
&lt;h3&gt;Note&lt;/h3&gt;
&lt;p&gt;
And one last comment, there are many cases that you need paging during display of master detail record sets. In cases like these &lt;code&gt;savePagingInfo()&lt;/code&gt; will save paging status for the detail records matching the current master and when the master changes, the paging in the session becomes invalid. My simple solution to this is to add a &lt;code&gt;'page' =&gt; 1&lt;/code&gt; entry in the &lt;code&gt;$url&lt;/code&gt; params pointing to a master record change. With the design of the application I am currently working on this proves just good enough.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8360683201016168408?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8360683201016168408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8360683201016168408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8360683201016168408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8360683201016168408'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2011/04/cakephp-storing-paging-info-in-session.html' title='CakePHP: Storing paging info in the Session'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3437727222482611602</id><published>2010-12-01T14:44:00.000+02:00</published><updated>2010-12-01T14:44:02.432+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>A simple GUID generator function for Delphi</title><content type='html'>&lt;p&gt;
Here is a little code sample, that I run into the other day. The actual URL is &lt;a herf="http://home.freeuk.com/iccarter/pages/del_guidgen.htm"&gt;here&lt;/a&gt;, but since the original site is now closed, I thought that I could save this posting on my blog as well.
&lt;/p&gt;

&lt;p&gt;
If anybody running CodeGear RAD Studio 2007 ever wishes to play with GUID's then this function is a real must have, All credit goes to the original &lt;a href="http://www.iccarter.freeuk.com/index.htm"&gt;poster&lt;/a&gt;.
&lt;/p&gt;

&lt;pre&gt;
interface

function GUIDString: String;

implementation

uses ActiveX;
  
function GUIDString: String;
var
  Guid: TGUID;
  wsGuid: WideString;
begin
  Result := '';
  { create the 128 bit integer }
  if CoCreateGuid(Guid) = S_OK then begin
    { create a buffer of suitable size }
    SetLength(wsGuid, 80);
    { convert the 128 bit integer into a Unicode string }
    if StringFromGUID2(Guid, POleStr(wsGuid), 80) &gt; 0 then
      { convert the Unicode to a String for output }
      Result := OleStrToString(PWideChar(wsGuid));
    end;  { if CoCreateGuid ... }
end;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3437727222482611602?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3437727222482611602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3437727222482611602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3437727222482611602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3437727222482611602'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/12/simple-guid-generator-function-for.html' title='A simple GUID generator function for Delphi'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1026422486154375019</id><published>2010-11-14T12:46:00.002+02:00</published><updated>2011-05-27T18:25:49.677+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='skype'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Packages required to run skype on Fedora 15</title><content type='html'>&lt;p&gt;
Just installed skype 2.2 on my Fedora 15 (x86_64) box and it works.The actual rpm can be downloaded from &lt;a title="Get skype for Linux" href="http://www.skype.com/intl/en/get-skype/on-your-computer/linux/post-download/"&gt; here&lt;/a&gt;. The rpm installs itself without checking for dependencies, so in order to run skype correctly you need the 32bit versions of the qt and alsa libraries. The actual command to install these packages is:
&lt;/p&gt;
&lt;pre&gt;

sudo yum -y install qt.i686 javascript:void(0)qt-x11.i686 libXScrnSaver.i686 alsa-lib.i686

&lt;/pre&gt;
&lt;p&gt;
... and away we go.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1026422486154375019?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1026422486154375019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1026422486154375019' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1026422486154375019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1026422486154375019'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/11/packages-required-to-run-skype-on.html' title='Packages required to run skype on Fedora 15'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7275137581762166366</id><published>2010-08-19T09:54:00.000+02:00</published><updated>2010-08-19T09:54:05.515+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='Chromium'/><title type='text'>Chromium repository for Fedora</title><content type='html'>&lt;p&gt;
This is only a quick note for me and anyone else &lt;i&gt;still&lt;/i&gt; searching for the new location of the chromium repo for Fedora. The new location is :
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://repos.fedorapeople.org/repos/spot/chromium/" title="New chromium packages"&gt;
  http://repos.fedorapeople.org/repos/spot/chromium/
&lt;/a&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7275137581762166366?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7275137581762166366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7275137581762166366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7275137581762166366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7275137581762166366'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/08/chromium-repository-for-fedora.html' title='Chromium repository for Fedora'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5061808296600622024</id><published>2010-07-09T10:39:00.002+02:00</published><updated>2010-07-09T17:59:45.792+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='etc'/><title type='text'>Hello T-SQL and ASP.NET</title><content type='html'>&lt;p&gt;
Half of me wishes things had gone the way I planned, so now we would be programming with CakePHP storing data in Oracle and calling remote enabled function modules in order to communicate with SAP. 
Then my other half says: "Ok, no more reading and mangling with ABAP spaghetti code written by somebody afraid to declare a single local variable and trying to figure out what all these magic tables with the enlightening four-letter names do!" Of course getting rid of ABAP is the bright side. The dark side said says "Hello from 1 Microsoft Way Redmond WA" 
&lt;/p&gt;
After the company I work for was sold out right before Christmas, the new management decided that SAP was too expensive and too complicated so from now the entire group we will be using a Greek ERP made by Entersoft SA. The new ERP is an N-Tier system running under Windows written in .NET and uses Microsoft SQL Server as data store. So what is left for us now is to learn and program in .NET
&lt;/p&gt;

&lt;p&gt;
Being the Linux junkie I am, this development in my developer status triggered various comments from friends and neighbours. The most interesting was this video trailer which much like Sgt. Pepper's Lonely Hearts Club Band is ... guaranteed to raise a smile.
&lt;/p&gt;
&lt;p&gt;
So Java vs .NET; the choice is not always yours sο sit back and enjoy
&lt;p&gt; 
&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/fzza-ZbEY70&amp;amp;hl=en_US&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/fzza-ZbEY70&amp;amp;hl=en_US&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
&lt;p&gt;
Stay tuned for more.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5061808296600622024?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5061808296600622024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5061808296600622024' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5061808296600622024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5061808296600622024'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/07/hello-t-sql-and-aspnet.html' title='Hello T-SQL and ASP.NET'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2542405450964139222</id><published>2010-04-14T09:11:00.001+02:00</published><updated>2011-08-11T07:52:19.562+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash player'/><title type='text'>Flash player for 64 bit Linux</title><content type='html'>&lt;p&gt;
Thanks to 
 &lt;a title="See the releant post on the fedora forum"
    title="__blank"
    href="http://forums.fedoraforum.org/showthread.php?t=205642&amp;highlight=64bit+flash+player+repository"&gt;
    Leigh's
  &lt;/a&gt; 
  repository for Fedora, I almost forgot where to find the latest 
  version of flash player.
&lt;/p&gt;
&lt;p&gt;So, to save a little bit of googling ...&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;a href="http://labs.adobe.com/downloads/flashplayer11.html"
       title="Download Adobe Flash Player 11 Beta for Desktops"
       target="_blank"&gt;
      Adobe Labs Flash Player 11 page
    &lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
  Last update : August 11, 2011
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2542405450964139222?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2542405450964139222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2542405450964139222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2542405450964139222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2542405450964139222'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/04/flash-player-for-64-bit-linux.html' title='Flash player for 64 bit Linux'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2737526550533752095</id><published>2010-02-07T12:46:00.004+02:00</published><updated>2010-02-08T14:37:54.045+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: Mass rename of files</title><content type='html'>&lt;p&gt;
When people give me files, especially images, coming from windows machines I always have problems with capitalised extensions. JPEG format files for instance appear as &lt;code&gt;image.JPG&lt;/code&gt; instead of &lt;code&gt;image.jpg&lt;/code&gt;. Worst case is that in some collections some file extensions appear capitalised while others in lower case.
&lt;/p&gt;
&lt;p&gt;
I have searched the web for some simple solution to this problem and ended up seeing &lt;code&gt;sed&lt;/code&gt; commands and pipes that &lt;a title="6V8 - Production of my Mind" target="_blank" href="http://6v8.gamboni.org/Mass-renaming-with-linux-shell.html"&gt;UNIX gurus&lt;/a&gt; are so fond off, 
&lt;/p&gt;
&lt;blockquote&gt;
So, if you wanted to rename all the .php3  to .php, this would be the command:
&lt;br/&gt;
&lt;code&gt;
ls -d *.php3 | sed 's/\(.*\).php3$/mv "&amp;" "\1.php"/' | sh
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;
As Fortune keeps reminding me, &lt;q lang="en"&gt;there is more than one way to skin a cat&lt;/q&gt;, so a more complete discussion on mass renaming with Linux can be found on Gareth Anderson's &lt;a target="_blank" title="Visit the book index" href="http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html"&gt;GNU/Linux Command-Line Tools Summary
&lt;/a&gt; book article directly accessible from &lt;a target="_blank" href="http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/mass-rename.html"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Anyway, after a little bit of googling, it turned out to my surprise that the simplest way to do this was inside my own Fedora distro. The magic command is &lt;strong&gt;rename&lt;/strong&gt; and the man entry is small, simple and accurate :
&lt;/p&gt;
&lt;pre&gt;
RENAME(1)                  Linux Programmer’s Manual                 RENAME(1)

NAME
       rename - Rename files

SYNOPSIS
       rename from to file...
       rename -V

DESCRIPTION
       rename will rename the specified files by replacing the first occurrence of from in their name by to.

       -V, --version
              Display version information and exit.

       For example, given the files
              foo1, ..., foo9, foo10, ..., foo278, the commands

              rename foo foo0 foo?
              rename foo foo0 foo??

       will turn them into foo001, ..., foo009, foo010, ..., foo278.

       And
              &lt;strong&gt;rename .htm .html *.htm&lt;/strong&gt;

       will fix the extension of your html files.

SEE ALSO
       mmv(1), mv(1)

AVAILABILITY
       The   rename   command   is   part   of   the   util-linux-ng   package   and   is   available  from  ftp://ftp.ker-
       nel.org/pub/linux/utils/util-linux-ng/.

                                1 January 2000                       RENAME(1)

&lt;/pre&gt;
&lt;p&gt;
The rename command is also available on all EL clones like (CentOS and Oracle EL).
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2737526550533752095?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2737526550533752095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2737526550533752095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2737526550533752095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2737526550533752095'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/02/linux-mass-rename-of-files.html' title='Linux: Mass rename of files'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2311741307332361715</id><published>2010-01-20T15:45:00.003+02:00</published><updated>2010-01-20T19:12:32.264+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 11g'/><category scheme='http://www.blogger.com/atom/ns#' term='PL/SQL'/><title type='text'>CakePHP: Calling Oracle stored procedures and functions</title><content type='html'>&lt;p&gt;
Our testing with Cake is almost complete. We have been able to read and write data correctly in our non UTF-8 Oracle database, managed to communicate with &lt;spam style="color:#003366;" title="... the company's ERP system"&gt;SAP&lt;/spam&gt;, played enough with AJAX, so our users will not complain when dealing with tree like data and even managed to get authenticated by our MS-Windows 2003 active directory servers. So the last question left was how does one call an Oracle PL/SQL stored procedure or function from CakePHP ?
&lt;/p&gt;
&lt;p&gt;
A little bit of googling and a little bit of digging into the CakePHP code revealed the following: The most common approach to calling stored procedures and functions is to create a member function in your model class and set up the call from there. In the simple case of calling a stored procedure with IN parameters only, the Model's &lt;code&gt;query()&lt;/code&gt; method can be used to perform the actual call via the &lt;code&gt;CALL PROC_NAME( ... )&lt;/code&gt; SQL statement. The usual approach is to create a model method like this :
&lt;/p&gt;
&lt;pre&gt;
class MyModel extends AppModel {
    var $name = "MyModel";

    ...
    function callStoredProc( $param1, $param2)
    {
        $this-&gt;query("CALL my_stored_proc( $param1, $param2");
    }
    ...
}

&lt;/pre&gt;
&lt;p&gt;
If however you need to get data in and out of Oracle then you have to get your hands dirty and set up the call using low level oci_* functions. A simple example will clarify everything.
&lt;/p&gt;
&lt;p&gt;
Let us suppose that you library users require that you display the average number of pages of the books stored in your library. A simple PL/SQL function to return this would probably be something like this:
/p&gt;
&lt;pre&gt;
CREATE OR REPLACE FUNCTION average_book_pages RETURN NUMBER
IS
   page_avg NUMBER;   
BEGIN
   SELECT avg( num_pages) 
      INTO page_avg
      FROM books;
   RETURN page_avg;   
END AVERAGE_BOOK_PAGES;
&lt;/pre&gt;
&lt;p&gt;
The next thing to do would be to create a &lt;code&gt;getAvergaeBookPages()&lt;/code&gt; function in our &lt;code&gt;Book&lt;/code&gt; model class :
&lt;pre&gt;
&amp;lt;?php
class Book extends AppModel {
    var $name = 'Book';
    var $belongsTo = ...
    var $validate = array( ...

    function getAverageBookPages()
    {
        // every model has a datasource
        $dataSource = $this-&gt;getDataSource();
        // and every datasource has a  database connection handle
        $connection = $dataSource-&gt;connection;
        if (!$connection)
            return -1;

        // from now you need this Oracle specific approach 
        $statement = oci_parse( $connection,
                "begin :ret := AVERAGE_BOOK_PAGES(); end;");
        oci_bind_by_name($statement, ':ret', $r, 100);
        oci_execute($statement);
        return $r;
    }
}
?&gt;
&lt;/pre&gt;
&lt;p&gt;
The last parameter of &lt;code&gt;oci_bind_by_name&lt;/code&gt; is the number of bytes to allocate for returning the string representation of the bind variable. Just make sure that you allocate enough memory for that. My test data yield an average of 762,666666666666666666666666666666666667 pages per book (Thank you Mr. Minasi) and so oci_execute kept giving me &lt;q&gt;ORA-06502: PL/SQL: numeric or value error: character string buffer too small&lt;/q&gt; until I raised the value to 100.
&lt;/p&gt;
&lt;p&gt;
So that does it. Now calling this from you controller code is as easy as :
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;?php
class BooksController extends AppController {
    var $name = 'Books';

    ...

    function index()
    {
        $this-&gt;Book-&gt;recursive = 0;
        $this-&gt;set('books', $this-&gt;paginate());
        $this-&gt;set('averagePages', $this-&gt;Book-&gt;getAverageBookPages());
    }

    ...
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2311741307332361715?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2311741307332361715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2311741307332361715' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2311741307332361715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2311741307332361715'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/01/cakephp-calling-oracle-stored-functions.html' title='CakePHP: Calling Oracle stored procedures and functions'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4240902833896380520</id><published>2010-01-07T12:30:00.012+02:00</published><updated>2011-01-24T09:50:06.429+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>CakePHP: The dependent listboxes problem</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
When creating dynamic web-sites, sooner or later you are going to face the problem of providing dependent list boxes. Imagine the case where one wishes to select a city from a list grouped by region, or a user from a group, an invoice from an order etc. Grouping things into categories is very common in real life and as far as I am concerned, it is almost always a must for your application to be able to utilize such groupings.
&lt;br /&gt;
In CakePHP -- as far as I know -- there are two ways you can help your users pick up a value from a list of grouped items. One is to create a select box whose items are organized in selection groups sorted in some logical way. the other way in to use dependent AJAX triggered combo or list boxes where selection on the first will filter the items displayed on the second.
&lt;br /&gt;
In this posting I will provide code that handles both cases.
&lt;br /&gt;
&lt;h3&gt;
The sample data&lt;/h3&gt;
As an exercise for learning Cake, I developed a small application that manages the IT department books. Each &lt;code&gt;Book&lt;/code&gt; belongs to a &lt;code&gt;BookCategory&lt;/code&gt; and each &lt;code&gt;BookCategory&lt;/code&gt; belongs to a &lt;code&gt;BookCategoryGroup&lt;/code&gt;. Reversely, each &lt;code&gt;BookCategoryGroup&lt;/code&gt; has many &lt;code&gt;BookCategory&lt;/code&gt; and each &lt;code&gt;BookCategory&lt;/code&gt; has many &lt;code&gt;Book&lt;/code&gt;. The corresponding tables have foreign keys adhering to the CakePHP conventions, so I am not going to waste any more time explaining the data structure.  
&lt;br /&gt;
The goal here is to help our users, when adding or editing book records, to find the right category for each book given the organization of book categories in book category groups. Like I said in the introduction there are two ways we can accomplish this
&lt;br /&gt;
&lt;h3&gt;
One combo box organized in selection groups&lt;/h3&gt;
The way is very easy to implement and may become particularly handy whenever the total number of list items is relatively small. Cake's &lt;code&gt;Form::imput&lt;/code&gt; method will create option groups if the array containing the options for a select box is organized into sub arrays so if 
we add the following function in our &lt;code&gt;BooksController&lt;/code&gt; ....
&lt;br /&gt;
&lt;pre&gt;    private function prepareCategoriesCombo()
    {
        // gain access to the BookCategoryGroups model class
        $this-&amp;gt;loadModel('BookCategoryGroup');
        // prepare a list of all book category groups
        $this-&amp;gt;BookCategoryGroup-&amp;gt;recursive = 0;
        $bookCategoryGroups = $this-&amp;gt;BookCategoryGroup-&amp;gt;find(
                                'all',
                                array(
                                    'conditions' =&amp;gt; array(),
                                    'order' =&amp;gt; array('BookCategoryGroup.name')
                                )
                            );

        // create an empty array to hold the combo box options
        $bookCategories = array();
        foreach( $bookCategoryGroups as $bookCategoryGroup) {
            $groupId = $bookCategoryGroup['BookCategoryGroup']['id'];
            $groupName = $bookCategoryGroup['BookCategoryGroup']['name'];
            // create a sub array for each group category
            $bookCategories[] = $groupName;
            // fill the array with the categories corresponding to the group
            $bookCategories[$groupName] = $this-&amp;gt;Book-&amp;gt;BookCategory-&amp;gt;find(
                                'list',
                                array (
                                    'conditions' =&amp;gt; array(
                                        'BookCategory.book_category_group_id' =&amp;gt; $groupId
                                        ),
                                    'order' =&amp;gt; array(
                                        'BookCategory.name'
                                        )
                                )
                                    );
        }
        return $bookCategories;
    }
&lt;/pre&gt;
Supposing that you have &lt;i&gt;baked&lt;/i&gt; your original controller and view code with the cake script, your &lt;code&gt;add()&lt;/code&gt; or &lt;code&gt;edit()&lt;/code&gt; controller actions need to have the following in order to use the option grouped combo:
&lt;br /&gt;
&lt;pre&gt;   ...
   $bookCategories = $this-&amp;gt;prepareCategoriesCombo();
   ...
&lt;/pre&gt;
while the view template will require no change at all (i.e. a simple 
&lt;code&gt;echo $form-&amp;gt;input('book_category_id');&lt;/code&gt; will suffice). As I said earlier on, this method is simple enough and unless you intent to let your users pick a US zip code organized by state, this may be the preferred solution for many cases. If however you have lots of data and an
&lt;i&gt;untamable&lt;/i&gt; desire for ajax, read on; fear not however CakePHP's approach to AJAX makes this look also like a piece of cake.
&lt;br /&gt;
&lt;h3&gt;
The AJAX way: Two combos with one auto filtering the other&lt;/h3&gt;
The basic idea behind AJAX is the following: You start by defining an area in you web page identifiable via the the HTML &lt;code&gt;id&lt;/code&gt; attribute. Then when the user clicks on a button or changes the value of some control (edit, list or combo), you make an asynchronous call to the web server -- that is without having to reload the page -- and the server returns HTML code that is ready to be placed inside that area. The actual way you implement this depends on the libraries and the AJAX framework you use. Cake does that using the &lt;a href="http://www.prototypejs.org/" target="_blank"&gt;prototype&lt;/a&gt; and the &lt;a href="http://script.aculo.us/" target="_blank"&gt;Scriptaculus&lt;/a&gt; frameworks.
&lt;br /&gt;
So to get things started, download prototype and scriptaculus and place the following files in your &lt;code&gt;APP/webroot/js&lt;/code&gt; folder:
&lt;br /&gt;
&lt;pre&gt;builder.js   dragdrop.js  prototype.js      slider.js  unittest.js
controls.js  effects.js   scriptaculous.js  sound.js
&lt;/pre&gt;
Having done that, modify you application layout in order to include them. Open &lt;code&gt;APP/view/layouts/default.ctp&lt;/code&gt; and change the HTML head part so it looks like this :
&lt;br /&gt;
&lt;pre&gt;&lt;span style="color: red; font-weight: bold;"&gt;&amp;lt;!DOCTYPE &lt;/span&gt;&lt;span style="color: black;"&gt;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&lt;span style="color: red; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;html&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; xmlns=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;  &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;meta&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; http-equiv=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Content-Type"&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; content=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"text/html; charset=UTF-8"&lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;      &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; echo $title_for_layout; &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; echo $html-&amp;gt;css('it-library'); &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;meta&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; name=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Generator"&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; content=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Quanta Plus"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;meta&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; name=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Author"&lt;/span&gt;&lt;span style="color: #0000c0;"&gt; content=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Thanassis Bakalidis"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; if (isset($javascript)) : &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;      &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; echo $javascript-&amp;gt;link('prototype.js'); &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;  &amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; echo $javascript-&amp;gt;link('scriptaculous.js'); &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; endif; &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;    &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;?php&lt;/span&gt;&lt;span style="color: black;"&gt; echo $scripts_for_layout; &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;?&amp;gt;&lt;/span&gt;
&lt;span style="color: black;"&gt;  &lt;/span&gt;&lt;span style="color: blue; font-weight: bold;"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
The next thing to do is to modify our controller in order to provide Javascript and AJAX support: Our books controller now looks like the following:
&lt;br /&gt;
&lt;pre&gt;class BooksController extends AppController {

    var $name = 'Books';
    var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
    var $components = array('RequestHandler');

    ...
}
&lt;/pre&gt;
Next go to your view template -- may that be the add or edit.ctp -- and change the initial &lt;code&gt;echo $form-&amp;gt;input('Book.book_category_id');&lt;/code&gt; line in order to look like the following:
&lt;br /&gt;
&lt;pre&gt;        // here are the two list boxes displaying groups and categories
        // aim is to create an auto-filter effect with AJAX
        echo $form-&amp;gt;label( 'BookCategory.book_category_group_id',
                            'Category Group');
        echo $form-&amp;gt;select('BookCategory.book_category_group_id',
                            $bookCategoryGroups,
                            $bookCategoryGroupId,
                            array(
                                'id' =&amp;gt; 'bookCategoryGroups'
                            ),
                            FALSE);
        echo $form-&amp;gt;input('Book.book_category_id', array('id' =&amp;gt; 'bookCategories' ));

        // each time the bookCategoryGroups element changes we are to
        // asynchronously call the updateSelect action of the current 
        // controller and insert whatever the action produces inside the 
        // html DOM element identified by bookCategories
        $ajaxOptions = array('url' =&amp;gt; 'updateSelect','update' =&amp;gt; 'bookCategories');
        echo $ajax-&amp;gt;observeField('bookCategoryGroups',$ajaxOptions);
&lt;/pre&gt;
I believe that the code is self explanatory. Now let us add the &lt;code&gt;updateSelect&lt;/code&gt; method of the &lt;code&gt;BooksController&lt;/code&gt; class
&lt;br /&gt;
&lt;pre&gt;    function updateSelect()
    {
        $groupId = $this-&amp;gt;data['BookCategory']['book_category_group_id'];
        if (!empty( $groupId )) {
            $options = $this-&amp;gt;getBookCategoriesForGroup( $groupId);
            // these are the combo box options to be used in the view file
            $this-&amp;gt;set('options',$options);
        }
    }
&lt;/pre&gt;
There is one thing to mention here: the AJAX code produced by &lt;code&gt;observeField()&lt;/code&gt; serializes the entire field that is supposed to observe, so this will be available in the controller action as &lt;code&gt;$this-&amp;gt;data['Model']['field']&lt;/code&gt;.
&lt;br /&gt;
Next we need to create the actual view code. Create a file named &lt;code&gt;update_select.ctp&lt;/code&gt; inside your &lt;code&gt;APP/views/books&lt;/code&gt; directory and place the following code inside (Thanks HerbCSO):
&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
    // create &lt;options&gt; tags coming from a $options variable
    // This is to be used by AJAX in order to fill the contents of a combo
    // box
    if(!empty($options)) {
        foreach($options as $key =&amp;gt; $value) {
             echo "&amp;lt;option value=\"$key\"&gt;$value&amp;lt;/option&gt;";
        }
    }
?&amp;gt;
&lt;/options&gt;&lt;/pre&gt;
Now we have everything in place. The only thing left to do is to initialize the two combo boxes so that they contain the correct data, i.e. all the group categories for the top combo and the categories for the selected records category group on the second, during initial page load. To achieve this I have created two additional functions in the &lt;code&gt;BooksController&lt;/code&gt; class:
&lt;br /&gt;
&lt;pre&gt;    private function getBookCategoriesGroups()
    {
        $this-&amp;gt;loadModel('BookCategoryGroup');
        $this-&amp;gt;BookCategoryGroup-&amp;gt;recursive = 0;
        return $this-&amp;gt;BookCategoryGroup-&amp;gt;find('list',
                                                array(
                                                    'conditions' =&amp;gt; array(),
                                                    'order' =&amp;gt; array(
                                                        'BookCategoryGroup.name'
                                                        )
                                                )
                                            );
    }

    private function getBookCategoriesForGroup( $groupId)
    {
        return $this-&amp;gt;Book-&amp;gt;BookCategory-&amp;gt;find('list',
                                array(
                                    'conditions' =&amp;gt; array (
                                        'book_category_group_id' =&amp;gt; $groupId
                                        ),
                                    'order' =&amp;gt; array(
                                            'BookCategory.name'
                                        )
                                )
                            );
    }
&lt;/pre&gt;
Now my controller's edit action -- which as I mentioned earlier, was baked by cake -- looks like the following. 
&lt;br /&gt;
&lt;pre&gt;    function edit($id = null)
    {
        if (!$id &amp;amp;&amp;amp; empty($this-&amp;gt;data)) {
            $this-&amp;gt;Session-&amp;gt;setFlash(__('Invalid Book', true));
            $this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
        }
        if (!empty($this-&amp;gt;data)) {
            if ($this-&amp;gt;Book-&amp;gt;save($this-&amp;gt;data)) {
                $this-&amp;gt;Session-&amp;gt;setFlash(__('The Book has been saved', true));
                $this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
            } else {
                $this-&amp;gt;Session-&amp;gt;setFlash(__('The Book could not be saved. Please, try again.', true));
            }
        }

        if (empty($this-&amp;gt;data)) {
            $this-&amp;gt;data = $this-&amp;gt;Book-&amp;gt;read(null, $id);
        }

        // set up additional book record parameters
        $sites = $this-&amp;gt;Book-&amp;gt;Site-&amp;gt;find('list');
        $bookTypes = $this-&amp;gt;Book-&amp;gt;BookType-&amp;gt;find('list');
        $languages = $this-&amp;gt;Book-&amp;gt;Language-&amp;gt;find('list');

        // setup the two AJAX operated combo boxes
        $bookCategoryGroups = $this-&amp;gt;getBookCategoriesGroups();                
        $bookCategoryGroupId = $this-&amp;gt;data['BookCategory']['book_category_group_id'];
        $bookCategories = $this-&amp;gt;getBookCategoriesForGroup( $bookCategoryGroupId);

        $ratings = $this-&amp;gt;Book-&amp;gt;Rating-&amp;gt;find('list');
        $publishers = $this-&amp;gt;Book-&amp;gt;Publisher-&amp;gt;find('list');

        $this-&amp;gt;set( compact( 'sites','bookTypes','languages',
                             'bookCategories', 'bookCategoryGroups', 'bookCategoryGroupId',
                             'ratings','publishers'));
    }
&lt;/pre&gt;
Needless to say that when adding a record, the initial &lt;code&gt;$bookCategoryGroupId&lt;/code&gt; can be set to an initial value say 1 and then let your uses change to whatever seems appropriate.
&lt;br /&gt;
I have tested this with CakePHP 1.2.5 on both Firefox (versions 3 and 3.5) and IE (version 8).
&lt;br /&gt;
As a last statement, I would like to point out that I am by no means an expert on AJAX or CakePHP. I got my info from an earlier posting by &lt;a href="http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/"&gt;DEVMOZ&lt;/a&gt; and the CakePHP &lt;a href="http://api.cakephp.org/class/ajax-helper"&gt;AJAXHelper&lt;/a&gt; class info page. I have put this down as a working reference to a &lt;i&gt;real&lt;/i&gt; problem, that anybody can copy -- hopefully -- easy to modify code.
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4240902833896380520?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4240902833896380520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4240902833896380520' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4240902833896380520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4240902833896380520'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2010/01/cakephp-dependent-listboxes-problem.html' title='CakePHP: The dependent listboxes problem'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-6691417479418274705</id><published>2009-12-16T12:30:00.007+02:00</published><updated>2010-01-21T15:43:21.736+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 11g'/><title type='text'>CakePHP and Oracle on CentOS. My own how to guide</title><content type='html'>&lt;p&gt;
During the last couple of days I formated and set up from scratch my CakePHP development server, using CentOS, php 5.3 from Remi and the Oracle 11gR2 clients. The log of my actions in PDF can be downloaded from &lt;a href="https://docs.google.com/leaf?id=0B6KLBoL1nvwLZmYyMWMyZmMtMTk5MS00Y2E4LTg2ZjUtOWUwNWI4NWM1ZmI0&amp;hl=en_GB"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
During the following days I will setup one more server -- supposed to be the one that we will use productively -- following these same instructions. If I find any mistakes I will correct them and post back the orginal file here.
&lt;/p&gt;
&lt;h3&gt;Update history&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;strong&gt;Dec-28-2009&lt;/strong&gt;: Added information about setting up  
    and running the cake scripts from the command line.
  &lt;/li&gt;
  &lt;li&gt;
    &lt;strong&gt;Jan-21-2010&lt;/strong&gt;: Verified contents on a new installation
    and added reminder for configuring the firewall.
  &lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-6691417479418274705?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/6691417479418274705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=6691417479418274705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6691417479418274705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6691417479418274705'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/12/cakephp-and-oracle-on-centos-my-own-how.html' title='CakePHP and Oracle on CentOS. My own how to guide'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1593131721631548361</id><published>2009-12-15T11:46:00.012+02:00</published><updated>2009-12-23T10:01:04.755+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 11g'/><title type='text'>CakePHP: A behavior for acessing non UTF Oracle databases</title><content type='html'>&lt;p&gt;
The origins of our company's Oracle database date back at the beginning of the decade. At that time we had Oracle version 9i running on SuSE Linux 8.2 and the expected thing to do back then was to create a database using the EL8ISO8859P7 character set. After eight years we are still using Oracle. Now the database is 11g and the database server is OEL 5.4. Basic data structures however, are still the same as they were back in 2002.
&lt;/p&gt;
&lt;p&gt;
During the evaluation of CakePHP as our next development environment we very soon run into the problem of trying to insert and retrieve Unicode data from a non-unicode database. Since the &lt;code&gt;encoding&lt;/code&gt; key of &lt;code&gt;$defualt&lt;/code&gt; array member of the &lt;code&gt;DATABASE_CONFIG&lt;/code&gt; class (stored in &lt;code&gt;app/config/database.php&lt;/code&gt; file) has no effect when connecting to Oracle databases, we ended up creating an additional translation layer, that would convert data to and from Unicode when reading from and writing to Oracle. 
&lt;/p&gt;
&lt;p&gt;
CakePHP's way of doing this kind of staff is to create &lt;a target="_blank" href="http://book.cakephp.org/view/88/Behaviors" title="Read all about it in the CakePHP manual."&gt;behaviors&lt;/a&gt;. Ours is called &lt;code&gt;CharsetConverter&lt;/code&gt;, so by CakePHP's standards it is  implemented in a class named &lt;code&gt;CharsetConverterBehavior&lt;/code&gt; that is stored in a file named &lt;code&gt;charset_converter.php&lt;/code&gt; which is located in the &lt;code&gt;APP/models/behaviors&lt;/code&gt; directory. 
&lt;/p&gt;
&lt;p&gt;
The approach here uses the &lt;code&gt;mb_convert_encoding&lt;/code&gt; function provided with the &lt;strong&gt;php-mbstring&lt;/strong&gt; package. The code implementation is the following
&lt;/p&gt;
&lt;pre&gt;
&amp;lt?php
/**
 * A simple behavior that allows cake PHP to use single byte Oracle
 * and possibly other vendor -- databases
 * Tested with Oracle 11gR1
 *
 * @version 0.1
 * @author Thanassis Bakalidis
 */
class CharsetConverterBehavior extends ModelBehavior {
    // we have an Oracle database that dates back to 2002 so
    const DEFAULT_DB_LOCALE = 'ISO-8859-7';
    const DEFAULT_PAGE_LOCALE = 'UTF-8';

    const READING_FROM_DB = TRUE;
    const WRITING_TO_DB = FALSE;

    var $databaseLocale;
    var $webpageLocale;
    var $Model;

    function setup(&amp;$model, $settings=array())
    {
        $this-&gt;Model = $model;

        $this-&gt;databaseLocale = isset($settings['databaseLocale']) ?
                                    $settings['databaseLocale'] :
                                    self::DEFAULT_DB_LOCALE;
        $this-&gt;webpageLocale = isset($settings['webpageLocale']) ?
                                    $settings['webpageLocale'] :
                                    self::DEFAULT_PAGE_LOCALE;
    }

    /**
     * Change the query where clause to the datbase native character set.
     */
    function beforeFind( &amp;$queryData, $queryParams)
    {
        if (!isset( $queryParams['conditions']))
            return $queryParams;

        $queryParams['conditions'] = $this-&gt;recodeRecordArray(
                                                        $queryParams['conditions'],
                                                        self::WRITING_TO_DB);
        return $queryParams;
    }

    /**
     * Convert fetched data from single byte to utf-8
     */
    function afterFind(&amp;$model, $results, $primary)
    {
        return $this-&gt;recodeRecordArray($results, self::READING_FROM_DB);
    }

    /**
     * Convert data to be saved into the database speciffic locale
     */
    function beforeSave()
    {
        $this-&gt;Model-&gt;data = $this-&gt;recodeRecordArray( $this-&gt;Model-&gt;data,
                                                       self::WRITING_TO_DB);
        return true;
    }

    /**
     * Recursively traverse and convert the encoding of the array passed
     * as parameter.
     */
    function recodeRecordArray(&amp;$recordArray, $loading = TRUE)
    {
        foreach( $recordArray as $key =&gt; $value)
            if (is_array($value))
                $recordArray[$key] = $this-&gt;recodeRecordArray($value, $loading);
            else {
                if (is_numeric($value))
                    continue;
                $recordArray[$key] = $loading ?
                                    mb_convert_encoding(
                                                $value,
                                                $this-&gt;webpageLocale,
                                                $this-&gt;databaseLocale)
                                    :
                                    mb_convert_encoding(
                                                $value,
                                                $this-&gt;databaseLocale,
                                                $this-&gt;webpageLocale);
            }
        return $recordArray;
    }
}
?&gt;

&lt;/pre&gt;
&lt;p&gt;
Once we have this in place, using the new behavior in one of our models is as simple as setting the correct value of the &lt;code&gt;$actAs&lt;/code&gt; variable. Here is a simple example of a model using the Character set convention and validation.
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;?php
    class Task extends AppModel {
        var $name = 'Task';
        var $actsAs = array(
                    'CharsetConverter' =&gt; array(
                                            'databaseLocale' =&gt; 'ISO-8859-7',
                                            'webpageLocale' =&gt; 'UTF-8'
                                        )
                    );
        var $validate = array(
                    'title' =&gt; array(
                                'rule' =&gt; 'notEmpty',
                                'message' =&gt; 'Task title cannot be left blank'
                    )
                );
    }
?&gt;
&lt;/pre&gt;
&lt;p class="note"&gt;
Almost all applications contain more than one model. Perhaps the best place to put the &lt;code&gt;$actAs&lt;/code&gt; definition would be the &lt;code&gt;AppModel&lt;/code&gt; class defined in the file &lt;code&gt;app_model.php&lt;/code&gt; in the root of your app directory 
&lt;br/&gt;&lt;br/&gt;
I also understand that writing a behavior to accomplish the job of the database driver is not the best solution. Since I have nothing better for the moment, I guess I will have to start every new CakePHP project by first changing my &lt;code&gt;app_model.php&lt;/code&gt; file.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1593131721631548361?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1593131721631548361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1593131721631548361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1593131721631548361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1593131721631548361'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/12/cakephp-behavior-for-acessing-non-utf.html' title='CakePHP: A behavior for acessing non UTF Oracle databases'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4090332114206230218</id><published>2009-12-01T12:47:00.025+02:00</published><updated>2010-01-22T10:56:19.332+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='SAPRFC'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>How to set up the SAPRFC extension for PHP on CentOS 5</title><content type='html'>&lt;h2&gt;SAPRFC&lt;/h2&gt;
&lt;p&gt;
&lt;a href="http://saprfc.sourceforge.net/" tagret="_blank title=" visit="" the="" projects=""&gt;SAPRFC&lt;/a&gt; is an extension module for PHP 4 and 5, that makes it possible to call ABAP function modules running on a SAP R/3 system from PHP scripts.
&lt;/p&gt;
&lt;p&gt;
I always wanted to test how SAP's remote function calls work together with PHP and since I am already evaluating &lt;a href="http://www.cakephp.org" target="_blank"&gt;CakePHP&lt;/a&gt; as our next development platform, I decided that the occasion was right to give it a try.
&lt;/p&gt;
&lt;p&gt;
Next thing I did was to get my hands on &lt;a href="http://www.amazon.com/SAP-Developers-Guide-PHP/dp/1592290663/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1259665626&amp;amp;sr=8-1" target="_blank"&gt;The SAP Developer's Guide to PHP&lt;/a&gt; book by Craig S. Cmehil, which is an $85 cost and 98 page long  (indexes included) tutorial on how to set up and use SAPRFC for PHP. Unfortunately the second chapter that discusses setting up your development system focuses mainly on Windows, so this post will contain the steps I took to set up SAPRFC for PHP on my x86_64 CentOS 5.4 server.
&lt;/p&gt;

&lt;h2&gt;Package Requirements and Downloads&lt;/h2&gt;
&lt;p&gt;To get the latest PHP packages for Enterprise Linux I have used Remi's repository.
&lt;/p&gt;
&lt;pre&gt;
# wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
&lt;/pre&gt;
&lt;p class="note"&gt;
Remi's packages depend on the EPEL repository, so I am posting the installation procedure for EPEL as well. (if you haven't installed
it yet, now will be a good time to do so.)
&lt;/p&gt;
&lt;p&gt;
In addition to any other PHP packages that your application requires, in order for the SAPRFC to compile correctly, you will also require the &lt;code&gt;php-devel&lt;/code&gt; package.
&lt;/p&gt;
&lt;p&gt;
Next thing is the SAPRFC package itself. The method to install it will be to build the saprfc extension as a dynamic module without rebuilding PHP. (Remi has already done that for us.) The package itself can be downloaded from &lt;a target="_blank" href="http://saprfc.sourceforge.net/"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Continue by installing &lt;strong&gt;SAP's Non Unicode RFC SDK&lt;/strong&gt; version &lt;strong&gt;6.20&lt;/strong&gt; or &lt;strong&gt;6.40&lt;/strong&gt;. This must be downloaded directly from the &lt;a target="_blank"  href="http://service.sap.com/support"&gt;SAP Service Support Portal&lt;/a&gt;. You will need a customer SAP support ID
&lt;/p&gt;
&lt;p class="note"&gt;
Be advised however, that SAP has implemented some form of a DNS transparent cluster for their WEB service, so each time you log in there,  you end up accessing a server with a different DNS name (something like https://websmp104.sap-ag.de/support). That means that your browser will not be able to store your credentials because every time you attempt to connect to https://service.sap.com/support, the DNS name changes so it pops up a dialog asking for login data again and again... Perhaps this is SAP's way of implementing the &lt;em&gt;ultimate&lt;/em&gt; security system but, as far as I can say it is very annoying.
&lt;/p&gt;
&lt;p&gt;
Anyway, once you are there select &lt;em&gt;"Download"&lt;/em&gt; from the top menu. Next click &lt;em&gt;"Search on all categories"&lt;/em&gt; from the left menu and enter &lt;code&gt;RFC SDK&lt;/code&gt; on the search box that appears. You will be given the chance to select SAP RFC SDK 6.40 from the results page. &lt;strong&gt;Be careful not to choose the UNICODE version.&lt;/strong&gt; Select Linux on x86_64 64bit from the list of architectures and you will end up with an SAR file in your download basket. Now you can download it 
&lt;/p&gt;
&lt;p&gt;
There is one more problem though. The file you download is of type SAR. meaning SAP Archive. In order to unpack it you will need SAPCAR, SAP's unpacking program. You download this the same way you downloaded RFCSDK -- just type SAPCAR on the search box. Only thing is that the Linux x86_64 version does not run on CentOS. You will need to download a Windows version, unpack the archive on a Windows machine and then upload it again on you Linux system. At least that is what I had to do. (From what I was able to understand SAP's SAPCAR for Linux is compiled to run under SuSE, so if you have satch a machine, you can try unpacking the archive over there...)
&lt;/p&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;
So now let's assume that you have placed SAP's RFC SDK under &lt;code&gt;/opt/SAP/rfcsdk&lt;/code&gt; and SAPRFC extention module for PHP under &lt;code&gt;/usr/src/saprfc-1.4.1/&lt;/code&gt;. Type the following commands on your shell prompt 
or add them at the end of your startup file. (I put them in &lt;code&gt;/etc/profile&lt;/code&gt;.)
&lt;pre&gt;
# SAP RFC SDK
export SAPRFC_DIR=/opt/SAP/rfcsdk/
export PATH=$SAPRFC_DIR/bin:$PATH
&lt;/pre&gt;
&lt;p&gt;
If necessary, log out and back in again. Now move to the SAPRFC extension for PHP directory and issue the &lt;code&gt;phpize&lt;/code&gt; command. This will create the &lt;code&gt;configure&lt;/code&gt; script that needs to be run next. After configure completes, run &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;make install&lt;/code&gt; (as root) to finish installation. When everything finishes the file &lt;code&gt;saprfc.so&lt;/code&gt; will be placed in your &lt;code&gt;/usr/lib64/php/modules&lt;/code&gt; folder. 
Open you &lt;code&gt;php.ini&lt;/code&gt; file located in &lt;code&gt;/etc&lt;/code&gt; and add a line line 
&lt;/p&gt;
&lt;pre&gt;
extension=saprfc.so
&lt;/pre&gt;
&lt;p&gt;
in the Dynamic Extensions section, save it, restart http server and you are ready to go.
&lt;pre&gt;
[root@barbara ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
&lt;/pre&gt;
&lt;h2&gt;Verification and testing&lt;/h2&gt;
&lt;p&gt;
The very first check will be as simple as looking at the &lt;strong&gt;saprfc&lt;/strong&gt; section of your &lt;code&gt;phpinfo()&lt;/code&gt; page. You should be seeing something like :
&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SxjiYmFVRPI/AAAAAAAAAOo/e7ac7D0eX9Y/s1600-h/Screenshot.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SxjiYmFVRPI/AAAAAAAAAOo/e7ac7D0eX9Y/s400/Screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5411323864453301490" /&gt;&lt;/a&gt;
&lt;p&gt;
The next thing will be to write an actual program that does something more practical like connecting to an SAP R/3 system and fetching back some useful data. Since this already a rather lengthy post, I will prepare and provide a test program some time later.
&lt;/p&gt;
&lt;p class = "note"&gt;
One last comment: It took me a while to figure that out. All examples that come along with the SAPRFC module for PHP, as well as the examples on the "SAP Developer's Guide to PHP" book, use &lt;code&gt;&amp;lt;?&lt;/code&gt; instead of &lt;code&gt;&amp;lt;?php&lt;/code&gt; to introduce php code. This is going to give you a lot of trouble when attempting to use these files with php 5.3.1 so before trying anything else, go to the files in the installation directory -- especially &lt;code&gt;saprfc.php&lt;/code&gt; that you will always include -- and perform the necessary changes.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4090332114206230218?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4090332114206230218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4090332114206230218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4090332114206230218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4090332114206230218'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/12/how-to-set-up-saprfc-extension-for-php.html' title='How to set up the SAPRFC extension for PHP on CentOS 5'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CFT56hwlD5g/SxjiYmFVRPI/AAAAAAAAAOo/e7ac7D0eX9Y/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8181565457061297190</id><published>2009-11-27T16:30:00.005+02:00</published><updated>2009-12-03T09:35:51.558+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='etc'/><title type='text'>Enterprise class hardware for Enterprise class software</title><content type='html'>&lt;p&gt;
We wanted to set up a portable LAMP server for a home project we are playing with and there it is : 
&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/Sw_iowEagfI/AAAAAAAAAOY/aOOOZpEEqpc/s1600/trimmed.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 254px;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/Sw_iowEagfI/AAAAAAAAAOY/aOOOZpEEqpc/s320/trimmed.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5408790867221316082" /&gt;&lt;/a&gt;
Since the little monster uses two SD cards as hard drives, it takes around four minutes to boot, but once it does boot, then its 900MHz Celeron CPU with its 1GB of RAM can stand up against a multi-threaded Java program gathering information from the local Ethernet and a complete Apache, PHP and MySQL server accessed for reporting.
&lt;/p&gt;
&lt;p&gt;
Only thing is that the book is almost three times thicker than the machine.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8181565457061297190?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8181565457061297190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8181565457061297190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8181565457061297190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8181565457061297190'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/11/enterprise-class-hardware-for.html' title='Enterprise class hardware for Enterprise class software'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_CFT56hwlD5g/Sw_iowEagfI/AAAAAAAAAOY/aOOOZpEEqpc/s72-c/trimmed.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4024212604676250136</id><published>2009-11-26T10:27:00.013+02:00</published><updated>2009-11-26T12:36:20.275+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP-Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>SAP: All the little text tables</title><content type='html'>&lt;p&gt;
Even after 5 years of tampering with ABAP, I still have problems getting used to the way SAP name their production tables. All those four letter German abbreviated names are &lt;em&gt;explanatory&lt;/em&gt; enough to scare away any newcomer. Even the English descriptive texts that SAP provides along with each object are so Spartan, that I very seldom can make any good use out of them. 
&lt;/p&gt;
&lt;p&gt;
Luckily enough, I have just the right person available who seems to know all the four -- or five -- letter permutations that yield SAP table and field identifiers. (Thanks again Marilena), so today I am going to steal a few of her knowledge and give us code fragments that show how to get descriptive texts for various material and production related key's like material names, groups, blocking statuses, MRP controllers, etc.
&lt;/p&gt;
&lt;p&gt;
We will start with the names of &lt;strong&gt;storage locations&lt;/strong&gt;. The field and the data type for those are named &lt;code&gt;lgode&lt;/code&gt;. The table that stores related info is &lt;code&gt;t001l&lt;/code&gt;.
&lt;/p&gt;
&lt;pre&gt;
   DATA :
     storage_location TYPE lgort_d, 
     storage_location_name TYPE lgobe.

    " storage_location = '...'.
    SELECT SINGLE lgobe
      INTO storage_location_name
      FROM t001l
      WHERE lgort = storage_location.
&lt;/pre&gt;
&lt;p&gt;
The next one is easy. Even I know by heart how to get the &lt;strong&gt;material description&lt;/strong&gt; given the material number, but I will put it down anyway. The thing to mention however, is that most SAP text tables are language dependent, so to get the text for the key, you also need to specify the language
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      material TYPE matnr,
      material_descr TYPE maktx.

    " material = '...'.
    SELECT SINGLE maktx
      INTO material_descr
      FROM makt
      WHERE matnr = material
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;Material types&lt;/strong&gt; are stored in table &lt;code&gt;t134t&lt;/code&gt; which is also language dependent.
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      material_type TYPE mtart,
      material_type_descr TYPE mtbez.

    " material_type = '...'.
    SELECT SINGLE mtbez
      INTO material_type_descr
      FROM t134t
      WHERE mtart = material_type
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
Our next table is &lt;code&gt;t141t&lt;/code&gt;, that stores the various texts for the &lt;strong&gt;material blocking statuses&lt;/strong&gt;.
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      mat_blocking_status TYPE mstae,
      mat_blocking_status_descr TYPE mstb.

 " Material blocking status descriptions
    SELECT SINGLE mtstb
      INTO mat_blocking_status_descr
      FROM t141t
      WHERE mmsta = mat_blocking_status
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
We wil now move to the inspiringly named &lt;code&gt;t023t&lt;/code&gt; table, that provides access to the short and long names of &lt;strong&gt;material groups&lt;/strong&gt;. 
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      material_group TYPE matkl,
      mat_group_short_descr type wgbez,
      mat_group_long_descr TYPE wgbez60.
    
    " material_group = "...".
    SELECT SINGLE wgbez wgbez60
      INTO (mat_group_short_descr, mat_group_long_descr)
      FROM t023t
      WHERE matkl = material_group
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;Product hierarchy descriptions&lt;/strong&gt; are found in in  &lt;code&gt;t179t&lt;/code&gt;.
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      mat_hierarchy TYPE prodh_d,
      mat_hierarchy_descr TYPE vtext.

    " mat_hierarchy = '...'.
    SELECT SINGLE vtext
      INTO mat_hierarchy_descr
      FROM t179t
      WHERE prodh = mat_hierarchy
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
Table &lt;code&gt;t438t&lt;/code&gt; stores &lt;strong&gt;MRP type&lt;/strong&gt; descriptions.
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      mrp_type TYPE dismm,
      mrp_type_descr TYPE disbez.

    SELECT SINGLE dibez
      INTO mrp_type_descr
      FROM t438t
      WHERE dismm = mrp_type
        AND spras = sy-langu.
&lt;/pre&gt;
&lt;p&gt;
Last table for today's post will be &lt;code&gt;t024d&lt;/code&gt;. this one contains MRP Controller descriptions and is not language but plant organized.
&lt;/p&gt;
&lt;pre&gt;
    DATA :
      plant TYPE werks_d,
      mrp_controller type idspo,
      mrp_controller_descr TYPE disnam.

    SELECT SINGLE dsnam
      FROM t024d
      INTO mrp_controller_descr
      WHERE dispo = mrp_controller
        AND werks = plant.
&lt;/pre&gt;
&lt;p&gt;
... and that is enough for one day.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4024212604676250136?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4024212604676250136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4024212604676250136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4024212604676250136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4024212604676250136'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/11/sap-all-little-text-tables.html' title='SAP: All the little text tables'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2538694828731126543</id><published>2009-11-12T10:40:00.009+02:00</published><updated>2010-01-05T16:56:13.559+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CakePHP'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>The CakePHP manual in PDF</title><content type='html'>&lt;p&gt;
if anybody wants a PDF version of the entire CakePHP manual as it appears in &lt;a herf="http://book.cakephp.org/" target="_blnak"&gt;http://book.cakephp.org/&lt;/a&gt;, the book is available from
&lt;a href="http://docs.google.com/fileview?id=0B6KLBoL1nvwLMmRmMjVmZTYtZTVhMC00Y2RlLTlmNDItYzQ4NGI2Mjg3N2U4&amp;hl=en_GB" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I created this document by copying and pasting text from the book website into an OpenOffice text document, because I wanted to have something to print and browse like a normal book. I have also added a few Oracle specific instructions. It is therefore possible, that some things may have slipped me. I will try and change this document every time I find an error or add a correction. Please feel free to post any mistakes you may find.
&lt;/p&gt;
&lt;p&gt;
Last uploading: January 5-2010
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2538694828731126543?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2538694828731126543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2538694828731126543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2538694828731126543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2538694828731126543'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/11/cakephp-manual-in-pdf.html' title='The CakePHP manual in PDF'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4992397180172693446</id><published>2009-10-31T20:51:00.008+02:00</published><updated>2011-08-20T14:55:14.633+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>How to split a music file when given the corresponding .cue file.</title><content type='html'>&lt;p&gt;
This is the second time I needed to do this, so instead of &lt;em&gt;googling&lt;/em&gt; again, I thought that I may post it here for future reference .....
&lt;/p&gt;

&lt;p&gt;
Thanks to &lt;em&gt;fl_bulgarelli&lt;/em&gt; from the Fedora Forum here is a small &lt;q lang=el xml:lang="en"&gt;how to&lt;/q&gt;, when somebody gives you a complete album encoded in flac and a the corresponding .cue file, while what you want is to be able to split the album into smaller music files corresponding to the songs.
&lt;/p&gt;

&lt;p&gt;
The magic command is: &lt;code&gt;cuebreakpoints album.cue | shnsplit -o flac album.flac&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
More details about how to set this up, can be found &lt;a target="_blank" href="http://forums.fedoraforum.org/showthread.php?t=163578"&gt;here&lt;/a&gt;. For the shake of completeness I will add that as of this writing (August 20th 2011) both the cuetools and shntool packages are available from the main fedora repository, so a simple &lt;code&gt; yum install shntool cuetools&lt;/code&gt;, will work just fine.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4992397180172693446?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4992397180172693446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4992397180172693446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4992397180172693446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4992397180172693446'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/10/how-to-split-music-file-givena-cue-file.html' title='How to split a music file when given the corresponding .cue file.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8545459558794414090</id><published>2009-09-29T08:17:00.006+02:00</published><updated>2009-12-09T11:09:56.215+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Fedora: Using and authenticating yum through a proxy</title><content type='html'>&lt;p&gt;
I have just finished a Fedora 11 installation here at the office. We needed a test bed for working with &lt;a href="http://www.symfony-project.org"&gt;symfony&lt;/a&gt; and our EL machines did not provide php 5.2.
&lt;/p&gt;
&lt;p&gt;
Next thing was to update the new machine and install additional software and that meant being able to go through a squid proxy server, that requires authentication.
&lt;/p&gt;
&lt;p&gt;
A little bit of digging and the &lt;em&gt;magic&lt;/em&gt; &lt;code&gt;man yum.conf&lt;/code&gt; revealed the following :
&lt;/p&gt;
&lt;p&gt;Edit /etc/yum.conf and add the following lines:&lt;/p&gt;
&lt;pre&gt;
proxy=http://proxy.domain.local:port
proxy_username=your_user_name
proxy_password=your_password
&lt;/pre&gt;
&lt;p&gt;
Needless to say that the same configuration works perfectly on CentOS 5.4 ...
&lt;/p&gt;
&lt;p class="note"&gt;
When your machine is behind a proxy then, in order for many other programs -- like wget -- to function correctly,  you also need to export the &lt;code&gt;http_proxy&lt;/code&gt; variable. The correct format for it is : &lt;br/&gt;&lt;br/&gt;
&lt;code&gt;export http_proxy=http://username:password@proxy.domain:port&lt;/code&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8545459558794414090?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8545459558794414090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8545459558794414090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8545459558794414090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8545459558794414090'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/09/fedora-using-and-authenticating-yum.html' title='Fedora: Using and authenticating yum through a proxy'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1233737509105568288</id><published>2009-09-11T08:22:00.005+02:00</published><updated>2009-09-11T09:52:54.699+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Javascript : Yet an other email address validator.</title><content type='html'>&lt;p&gt;
I was building a &lt;em&gt;Conduct us&lt;/em&gt; page the other day and run into the need for a JavaScript e-mail validator. I googled around a bit only to discover that the approaches were so many that I didn't know which one to choose.
&lt;/p&gt;
&lt;p&gt;
So, eventually I did what every hard headed person would do, so I sat down amd wrote my own &lt;code&gt;validateEmail&lt;/code&gt; function.  The code is a merge of ideas coming from the fifth edition of Tom Mergino's and Dori Smith's &lt;a href="http://www.amazon.com/JavaScript-World-Wide-Web-Fifth/dp/032119439X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1252651324&amp;sr=8-1" target="_blank"&gt;JavaScript for the World Wide Web&lt;/a&gt;, and Anita Sudhakar's apprach from &lt;a href="http://www.smartwebby.com/DHTML/email_validation.asp" target="_blank"&gt;SmartWebby&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The resulted code looks like the following :
&lt;/p&gt;
&lt;pre&gt;
function validateMail(str)
{
  var at = "@";
  var dot = ".";
  var atPos = str.indexOf(at);    // position of '@' in the string
  var stringLength = str.length;  // position of '.' after the '@'
  var dotPos = str.indexOf(dot, atPos);
  var invalidChars = "~`/!#$%^&amp;*()+={}[];:";
  var i;
  var badChar;

  // Step 1 Do not allow blank emails
  if ( str == "")
    return false;

  // Step 2 Make sure that the address does not contain invalid characters
  for (i = 0; i &lt; invalidChars.length; i++) {
    badChar = invalidChars.charAt(i);
    if (str.indexOf( badChar) &gt; -1)
      return false;
  }

  // Step 3: Make sure that the @ character is present and
  // that is not the first or the last character of the
  // email address string.
  if (atPos == -1 || atPos == 0 || atPos == stringLength)
     return false;

  // Step 4: Likewise make sure that a dot character exists and that
  // the distance between the @ and . is at least two characters apart
  if (dotPos == -1 || dotPos + 3 &gt; stringLength)
      return false;

  // we have passed all tests let's hope that the email is valid
  return true;
}
&lt;/pre&gt;
&lt;p&gt;
The function should be called from an other function that will retrieve that value of an email filed and test it during form submit. A typical usage would be :
&lt;/p&gt;
&lt;pre&gt;

function validateEmailField( fieldID)
{
  var emailField = document.getElementById( eMailFieldID);
  var status = false;

  if (validateMail(emailField.value))
    status = true;
  else
    alert('Invalid email!');
  
  return status;
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1233737509105568288?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1233737509105568288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1233737509105568288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1233737509105568288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1233737509105568288'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/09/javascript-yet-other-email-address.html' title='Javascript : Yet an other email address validator.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8395160291937921939</id><published>2009-09-04T14:20:00.004+02:00</published><updated>2009-09-05T09:10:24.327+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Windows: The ultimate way to get rid of stuck print jobs.</title><content type='html'>&lt;p&gt;
Sometimes print jobs get stuck for good. Users try to delete them and then the entire queue gets stuck too. I have many times tried to find a remedy for that and even attempted to reboot the Windows server in question without always achieving the desired result. Lately, my eyes were opened by a friend who showed me they way by following the steps shown below.
&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;Stop the Print Spooler service.&lt;/li&gt;
&lt;li&gt;Delete all files from &lt;code&gt;%SystemRoot%\system32\spool\PRINTERS/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Start the Print Spooler Service again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
... and that does it.
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8395160291937921939?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8395160291937921939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8395160291937921939' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8395160291937921939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8395160291937921939'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/09/windows-ultimate-way-to-get-rid-of.html' title='Windows: The ultimate way to get rid of stuck print jobs.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-6922890445639189055</id><published>2009-09-02T08:08:00.005+02:00</published><updated>2009-09-02T10:22:43.149+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Windows: Shutting down machines remotely</title><content type='html'>&lt;p&gt;
I have many times heard people complain about Windows machines freezing or being very slow to respond. The problem sometimes is so bad that not even the desktop user is able to close &lt;em&gt;frozen&lt;/em&gt; applications or even shutdown her own machine. The remedy for 99% of all these cases, thank you Microsoft, -- as &lt;a href="http://www.minasi.com/"&gt;Mark Minasi&lt;/a&gt; would have said -- is the notorious &lt;strong&gt;&lt;code&gt;shutdown&lt;/code&gt;&lt;/strong&gt; command.
&lt;/p&gt;
&lt;p&gt;
This posting will contain a brief overview of the command syntax. This command has been around since the days of Windows NT4  but Microsoft has changed it and now in Windows 2003 environments the arguments are not the same
&lt;/p&gt;
&lt;p&gt;
So, to begin with the oldest version for those of us still stuck with NT4, the syntax for this platform is like this
&lt;p&gt;
&lt;pre&gt;
shutdown \\machine_name /r /t:10 "Machine is going down in 10 seconds" /y /c
&lt;/pre&gt;
&lt;p&gt;
You can also use the &lt;strong&gt;/l&lt;/strong&gt; switch to force a local shutdown. The &lt;strong&gt;/c&lt;/strong&gt;, shown above, is very useful since it forces all running applications to close. The -t:N will display a message notifying the user that their machine is going down in N seconds. Here you can also provide an additional string explaining the reasons for the reboot, enclosed in double quotes.  Finally if you forget the &lt;strong&gt;/r&lt;/strong&gt; then the machine will just shutdown and then you 'll have to walk over there and power it down -- remember, this is NT4 we 're talking about --  and then up yourself. If after all you change your mind and you decide that the machine does not need to reboot, then -- if there is still enough time left --  use the command &lt;code&gt;shutdown \\machine_name /A&lt;/code&gt; to abort the shutdown process.
&lt;/p&gt;
&lt;p&gt;
Now with Windows 2003 the shutdown command has changed quite a bit. The equivalant command to shutdown a remote system now looks like this:
&lt;/p&gt;
&lt;pre&gt;
shutdown /r /m \\machine_name /t 10 /f /c "Machine is going down in 10 seconds"
&lt;/pre&gt;
&lt;p&gt;
The order of the arguments is significant. The /r switch can be replaced with &lt;strong&gt;/s&lt;/strong&gt; to shutdown or &lt;strong&gt;/a&lt;/strong&gt; to abort a shutdown in progress. The &lt;strong&gt;/t&lt;/strong&gt; and the time interval are now separated by a space instead of a column ':' character. The &lt;strong&gt;/c&lt;/strong&gt; switch now introduces the message for the shutdown reason and finally &lt;strong&gt;/f&lt;/strong&gt; is now used to force closing of all running applications.
&lt;/p&gt;
&lt;p&gt;
Shutdown for Windows 2003 has also an additional &lt;strong&gt;/d [p:]xx:yy&lt;/strong&gt; switch that allows you to specify a coded reason for the shutdown, in exactly the same way you do when shutting down a Windows 2003 server via the GUI. The shutdown help screen provides detailed code listings about the meaning of each code. I never use them from the command line, so my most often issued command looks like this :
&lt;/p&gt;
&lt;pre&gt;
shutdown /r /m \\pc-bakalidis /t 0 /f 
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-6922890445639189055?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/6922890445639189055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=6922890445639189055' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6922890445639189055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6922890445639189055'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/09/windows-shutting-down-machines-remotely.html' title='Windows: Shutting down machines remotely'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-897610086248588185</id><published>2009-09-01T09:12:00.005+02:00</published><updated>2009-09-01T09:31:08.304+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>CentOS: Problems updating python</title><content type='html'>&lt;p&gt;
I have been running into the same problem while trying to update my 5.3 CentOS machine. 
&lt;/p&gt;
&lt;p&gt;
Yum reported three packages that needed update :
&lt;/p&gt;
&lt;pre&gt;
 java-1.6.0-openjdk     x86_64     1:1.6.0.0-1.2.b09.el5      updates      27 M
 libxml2-python         x86_64     2.6.26-2.1.2.8             updates     713 k
 python                 x86_64     2.4.3-24.el5_3.6           updates     5.9 M
&lt;/pre&gt;
&lt;p&gt;
When &lt;code&gt;yum update&lt;/code&gt; was issued however, the same error message kept popping up.
&lt;/p&gt;
&lt;pre&gt;
--&gt; Missing Dependency: /usr/lib64/python2.4 is needed by package
libxslt-python-1.1.17-2.el5_2.2.x86_64 (installed)
&lt;/pre&gt;
&lt;p&gt;
I tried disabling almost all my repositories, I removed many packages, almost ended up un-installing half my entire and then I googled on it. As always,, the answer was right there in front of me. &lt;a href="http://www.linux-archive.org/centos/352695-yum-update-problems-python-x86_64-centos-5-3-a.html" target="_blank"&gt;Frank Cox&lt;/a&gt; wrote on the CentOS mailing list:
&lt;pre&gt;
yum clean all
yum update
&lt;/pre&gt;
&lt;p&gt;
And that works. Thank you Frank.
&lt;/p&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-897610086248588185?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/897610086248588185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=897610086248588185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/897610086248588185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/897610086248588185'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/09/centos-problems-updating-python.html' title='CentOS: Problems updating python'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3435422568135091767</id><published>2009-06-12T09:18:00.003+02:00</published><updated>2009-09-21T13:58:33.051+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash scripts'/><title type='text'>Linux: Safely deleting .rpmnew files</title><content type='html'>&lt;p&gt;
Just got on my hands on the new Fedora 11 today. I have to admit that I didn't get a chance to explore all the &lt;a title="Fedora 11 release notes" href="http://docs.fedoraproject.org/release-notes/f11/en-US/"&gt;new&lt;/a&gt; things that Leonidas has brought along. 
&lt;/p&gt;
&lt;p&gt;
For starters, the feature that amazed me was the preupgrade script that magically downloaded everything, installed it and even changed my repos to point to correct ones for Fedora 11. And when I say repos, I do not mean only the basic ones, but also livna and RPM Fusion.
&lt;/p&gt;
&lt;p&gt;
So the next thing that I had in my mind was to check all the .rpmnew files installed in my system and determine what was needed, so I started doing a search with a command like &lt;code&gt;find / -name *.rpmnew -print&lt;/code&gt;, I ended up using diff and deleting the .rpmnew file that was identical to the original.
&lt;/p&gt;
&lt;p&gt;
After comparing /usr/share/config/colors/Royal.colors.rpmnew, /usr/share/config/colors/40.colors.rpmnew, /usr/share/config/colors/Web.colors.rpmnew and /usr/share/config/colors/Rainbow.colors.rpmnew with their original versions and deleting all four of them, I decided that a little script could save me quit a lot of trouble. So after a little bit of digging I ended up with the following code:
&lt;/p&gt;
&lt;pre&gt;
#!/bin/bash

# Locate all *.rpmnew files in your system and compares them with the 
# original files without the rpmnew extention. 
# Files are then compared using diff. If their contents are the same, then
# the .rpmnew version is removed.

RPM_NEW_LIST=`find / -name "*.rpmnew" -print 2&gt;/dev/null`

for RPMNEW_FILE in $RPM_NEW_LIST
do
    # Get the file without the .rpmnew extention
    ORIGINAL_FILE=${RPMNEW_FILE%".rpmnew"}
    # Compare it with the original
    DIFFERENT=`diff $RPMNEW_FILE $ORIGINAL_FILE`
    # If diff's answer is not empty ...
    if [ -n "$DIFFERENT" ]; then
        echo "Please examnine files $ORIGINAL_FILE and $RPMNEW_FILE "
    else
        # File is safe to remove
        # rm -f -v $RPMNEW_FILE
        echo "$RPMNEW_FILE file can safely be removed." 
    fi
done
&lt;/pre&gt;

&lt;p&gt;
I run this script as root on both my Fedora and CentOS 5.3 machines The simple version I have here will show you the files that are safe to delete and the files need your attention. If you like, you can uncomment the rm -fv line at the end of the script, but I would strongly advice against it.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Sometimes rpm leaves out .rpmsave files as well so, if you are really into cleaning up your system, it is wise to search for these files also.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3435422568135091767?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3435422568135091767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3435422568135091767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3435422568135091767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3435422568135091767'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/06/linux.html' title='Linux: Safely deleting .rpmnew files'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7703067154692904633</id><published>2009-05-03T19:01:00.006+02:00</published><updated>2009-10-15T11:37:47.792+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='SuSE'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: File containing active DHCP leases</title><content type='html'>&lt;ul&gt;
&lt;li&gt;On &lt;strong&gt;openSUSE&lt;/Strong&gt; systems this is located in &lt;code&gt;/var/lib/dhcp/db/dhcpd.leases&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;On &lt;strong&gt;CentOS&lt;/strong&gt; the leases file is in: &lt;code&gt;/var/lib/dhcpd/dhcpd.leases&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
As soon as I find out what goes on on other systems, I 'll make new entries as needed. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7703067154692904633?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7703067154692904633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7703067154692904633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7703067154692904633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7703067154692904633'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/05/linux-file-containing-active-dhcp.html' title='Linux: File containing active DHCP leases'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7445734462349527144</id><published>2009-04-16T11:50:00.009+02:00</published><updated>2009-04-17T22:07:41.502+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 11g'/><title type='text'>Oracle 11g: Switching to native compilation</title><content type='html'>&lt;p&gt;
One of the most &lt;i&gt;celebrated&lt;/i&gt; features of Oracle 11g is supposed to be the PL/SQL native compilation feature. This allows PL/SQL code to be compiled directly into machine code that is also stored inside the database, thus eliminating the need for an external C complier of DLL loader. 
&lt;/p&gt;
&lt;p&gt;
Sam R. Alapati and Charles Kim in their &lt;a href="http://www.amazon.com/Oracle-Database-11g-Features-Developers/dp/1590599101/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1239877147&amp;sr=8-1" target="__blank"&gt;Oracle Database 11g New Features for DBA's and Developers&lt;/a&gt; book published by APRESS, write that tests performed by Oracle showed an increase in performance of up to 20 times when using native SQL.
&lt;/p&gt;
&lt;p&gt;
There is only one startup parameter that affects the compilation mode of new PL/SQL programs. This parameter is named &lt;code&gt;plsql_code_type&lt;/code&gt; and its value can be either 'NATIVE' or 'INTERPRETED'. So doing an :
&lt;/p&gt; 
&lt;pre&gt;
SQL&gt; alter system set plsql_code_type = 'NATIVE' scope=both;

System altered.

SQL&gt; 
&lt;/pre&gt;
&lt;p&gt; 
... will effect all new PL/SQL programs that will be created or compiled from this point on. Switching the entire database to use native PL/SQL is a bit more complicated and is performed by following these steps :
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt; Shutdown the database.&lt;/li&gt;
&lt;li&gt; Start it up again in upgrade more. (&lt;code&gt;startup upgrade&lt;/code&gt;) &lt;/li&gt;
&lt;li&gt; Run the &lt;code&gt;$ORACLE_HOME/rdbms/admin/dbmsupgnv.sql&lt;/code&gt; script. This will set the execution mode of all database PL/SQL code blocks to native.&lt;/li&gt;
&lt;li&gt; Shutdown the database and start it up again in normal mode. &lt;/li&gt;
&lt;li&gt; Run the &lt;code&gt;$ORACLE_HOME/rdbms/admin/utlrp.sql&lt;/code&gt; script to recompile all invalid PL/SQL code units.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Be advised that the last step may take a considerable amount of time, depending on the number of PL/SQL objects in your database. Oracle provides the following query to test the number of objects left to be compiled.
&lt;/p&gt;
&lt;pre&gt;
SQL&gt;  SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

  COUNT(*)
----------
      2055

SQL&gt; r   
  1*  SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6)

  COUNT(*)
----------
      2005

SQL&gt; r
  1*  SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6)

  COUNT(*)
----------
      1109

SQL&gt;
&lt;/pre&gt;
&lt;/p&gt;
One last thing. The process can be reversed, by following the steps above but instead of running &lt;code&gt;dbmsupgnv.sql&lt;/code&gt;, run the &lt;code&gt;dbmsupgin.sql&lt;/code&gt; also located in &lt;code&gt;$ORACLE_HOME/rdbms/bin&lt;/code&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7445734462349527144?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7445734462349527144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7445734462349527144' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7445734462349527144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7445734462349527144'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/04/oracle-11g-switching-to-native.html' title='Oracle 11g: Switching to native compilation'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7853336038829587317</id><published>2009-04-07T15:13:00.006+02:00</published><updated>2009-04-08T08:51:43.206+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Linux: Getting passed rsync's most notorious error messages and determining whether a shell is interactive or not.</title><content type='html'>&lt;p&gt;
While trying to back up my personal data using &lt;code&gt;rsync -aruvzh --delete  /home/thanassis/jdevhome/ thanassis@192.168.1.68:/home/thanassis/jdevhome&lt;/code&gt; I run into the following error message.
&lt;/p&gt;
&lt;pre&gt;
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(69)
&lt;/pre&gt;
&lt;p&gt;
A little googling and a final look at the rsync manual revealed that :
&lt;/p&gt;
&lt;pre&gt;
&lt;strong&gt;DIAGNOSTICS&lt;/strong&gt;
     rsync occasionally produces error messages that may seem a little cryp-
     tic.  The  one that seems to cause the most confusion is “protocol ver-
     sion mismatch — is your shell clean?”.

     This message is usually caused by your startup scripts or remote  shell
     facility  producing  unwanted garbage on the stream that rsync is using
     for its transport. The way to diagnose this  problem  is  to  run  your
     remote shell like this:

            ssh remotehost /bin/true &gt; out.dat

     then  look  at out.dat. If everything is working correctly then out.dat
     should be a zero length file. If you are getting the above  error  from
     rsync  then  you  will probably find that out.dat contains some text or
     data. Look at the contents and try to work out what  is  producing  it.
     The  most  common cause is incorrectly configured shell startup scripts
     (such as .cshrc or .profile) that contain output  statements  for  non-
     interactive logins.
&lt;/pre&gt;
&lt;p&gt;
Needless to say that fortune was the one to blame. My .bashrc file had the following last statements since the days of SuSE 8.2 and although I am now using a completely different distro, I still refuse to get them out of my startup files.
&lt;/p&gt;
&lt;pre&gt;
# Something to remember the old SuSE days
if [ -x /usr/bin/fortune ] ; then
    echo
    /usr/bin/fortune
    echo
fi
&lt;/pre&gt;
&lt;p&gt;
So, the solution would be to display a fortune cookie only when the current shell is interactive and then it was time for the &lt;a target="__blank" href="http://www.gnu.org/software/bash/manual/bashref.html#Is-this-Shell-Interactive_003f"&gt;Bash Reference Manual&lt;/a&gt; to come to our rescue. Their answers are straightforward : 
&lt;/p&gt;
&lt;blockquote&gt;
To determine within a startup script whether Bash is running interactively or not, examine the variable $PS1; it is unset in non-interactive shells, and set in interactive shells. Thus:
&lt;/blockquote&gt;
&lt;pre&gt;
     if [ -z "$PS1" ]; then
        echo This shell is not interactive
     else
        echo This shell is interactive
     fi
&lt;/pre&gt;
&lt;blockquote&gt;
Alternatively, startup scripts may test the value of the `-' special parameter. It contains i when the shell is interactive. For example:
&lt;/blockquote&gt;
&lt;pre&gt;
     case "$-" in
     *i*)  echo This shell is interactive ;;
     *)    echo This shell is not interactive ;;
     esac
&lt;/pre&gt;
&lt;p&gt;
In my case I wanted to run fortune on interactive shells only. So
again I modified my bashrc file to look like :
&lt;/p&gt;
&lt;pre&gt;
# Display a fortune cookie on interactive logins only
if [ -n "$PS1" ]; then
        # Some people don't like fortune. If you uncomment the following lines,
        # you will have a fortune each time you log in ;-)
        if [ -x /usr/bin/fortune ] ; then
                echo
                /usr/bin/fortune
                echo
        fi
fi

&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt; 
... and that did it.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7853336038829587317?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7853336038829587317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7853336038829587317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7853336038829587317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7853336038829587317'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/04/linux-getting-passed-rsyncs-most.html' title='Linux: Getting passed rsync&apos;s most notorious error messages and determining whether a shell is interactive or not.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7839154373573437830</id><published>2009-03-27T17:04:00.009+02:00</published><updated>2009-03-30T09:05:53.435+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDeveloper'/><title type='text'>JDevelopr 10g to 11g. It's a long way to migration</title><content type='html'>&lt;p&gt;
  Today i tried migrating a simple project from JDeveloper 10g (10.1.3.4) to 11g (11.1.1.0.1) )and the results are mostly disappointing.
&lt;/p&gt;
&lt;p&gt;
A picture is a thousand words.
&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;
 Migration Results
&lt;/caption&gt;
&lt;tr&gt;
  &lt;th colspan="2"&gt;
     Browse Page
  &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SczsN6l486I/AAAAAAAAALk/YEW05k8gdZw/s1600-h/Screenshot-JDev+10g.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SczsN6l486I/AAAAAAAAALk/YEW05k8gdZw/s400/Screenshot-JDev+10g.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317884983828345762" /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/SczsrurXXDI/AAAAAAAAALs/JSCXzjQrLk8/s1600-h/Screenshot-JDev11g.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/SczsrurXXDI/AAAAAAAAALs/JSCXzjQrLk8/s400/Screenshot-JDev11g.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317885496026160178" /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
  &lt;th colspan="2"&gt;
      Search Page
  &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/SdBlWEfZHAI/AAAAAAAAAL0/f7XAkg-5G1I/s1600-h/Search+10g.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/SdBlWEfZHAI/AAAAAAAAAL0/f7XAkg-5G1I/s400/Search+10g.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5318862589761494018" /&gt;&lt;/a&gt;
  &lt;/td&gt;
  &lt;td&gt;
    &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CFT56hwlD5g/SdBllTAl86I/AAAAAAAAAL8/ZnYJe2uU_nc/s1600-h/Screenshot-Search11g.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://1.bp.blogspot.com/_CFT56hwlD5g/SdBllTAl86I/AAAAAAAAAL8/ZnYJe2uU_nc/s400/Screenshot-Search11g.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5318862851356881826" /&gt;&lt;/a&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    This is how the application looks today.
  &lt;/td&gt;
  &lt;td&gt;
    ... and here is how it ended up after migration......
  &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;p&gt;
 Just for the shake of complicity, I have to report the following :
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    Migration finished without any exceptions being thrown at the console. The only warning message that appears when opening the project is :
    &lt;pre&gt;
Mar 30, 2009 9:43:18 AM oracle.jdevimpl.webapp.taglib.JDevTaglibUtils _parseFail
WARNING: Invalid TLD Location, TldUtils parse failed for URL : jar:file:/home/oracle/jdeveloper/mywork/AS400-Materials/ViewController/opt/oracle/Middleware/jdeveloper/jlib/adf-faces-databinding-rt.jar!/META-INF/databinding.tld
    &lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    Although attribute labels are not shown in the search page, the Attribute properties page displays them correctly.
    &lt;br/&gt;
    &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/SdBoM5JeAvI/AAAAAAAAAME/r7-2u3eH268/s1600-h/Screenshot-Edit+Attribute:+Plant.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/SdBoM5JeAvI/AAAAAAAAAME/r7-2u3eH268/s400/Screenshot-Edit+Attribute:+Plant.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5318865730632811250" /&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   The initial JSF navigation diagram, does not display any graphic, despite the fact that I see no error ether on the message window or the console.
   &lt;br/&gt;
   &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SdBr042wKQI/AAAAAAAAAMM/yLnkrmGmnGo/s1600-h/Screenshot.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SdBr042wKQI/AAAAAAAAAMM/yLnkrmGmnGo/s400/Screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5318869716283959554" /&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   I feel like I want to complain to somebody, but I am not sure to whom.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7839154373573437830?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7839154373573437830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7839154373573437830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7839154373573437830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7839154373573437830'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/03/jdevelopr-10g-to-11g-its-long-way-to.html' title='JDevelopr 10g to 11g. It&apos;s a long way to migration'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CFT56hwlD5g/SczsN6l486I/AAAAAAAAALk/YEW05k8gdZw/s72-c/Screenshot-JDev+10g.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1594080915431465672</id><published>2009-03-23T14:16:00.008+02:00</published><updated>2009-03-23T15:52:56.203+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: Mind your labels</title><content type='html'>&lt;p&gt;
I had seen labels used in &lt;code&gt;/etc/fstab&lt;/code&gt; and &lt;code&gt;/boot/grub/grub.conf&lt;/code&gt; but never quite got the hung of them, until I read page 170 of Tammy Fox's &lt;a target="__blank" href="http://www.amazon.com/Red-Enterprise-Linux-Administration-Unleashed/dp/0672328925"&gt;Red Hat Enterprise Linux 5 Administration Unleashed&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
So what I got out of this, was that labels may be listed in place of partitions and while they are not required, they may become useful when a partition number changes, when moving the partition or repartitioning the drive.
&lt;/p&gt;
&lt;p&gt;
The command to use for changing or displaying a partition's label is &lt;strong&gt;&lt;code&gt;e2label&lt;/code&gt;&lt;/strong&gt;. The command must be run as root and the syntax is as simple as :
&lt;/p&gt;
&lt;center&gt;
e2label device [newlabel
&lt;/center&gt;
&lt;p&gt;
This sets label to device and if no label is provided, then the device's label is displayed. 
&lt;/p&gt;
&lt;p&gt;
So far so good. Now the sad story begins when attempting to change the label of an existing partition of an already used drive, especially the one containing /boot.
&lt;/p&gt;
&lt;p&gt;
When that happens remember to update both &lt;strong&gt;/etc/fstab&lt;/strong&gt; and &lt;strong&gt;/boot/grub/grub.conf&lt;/strong&gt;. Otherwise you risk not being able to boot your system next time. The default label used by the Anaconda installer is "\". So let's suppose that for some reason you decide to change this to CentOS-Root, by issuing something like :
&lt;/p&gt;
&lt;pre&gt;
[root@lxbakalidis ~]# e2label /dev/sda1 CentOS-Root
&lt;/pre&gt;
&lt;p&gt;
Next thing to do is check your /etc/fstab file and make sure that an entry like :
&lt;/p&gt;
&lt;pre&gt;
LABEL=CentOS-Root       /                       ext3    defaults        1 1
&lt;/pre&gt;
&lt;p&gt;
is really there and last but not least make sure that grab.conf line that starts your current kernel also references the new label like this:
&lt;/p&gt;
&lt;pre&gt;
title CentOS (2.6.18-92.1.22.el5)
        root (hd1,0)
        kernel /boot/vmlinuz-2.6.18-92.1.22.el5 ro &lt;strong&gt;root=LABEL=CentOS-Root&lt;/strong&gt; rhgb quiet 
        initrd /boot/initrd-2.6.18-92.1.22.el5.img

&lt;/pre&gt;
&lt;p&gt;
Failure to do this right will probably halt your kernel with messages like :
&lt;/p&gt;
&lt;pre&gt;
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
&lt;/pre&gt;
&lt;p&gt;
... and you will probably need a live CD to fix it. For more information refer to the following thread at &lt;a href="http://www.linuxquestions.org/questions/fedora-installation-39/fc6-mount-could-not-find-filesystem-devroot-497332/"&gt;LinuxQustions.org&lt;/a&gt;.
&lt;p&gt;
&lt;p&gt;
PS: Now I am sure that the last fortune cookie I saw  before the crush read something like &lt;q&gt;Good judgement comes from experience, experience comes from bad judgement. &lt;/q&gt; but I was too preoccupied with the coming Friday night joys to take it seriously.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1594080915431465672?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1594080915431465672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1594080915431465672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1594080915431465672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1594080915431465672'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/03/linux-mind-your-labels.html' title='Linux: Mind your labels'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8060861686410311397</id><published>2009-02-13T12:41:00.003+02:00</published><updated>2009-02-13T13:45:43.451+02:00</updated><title type='text'>Linux : Creating virtual disks from .iso files</title><content type='html'>&lt;p&gt;
Just picked this up from the fedora guide and and thought I might put it here for reference.
&lt;/p&gt;
&lt;p&gt;
Suppose you have a .ISO file whose contents you wish to examine or even need to copy some data out of. The &lt;a target="_blank" href="http://www.fedoraguide.info/index.php?title=Main_Page#How_to_Un.2FMount_an_Image_.28iso.29_without_burning_it"&gt;fedora-guide&lt;/a&gt; suggests the following approach.
&lt;/p&gt;
&lt;pre&gt;
mkdir ~/your_disc/
su -c 'mount file.iso ~/your_disc -t iso9660 -o loop'
&lt;/pre&gt;
&lt;p&gt;
then to unmount it 
&lt;/p&gt;
&lt;pre&gt;
su -c 'umount ~/your_disc/'
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8060861686410311397?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8060861686410311397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8060861686410311397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8060861686410311397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8060861686410311397'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/02/linux-creating-virtual-disks-from-iso.html' title='Linux : Creating virtual disks from .iso files'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7655323975010479821</id><published>2009-02-05T20:28:00.003+02:00</published><updated>2009-02-05T20:37:07.579+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RealPlayer'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>RealPlayer for 64 bit Linux</title><content type='html'>&lt;p&gt;
This is quick note to myself as I keep forgetting it.
&lt;/p&gt;
&lt;p&gt;
The location to download latest nightly builds for RealPlayer that includes a x86_64 version for Linux is
&lt;a href="http://forms.helixcommunity.org/helix/builds/?category=realplay-current" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
For x86_64 Linux choose the version tagged &lt;code&gt;linux-2.6-glibc23-amd64&lt;/code&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7655323975010479821?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7655323975010479821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7655323975010479821' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7655323975010479821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7655323975010479821'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/02/realplayer-for-64-bit-linux.html' title='RealPlayer for 64 bit Linux'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4812453622750031523</id><published>2009-01-08T10:45:00.010+02:00</published><updated>2009-02-24T12:04:44.837+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: Getting past the "BIOS doesn't leave a aperture memory hole" error or "How to enable the IOMMU option in the BIOS setup" . Part 2</title><content type='html'>&lt;p&gt;
      After &lt;a href="http://abakalidis.blogspot.com/2009/01/linux-getting-past-bios-doesnt-leave.html"&gt;yesterdays&lt;/a&gt; post regarding the &lt;q xml:lang="en"&gt;BIOS doesn't leave a aperture memory hole&lt;/q&gt; issue, I got a very logical question that I forgot to ask myself as I was too happy to see the error message go away.
    &lt;/p&gt;
    &lt;blockquote&gt;
      &lt;a href="http://www.blogger.com/profile/12132179834912519990"&gt;Quirinius&lt;/a&gt; said:
      &lt;br/&gt;&lt;br/&gt;
      But did that boot option actually give you more memory? Did you check with "free -m"?
    &lt;/blockquote&gt;
    &lt;p&gt;
      So I did a little bit of testing. Here is the output of the free command before the using boot-options on the CentOS machine.
    &lt;/p&gt;
    &lt;hr/&gt;
    &lt;pre&gt;
  total       used       free     shared    buffers     cached
Mem:       4048440     804072    3244368          0      34324     428640
-/+ buffers/cache:     341108    3707332
Swap:      4200988          0    4200988
      
  total       used       free     shared    buffers     cached
Mem:          3953        785       3168          0         33        418
-/+ buffers/cache:        333       3620
Swap:         4102          0       4102
    &lt;/pre&gt;
    &lt;hr/&gt;
    &lt;p&gt;
      and here is after :
    &lt;/p&gt;
    &lt;hr/&gt;
    &lt;pre&gt;
  total       used       free     shared    buffers     cached
Mem:       4048024     553232    3494792          0      30792     336400
-/+ buffers/cache:     186040    3861984
Swap:      4200988          0    4200988
      
  total       used       free     shared    buffers     cached
Mem:          3953        536       3416          0         30        328
-/+ buffers/cache:        177       3775
Swap:         4102          0       4102
    &lt;/pre&gt;
    &lt;hr/&gt;
    &lt;p&gt;
      I have also checked what is happening on my notebook which also has 4GB of RAM memory but unlike the rest of my machines does not have an AMD processor or an Asus Motherboard with Phoenix BIOS and here is what free had to say.
    &lt;/p&gt;
    &lt;hr/&gt;
    &lt;pre&gt;
  total       used       free     shared    buffers     cached
Mem:       4059392     652816    3406576          0      13048     206600
-/+ buffers/cache:     433168    3626224
Swap:      2096472          0    2096472
      
  total       used       free     shared    buffers     cached
Mem:          3964        637       3326          0         12        201
-/+ buffers/cache:        423       3541
Swap:         2047          0       2047
    &lt;/pre&gt;
    &lt;hr/&gt;
    &lt;p&gt;
      Doing a little bit of math shows that ...
    &lt;/p&gt;
    &lt;pre&gt;
      [thanassis@lxbakalidis ~]$ expr 4048024 - 4048440
      -416
    &lt;/pre&gt;
    &lt;p&gt;
      After the boot option is set our memory decreases by 416 bytes and the memory reported by Fedora on a system that does not display the IOMMU error message at all is
    &lt;/p&gt;
    &lt;pre&gt;
      [thanassis@lxbakalidis ~]$ expr 4059392 - 4048440
      10952
    &lt;/pre&gt;
    &lt;p&gt;
      ... bytes bigger. Now I understand that I am comparing results from two different kernel versions, so I performed the same test at home on my AMD/Asus based Fedora box and here are my results..
    &lt;p&gt;
    &lt;hr/&gt;
    &lt;pre&gt;
[thanassis@plouton ~]$ cat fedora-home-before.txt 
             total       used       free     shared    buffers     cached
Mem:       4062232     490440    3571792          0      13816     177132
-/+ buffers/cache:     299492    3762740
Swap:            0          0          0
             total       used       free     shared    buffers     cached
Mem:          3967        479       3488          0         13        172
-/+ buffers/cache:        292       3674
Swap:            0          0          0
[thanassis@plouton ~]$ cat fedora-home-after.txt 
             total       used       free     shared    buffers     cached
Mem:       4061820    1083232    2978588          0      34960     393808
-/+ buffers/cache:     654464    3407356
Swap:            0          0          0
             total       used       free     shared    buffers     cached
Mem:          3966       1055       2910          0         34        384
-/+ buffers/cache:        636       3329
Swap:            0          0          0
[thanassis@plouton ~]$ expr 4061820 - 4062232
-412
[thanassis@plouton ~]$ 
    &lt;/pre&gt;
    &lt;hr/&gt;
&lt;h3&gt;
Addendum
&lt;/h3&gt;
    &lt;p&gt;
     This is only a closing statement to admit that I managed nothing. I tried 
changing my graphics adapter with a new NVIDIA using the new kernel updates and my CentOS machine just froze again. 
    &lt;/p&gt;
    &lt;p&gt;
So I switched everything back, got my 416 bytes back and try to keep an eye on the net and the forums in case I somehow find something to help me this.... :-(
    &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4812453622750031523?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4812453622750031523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4812453622750031523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4812453622750031523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4812453622750031523'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/01/linux-getting-past-bios-doesnt-leave_08.html' title='Linux: Getting past the &quot;BIOS doesn&apos;t leave a aperture memory hole&quot; error or &quot;How to enable the IOMMU option in the BIOS setup&quot; . Part 2'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3308800044366277111</id><published>2009-01-06T19:27:00.019+02:00</published><updated>2009-01-08T10:43:29.557+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Linux: Getting past the "BIOS doesn't leave a aperture memory hole" error or "How to enable the IOMMU option in the BIOS setup" .</title><content type='html'>&lt;p&gt;
This had been a major &lt;i&gt;"To Do"&lt;/i&gt; item for me during the last year and I have tried many times to fix it, but today it seems I got lucky.
&lt;/p&gt;
&lt;p&gt;
I had been seeing this on my CentOS workstation &lt;code&gt;dmesg&lt;/code&gt; output, since the first day I installed it, approximately one year ago.
&lt;/p&gt;
&lt;hr/&gt;
&lt;pre&gt;
Checking aperture...
CPU 0: aperture @ 14000000 size 32 MB
Aperture too small (32 MB)
No AGP bridge found
Your BIOS doesn't leave a aperture memory hole
Please enable the IOMMU option in the BIOS setup
This costs you 64 MB of RAM
&lt;/pre&gt;
&lt;hr/&gt;
&lt;p&gt;
At first I thought it was nothing serious, and I tried to fix my graphics card that would not work with the NVidia provided drivers freezing the entire graphics system each time I would install them and tried to start X. I failed that too and replaced the graphics card with one from ATI. The new card  appeared to work more satisfactory, but it would also hung if I tried to load the custom drivers provided by the vendor.
&lt;/p&gt;
&lt;p&gt;
When I installed Feodra 9 at home, I saw the exact same error message but my GeForce 9600 NVidia appeared to work correctly so I dropped it. Then came Fedora 10  and there we were again. At the same time I began to get tired by the sluggish performance of my CentOS graphics and decided to try once again.
&lt;/p&gt;
&lt;p&gt;
But his time I was lucky : &lt;strong&gt;jbkt23&lt;/strong&gt; provided the solution at the &lt;a href="http://fedoraforum.org/forum/printthread.php?t=186632" target="__blank"&gt;Fedora Forums.&lt;/a&gt; I am only copying it here just to help others who &lt;i&gt;google&lt;/i&gt; for it come up with one much match.
&lt;/p&gt;
&lt;p&gt;
Put it simply, the solution is to add the &lt;strong&gt;&lt;code&gt;
iommu=noaperture&lt;/code&gt;&lt;/strong&gt; kernel boot parameter on your grub.conf file.
&lt;/p&gt;

&lt;p&gt;
In more words, you need to edit the grub configuration file located in &lt;code&gt;/boot/grub/grub.conf&lt;/code&gt; and locate the line that boots the current kernel. On my Fedora system the line looks like this :
&lt;hr/&gt;
&lt;pre&gt;
title Fedora (2.6.27.9-159.fc10.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.27.9-159.fc10.x86_64 ro root=UUID=8a9d59ee-c401-41bf-a4e6-8fdd97
067215 rhgb quiet &lt;strong&gt;iommu=noaperture&lt;/strong&gt;
        initrd /boot/initrd-2.6.27.9-159.fc10.x86_64.img
&lt;/pre&gt;
&lt;hr/&gt;
&lt;p&gt;
All I needed was to add the bolded text at the end of the kernel line. Then a reboot and as MSK61 from the Fedora forum put it: &lt;q&gt;Thanks, jbkt23. Worked like a charm.&lt;/q&gt;
&lt;/p&gt;
&lt;p&gt;
The same solution worked for the CentOS 5.2 machine at work. There is more to it however. After getting rid of the IOMMU error, I tried to enable the 3D driver for my ATI Radeon X1300. At some point it worked. After the first reboot however, things went back to their normal not working state so I had to switch back to the standard driver.
&lt;p&gt;
&lt;p&gt;
Tomorrow I will try an NVidia card that was also not working and see how it goes.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3308800044366277111?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3308800044366277111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3308800044366277111' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3308800044366277111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3308800044366277111'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2009/01/linux-getting-past-bios-doesnt-leave.html' title='Linux: Getting past the &quot;BIOS doesn&apos;t leave a aperture memory hole&quot; error or &quot;How to enable the IOMMU option in the BIOS setup&quot; .'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-457410216429224244</id><published>2008-11-19T11:19:00.010+02:00</published><updated>2009-07-02T18:58:07.813+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='GoogleEarth 4.3'/><title type='text'>GoogleEarth 4.3: How to change the GUI fontsize in Linux</title><content type='html'>&lt;p&gt;
 Just installed GoogleEarth version 4.3 on my CentOS 5.2 machine today.
&lt;/p&gt;
&lt;p&gt;
The installation finished without any errors but the font the GUI started 
with was a complete disaster. It was so small I could not read it. A little
bit of googling revealed the following:
&lt;/p&gt;
&lt;ol type="i"&gt;
&lt;li&gt;
GoogleEarth 4.3 stores it's configuration in the &lt;code&gt;~/.config/Google&lt;/code&gt; directory.
&lt;/li&gt;
&lt;li&gt;
Inside it, the file &lt;code&gt;GoogleEarthPlus.conf&lt;/code&gt; contains a section called &lt;code&gt;[Render]&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
The render section contains attributes for &lt;cpde&gt;GuiFontFamily&lt;/code&gt;
and &lt;code&gt;GuiFontSize&lt;/code&gt;.
Place the right values over there, restart googleearth and that does it.
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Thanks to &lt;a target="__blank" href="http://markmail.org/message/oxie6kdanomwsl4v#query:+page:1+mid:n7sj22q7mrb5765g+state:results"&gt;Santana&lt;/a&gt;
for posting it.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-457410216429224244?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/457410216429224244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=457410216429224244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/457410216429224244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/457410216429224244'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/11/googleearth-43-how-to-change-to-gui.html' title='GoogleEarth 4.3: How to change the GUI fontsize in Linux'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5929943826630030937</id><published>2008-11-11T09:07:00.004+02:00</published><updated>2008-11-11T10:26:18.155+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>JavaScript: Dynamically changing CSS properties of any DOM object</title><content type='html'>&lt;p&gt;
I was trying to create a web album the other day and played around with the &lt;a target="_blank" href="http://gthumb.sourceforge.net/"&gt;gThumb&lt;/a&gt; image program. The program offers various templates that allow you to create web galleries with various different styles and it turned out that for me, the &lt;i&gt;BestFit&lt;/i&gt; template was the best looking of them all.
&lt;/p&gt;

&lt;p&gt;
The interesting part of the story is that when you create a web gallery based on the &lt;i&gt; BestFit&lt;/i&gt; template, you also get a number of JavaScript files containing various programming goodies like the get and set property functions that I am displaying on this post. The copyright of these functions is &lt;q&gt;Copyright (C) 2005-2006 Free Software Foundation, Inc.&lt;/q&gt;, thus my thanks here go to Rennie deGraaf who provided both the template and the opportunity to get access to these functions. 
&lt;/p&gt;
&lt;p&gt; 
So changing the width, height, or display mode of any DOM object found in your web page has never been so simple.
&lt;/p&gt;
&lt;pre&gt;
// set a property to a given value on an object
function setProperty ( obj, prop, val )
{
    if (obj.style.setProperty) // W3C
        obj.style.setProperty(prop, val, null);
    else // MSIE
        eval("obj.style." + prop + " = \"" + val + "\"");
}
 
// gets a style property for an object
function getProperty ( obj, prop )
{
    if (document.defaultView &amp;&amp; 
        document.defaultView.getComputedStyle) {
        var val = document.defaultView.getComputedStyle( obj, 
                    null).getPropertyValue(prop)
        if (val)
            return val;
        else
            return eval("document.defaultView.getComputedStyle(obj,null)." + prop);
    }
    else if (window.getComputedStyle) // Konqueror
        return window.getComputedStyle(obj,null).getPropertyValue(prop);
    else if (obj.currentStyle)        // MSIE
        return eval('obj.currentStyle.' + prop);
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5929943826630030937?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5929943826630030937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5929943826630030937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5929943826630030937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5929943826630030937'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/11/javascript-dynamically-changing-css.html' title='JavaScript: Dynamically changing CSS properties of any DOM object'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4967074665562861179</id><published>2008-10-23T13:04:00.006+02:00</published><updated>2008-10-23T14:50:15.301+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ias10g'/><title type='text'>Oracle IAS 10g 10.1.3.x Mapping j2ee security roles to OID groups</title><content type='html'>&lt;p&gt;
Today I feel like I have touched down the deepest bottom of applied  j2ee. 
&lt;img src="http://www.websmileys.com/sm/sad/568.gif" align="middle"/&gt; I have spend two hours trying to figure out why mapping of j2ee application roles -- defined in &lt;code&gt;`/META-INF/jazn-data.xml&lt;/code&gt; -- to Internet directory groups did not work and all it required was just to restart the OC4J instance. And although I knew the peeps in a Jeep joke, it took me two hours to finally get out and back in again, i.e. do the restart and get over with it.
&lt;/p&gt;
&lt;p&gt;To be honest, I have always wanted to do that simply by matching j2ee roles and OID groups and then use something as simple as my 
&lt;a href="http://abakalidis.blogspot.com/2008/07/oracle-adf-my-simple-userinfo-bean.html"&gt;UserInfo bean&lt;/a&gt; to determine allowed user actions. The truth of the matter is that until today I always gave it up after running into the &lt;strong&gt;403 Forbidden&lt;/strong&gt; reply from Apache popping out after accessing the application..
&lt;/p&gt;
&lt;p&gt;
Anyway, enough with grumbling, my advice to anyone interested in performing the same is: &lt;q&gt;Just when you think you 've finished changing the applications security provider, setting up mappings and deploying the application do a final restart to the instance&lt;/q&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4967074665562861179?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4967074665562861179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4967074665562861179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4967074665562861179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4967074665562861179'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/10/oracle-ias-10g-1013x-mapping-j2ee.html' title='Oracle IAS 10g 10.1.3.x Mapping j2ee security roles to OID groups'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7517492810836244592</id><published>2008-10-15T09:54:00.010+02:00</published><updated>2008-10-16T11:49:40.220+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><title type='text'>Oracle ADF: Verifying Master-Detail relationships and throwing exception on "beforeCommit()" events</title><content type='html'>&lt;p&gt;
I have found no other way to validate master detail hierarchies, than using &lt;code&gt;theEntityImpl.beforeCommit(TransactionEvent transactionEvent)&lt;/code&gt;.
Writing a &lt;code&gt;validateEntity()&lt;/code&gt; function can only prove useful when examining the fields of the current record. There are cases however where you need to verify that the entire tree is correct. Consider for instance a cases where you need to verify that all items included in an order are eligible for seeding to the user's dispatch address. For cases like this you need to examine your data just before committing and the &lt;code&gt;beforeCommit()&lt;/code&gt; does just that.
&lt;/p&gt;
&lt;p&gt;
During before commit you can practically traverse your entire M/D tree using association accessors and verify that everything meets you business rules. 
&lt;/p&gt;
&lt;p&gt;
If anything fails to validate then raising a JboException will prevent the actual commit and the exception error message will appear on your &lt;af:messages&gt; tag in your jspx page. There is however only one small catch:
&lt;/p&gt;
&lt;p&gt;
Unless you modify your application module configuration and set the &lt;code&gt;&lt;strong&gt;jbo.txn.handleafterpostexc&lt;/strong&gt;&lt;/code&gt; to &lt;code&gt;&lt;strong&gt;true&lt;/strong&gt;&lt;/code&gt;, all exceptions thrown inside the afterCommit() method result in a roll-back which completely destroys the data hierarchy just build. As &lt;a href="http://radio.weblogs.com/0118231/2004/02/02.html"&gt;Steve Muench&lt;/a&gt; puts it,
&lt;/p&gt;
&lt;blockquote cite="http://radio.weblogs.com/0118231/2004/02/02.html"&gt;
&lt;p&gt;
When this flag is true, the framework will take an in-memory snapshot of the pending state of the application module, and then use this snapshot to reinstate that same pending state in case any of the beforeCommit() methods fail with an exception. If everything goes successfully with no errors, the in-memory snapshot is not used and will just get garbage collected.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/SPcMZ_W_DAI/AAAAAAAAAIo/cNQ2giamR7A/s1600-h/Screenshot-Oracle+Business+Component+Configuration.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/SPcMZ_W_DAI/AAAAAAAAAIo/cNQ2giamR7A/s400/Screenshot-Oracle+Business+Component+Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5257684730622446594" /&gt;
&lt;/a&gt;
&lt;p&gt;
To change the jbo.txn.handleafterpostexc parameter, right click on your application module inside the application navigator, then select &lt;q&gt;Configurations...&lt;/q&gt; from the pop-up menu, click the &lt;q&gt;Edit&lt;/q&gt; button from the resulting dialog box and you are there.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7517492810836244592?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7517492810836244592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7517492810836244592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7517492810836244592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7517492810836244592'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/10/oracle-adf-verifying-master-detail.html' title='Oracle ADF: Verifying Master-Detail relationships and throwing exception on &quot;beforeCommit()&quot; events'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_CFT56hwlD5g/SPcMZ_W_DAI/AAAAAAAAAIo/cNQ2giamR7A/s72-c/Screenshot-Oracle+Business+Component+Configuration.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8263009012306577444</id><published>2008-08-11T14:24:00.007+02:00</published><updated>2008-08-11T15:04:52.558+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g'/><title type='text'>Oracle Database : Space used in the flash recovery area</title><content type='html'>&lt;p&gt;Here is a small script adopted from the book &lt;a href="http://www.apress.com/book/view/9781590598511" target="_blank"&gt;"RMAN Recipes for Oracle 11g" &lt;/a&gt; by Darl Kuhn, Sam R. Alapati and Arup Nanda. This script when run in from SQL Plus, will display the
amount of used space in the current database flash recovery area.&lt;/p&gt;
&lt;pre&gt;
SET PAGESIZE 66;
SET LINESIZE 80;

REPHEADER PAGE CENTER 'Flash Recovery Area Usage';

COLUMN FILE_TYPE FORMAT a20;
COLUMN FILE_TYPE HEADING 'File Type';

COLUMN USED_MB HEADING 'Used MBytes';
COLUMN USED_MB FORMAT 999999.99;
COLUMN RECLAIMABLE_MB HEADING 'Reclaimable Mbytes';
COLUMN RECLAIMABLE_MB FORMAT 9999999.99;

COLUMN NUMBER_OF_FILES HEADING 'Number of files';

BREAK ON REPORT
COMPUTE SUM LABEL 'Totals:' OF USED_MB RECLAIMABLE_MB ON REPORT;

SELECT
  rau.file_type,
  rfd.space_used * rau.percent_space_used / 1024 / 1024 as USED_MB,
  rfd.space_reclaimable * rau.percent_space_reclaimable / 1024 / 1024 as RECLAIMABLE_MB,
  rau.number_of_files as NUMBER_OF_FILES
FROM
  v$recovery_file_dest rfd, v$flash_recovery_area_usage rau;

&lt;/pre&gt;
&lt;p&gt; Hre is a sample output run against a newly created 11g database&lt;/p&gt;
&lt;pre&gt;
                            Flash Recovery Area Usage

File Type            Used MBytes Reclaimable Mbytes Number of files
-------------------- ----------- ------------------ ---------------
CONTROL FILE              716.17                .00               1
REDO LOG                11649.70                .00               3
ARCHIVED LOG            31957.11             391.11              10
BACKUP PIECE            79272.10                .00               2
IMAGE COPY                   .00                .00               0
FLASHBACK LOG                .00                .00               0
FOREIGN ARCHIVED LOG         .00                .00               0
                     ----------- ------------------
Totals:                123595.09             391.11

&lt;/pre&gt;
&lt;p&gt; The concept is very simple. Oracle provides two views for retrieving information about the flash recovery area. One is the &lt;code&gt;v$recovery_file_dest&lt;/code&gt; that contains information about the flash recovery area associated with the current database. A select * on this view will give us an output like the following :&lt;/p&gt;
&lt;pre&gt;
SQL&gt; select * from v$recovery_file_dest;

NAME
--------------------------------------------------------------------------------
SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
----------- ---------- ----------------- ---------------
/u01/app/oracle/flash_recovery_area
 2147483648 1668797952          93845504              16

&lt;/pre&gt;
&lt;p&gt; This view provides the total number of used and reclaimable bytes from the flash recovery area. The next view named &lt;code&gt;v$flash_recovery_area_usage&lt;/code&gt;, provided percentage information about each type of file that can be stored in the flash recovery area. Doing a select * on this view gives up the following results.&lt;/p&gt;
&lt;pre&gt;
SQL&gt; set linesize 100;
SQL&gt; select * from v$flash_recovery_area_usage

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE                        ,45                         0               1
REDO LOG                           7,32                         0               3
ARCHIVED LOG                      20,08                      4,37              10
BACKUP PIECE                      49,81                         0               2
IMAGE COPY                            0                         0               0
FLASHBACK LOG                         0                         0               0
FOREIGN ARCHIVED LOG                  0                         0               0

&lt;/pre&gt;
&lt;p&gt; ... so the next logical thing in order to get something meaningful out of these is to join them and this is what the initial script does. Since the &lt;code&gt;v$recovery_file_dest&lt;/code&gt; view has only one column, all columns of the &lt;code&gt;v$flash_recovery_area_usage&lt;/code&gt; view refer this hence the no need for a where clause in the script's sql.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8263009012306577444?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8263009012306577444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8263009012306577444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8263009012306577444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8263009012306577444'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/08/oracle-database-space-used-in-flash.html' title='Oracle Database : Space used in the flash recovery area'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4805464034513638167</id><published>2008-07-18T11:52:00.008+02:00</published><updated>2008-07-21T08:18:05.702+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>Oracle ADF/ JSF: Mind your flags!</title><content type='html'>&lt;p&gt;
I do not know why JSF UI elements have a &lt;i&gt;Disabled&lt;/i&gt; property. I mean I would prefer it if they instead offered an &lt;i&gt;Enabled&lt;/i&gt; one. ADF bindings on the other hand have enabled properties, so UI tags usually look this :
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;af:commandButton actionListener="#{bindings.Create.execute}"
                     text="#{res['commands.create']}"
                     &lt;strong&gt;disabled="#{!bindings.Create.enabled}"&lt;/strong&gt;
                     action="addEdit"/&gt;
&lt;/pre&gt;
&lt;p&gt;
How imagine having to wire in the &lt;code&gt;UserInfo&lt;/code&gt; bean, I was &lt;a href="http://abakalidis.blogspot.com/2008/07/oracle-adf-my-simple-userinfo-bean.html"&gt;talking&lt;/a&gt; about the other day. Ideally you would like to have the above Create button enabled when your user is an administrator i.e. &lt;code&gt;#{UserInfo.admin == true}&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; when the Create binding is enabled, meaning &lt;code&gt;#{bindings.Create.enabled == true}&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
Since we now have a Disabled property, this means that the value assigned should be the opposite of &lt;code&gt;#{UserInfo.admin == true &amp;amp;&amp;amp; bindings.Create.enabled == true}&lt;/code&gt;. The EL expression for this is &lt;code&gt;#{!(UserInfo.admin == true &amp;amp;&amp;amp; bindings.Create.enabled == true)}&lt;/code&gt;. Using De Morgan's low we end up with &lt;strong&gt;&lt;code&gt;#{!UserInfo.admin || !bindings.Create.enabled}&lt;/code&gt;&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
I understand that for most people this is more than trivial, but I have to admit that is took me a good while to figure it out. (Does age come at a price or what?) I want to learn by my own mistakes. Therefore I thought I 'd put it down in witting, so I won't run into this again.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4805464034513638167?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4805464034513638167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4805464034513638167' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4805464034513638167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4805464034513638167'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/07/oracle-adf-jsf-mind-your-flags.html' title='Oracle ADF/ JSF: Mind your flags!'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7917411991311742384</id><published>2008-07-15T18:22:00.024+02:00</published><updated>2008-12-11T07:40:51.625+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><title type='text'>Oracle ADF: Viewlink based attributes vs Full Blown Queries</title><content type='html'>&lt;p&gt;
At one time or an other all of us must have dealt with an entity based View object whose SQL statement looked more or less like this :
&lt;/p&gt;
&lt;pre&gt;
SELECT UserInfo.USER_ID,
      UserInfo.USER_NAME,
      UserInfo.FULL_NAME,
      UserInfo.USER_ROLE,
      UserInfo.DEPARTMENT_ID,
      UserInfo.ACTIVE,
      Department.NAME,
      Department.ID
FROM USERS UserInfo, DEPARTMENTS Department
WHERE UserInfo.DEPARTMENT_ID = Department.ID &lt;strong&gt;(+)&lt;/strong&gt;
&lt;/pre&gt;
&lt;p&gt;
This kind of VO may appear easy to create and manage when your schema contains two or three entities but things may end up pretty complicated as the number of associated entities increases. Let me show you the SQL statement of a view object displaying my version of the Service requests view in full detail.
&lt;/p&gt;
&lt;pre&gt;
  SELECT
      ServiceRequest.ID,
      ServiceRequest.REQUEST_DATE,
      TRUNC(REQUEST_DATE) AS SEARCH_DATE,
      ServiceRequest.REQUESTER_FIRST_NAME,
      upper( REQUESTER_FIRST_NAME) AS SEARCH_FIRST_NAME,
      ServiceRequest.REQUESTER_LAST_NAME,
      UPPER( REQUESTER_LAST_NAME) AS SEARCH_LAST_NAME,
      ServiceRequest.REQUESTER_TELEPHONE,
      ServiceRequest.LOCATION_STREET,
      ServiceRequest.LOCATION_NUMBER,
      ServiceRequest.LOCATION_AREA,
      ServiceRequest.LOCATION_ZIP,
      ServiceRequest.LOCATION_CITY,
      ServiceRequest.DEPARTMENT_FOR,
      Department.NAME AS DEPARTMENT_NAME,
      ServiceRequest.ASSIGNED_DATE,
      ServiceRequest.ASSIGNED_TO,
      AssignedTechnician.FULL_NAME AS TECHNICIAN_NAME,
      ServiceRequest.RESOLUTION_COMMENTS,
      ServiceRequest.REQUEST_STATUS,
      Status.NAME AS STATUS_NAME,
      ServiceRequest.PROBLEM_DESCRIPTION,
      AssignedTechnician.USER_ID,
      ServiceRequest.CREATED_BY,
      ServiceRequest.CREATED_ON,
      ServiceRequest.MODIFIED_BY,
      ServiceRequest.MODIFIED_ON,
      ServiceRequest.RESOLVED_ON,
      Department.ID AS ID1,
      Status.STATUS_ID,
      ServiceRequest.TELEPHONE_BY,
      TelephonedOperator.FULL_NAME AS TELEPHONE_OPERATOR_NAME,
      ServiceRequest.TELEPHONE_DATE,
      TelephonedOperator.USER_ID AS USER_ID1
 FROM
   SERVICE_REQUESTS ServiceRequest,
   DEPARTMENTS Department,
   STATUSES Status,
   USERS AssignedTechnician,
   USERS TelephonedOperator
 WHERE 
  (ServiceRequest.DEPARTMENT_FOR = Department.ID &lt;b&gt;(+)&lt;/b&gt;) AND
  (ServiceRequest.REQUEST_STATUS = Status.STATUS_ID) AND
  (ServiceRequest.ASSIGNED_TO = AssignedTechnician.USER_ID(+)) AND
  (ServiceRequest.TELEPHONE_BY = TelephonedOperator.USER_ID(+))
&lt;/pre&gt;
&lt;p&gt;
When dealing with pure entity based view objects -- that is without a custom where clause -- then JDeveloper makes some descent effort in keeping your where clause straight. If you decide to add bind variables however,  then JDeveloper completely looses it and you end up having to manage everything by hand. Where clauses have to be tampered with if you also decide that you need outer left joins and you cannot get away without using the primary keys of all the participating entities and then having to learn how to &lt;a href="http://download.oracle.com/docs/html/B25947_01/bcvoeo003.htm#sthref528"&gt;hide&lt;/a&gt; them.
&lt;/p&gt;
&lt;p&gt;
I am never too happy when dealing with such &lt;i&gt;monsters&lt;/i&gt; but users are always hungry for more and more information. I guess that this why every self respecting SAP table has at least 70 or more columns :-) ....
&lt;/p&gt;
&lt;p&gt;
Anyway the thing that triggered my search for alternatives was the fact that on many occasions the reference fields of multi entity view objects would not update their values correctly especially after edits, until you issued a final commit, thus giving users one more reason to grumble. So instead of using the SQL query mode, I ended up using view link based transient attributes.
&lt;/p&gt;
&lt;p&gt;
The idea is very simple. Create single entity based view objects containing all the relevant information. In our example Users and Departments. Then create a view link between the two and expose accessors to the client. Enable Java code generation for the primary view row. Last create a transient attribute to the source View (Users) that exposes the department name through the view link provided departments row member.
&lt;/p&gt;
&lt;p&gt;
Let's follow the steps in more details....
&lt;/p&gt;
&lt;p&gt;
For starters we can create two view objects &lt;code&gt;UsersFullList&lt;/code&gt; and &lt;code&gt;DepartmentsList&lt;/code&gt; with SQL statements like the following :
&lt;/p&gt;
&lt;pre&gt;
SELECT UserInfo.USER_ID,
      UserInfo.USER_NAME,
      UserInfo.FULL_NAME,
      UserInfo.USER_ROLE,
      UserInfo.DEPARTMENT_ID,
      UserInfo.ACTIVE
FROM USERS UserInfo
&lt;/pre&gt;
&lt;p&gt; ... for the Users View and ... &lt;/p&gt;
&lt;pre&gt;
SELECT Department.ID,
      Department.NAME,
      Department.IS_TECH
FROM DEPARTMENTS Department
&lt;/pre&gt;
&lt;p&gt;...
for the departments. If you do not intend to edit Departments through your application, you may very well create a read only view object. Next we shall create a view link named &lt;code&gt; UserAssignedToDept &lt;/code&gt;. Creating the view link is trivial, so I will  show only you the images where we define the connection ....
&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CFT56hwlD5g/SH4vs7nNZfI/AAAAAAAAAHg/6iy2O1zmd5E/s1600-h/VLDef.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_CFT56hwlD5g/SH4vs7nNZfI/AAAAAAAAAHg/6iy2O1zmd5E/s400/VLDef.png" alt="" id="BLOGGER_PHOTO_ID_5223665066759251442" border="0" /&gt;&lt;/a&gt;
&lt;p&gt; and the view link properties :&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/SH4v5GWm1FI/AAAAAAAAAHo/GUW9UQK3imc/s1600-h/VLProperties.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/SH4v5GWm1FI/AAAAAAAAAHo/GUW9UQK3imc/s400/VLProperties.png" alt="" id="BLOGGER_PHOTO_ID_5223665275800835154" border="0" /&gt;&lt;/a&gt;
&lt;p&gt;
The important thing to remember here is that since the view link cardinality is set to 1 → ∞ the department accessor will be of type &lt;strong&gt;Row&lt;/strong&gt; instead of &lt;strong&gt;RowIterator&lt;/strong&gt;. So if we next edit the UsersFullList view and create a Java class for the view row, then the code for the DepartmentInfo attribute will look exactly like this :
&lt;/p&gt;
&lt;pre&gt;
   /**Gets the associated &lt;code&gt;Row&lt;/code&gt; using master-detail link DepartmentInfo
    */
   public Row getDepartmentInfo()
   {
       return (Row)getAttributeInternal(DEPARTMENTINFO);
   }
&lt;/pre&gt;
&lt;p&gt;
Creating a department name attribute for the the new view is now done by defining a transient attribute to the UsersFullList view
&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SH4yHkMLV3I/AAAAAAAAAHw/yvQTrM6A3_0/s1600-h/NewAttribute.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SH4yHkMLV3I/AAAAAAAAAHw/yvQTrM6A3_0/s400/NewAttribute.png" alt="" id="BLOGGER_PHOTO_ID_5223667723351578482" border="0" /&gt;&lt;/a&gt;
&lt;p&gt;and then providing a getter method that looks like this : &lt;/p&gt;
&lt;pre&gt;
   public String getDepartmentName()
   {
       String deptName;
       try {
           Row deptRow = this.getDepartmentInfo();
           deptName = (String )deptRow.getAttribute("Name");
       } catch (Exception e) {
           deptName = "";
       }
       return deptName;
   }
&lt;/pre&gt;
&lt;p&gt; From the controller's side the view object looks exactly like it would if based on SQL and you don't have to hide the participating entity key attributes.
&lt;/p&gt;
&lt;p&gt;
So is it worth it you might ask. The answer is -- as usually -- yes and no depending on the size of your project the complexity of your view objects and whether or not you prefer tampering with SQL code than Java. As I explained in the beginning of this posting the main advantage of this method is that your reference attributes will always display correctly since they are composed of pointers to the actual data of the view cache instead of cached entries. On the other hand if you project contains two view objects each composed from two entities, going through all that will be like killing a fly with a machine gun.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7917411991311742384?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7917411991311742384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7917411991311742384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7917411991311742384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7917411991311742384'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/07/oracle-adf-viewlink-based-attributes-vs.html' title='Oracle ADF: Viewlink based attributes vs Full Blown Queries'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_CFT56hwlD5g/SH4vs7nNZfI/AAAAAAAAAHg/6iy2O1zmd5E/s72-c/VLDef.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5047895421454467890</id><published>2008-07-11T11:23:00.004+02:00</published><updated>2008-07-18T10:04:09.149+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><title type='text'>Oracle ADF: My simple UserInfo bean class</title><content type='html'>&lt;p&gt;
Some time ago, I posted a link to the JDeveloper forum regarding how to use he &lt;code&gt;isUserInRole()&lt;/code&gt; method of the &lt;code&gt;ExternalContext&lt;/code&gt; class in order to determine whether or not the current application user is assigned a role.
&lt;/p&gt;
&lt;p&gt;
Since I have lost the original post, I am giving to display sample code showing how to reference the function, how to declare the bean in &lt;code&gt;faces-config.xml&lt;/code&gt; and also how to use it.
&lt;/p&gt;
&lt;p&gt;
Let's suppose that you our application has two roles. User and admin. Definitions ofr these roles is included in jazn-data.xml.
&lt;/p&gt;

&lt;pre&gt;
package mycompany.myapplication.view.beans;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

public class UserInfo {
   
    private boolean admin;
    private boolean user;

    public UserInfo()
    {
        FacesContext fc = FacesContext.getCurrentInstance();
        ExternalContext ec = fc.getExternalContext();
        
        user = ec.isUserInRole("user");
        admin = ec.isUserInRole("admin");
    }
    
    public boolean isUser()
    {
        return user;
    }
    
    public boolean isAdmin()
    {
        return admin;
    }
}
&lt;/pre&gt;
&lt;p&gt;
The next step is to define the bean in faces-config.xml
&lt;/p&gt;
&lt;pre&gt;
  &amp;lt;managed-bean&gt;
    &amp;lt;managed-bean-name&gt;UserInfo&amp;lt;/managed-bean-name&gt;
    &amp;lt;managed-bean-class&gt;mycompany.myapplication.view.beans.UserInfo&amp;lt;/managed-bean-class&gt;
    &amp;lt;managed-bean-scope&gt;session&amp;lt;/managed-bean-scope&gt;
  &amp;lt;/managed-bean&gt;
&lt;/pre&gt;
&lt;p&gt;
Finally enabling or disabling a menu item property based on whether the user is an admin, is done like this
&lt;/p&gt;
&lt;pre&gt;
             &amp;ltaf:commandMenuItem text="#{res['menutabs.AdminAction']}"
                                    action="adminAction"
                                    disabled="#{!UserInfo.admin}"/&gt;
&lt;/pre&gt;
&lt;p&gt;
By the same token preventing a page from being display is done like this
&lt;/p&gt;
&lt;pre&gt;
          &amp;lt;af:panelPage title="#{res['pages.pricelist.BasicFees.title']}"
                        rendered="#{UserInfo.admin}"&gt;
&lt;/pre&gt;
&lt;p&gt;
The truth of the matter is that I ended up using all that because I could not succeed in making j2ee security work for my application. Despite Chris Muir's hints on the &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=680163&amp;tstart=0" target="_blank"&gt;JDeveloper forum&lt;/a&gt;, there was no way I could deny access to certain parts of my application, so I ended up enforcing security using my simple UserInfo bean that I hooked into the disabled and rendered properties of menu and panelPage tags of the protected pages like I showed before. 
&lt;/p&gt;
&lt;p&gt;
That way if anyone runs the application by going from the standard path, then he won't be able to access the admin pages and if he calls the pages directly, then he will see nothing.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5047895421454467890?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5047895421454467890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5047895421454467890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5047895421454467890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5047895421454467890'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/07/oracle-adf-my-simple-userinfo-bean.html' title='Oracle ADF: My simple UserInfo bean class'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7679298349286559940</id><published>2008-07-03T13:33:00.019+02:00</published><updated>2008-12-11T07:40:52.339+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLDeveloper'/><title type='text'>Oracl;e SQL Developer: Unable to dubug PL/SQL</title><content type='html'>&lt;p&gt;
I have to thank Brian from Oracle support for this one, but let me first give you the story. 
&lt;/p&gt;
&lt;p&gt;
If you are trying to debug PL/SQL using Oracle SQLDeveloper 1.5.1 and getting an like this :
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/SGy70-NN_aI/AAAAAAAAAGo/bBjA9O4ov-M/s1600-h/error-mesage.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/SGy70-NN_aI/AAAAAAAAAGo/bBjA9O4ov-M/s400/error-mesage.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218752586941595042" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
then you are probably facing one of two options :
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
     You are trying to access you database server from a machine getting
     its address from DHCP. In that case you will need to supply your ip 
     address each time your start a debugging session.
     This is accomplished by checking the &lt;q&gt;Prompt for Debugger 
     Host for Database debugging&lt;/q&gt; checkbox in the Debuger page of the
     preferences dialog as shown in the image below.
     &lt;br/&gt;
     &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/SGy9fGx1VMI/AAAAAAAAAGw/8RgrgDBLLNM/s1600-h/Screenshot-Debuger-Preferences.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/SGy9fGx1VMI/AAAAAAAAAGw/8RgrgDBLLNM/s400/Screenshot-Debuger-Preferences.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218754410308785346" /&gt;&lt;/a&gt; 
  &lt;/li&gt;
  &lt;li&gt;
      The other option is that your machine firewall is blocking access to
      the debugging process between your machine and the DB server. 
      In that case you need to reconfigure SQL Developer to use a speciffic 
      port range and also have the firewall allow traffic through these 
      ports.
      &lt;br/&gt;
      In my case all I had to do was change my debugger preferences 
      so the dialog page looks exactly like this :
      &lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SGzBqNX7hMI/AAAAAAAAAHA/9E7ZTAHCMng/s1600-h/Debugger-Preferences.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SGzBqNX7hMI/AAAAAAAAAHA/9E7ZTAHCMng/s400/Debugger-Preferences.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5218758999104259266" /&gt;&lt;/a&gt;
      &lt;br/&gt;
       and also change my firewall setup to allow access through port 4000.
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
One final comment. When I run into this problem and asked for help, deep inside I was already blaming my unsupported CentOS Linux version. I had already run into the same problem with my openSUSE machine and found no way out. As it turned out the solution was not machine or distro specific but rather platform independent. So next time, I promise to have a little more faith in my &lt;i&gt;own devices&lt;/i&gt;,
&lt;/p&gt;
&lt;p&gt;
Now SQLDeveloper 1.5.1 runs very nicely on both machines at home and at work, and me having regained my trust on the platform, I even run it using the 64 bit 1.6.0_06 JDK. To be honest I haven't seen any real changes in terms of speed, but I tell myself that now I can savour one more taste of the 64 bit glamour. ;-)
&lt;/p&gt;
&lt;p&gt;
Thanks again Brian.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7679298349286559940?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7679298349286559940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7679298349286559940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7679298349286559940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7679298349286559940'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/07/oracle-sql-developer-unable-to-dubug.html' title='Oracl;e SQL Developer: Unable to dubug PL/SQL'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_CFT56hwlD5g/SGy70-NN_aI/AAAAAAAAAGo/bBjA9O4ov-M/s72-c/error-mesage.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2969639154972153095</id><published>2008-07-02T06:59:00.007+02:00</published><updated>2008-07-04T10:38:06.822+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>PHP: Number of rows  from query</title><content type='html'>&lt;p&gt;
The idea comes from the developers of Oracle ADF, I have seen it work on JDeveloper and I thought that I can use it in PHP. The trick here is to place the entire query inside a &lt;code&gt;SELECT count(*) from ($query)&lt;/code&gt; statement.
&lt;/p&gt;
&lt;p&gt;
Once you know what to do implementation is as easy as witting the code below. The only comment is that the function references an already initialized  external &lt;a href="http://gr.php.net/manual/en/class.mysqli.php"&gt;mysqli&lt;/a&gt; class variable that connects to the database, which if you feel like it may also be passed as a function parameter.  
&lt;/p&gt;
&lt;pre&gt;
    /**
      * returns the number of records  of the query passed as parameter 
      */
    function numRecordsOfQuery( $a_query) 
    {
        global $mysqli;

        $count_query = " 
                   SELECT count(*) as TotalLines 
                     FROM ($a_query) MyQuery";
        $result = $mysqli-&gt;query($count_query);
        // echo $count_query;
        $row = $result-&gt;fetch_array( MYSQLI_ASSOC);
        $numRecords = $row['TotalLines'];
        $result-&gt;close();
        
        return $numRecords;
    }
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;Note&lt;/strong&gt; The &lt;code&gt;MyQuery&lt;/code&gt; references is mandatory. MySQL will return an error if the enclosed query is not referenced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2969639154972153095?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2969639154972153095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2969639154972153095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2969639154972153095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2969639154972153095'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/07/php-number-of-rows-from-query.html' title='PHP: Number of rows  from query'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3688185214251671592</id><published>2008-06-18T09:06:00.006+02:00</published><updated>2009-11-04T15:59:27.288+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>CentOS: Manual install of plugins for Mozilla Firefox</title><content type='html'>&lt;p&gt;
This is just a note to myself and everyone else in the same spot. 
&lt;/p&gt;
&lt;h3&gt;Flash Player&lt;/h3&gt;
&lt;p&gt;
Manual installation of the Flash player plugin for a new Firefox installation is done like this :
&lt;/p&gt;
&lt;pre&gt;
[root@lxbakalidis ~]# cd /opt/mozilla/firefox/plugins
[root@lxbakalidis plugins]# ln -sf /usr/lib/flash-plugin/libflashplayer.so 
libflashplayer.so
&lt;/pre&gt; 
&lt;p&gt;
Detailed instructions for installing flash-player from Adobe are available &lt;a href="http://www.adobe.com/products/flashplayer/productinfo/instructions/" target="_blank"&gt;here&lt;/a&gt;.
&lt;h3&gt;Java&lt;/h3&gt;
&lt;p&gt;
The java plugin gets installed by linking libjavaplugin_oji.so located in $JAVA_HOME/jre/plugin/i386/ns7/ in your plugin dir.
&lt;/p&gt;
&lt;h3&gt;Real Player&lt;/h3&gt;
&lt;p&gt;
For real Player the plugin name is &lt;code&gt;nphelix.so&lt;/code&gt; and the plugin location is &lt;code&gt;/opt/RealPlayer//mozilla/&lt;/code&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3688185214251671592?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3688185214251671592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3688185214251671592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3688185214251671592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3688185214251671592'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/06/centos-manual-install-of-flash-player.html' title='CentOS: Manual install of plugins for Mozilla Firefox'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2839253701192944705</id><published>2008-05-30T09:22:00.006+02:00</published><updated>2008-12-11T07:40:52.585+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Oracle ADF: Enriching the actions of a ViewObject</title><content type='html'>&lt;p&gt;
Based on the technique described two posts &lt;a href="http://abakalidis.blogspot.com/2008/05/oracle-adf-view-object-with.html"&gt;back&lt;/a&gt; regarding creation of a custom ViewObject that offers ready to drag actions, I now give you another simple yet very handy function. The &lt;code&gt;showAllRows()&lt;/code&gt; function when added to the &lt;code&gt;AB_BaseViewObject&lt;/code&gt; methods, allows you to create a button in a search page that removes all view criteria and executes the current query, very useful for cases when uses enter lots of view criteria and then need to display the entire contents of the entire row with a single click.
&lt;/p&gt;
&lt;pre&gt;
    public void showAllRows()
    {
        clearViewCriterias();
        executeQuery();
    }
&lt;/pre&gt;
&lt;p&gt;
Remember that in order for the action to appear in the JDeveloper Data Control Palette like in the following picture, 

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/SD_B0bFgW9I/AAAAAAAAAGg/UlM4DhqCwAE/s1600-h/Screenshot-ViewObject.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/SD_B0bFgW9I/AAAAAAAAAGg/UlM4DhqCwAE/s400/Screenshot-ViewObject.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5206092800631790546" /&gt;&lt;/a&gt;

you must include the &lt;code&gt;showAllRows()&lt;/code&gt; function to the view objects client interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2839253701192944705?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2839253701192944705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2839253701192944705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2839253701192944705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2839253701192944705'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/05/oracle-adf-enriching-actions-of.html' title='Oracle ADF: Enriching the actions of a ViewObject'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_CFT56hwlD5g/SD_B0bFgW9I/AAAAAAAAAGg/UlM4DhqCwAE/s72-c/Screenshot-ViewObject.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7611325177662024413</id><published>2008-05-21T08:57:00.009+02:00</published><updated>2008-07-18T10:05:36.412+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Oracle ADF: Duplicating a ViewObject's current row</title><content type='html'>&lt;p&gt;
I wanted to add a &lt;i&gt;Create Like&lt;/i&gt; functionality that would allow a new row to be inserted in a ViewObject then drive the user to an edit page where he or she would make ant changes required for valid insertion of the new row to the database and avoid having to re-enter everything from scratch.
&lt;/p&gt;
&lt;p&gt;
In order to accomplish this I created the following method in the ViewObject's implementation class.
&lt;/p&gt;
&lt;pre&gt;
import oracle.jbo.AttributeDef;
import oracle.jbo.Row;
import oracle.jbo.ReadOnlyAttrException;
import oracle.jbo.TooManyObjectsException;

. . .

    /**
     * create and insert a row similar to the current
     */
    public void createLike()
    {
        // get the current row to dublicate
        Row currentRow = getCurrentRow();
        if (currentRow == null)
            return;
            
        // create new one
        Row newRow = createRow();
        
        // get the attribute values for the current attribute
        Object[] myValues = currentRow.getAttributeValues();
        
        for (int i = 0; i &lt; currentRow.getAttributeCount(); i++)
            try {
                AttributeDef d = getAttributeDef(i);
                    
                if (d.getUpdateableFlag() != AttributeDef.READONLY)                
                    newRow.setAttribute( i, myValues[i]);                
            }    
            catch (ReadOnlyAttrException roe) {
                continue;
            }
            catch (Exception e) {
                // it is almost certain that the primary key will be
                // violated so the user must do something in the 
                // page following execution of the method.
                if (!(e instanceof TooManyObjectsException))
                    System.out.println(e.toString());
            }
            
        insertRow(newRow);        
    }
&lt;/pre&gt;
&lt;p&gt; 
The code works fine and copies the values all columns from the current row 
into a new one except that of the last column that constitutes the primary 
key. That way the user will have to make the appropriate changes to the new record, so it can be inserted correctly.
&lt;/p&gt;
&lt;p&gt;
There are a few points worth mentioning in this apprach
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;
if your view object contains attributes from multiple entity objects then 
the the key attributes of the referenced entities that gets inserted by the framework appear to be updatable -- hence the &lt;code&gt;catch (ReadOnlyAttrException roe)&lt;/code&gt; line. I have brought this to the JDeveloper &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=658043&amp;tstart=30"&gt;forum&lt;/a&gt; but got no suggestions.
&lt;/li&gt;
&lt;li&gt;
Using the above technique requires that you expose the &lt;code&gt;createLike()&lt;/code&gt; method to the ViewObject's client interface. See the &lt;a href="http://abakalidis.blogspot.com/2008/05/oracle-adf-view-object-with.html"&gt;previous&lt;/a&gt; post for details.
&lt;/li&gt;
&lt;li&gt;
The most probable use of this method will be to place a command button into an &amp;lt;af:tableSelectOne&gt; facet in order to drive your users to an edit page with values already set.  On most occasions the edit page will contain a commit button that will perform the final post. My suggestion is to use a backing bean to invoke the commit action like I discuss in a previous article named &lt;a href="http://abakalidis.blogspot.com/2007/11/adfjsf-avoiding-uncought-exeptions.html"&gt;
ADF/JSF Avoiding uncaught exceptions after commit&lt;/a&gt; that will prevent the controller layer to change back to the browse page in case of any errors.
&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7611325177662024413?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7611325177662024413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7611325177662024413' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7611325177662024413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7611325177662024413'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/05/oracle-adf-duplicating-viewobjects.html' title='Oracle ADF: Duplicating a ViewObject&apos;s current row'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2531568001855050543</id><published>2008-05-15T13:11:00.005+02:00</published><updated>2009-03-09T14:11:21.461+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Oracle ADF: A view object with cancelInsert and cancelEdit operations</title><content type='html'>&lt;p&gt;
I have &lt;a href="http://abakalidis.blogspot.com/2007/12/adf-bc-canceling-edits-in-current.html"&gt;already&lt;/a&gt; discussed the problem of providing a &lt;i&gt;cancel&lt;/i&gt; button in an ADF/JSF edit page. Here is an alternative that allows the usage of a base view object that provides both a cancel edit and a cancel insert method.
&lt;/p&gt;
&lt;p&gt;
I have come to believe that this method is the most appealing so here is a brief outline of how to use it :
&lt;/p&gt;
&lt;p&gt;
First create the following class in the queries package of you model application.
&lt;/p&gt;

&lt;pre&gt;
package myapp.model.queries;

import oracle.jbo.Row;
import oracle.jbo.server.ViewObjectImpl;

public class AB_BaseViewObject
    extends ViewObjectImpl {

    public AB_BaseViewObject()
    {
    }
    
    /**
     * Refresh the view obejct's current row from the dataset practically 
     * undoing any changes.
     */
    public void cancelEdits() 
    {
        Row r = getCurrentRow();

        if (r != null) 
            r.refresh( Row.REFRESH_WITH_DB_FORGET_CHANGES);
    }
    
    /**
     * Undo changes and get rid of new rows
     */
    public void cancelInsert()
    {
        clearCache();      
    }
}
&lt;/pre&gt;
&lt;p&gt;
Next create Java Classes that extend the AB_ViewObject for all the view objects that require editing in your project. Publish the cancelXXX() methods on the view interface like in following picture.
&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CFT56hwlD5g/SCwaw-NHPRI/AAAAAAAAAGY/8TdqtkXMQfk/s1600-h/Screenshot-View+Object+Editor:+PricelistBasicFeesList.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_CFT56hwlD5g/SCwaw-NHPRI/AAAAAAAAAGY/8TdqtkXMQfk/s400/Screenshot-View+Object+Editor:+PricelistBasicFeesList.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5200561098340121874" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Finally create buttons on the edit or create pages in the ViewController project that call the methods.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2531568001855050543?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2531568001855050543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2531568001855050543' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2531568001855050543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2531568001855050543'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/05/oracle-adf-view-object-with.html' title='Oracle ADF: A view object with cancelInsert and cancelEdit operations'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_CFT56hwlD5g/SCwaw-NHPRI/AAAAAAAAAGY/8TdqtkXMQfk/s72-c/Screenshot-View+Object+Editor:+PricelistBasicFeesList.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5041743212568564006</id><published>2008-05-14T15:19:00.010+02:00</published><updated>2008-09-02T10:34:04.466+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='amarok'/><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Amarok on CentOS</title><content type='html'>&lt;p&gt;
Today I found the time to compile &lt;a target="_blank" href="http://amarok.kde.org"&gt;amarok&lt;/a&gt; on my x86_64 CentOS 5.1 machine at work. It was a long time since I compiled any version of amarok, thanks to Packman and openSUSE, but it worked. The truth of the matter is that the sound produced by the xine engine is a bit over bassed, still I enjoy very much the amarok experience that I may very well start getting used to it.
&lt;/p&gt;
&lt;p&gt;
Anyway, here are the steps I followed. After installing the amarok sources in &lt;code&gt;/usr/src&lt;/code&gt; I run 
&lt;pre&gt;
[root@lxbakalidis amarok-1.4.9.1]#yum install gcc-c++.x86_64
libstdc++-devel.x86_64 kdelibs-devel.x86_64 alsa-lib-devel.x86_64
zlib-devel.x86_64 taglib-devel.x86_64 ruby-libs.x86_64 ruby.x86_64
xine-lib-devel.x86_64 libXv-devel.x86_64 libXvMC-devel.x86_64
ruby-devel.x86_64 sqlite-devel.x86_64
&lt;/pre&gt;
&lt;p&gt;
Then I did a
&lt;p&gt;
&lt;pre&gt;
[root@lxbakalidis amarok-1.4.9.1]# ./configure --disable-debug
&lt;/pre&gt;
&lt;p&gt;
Finally I run &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;make install&lt;/code&gt; and there I have it.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PS 1:&lt;/strong&gt; Thanks for the tip &lt;a target="_blank" href="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=12234"&gt;bmcl&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;PS 2:&lt;/strong&gt;When compiling on the new CentOS 5.2 you will additionally need package &lt;strong&gt;libutempter-devel&lt;/strong&gt;. A simple ...
&lt;/p&gt;
&lt;pre&gt;
# yum install libutempter-devel
&lt;/pre&gt;
&lt;p&gt; 
... is enough
&lt;/p&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5041743212568564006?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5041743212568564006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5041743212568564006' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5041743212568564006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5041743212568564006'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/05/amarok-on-centsos.html' title='Amarok on CentOS'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2134419005367128854</id><published>2008-04-23T11:39:00.003+02:00</published><updated>2008-04-23T11:51:51.150+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Java: Formatting a Number Using a Custom Format</title><content type='html'>&lt;p&gt;
The example comes form the The &lt;a target="__blank" href="http://exampledepot.com/"&gt;Java Developers Almanac 1.4&lt;/a&gt; and I am adding it here to serve only as a quick reference note.
&lt;/p&gt;

&lt;pre&gt;
    // The &lt;strong&gt;0&lt;/strong&gt; symbol shows a digit or 0 if no digit present
    NumberFormat formatter = new DecimalFormat("000000");
    String s = formatter.format(-1234.567);  // -001235
    // notice that the number was rounded up
    
    // The &lt;strong&gt;#&lt;/strong&gt; symbol shows a digit or nothing if no digit present
    formatter = new DecimalFormat("##");
    s = formatter.format(-1234.567);         // -1235
    s = formatter.format(0);                 // 0
    formatter = new DecimalFormat("##00");
    s = formatter.format(0);                 // 00
    
    
    // The &lt;strong&gt;.&lt;/strong&gt; symbol indicates the decimal point
    formatter = new DecimalFormat(".00");
    s = formatter.format(-.567);             // -.57
    formatter = new DecimalFormat("0.00");
    s = formatter.format(-.567);             // -0.57
    formatter = new DecimalFormat("#.#");
    s = formatter.format(-1234.567);         // -1234.6
    formatter = new DecimalFormat("#.######");
    s = formatter.format(-1234.567);         // -1234.567
    formatter = new DecimalFormat(".######");
    s = formatter.format(-1234.567);         // -1234.567
    formatter = new DecimalFormat("#.000000");
    s = formatter.format(-1234.567);         // -1234.567000
    
    
    // The &lt;strong&gt;,&lt;/strong&gt; symbol is used to group numbers
    formatter = new DecimalFormat("#,###,###");
    s = formatter.format(-1234.567);         // -1,235
    s = formatter.format(-1234567.890);      // -1,234,568
    
    // The &lt;strong&gt;;&lt;/strong&gt; symbol is used to specify an alternate pattern for negative values
    formatter = new DecimalFormat("#;(#)");
    s = formatter.format(-1234.567);         // (1235)
    
    // The &lt;strong&gt;'&lt;/strong&gt; symbol is used to quote literal symbols
    formatter = new DecimalFormat("'#'#");
    s = formatter.format(-1234.567);         // -#1235
    formatter = new DecimalFormat("'abc'#");
    s = formatter.format(-1234.567);         // -abc1235
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2134419005367128854?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2134419005367128854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2134419005367128854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2134419005367128854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2134419005367128854'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/04/java-formatting-number-using-custom.html' title='Java: Formatting a Number Using a Custom Format'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4721069710730824183</id><published>2008-03-20T19:02:00.008+02:00</published><updated>2008-07-04T10:47:01.157+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Oracle ADF Two action listeners in one action</title><content type='html'>&lt;p&gt;
Some time ago, I run into a situation when I wanted to add two action listeners inside a single command element but I realized that this was just not possible. When I asked about that in the JDeveloper forums somebody told me that this could only be accomplished in code, but at that time my knowledge was just not enough
&lt;/p&gt;
&lt;p&gt;
A couple of days ago I run into the same problem. I had a view page that when accessed wanted to know two things:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;First was the &lt;code&gt;${row.rowKeyStr}&lt;/code&gt; of the row to display 
      and ...
  &lt;/li&gt;
  &lt;li&gt;Next a session scope boolean parameter called 
      &lt;code&gt;#{sessionScope.returnHome}&lt;/code&gt; that 
      indicated whether to return the user to the application home page 
      or to another (the search in that case) page. 
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
  To summarize, I ended up with the a button called &lt;q&gt;View record&lt;/q&gt; in
  two different pages both having a navigation case (also called 
  &lt;q&gt;view&lt;/q&gt;) linking to the view record page. in the application JSF 
  diagram.
&lt;/p&gt;

&lt;p&gt;
  On both cases the expression &lt;code&gt;#{row.rowKeyStr}&lt;/code&gt; had to be 
  recorded in the JSF session scope along with a value for the 
  &lt;code&gt;returnHome&lt;/code&gt; flag that had to be true on one occasion 
  and false on the other.. 
&lt;/p&gt;
&lt;p&gt;
  Following is the code I used to perform this. First the base class :
&lt;/p&gt;
&lt;pre&gt;
package myapp.view.backing;

import javax.faces.application.Application;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;

class backing_SRListBase {

    public backing_SRListBase()
    {
    }
    
    public String viewButtonBase_action( boolean returnHome)
    {
        // access the faces context
        FacesContext fc = FacesContext.getCurrentInstance();
        Application app = fc.getApplication();
        
        // on both case row.rowKeyStr points to the current row key
        ValueBinding vbActRowKey = app.createValueBinding("#{row.rowKeyStr}");
        String rowKey = (String )vbActRowKey.getValue(fc);
                
        // in that case we must save that in sessionScope
        ValueBinding vbSessionScopeRowKey = app.createValueBinding("#{sessionScope.rowKey}");
        vbSessionScopeRowKey.setValue( fc, rowKey);
                
        // also save the return home boolean value
        ValueBinding vbReturnHome = app.createValueBinding("#{sessionScope.returnHome}");
        vbReturnHome.setValue( fc, new Boolean( returnHome));
        
        return "view";
    }
}
&lt;/pre&gt;
&lt;p&gt;
Finally, the backing bean for each of the two pages looks like this
&lt;/p&gt;
&lt;pre&gt;
package myapp.view.backing;

public class backing_OpenSRList 
    extends backing_SRListBase {

    public backing_OpenSRList()
    {
    }

    public String viewButton_action()
    {
        return viewButtonBase_action( false);
    }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4721069710730824183?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4721069710730824183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4721069710730824183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4721069710730824183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4721069710730824183'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/03/oracle-adf-two-action-listeners-in-one.html' title='Oracle ADF Two action listeners in one action'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4686821411652924832</id><published>2008-03-07T16:33:00.006+02:00</published><updated>2009-01-30T11:09:51.888+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RedHat-CentOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Firefox 2.0.0.0.x on CentOS 5.1</title><content type='html'>&lt;p&gt;
Thanks to people like Diezel who posted the original &lt;a target="__blank" href="http://www.nixadmins.net/2007/11/22/install-firefox-2-0-0-9-in-centos-5-rhel-5/"&gt;article&lt;/a&gt; on nixadmins.net, we now  know that in order for Firefox 2.0 to run on a CentOS (or Red Hat EL) version 5.1 machine, we need to install &lt;strong&gt;compat-libstdc++-33&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Using yum this is done as easy as entering 
&lt;/p&gt;
&lt;pre&gt;
#yum install compat-libstdc++-33
&lt;/pre&gt;
&lt;p&gt;
s the root user. The rest is trivial.
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4686821411652924832?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4686821411652924832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4686821411652924832' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4686821411652924832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4686821411652924832'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/03/firefox-20-on-centos-51.html' title='Firefox 2.0.0.0.x on CentOS 5.1'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7543584971588596902</id><published>2008-02-29T10:20:00.021+02:00</published><updated>2008-12-11T07:40:53.079+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ias10g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><title type='text'>Deploying Oracle ADF: What did I learn about caching</title><content type='html'>&lt;p&gt;
Our company's production application server is located at a site different than the one we do our development. Whenever we deployed a new application users were always complaining about long response times, but we usually blamed that on the network. When we moved away from jsps and started working with JSF pages things really got out of hand.
&lt;/p&gt;
&lt;p&gt;
Response times took as much as 10 seconds when application pages where accessed via WAN, rising the user complaint level to maximum levels.
&lt;/p&gt;
&lt;p&gt;
Additionally the network link appeared to be utilized below 80% and then application server response times as shown at OC4J administration website where much below 0.045 sec.
&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/R8f03alriRI/AAAAAAAAAF4/o5CFdklKhbw/s1600-h/graph2.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/R8f03alriRI/AAAAAAAAAF4/o5CFdklKhbw/s320/graph2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5172371929925650706" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
First thing we tried was to use Oracle's ADF Cache library as explained in Chapter 23 of the &lt;a href="http://download-uk.oracle.com/docs/pdf/B25947_01.pdf" target="_blank"&gt;ADF Programmers guide for Forms/4GL Developers&lt;/a&gt;, without any success. To be precise the library was indeed incorporated into the application but the server response time was still as long as 9 or 10 seconds.
&lt;/p&gt;
&lt;p&gt;
It was then when we asked for help from Oracle Support. So thanks to Kavintha we learned the following :
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; First thing we learned was that the problem was indeed related to caching. Every JSF page created using Oracle ADF utilizes a Javascript file named &lt;code&gt;Common10_1_3_3_0.js&lt;/code&gt; with a file size of 120 KB. This is an external script referenced at every page. The problem was that this script was never cached so users had to download it every time causing the delays mentioned above. If this file -- and all related page images -- are cached, then the usual size of an ADF/JSF generated HTML code ranges between 1 and 2 KBytes.
&lt;br/&gt;
Enabling full caching options on the Oracle Apache Server can be done by uncommenting the &lt;code&gt;# CacheNegotiatedDocs&lt;/code&gt; line of the &lt;code&gt;httpd.conf&lt;/code&gt; file located in &lt;code&gt;$ORACLE_HOME/Apache/Apache/conf&lt;/code&gt;.
&lt;/li&gt;

&lt;li&gt; Next thing was that if an application is protected by &lt;strong&gt;Single-Sign-On&lt;/strong&gt; then in that case, no matter whether &lt;code&gt;CacheNegotiatedDocs&lt;/code&gt; is commented out or not, Apache will always send &lt;strong&gt;no-cache headers&lt;/strong&gt; practically undoing whatever the Apache configuration or the ADF Faces Cache library do.
&lt;br/&gt;
The way to allow caching for SSO protected applications is to modify &lt;code&gt;mod_osso.conf&lt;/code&gt; located in &lt;code&gt;$ORACLE_HOME/Apache/Apache/conf&lt;/code&gt; so the entry for each application looks like this :
&lt;pre&gt;
        &amp;lt;Location /ProductionDelays&gt;
                OssoSendCacheHeaders off 
                require valid-user
                AuthType Basic
        &amp;lt;/Location&gt;
&lt;/pre&gt;
More information about how to to disable the caching headers sent by SSO is available on Metalink note 226119.1. Also you may have a look at a one of my previous postings regarding using SSO which is available through &lt;a href="http://abakalidis.blogspot.com/2007/05/oracle-ias-10g-1013x-enable-and-using.html" &gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Last thing we learned about this caching business was that when a JSF application is accessed via SSL, then again caching issues still apply. Firefox will disable caching by default whenever the user loads an https:// URL. IE on the other hand does cache SSL pages by default but this setting can change by a policy set by your system administrator. I realize that in this case Firefox uses the safest approach but unfortunately this will produce very poor results if ADF/JSF pages are to be accessed. 
&lt;br/&gt;
Enabling disk caching of SSL pages in Firefox can be done by changing the value of the &lt;strong&gt;browser.cache.disk_cache_ssl&lt;/strong&gt; parameter available from the about:config URL.
&lt;br/&gt;
IE on the other hand has an option called &lt;strong&gt;Do not save encrypted pages to disk&lt;/strong&gt; available in the Security section of the Advanced internet properties tab. If you want IE to cache content from SSL pages this option must be &lt;strong&gt;unchecked&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7543584971588596902?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7543584971588596902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7543584971588596902' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7543584971588596902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7543584971588596902'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/02/oracle-adf-what-did-i-learn-about.html' title='Deploying Oracle ADF: What did I learn about caching'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CFT56hwlD5g/R8f03alriRI/AAAAAAAAAF4/o5CFdklKhbw/s72-c/graph2.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1066878869629777317</id><published>2008-02-27T15:46:00.009+02:00</published><updated>2008-10-30T11:10:47.291+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLDeveloper'/><category scheme='http://www.blogger.com/atom/ns#' term='JDeveloper'/><title type='text'>Changing the JDeveloper IDE font size</title><content type='html'>&lt;p&gt;
If you are like me and wish that the JDeveloper IDE displayed using a bigger font, then thanks to Khaled from Oracle support all you need to do is shut down JDeveloper, and then add a line like the following in the file &lt;code&gt;ide.properties&lt;/code&gt; located in &lt;code&gt;&lt;jdev_home&gt;\jdev\system\oracle.jdeveloper.10.1.3.&lt;b&gt;X&lt;/b&gt;.&lt;b&gt;Y&lt;/b&gt;&lt;/code&gt;.
&lt;/p&gt;
&lt;pre&gt;
Ide.FontSize=14
&lt;/pre&gt;
&lt;p&gt; Finally start JDeveloper and you are done.&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt; The actual X, Y values in the oracle.jdeveloper.10.1.3.X.Y may vary depending on your version of JDeveloper. In 10.1.3.3 X=41 and Y=57, while in 10.1.3.4 X=42 and Y = 70. Anyway the safest approach is to have a look at the Oracle IDE version in the versions tab of the JDev about box as show in the image below. &lt;br/&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CFT56hwlD5g/SKLW_d2IFSI/AAAAAAAAAIg/YKg7Nz-FsqU/s1600-h/Screenshot-About+Oracle+JDeveloper.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_CFT56hwlD5g/SKLW_d2IFSI/AAAAAAAAAIg/YKg7Nz-FsqU/s400/Screenshot-About+Oracle+JDeveloper.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5233982102789690658" /&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Needless to say that the same goes for SQLDeveloper. The only difference is that he file to edit is located in &lt;code&gt;~/.sqldeveloper/system/oracle.sqldeveloper.1.2.1.3213&lt;/code&gt;. If using SQLDeveoper version 1.5 that comes with the new JDev11g look and feel then again the file chek is &lt;code&gt;.sqldeveloper/system1.5.1.54.40/o.sqldeveloper.11.1.1.54.40/ide.properties&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
On Jdeveloper 11g the ide.properties file location is &lt;code&gt;~/.jdeveloper/system11.1.1.0.31.51.56/o.jdeveloper&lt;/code&gt;. Once more the actul path may be determined by looking at the Oracle IDE version from the about box.
&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1066878869629777317?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1066878869629777317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1066878869629777317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1066878869629777317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1066878869629777317'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/02/changing-jdeveloper-ide-font-size.html' title='Changing the JDeveloper IDE font size'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_CFT56hwlD5g/SKLW_d2IFSI/AAAAAAAAAIg/YKg7Nz-FsqU/s72-c/Screenshot-About+Oracle+JDeveloper.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-6190805823472317652</id><published>2008-02-23T20:32:00.002+02:00</published><updated>2008-02-23T20:35:41.015+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g'/><title type='text'>Oracle 11g How to determine the database character set</title><content type='html'>&lt;p&gt;
This is only a quick note for something I keep forgetting. So to determine the oracle database character set use the following simple SQL statement.
&lt;p&gt;

&lt;pre&gt;
   select *
      from v$nls_parameters
      where parameter='NLS_CHARACTERSET'
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-6190805823472317652?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/6190805823472317652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=6190805823472317652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6190805823472317652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6190805823472317652'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/02/oracle-11g-how-to-determine-database.html' title='Oracle 11g How to determine the database character set'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8035491597760844214</id><published>2008-02-11T17:07:00.001+02:00</published><updated>2009-02-11T14:11:22.681+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PL/SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g'/><title type='text'>Oracle 10g Killing open sesions</title><content type='html'>&lt;p&gt;
We have a client program that leaves lots of open sessions. These sessions take up server resources and we wanted to find a way to locate and kill them.
&lt;/p&gt;
&lt;p&gt;
Thanks to Natasa Oikonomidou from &lt;a href="http://www.softworks.gr" target="_blank"&gt;Softworks&lt;/a&gt; who provided the code, I ended up with the following solution:
&lt;/p&gt;
&lt;p&gt;
Create a the following procedure on the &lt;strong&gt;sys&lt;/strong&gt; schema.
&lt;/p&gt;
&lt;pre&gt;
create or replace
PROCEDURE inactive_session_killer
IS
  now DATE;
BEGIN
  now := sysdate;
  FOR rec IN
    (SELECT sid,
       serial#,
       username,
       schemaname,
       osuser,
       terminal,
       machine,
       PROGRAM,
       status,
       type,
       saddr,
       logon_time,
       now - last_call_et / 86400 last_activity
     FROM v$session
     WHERE username = 'XXXXX'   -- user name of open session "leaver"
           AND type = 'USER')
  LOOP

    IF rec.last_activity &lt;( now  - 8 / 24) THEN
      -- inactive for more than 8 hours
      -- you can keep a log table here: inserrt into ...
      EXECUTE IMMEDIATE 'alter system kill session ''' ||  
                                        rec.sid || ',' || 
                                        rec.serial#    || 
                                        ''' immediate';

    END IF;

  END LOOP;
END;
&lt;/pre&gt;
&lt;p&gt;
Using SQLPlus or SQL Developer execute the following
&lt;/p&gt;
&lt;pre&gt;
 
VARIABLE jobno number;
BEGIN
   DBMS_JOB.SUBMIT(:jobno, 'inactive_session_killer;', SYSDATE, 'SYSDATE + 1/24');    -- runs every hour
   commit;
END;
&lt;/pre&gt;
&lt;p&gt; 
... and that does it.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8035491597760844214?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8035491597760844214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8035491597760844214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8035491597760844214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8035491597760844214'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/02/oracle-10g-killing-open-sesions.html' title='Oracle 10g Killing open sesions'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2657095002210578526</id><published>2008-01-23T08:59:00.000+02:00</published><updated>2008-01-24T09:34:35.071+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ias10g'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='OEL'/><title type='text'>Oracle IAS 10g 10.1.3.1 Installation on Enterprise Linux 5</title><content type='html'>&lt;p&gt;
Yesterday I completed my first installation of Oracle SOA Suite 10.1.3.1 on Oracle Enterprise Linux 5. In order to complete the installation I followed Metalink Note:465159.1, which explains the exact procedure.
&lt;/p&gt;
&lt;p&gt;
Now the only tip I can give you, is to make sure that the &lt;code&gt;/etc/hosts&lt;/code&gt; file contains a line that resolves the locally or DNS assigned computer name and domain to the machines network IP address.
&lt;/p&gt;
&lt;p&gt;
My up until now experience has been with SuSE systems only, so on my machine the &lt;code&gt;/etc/hosts/&lt;/code&gt; file always contains a line like
&lt;/p&gt;
&lt;pre&gt;
10.5.1.8 lxbakalidis.shelman.int lxbakalidis
&lt;/pre&gt;
&lt;p&gt;
An OEL installation hosts file only contains 
&lt;/p&gt;
&lt;pre&gt;
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost       lxBakalidis
::1     localhost6.localdomain6 localhost6
&lt;/pre&gt;
&lt;p&gt;
... but this is not enough. The installation completed successfully only after I added the line that resolved the external IP to my computer name. So the final &lt;code&gt;etc/hosts&lt;/code&gt; file looked something like this :
&lt;/p&gt;
&lt;pre&gt;
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost       lxBakalidis
::1     localhost6.localdomain6 localhost6
10.5.1.8 lxbakalidis.shelman.int lxbakalidis
&lt;/pre&gt;
&lt;p&gt;
The symptoms before that were: First OUI was taking a very long time to do the file copy operation and next when at some point installation would complete, then two out of three configuration assistants would fail.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2657095002210578526?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2657095002210578526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2657095002210578526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2657095002210578526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2657095002210578526'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/01/oracle-ias-10g-10131-installation-on.html' title='Oracle IAS 10g 10.1.3.1 Installation on Enterprise Linux 5'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-855340835797371224</id><published>2008-01-11T15:32:00.001+02:00</published><updated>2011-10-06T10:37:13.428+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP-Classification'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP Get the value of a date type characteristic</title><content type='html'>&lt;p&gt;
When an object is classified with characteristics of type date then, using BAPI &lt;code&gt;BAPI_OBJCL_GETCLASSES&lt;/code&gt; these characteristics are returned as numeric. That means that entries for date characteristics are found in the &lt;code&gt;valuesnum &lt;/code&gt; array which --as you remeber from a couple of postings &lt;a href="http://abakalidis.blogspot.com/2008/01/abap-obtaining-characteristics-of.html"&gt; back&lt;/a&gt; -- is defined to be a standard table of &lt;code&gt;bapi1003_alloc_values_num&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
When I first saw this I thought that the actual date value could be acquired by assigning the &lt;code&gt;value_from&lt;/code&gt; part of the returned &lt;code&gt;bapi1003_alloc_values_num&lt;/code&gt; structure to a date variable, but it was not at all like this. The actual value is stored like an integer representing the ABAP internal date fromat which is YYYYMMDD. So an integer value like 20080112 represents January 12th 2008.
&lt;/p&gt;
&lt;p&gt;
In ABAP code this translates as follows
&lt;/p&gt;
&lt;pre&gt;
  DATA :
    temp_int TYPE i,
    temp_date_str(8) TYPE c, 
    my_date TYPE d.

  FIELD-SYMBOLS :
    &lt;fs_num&gt; TYPE bapi1003_alloc_values_num.

      READ TABLE valuesnum
        WITH KEY charact = 'MY_DATE_CHARACT'
        ASSIGNING &lt;fs_num&gt;.

      IF sy-subrc = 0.
        temp_int = &lt;fs_num&gt;-value_from.
        temp_date_str = temp_int.
        my_date = temp_date_str.
      ENDIF.
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-855340835797371224?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/855340835797371224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=855340835797371224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/855340835797371224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/855340835797371224'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/01/abap-get-value-of-date-type.html' title='ABAP Get the value of a date type characteristic'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2143046779724918819</id><published>2008-01-11T10:33:00.000+02:00</published><updated>2008-01-23T09:37:27.923+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Java: Dates/Times and Calendars</title><content type='html'>&lt;p&gt;
The problem that many new Java programmers -- me included -- face when they start dealing with dates and times is : Given a java.util.Date object get month, date and year fields in separate variables. 
&lt;/p&gt;
&lt;p&gt;
The usual misunderstanding here is that the class &lt;code&gt;java.util.Date&lt;/code&gt; is almost deprecated and all things you expect to be able to perform with dates are done using the &lt;code&gt;java.util.Calendar;&lt;/code&gt; class.
&lt;/p&gt;
&lt;p&gt;
Calendar is an abstract class whose javadoc can be found &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html" target="_blank"&gt; here&lt;/a&gt;. The class provides get and set methods that allow you to alter any of the fields that constitute a point in time. The following example demonstrates one way to calculate the date corresponding to the start of the current term, using the Calendar get and set functions. It also shows how to convert a Date to a Calendar and vice versa.
&lt;/p&gt;
&lt;pre&gt;
    private void calStartOfCurrentTerm()
    {
        // create a new Gregorian Calendar
        Calendar c = new GregorianCalendar();
        // you can synchronize a Calendar with a date by using the
        // setTime() method
        c.setTime( new Date());
        
        // once you get a Calendar extracting field information is 
        // as easy as ....
        int month = c.get( Calendar.MONTH);
        int day = c.get(Calendar.DAY_OF_MONTH);
        int year = c.get(Calendar.YEAR);
        
        // let's calculate the date that corresponds to the 
        // start of the current term
        int newMonth;
        
        switch (month) {
        case Calendar.JANUARY:
        case Calendar.FEBRUARY:
        case Calendar.MARCH:
            newMonth = Calendar.JANUARY;
            break;
        case Calendar.APRIL:
        case Calendar.MAY:
        case Calendar.JUNE:
            newMonth = Calendar.JANUARY;
            break;
        case Calendar.JULY:
        case Calendar.AUGUST:
        case Calendar.SEPTEMBER:
            newMonth = Calendar.JULY;
            break;
        default:
            newMonth = Calendar.OCTOBER;
        }
        
        // adjust the calendar to point to the new date
        c.set(Calendar.MONTH, newMonth);
        c.set(Calendar.DAY_OF_MONTH, 1);
        
        // get the information to a new date variable
        Date startOfTerm = c.getTime();
        
        // display results
        System.out.println("Day is " + day +" month is " + month + " year is " + year);
        System.out.println( startOfTerm.toString());
    }
&lt;/pre&gt;
&lt;p&gt;
Here is a slightly different version that returns an object of type &lt;code&gt;oracle.jbo.domain.Date&lt;/code&gt;
&lt;/p&gt;
&lt;pre&gt;
&lt;font color="#336699"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;java&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;sql&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;Timestamp&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

&lt;font color="#336699"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;java&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;util&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
&lt;font color="#336699"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;java&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;util&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;GregorianCalendar&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

&lt;font color="#336699"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;oracle&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;jbo&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;domain&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;Date&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

  &lt;font color="#336699"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Date&lt;/font&gt; &lt;font color="#000000"&gt;getStartOfTerm&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;
  &lt;font color="#000000"&gt;{&lt;/font&gt;
    &lt;font color="#ff8400"&gt;// create a new Gregorian Calendar&lt;/font&gt;
    &lt;font color="#000000"&gt;Calendar&lt;/font&gt; &lt;font color="#000000"&gt;c&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#336699"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;GregorianCalendar&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

    &lt;font color="#ff8400"&gt;// once you get a Calendar extracting field information is &lt;/font&gt;
    &lt;font color="#ff8400"&gt;// as easy as ....&lt;/font&gt;
    &lt;font color="#336699"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;month&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;get&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MONTH&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

    &lt;font color="#ff8400"&gt;// let's calculate the date that corresponds to the &lt;/font&gt;
    &lt;font color="#ff8400"&gt;// start of the current term&lt;/font&gt;
    &lt;font color="#336699"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;newMonth&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;

    &lt;font color="#336699"&gt;&lt;b&gt;switch&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;month&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JANUARY&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;FEBRUARY&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MARCH&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
        &lt;font color="#000000"&gt;newMonth&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JANUARY&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
        &lt;font color="#336699"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;APRIL&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MAY&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JUNE&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
        &lt;font color="#000000"&gt;newMonth&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JANUARY&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
        &lt;font color="#336699"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JULY&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;AUGUST&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;case&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;SEPTEMBER&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
        &lt;font color="#000000"&gt;newMonth&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;JULY&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
        &lt;font color="#336699"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
      &lt;font color="#336699"&gt;&lt;b&gt;default&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt;
        &lt;font color="#000000"&gt;newMonth&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;OCTOBER&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;}&lt;/font&gt;

    &lt;font color="#ff8400"&gt;// adjust the calendar to point to the new date&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MONTH&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#000000"&gt;newMonth&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;DAY_OF_MONTH&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#006600"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;HOUR_OF_DAY&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#006600"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MINUTE&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#006600"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;SECOND&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#006600"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;set&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Calendar&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;MILLISECOND&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#006600"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    
    &lt;font color="#ff8400"&gt;// get the information to a new date variable&lt;/font&gt;
    &lt;font color="#000000"&gt;java&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;util&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;Date&lt;/font&gt; &lt;font color="#000000"&gt;javaDate&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#000000"&gt;c&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;getTime&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#000000"&gt;Timestamp&lt;/font&gt; &lt;font color="#000000"&gt;st&lt;/font&gt; &lt;font color="#000000"&gt;=&lt;/font&gt; &lt;font color="#336699"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Timestamp&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;javaDate&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#000000"&gt;getTime&lt;/font&gt;&lt;font color="#000000"&gt;())&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
    &lt;font color="#336699"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; &lt;font color="#336699"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Date&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;st&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;
  &lt;font color="#000000"&gt;}&lt;/font&gt;
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt;PS:&lt;/strong&gt;. Finally There is one last thing I have to get used to. "Copy as HTML" on JDeveloper 10g, does not work on openSUSE 10.2. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2143046779724918819?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2143046779724918819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2143046779724918819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2143046779724918819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2143046779724918819'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/01/java-datestimes-and-calendars.html' title='Java: Dates/Times and Calendars'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-4303266203117757513</id><published>2008-01-10T09:16:00.003+02:00</published><updated>2011-10-06T10:35:23.146+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP-Classification'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP Obtaining characteristics of a document from the classification system</title><content type='html'>&lt;p&gt;
In addition to a &lt;a href="http://abakalidis.blogspot.com/2007/10/abap-obtaining-objects-characteristics.html"&gt; previous&lt;/a&gt; post regarding getting classification information for objects of type Material or Batch and thanks to additional info and feedback that I received from our MM specialist Ms  Marilena Svolaki, I will be able to provide an example of how to do the same thing with documents. 
&lt;/p&gt;
&lt;p&gt;
Master information about documents is found in the &lt;strong&gt;DRAW&lt;/strong&gt; table. (This is short for German &lt;i&gt;Dokumentinformationssatz&lt;/i&gt;). The key fields for each document are displayed in the following image :
&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/R4XKZthJGuI/AAAAAAAAAFE/84-qc5gvhHY/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/R4XKZthJGuI/AAAAAAAAAFE/84-qc5gvhHY/s400/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5153747891659545314" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Creating the object key for &lt;code&gt;BAPI_OBJCL_GETCLASSES&lt;/code&gt; is performed by concatenating the document type (field DRAW-DOKAR), the document number (field DRAW-DOKNR), the document version (field DRAW-DOKVR) and the document part (field DRAW-DOKTL). In code this can be expressed as follows
&lt;/p&gt;
&lt;pre&gt;
 DATA
    wa_draw TYPE draw, 
    cur_bapi_objectkey LIKE inob-objek,

    class_list TYPE STANDARD TABLE OF bapi1003_alloc_list,
    valueschar TYPE STANDARD TABLE OF bapi1003_alloc_values_char,
    valuescurr TYPE STANDARD TABLE OF bapi1003_alloc_values_curr,
    valuesnum  TYPE STANDARD TABLE OF bapi1003_alloc_values_num,
    return     TYPE STANDARD TABLE OF bapiret2.

*   Make wa_draw somehow correspond to a valid document entry ....     
    CONCATENATE wa_draw-dokar
                wa_draw-doknr
                wa_draw-dokvr
                wa_draw-doktl
                INTO cur_bapi_objectkey.

*   Call BAPI to get the list of characteristics
    CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
    EXPORTING
      objectkey_imp         = cur_bapi_objectkey
      objecttable_imp       = 'DRAW'
      classtype_imp         = '017'
      read_valuations       = 'X'
      keydate               = sy-datum
*     language              = 'E'
    TABLES
      alloclist             = class_list
      allocvalueschar       = valueschar
      allocvaluescurr       = valuescurr
      allocvaluesnum        = valuesnum
      return                = return.

    READ TABLE return INDEX 1 ASSIGNING &amp;lt;ret&gt;.

*   Check that object allocations exist
    IF  sy-subrc = 0 AND
        &amp;lt;ret&gt;-id = 'CL' AND
        &amp;lt;ret&gt;-number = 741.

*      Read characteristic values
       ...
    ENDIF
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-4303266203117757513?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/4303266203117757513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=4303266203117757513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4303266203117757513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/4303266203117757513'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2008/01/abap-obtaining-characteristics-of.html' title='ABAP Obtaining characteristics of a document from the classification system'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_CFT56hwlD5g/R4XKZthJGuI/AAAAAAAAAFE/84-qc5gvhHY/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8126138419368118304</id><published>2007-12-12T13:56:00.000+02:00</published><updated>2007-12-13T09:10:26.498+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PL/SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g'/><title type='text'>Oracle 10g SQL Mass rebuild and move the indexes of a specified user</title><content type='html'>&lt;p&gt;
Here is a function that rebuilds or coalesces the indexes of a specified user.If asked to rebuild the indexes then you can supply a table space to move the rebuild indexes into.
&lt;/p&gt;
&lt;p&gt;
The function takes three parameters :
&lt;ul&gt;
&lt;li&gt;user_name : The name of the user whose indexes are to be updated&lt;/li&gt;
&lt;li&gt;rebuild_type : Ether &lt;strong&gt;C&lt;/strong&gt; or &lt;strong&gt;R&lt;/strong&gt; to indicate Coalesce or Rebuild operation&lt;/li&gt;
&lt;li&gt;tablespace_name : Optional parameter to indicate where to move the indexes in case of rebuild&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The function should be executed by a user with DBA privileges and  this code is as follows
&lt;/p&gt; 
&lt;pre&gt;
create or replace PROCEDURE rebuild_user_indexes( user_name IN VARCHAR2, 
                                rebuild_type IN VARCHAR2, 
                                tablespace_name IN VARCHAR2 DEFAULT NULL) 
AS
  full_index_name VARCHAR2(100);
  index_command VARCHAR2(10);
  sql_str VARCHAR2(100);
  
  total_indexes Integer;
  updated_indexes Integer;
  
  CURSOR get_index_cursor IS
    SELECT index_name, index_type 
    FROM dba_indexes
    WHERE owner = user_name AND
          index_type in ( 
              'BITMAP', 
              'NORMAL', 
              'FUNCTION-BASED NORMAL', 
              'FUNCTION-BASED DOMAIN');
      
BEGIN
  /* check initial parameters */
  IF rebuild_type &lt;&gt; 'R' AND rebuild_type &lt;&gt; 'C' THEN
    raise_application_error( -20999, 'rebuild type should be "C" or "R"');
  ELSIF rebuild_type = 'R' THEN
    index_command := ' Rebuild';
    /* if a rebuild tablespace is also defined */
    IF tablespace_name &lt;&gt; '' THEN
      index_command := index_command || ' tablespace ' || tablespace_name;
    END IF;
  ELSE
    index_command := ' Coalesce';
  END IF;
  
  total_indexes := 0;
  updated_indexes := 0;
  /* get all indexes that belong to the specified user */
  FOR r IN get_index_cursor LOOP
    total_indexes := total_indexes + 1; 
    dbms_output.put_line( total_indexes || ' ' || 
                          r.index_name || ' ' || 
                          r.index_type);

    /* Coalescing works only on normal B-Tree indexes, 
     * while rebuilding works with everything.
     */    
    IF (rebuild_type = 'R') OR 
       (rebuild_type = 'C' AND instr( r.index_type, 'NORMAL') &gt; 0) THEN
      
      full_index_name := user_name || '.' || r.index_name;
      sql_str := 'alter index ' || full_index_name || index_command;
      
      BEGIN
        /* attempt to modify the index */
        EXECUTE IMMEDIATE sql_str;
        updated_indexes := updated_indexes + 1;
      EXCEPTION
        WHEN OTHERS THEN
          /* display the command and the error that occured during index 
           * update 
           */
          dbms_output.put_line( sql_str);
          dbms_output.put_line( sqlcode || ' ' || sqlerrm);
          /* continue working */
          NULL;
      END;
    END IF;
  END LOOP;
    
  /* report results */
  dbms_output.put_line( 'Indexes examined :' || total_indexes);
  dbms_output.put_line( 'Indexes Updated  :' || updated_indexes);
END rebuild_user_indexes; 
&lt;/pre&gt;
&lt;p&gt;
Thanks to SQLDeveloper running the function can is as easy as copying and pasting the following in SQLPlus.
&lt;/p&gt;
&lt;pre&gt;
DECLARE
  USER_NAME VARCHAR2(200);
  REBUILD_TYPE VARCHAR2(200);
  TABLESPACE_NAME VARCHAR2(200);
BEGIN
  USER_NAME := NULL;       -- add your user here, for example 'HR'
  REBUILD_TYPE := NULL;    -- either 'C' or 'R'
  TABLESPACE_NAME := NULL; -- optional new tablespace name if desired

  REBUILD_USER_INDEXES(
    USER_NAME =&gt; USER_NAME,
    REBUILD_TYPE =&gt; REBUILD_TYPE,
    TABLESPACE_NAME =&gt; TABLESPACE_NAME
  );
END;
&lt;/pre&gt;
&lt;h3&gt;Note&lt;/h3&gt;
&lt;p&gt;
The above code provides a very simplistic approach to index rebuilding as it rebuilds all indexes of a user. In order to determine the indexes in your database that would really benefit from rebuilding you need to run the script available from Oracle Metalink &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:3957424067768460582::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,122008.1,1,0,1,helvetica" target="_blank"&gt;Note:122008.1&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8126138419368118304?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8126138419368118304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8126138419368118304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8126138419368118304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8126138419368118304'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/12/oracle-10g-sql-massive-rebuild-and-move.html' title='Oracle 10g SQL Mass rebuild and move the indexes of a specified user'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5066586349116446408</id><published>2007-12-11T18:15:00.001+02:00</published><updated>2008-12-11T07:40:53.587+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDeveloper'/><title type='text'>JDeveloper OC4J Changing the language that eror messages are displayed</title><content type='html'>&lt;p&gt;
I have had this problem many times. During development when something went wrong with my application, all I could get after the Internal server error would be JBO:XXXX error code with numerous question marks instead of the actual error message.
&lt;/p&gt;
&lt;p&gt;
Some people advised me to change the preferred language/locale of my WEB browser and make it English, so as to force the display of error messages in this language, but that didn't work either.
&lt;/p&gt;
&lt;p&gt;
Today I found a remedy. Open the project properties Go to Run/Debug click edit and add &lt;code&gt;-Duser.language=en -Duser.country=US&lt;/code&gt; in the java command line options, like I show you in the following pciture
&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/R1656QVGAVI/AAAAAAAAAEM/NOJi59UEs3s/s1600-h/project_properties.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/R1656QVGAVI/AAAAAAAAAEM/NOJi59UEs3s/s320/project_properties.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5142752234970677586" /&gt;&lt;/a&gt;
&lt;p&gt;
... and that does it.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5066586349116446408?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5066586349116446408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5066586349116446408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5066586349116446408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5066586349116446408'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/12/jdeveloper-oc4j-changing-language-that.html' title='JDeveloper OC4J Changing the language that eror messages are displayed'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_CFT56hwlD5g/R1656QVGAVI/AAAAAAAAAEM/NOJi59UEs3s/s72-c/project_properties.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8036705678838413505</id><published>2007-12-06T14:11:00.000+02:00</published><updated>2007-12-07T09:24:52.511+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><title type='text'>ADF BC Canceling edits in the current record of a ViewObject</title><content type='html'>&lt;p&gt;
The number of things that one man misses becomes frightening especially when something is as crucial as a cancel edits button in a record display form.
&lt;/p&gt;
&lt;p&gt;
Up until now I have been using a Rollback action binding to cancel any edits. Of course that was also casing current record information to be lost, so I had to rely on Steve Muench's &lt;a taget="_blank" href="http://otn.oracle.com/products/jdev/tips/muench/restorecurrencyonrollback/RestoreCurrentRowAfterRollback.zip"&gt;Restore Current Row After Rollback&lt;/a&gt; from his &lt;a target="_blank" href="http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html"  &gt;Not Yet Documented ADF Sample Applications&lt;/a&gt; in order to keep my data in sync..
&lt;/p&gt;
&lt;p&gt;
Revelation came as I as was browsing for the 9999th time the 10.1.3.1 version of the &lt;a target="_blank" href="http://www.oracle.com/technology/obe/ADFBC_tutorial_1013/10131/index.htm"&gt;Tutorial for Forms/4GL Developers.&lt;/a&gt; The &lt;i&gt;magic&lt;/i&gt; function that makes a view record refresh and forget any changes is as simple as that.
&lt;/p&gt;
&lt;pre&gt;
public void cancelEditsToCurrentServiceRequest() {
    getServiceRequestMain().getCurrentRow().refresh( 
                            Row.REFRESH_WITH_DB_FORGET_CHANGES);
}
&lt;/pre&gt;
&lt;p&gt;
Shame on me! 
&lt;/p&gt;
&lt;p&gt;
On second thought Muench's approach is more centric and may come in handy especially if a program has many view objects through which users enter data. Of course writing cancelEdits functions is clearer but has to be done for every view object that we require to use. The choice is still ours.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8036705678838413505?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8036705678838413505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8036705678838413505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8036705678838413505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8036705678838413505'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/12/adf-bc-canceling-edits-in-current.html' title='ADF BC Canceling edits in the current record of a ViewObject'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5518830604381876617</id><published>2007-11-29T14:04:00.000+02:00</published><updated>2007-12-04T12:06:19.173+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>ADF-BC/JSF Performing case insensitive searches</title><content type='html'>&lt;p&gt;
I have been asked to implement a service request system that will allow a company to record service requests from customer via a telephone line. The difference with oracle's SRDemo application is that in my case SR's will be entered by telephone operators and be assigned to departments and not to technicians 
&lt;/p&gt;
&lt;p&gt; 
Anyway the application still offers a SRSearch page that allows telephone operators and managers to filter the service request list and here is where my problem started since they asked me if the QBE system would match parts of the requester first or last name case insensitively.My first reaction was to tell them to enter everything in capital letters, but then I though I might give it a try and ended up like this
&lt;/p&gt;
&lt;p&gt;
first I added two additional fields in my query named SearchFirstName and SearchLastName defined like this
&lt;pre&gt;
  SELECT 
       .....
       ServiceRequest.REQUESTER_FIRST_NAME, 
       UPPER( REQUESTER_FIRST_NAME) AS SEARCH_FIRST_NAME, 
       ServiceRequest.REQUESTER_LAST_NAME, 
       UPPER( REQUESTER_LAST_NAME) AS SEARCH_LAST_NAME, 
       ......
&lt;/pre&gt;
&lt;p&gt;
then changed I used JavaScript in the SRSearch page to make sure that whatever the user enters in the SearchFierstName and SearchLastName fields is converted to upper case before posting.
&lt;/p&gt;
&lt;p&gt;
The javascript file itself is as simple as this 
&lt;/p&gt;
&lt;pre&gt;
/* ---------------------------------------------------------------------------
 * file SRSearchSubmit.js
 * contains code that allows to submit the SRSearch form with the first name
 * and last name fields converted to upercase.
 *
 * Date 03-12-2007
 * ---------------------------------------------------------------------------
 */
 function convert()
 {
    var firstName = document.forms["myADFForm"].elements["myADFForm:searchFirstNameField"].value;
    var lastName =  document.forms["myADFForm"].elements["myADFForm:searchLastNameField"].value;

    document.forms["myADFForm"].elements["myADFForm:searchFirstNameField"].value
      = firstName.toUpperCase();
    document.forms["myADFForm"].elements["myADFForm:searchLastNameField"].value
      = lastName.toUpperCase();

    return true;
 }
&lt;/pre&gt;
&lt;p&gt;
No the two final points. First we need to include the javascript file at the top of the page inside a &amp;lt;f:verbatim&gt; tag. Next in order to get the names of the elements right, we need to set the id attribute of both the &amp;lt;h:form&gt; and the &amp;lt;af:inputText&gt; elements.
&lt;/p&gt;
&lt;p&gt;
The page header part of the resulting JSF page looks like this 
&lt;p&gt;
&lt;pre&gt;
    &amp;lt;afh:html&gt;
      &amp;lt;f:loadBundle basename="SRKomo" var="res"/&gt;
      &amp;lt;afh:head title="#{res['application.title']}"&gt;        
        &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
        &amp;lt;link href="../css/oracle.css" rel="stylesheet" media="screen"/&gt;
        &amp;lt;f:verbatim&gt;
          &amp;lt;script src="../javascript/SRSearchSumbit.js" type="text/javascript"&gt;&amp;lt;/script&gt;
        &amp;lt;/f:verbatim&gt;
      &amp;lt;/afh:head&gt;
      &amp;lt;afh:body&gt;
        &amp;lt;af:messages/&gt;
        &amp;lt;h:form id="myADFForm" onsubmit="convert();"&gt;
        ...
&lt;/pre&gt;
&lt;p&gt;
And the definitions for the each of th two search fields like this
&lt;p&gt;      
&lt;pre&gt;
              &amp;lt;af:panelLabelAndMessage label="#{bindings.AllRequestsListSearchFirstName.label}"&gt;
                &amp;lt;af:inputText value="#{bindings.AllRequestsListSearchFirstName.inputValue}"
                              simple="true"
                              required="#{bindings.AllRequestsListSearchFirstName.mandatory}"
                              columns="#{bindings.AllRequestsListSearchFirstName.displayWidth}"
                              styleClass="searchTextField"
                              id="searchFirstNameField"&gt;
                  &amp;lt;af:validator binding="#{bindings.AllRequestsListSearchFirstName.validator}"/&gt;
                &amp;lt;/af:inputText&gt;
              &amp;lt;/af:panelLabelAndMessage&gt;
&lt;/pre&gt;
&lt;p&gt;
and that did it.
&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt; 
The original info about how to place javascript into a JSF document comes from the Frank Nimphius' Blogbuster article &lt;a href="http://www.orablogs.com/fnimphius/archives/001788.html"&gt;ADF Faces: Submit a form with the Enter key&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
I have found it very easy to understand the HTML produced by the Oracle JSF engine using &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1843"&gt;Firebug&lt;/a&gt;. Especially the "Inspect element" function will locate the HTML code of each eleent you click on and that can save you an awfull lot of decoding trouble.
&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5518830604381876617?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5518830604381876617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5518830604381876617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5518830604381876617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5518830604381876617'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/adfjsf-change-text-alignment-of-table.html' title='ADF-BC/JSF Performing case insensitive searches'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7036477102469231124</id><published>2007-11-28T12:35:00.000+02:00</published><updated>2008-01-31T17:04:46.844+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g'/><title type='text'>Where is the Oracle Database alert log located ?</title><content type='html'>&lt;p&gt;
This is something I keep forgetting so I think that I may as well add it here.
&lt;/p&gt;

&lt;p&gt;
On my Linux system the alert log is located in &lt;strong&gt;$ORACLE_HOME/admin/$ORACLE_SID/bdump&lt;/strong&gt; while the exact same path -- with "\" instead of "/" &lt;a href="http://www.smileygarden.de" target="_bank"&gt;&lt;img src="http://www.smileygarden.de/smilie/Cool/115.gif"&gt;&lt;/a&gt; -- is used for Windows.
&lt;/p&gt;

&lt;p&gt;
The directory where the alert.log found is determined by the &lt;strong&gt;background_dump_dest&lt;/strong&gt; initialization parameter: So the ultimate way to find it is by issuing an SQL command like :
&lt;/p&gt;
&lt;pre&gt;
select value 
    from v$parameter 
    where name = 'background_dump_dest';
&lt;/pre&gt;
&lt;p&gt;
Needless to say that the alert.log's name is &lt;code&gt;alert&lt;SID&gt;.log&lt;/code&gt; and that it is a simple text file that can be opened using any text editor and that you can delete it or shrink it online. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7036477102469231124?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7036477102469231124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7036477102469231124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7036477102469231124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7036477102469231124'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/where-is-oracle-database-alert-log.html' title='Where is the Oracle Database alert log located ?'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1181608362653059624</id><published>2007-11-09T12:03:00.000+02:00</published><updated>2007-11-09T12:15:32.297+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>ADF/JSF Getting the current row with code executed  from a table bucking bean</title><content type='html'>&lt;p&gt;
The following code comes from the JDeveloper Forums courtesy of &lt;a href="http://forums.oracle.com/forums/profile.jspa?userID=11679"&gt;Frank Nimphus&lt;/a&gt;. If added to any event listener fired from "inside" an ADF Table, it prints the row's 1'st attribute and the rowKey. 
&lt;/p&gt;
&lt;pre&gt;
        FacesContext fctx = FacesContext.getCurrentInstance();
        ValueBinding vb = (ValueBinding) fctx.getApplication().createValueBinding("#{row}");
        JUCtrlValueBindingRef rwbinding = (JUCtrlValueBindingRef) vb.getValue(fctx);
        System.out.println("--- Key as String --"+rwbinding.getRow().getKey().toStringFormat(true));
        System.out.println("--- First Attribute ---"+rwbinding.getRow().getAttribute(1));
&lt;/pre&gt;
&lt;p&gt;
Thanks again Frank
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1181608362653059624?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1181608362653059624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1181608362653059624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1181608362653059624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1181608362653059624'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/adfjsf-getting-current-row-with-code.html' title='ADF/JSF Getting the current row with code executed  from a table bucking bean'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7874428661567853482</id><published>2007-11-09T09:11:00.000+02:00</published><updated>2007-11-09T11:20:48.697+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>ADF/JSF Avoiding uncought exeptions after commit.</title><content type='html'>&lt;p&gt;
When using Oracle JDeveloper 10.1.3.x, you can find it very tempting to create "Create/Edit Record" pages by dropping an ADF Form on a blank JSF page and then adding commit and rollback buttons in the place of the ok and cancel buttons with an action property that returns your users to the browse page.
&lt;/p&gt;
&lt;p&gt;
So let's assume that your faces-config file contains a navigation case labeled "return", that leads from you edit page back to your browse page. In cases like these, the code for the commit button will more or less look like this
&lt;/p&gt;
&lt;pre&gt;
                      &amp;lt;af:commandButton 
                                     actionListener="#{bindings.Commit.execute}"
                                     text="Ok" 
                                     action="return"
                                     id="commitButton"
                                     disabled="false"/&gt;
&lt;/pre&gt;
&lt;p&gt;
This approach, presents a very serious hazard, which is a bug in Oracle's JSF implementation. If any exception is thrown after commit, the framework moves to the page designated by the navigation case and the error messages are not being displayed at all.
&lt;/p&gt;
&lt;p&gt;
To make matters worse, you end up with on open transaction and nothing else entered in this manner ever gets stored in your database while you users have no way to realize that something has gone wrong. I had raised an SR for this that ended up in a one off patch (5630740) for JDeveloper 10.1.3.2. 
&lt;/p&gt;
&lt;p&gt;
I run into this problem again in am application that I developed recently using JDeveloper 10.1.3.3. And then it hit me. The solution was as simple as the Egg of Columbus. The only thing that needs to be done is to bind the commit button action in a backing bean. JDeveloper will then change the button tag into something like : 
&lt;/p&gt;
&lt;pre&gt;
                      &amp;lt;af:commandButton 
                                    text="Accept"
                                    id="commitButton"
                                    disabled="false"
                                    action="#{backing_Edit.commitButton_action}"/&gt;
&lt;/pre&gt;
&lt;p&gt;
... create the following code :
&lt;/p&gt;
&lt;pre&gt;
    public String commitButton_action()
    {
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding =
            bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            return null;
        }
        return "return";
    }
&lt;/pre&gt;
&lt;p&gt;
... and that does it. Commit exception messages are displayed correctly and everyone is happy.
&lt;/p&gt;
&lt;p&gt;
In case you have many edit pages with different navigation case labels then you might wish to create a solution that is a little more sophisticated and closer to the OO paradigm. In a case like this I suggest that you create a base class to be the parent of all your page backing beans and add the following method.
&lt;p&gt;
&lt;pre&gt;
public class MyBackingBase
{
    protected String executeCommit( BindingContainer bindings, String successValue)
    {
        OperationBinding commitBinding =
            bindings.getOperationBinding("Commit");
        
        commitBinding.execute();
                
        return commitBinding.getErrors().isEmpty() ? successValue : null;
    }
 }
&lt;/pre&gt;
&lt;p&gt;
Having done that the actual backing bean code could be something as simple as
&lt;/p&gt;
&lt;pre&gt;
    public String commitButton_action()
    {
        return executeCommit( getBindings(), "return");
    }
&lt;/pre&gt;
&lt;p&gt;
... and one more thing. The Copy as HTML function is not available again. I guess I 'll have to start looking why .. :-(
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7874428661567853482?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7874428661567853482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7874428661567853482' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7874428661567853482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7874428661567853482'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/adfjsf-avoiding-uncought-exeptions.html' title='ADF/JSF Avoiding uncought exeptions after commit.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-735776510971001811</id><published>2007-11-07T11:31:00.000+02:00</published><updated>2007-11-07T12:15:40.101+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>JSF Passing parameters to included jsp pages</title><content type='html'>&lt;p&gt;
The question was brought up in the &lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=582259&amp;tstart=0"&gt;JDeveloper forum&lt;/a&gt;. When I started creating my first JSF pages I wanted to be able to create a menu that I could edit and make make the changes propagate to all pages immediately. So What I wanted back then was amethod to include a jsp to all my pages but also be able to pass parameters from the including page to the one being included.
&lt;/p&gt;
&lt;p&gt;
The answer came from the book &lt;a href="http://www.amazon.co.uk/Mastering-JavaServer-sup-small-Faces/dp/0471462071/ref=sr_1_1/203-9047451-5105531?ie=UTF8&amp;s=books&amp;qid=1194428765&amp;sr=8-1" target=_bank&gt;Mastering JavaServer Faces&lt;/a&gt; by Bill Dudney, Jonathan Lehr, Bill Willis and LeRoy Mattingly.
&lt;/p&gt;
&lt;p&gt;
The approach is to create a subview and then include the page using a &lt;code&gt;jsp:include&lt;/code&gt; tag. Inside the include you must use a &lt;code&gt;jsp:param&lt;/code&gt; tag where you define the name and value of the expected JSP parameter. To cut the long story short, I tested the solution with JDeveloper 10.1.3.3 and here is the code fragment to use.
&lt;/p&gt;
&lt;pre&gt;
            &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;f:subview&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;id&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;header&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
                &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;jsp:include&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;page&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;/header.jsp&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;flush&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;true&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
                    &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;jsp:param&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;name&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;pageTitle&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;value&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;Welcome to my first JSF Application&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;/&amp;gt;&lt;/font&gt;
                &lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;jsp:include&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
            &lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;f:subview&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
 &lt;/pre&gt;
&lt;p&gt;
The included page should be surrounded by an &lt;code&gt;f:subview&lt;/code&gt; tag. 
The external parameter can be accessed by an EL expression like "#{param.paramName}" and a simple example would be something like :
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&amp;quot;
&amp;quot;http://www.w3.org/TR/html4/loose.dtd&amp;quot;&amp;gt;
&lt;font color="#006699"&gt;&amp;lt;%@&lt;/font&gt; &lt;font color="#006699"&gt;&lt;b&gt;page&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;contentType&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;text/html;charset=ISO-8859-7&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;%&amp;gt;&lt;/font&gt;
&lt;font color="#006699"&gt;&amp;lt;%@&lt;/font&gt; &lt;font color="#006699"&gt;&lt;b&gt;taglib&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;uri&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;http://java.sun.com/jsf/core&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;prefix&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;f&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;%&amp;gt;&lt;/font&gt;
&lt;font color="#006699"&gt;&amp;lt;%@&lt;/font&gt; &lt;font color="#006699"&gt;&lt;b&gt;taglib&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;uri&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;http://xmlns.oracle.com/adf/faces&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;prefix&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;af&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;%&amp;gt;&lt;/font&gt;
&lt;font color="#006699"&gt;&amp;lt;%@&lt;/font&gt; &lt;font color="#006699"&gt;&lt;b&gt;taglib&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;uri&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;http://xmlns.oracle.com/adf/faces/html&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;prefix&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;afh&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;%&amp;gt;&lt;/font&gt;
&lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;f:subview&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;id&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;header&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:html&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
    &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:head&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
      &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;meta&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;http-equiv&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;Content-Type&amp;quot;&lt;/font&gt; &lt;font color="#990000"&gt;content&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;text/html; charset=ISO-8859-7&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;/&amp;gt;&lt;/font&gt;
    &lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:head&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
    &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:body&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
      &lt;font color="#006699"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;af:panelHeader&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;text&lt;/font&gt;&lt;font color="#006699"&gt;=&lt;/font&gt;&lt;font color="#0033cc"&gt;&amp;quot;#{param.pageTitle}&amp;quot;&lt;/font&gt;&lt;font color="#006699"&gt;/&amp;gt;&lt;/font&gt;      
    &lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:body&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;afh:html&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
&lt;font color="#006699"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#006699"&gt;&lt;b&gt;f:subview&lt;/b&gt;&lt;/font&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;p&gt; ... and one last comment. I guess that this is the first time that the Copy as HTML command works correctly in JDeveloper on Linux. :-)
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-735776510971001811?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/735776510971001811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=735776510971001811' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/735776510971001811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/735776510971001811'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/jsf-passing-parameters-to-included-jsp.html' title='JSF Passing parameters to included jsp pages'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-2441557432951385540</id><published>2007-11-06T12:48:00.000+02:00</published><updated>2008-12-11T07:40:54.540+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><title type='text'>BAPI / RFC with Delphi 2006 / 2007</title><content type='html'>&lt;p&gt;
Six months ago I wrote an &lt;a href="http://abakalidis.blogspot.com/2007/04/bapi-rfc-with-delphi.html"&gt;article&lt;/a&gt; regarding how to install and use SAP's Active X components using Delphi 6. Here is the sequel regarding Delphi 2006 and 2007.
&lt;/p&gt;
&lt;p&gt;
The basic idea is still the same you only need to install &lt;strong&gt;SAP Logon Control version 1.1&lt;/strong&gt;, &lt;strong&gt;SAP BABPI Control Version 1.2&lt;/strong&gt; and finally import the &lt;strong&gt;SAP Remote Function Call Controll (Version 5.0) type library&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
To complete the task in Delphi 2006, use the following procedure:
&lt;p&gt;
&lt;ol&gt;
  &lt;li&gt;
    Start Delphi 2006 and create a new package using the menu 
    File &amp;rarr; New &amp;rarr; Package for Delphi Win 32.
  &lt;/li&gt;
  &lt;li&gt;
    Save the package and the project using a name like SAPControls
  &lt;/li&gt;
  &lt;li&gt;
    From the Delphi main menu select Component &amp;rarr; Import Component.
    &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"     href="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBMbtUb3yI/AAAAAAAAAC4/gEUtCCUxTUI/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:5px auto 10px; text-align:center; cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBMbtUb3yI/AAAAAAAAAC4/gEUtCCUxTUI/s320/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5129684014480482082" title="Import Component"/&gt; &lt;/a&gt;    
  &lt;/li&gt;
  &lt;li&gt;
   Locate the SAP Logon Control as show in the following image
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CFT56hwlD5g/RzBN7dUb3zI/AAAAAAAAADA/UkPL0aZ2zSc/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:5px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_CFT56hwlD5g/RzBN7dUb3zI/AAAAAAAAADA/UkPL0aZ2zSc/s320/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5129685659452956466" /&gt;&lt;/a&gt;
   and click next
  &lt;/li&gt;
  &lt;li&gt;
   In the following Screen just type SAP at the pallete page name
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBQJtUb30I/AAAAAAAAADI/XV_xTlIsr6U/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:5px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBQJtUb30I/AAAAAAAAADI/XV_xTlIsr6U/s320/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5129688103289347906" /&gt;&lt;/a&gt;
   ... and press next
  &lt;/li&gt;
  &lt;li&gt;
   On the next screen select Add unit to Package radio item.
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBSAtUb31I/AAAAAAAAADQ/xyVYrkgWfic/s1600-h/1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_CFT56hwlD5g/RzBSAtUb31I/AAAAAAAAADQ/xyVYrkgWfic/s320/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5129690147693780818" /&gt;&lt;/a&gt;
   ... and click Finish
  &lt;/li&gt;
  &lt;li&gt;
    Repeat the previous steps and install the SAP BAPI Control and the 
    Remote function type library. Unlike Delphi 6 you should get no 
    compiler error messages.
  &lt;/li&gt;
  &lt;li&gt;
   When you are finished, right click on the SAPControls package on 
   the project manager window and select Install from the pop up menu.
  &lt;/li&gt;
  &lt;li&gt;
   That does it. Create a new project and use the components of the new SAP
   pallete Category as you please.
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
  Don't worry if you misplaced your components in an other category. You can drug them into any category you wish afterwards.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-2441557432951385540?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/2441557432951385540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=2441557432951385540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2441557432951385540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/2441557432951385540'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/11/bapi-rfc-with-delphi-2006.html' title='BAPI / RFC with Delphi 2006 / 2007'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_CFT56hwlD5g/RzBMbtUb3yI/AAAAAAAAAC4/gEUtCCUxTUI/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5673339466100079934</id><published>2007-10-19T10:12:00.000+02:00</published><updated>2007-10-19T10:31:58.251+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDeveloper'/><title type='text'>JDeveloper 10.1.3.3 JSP Compiler Errors in JSF faces</title><content type='html'>&lt;p&gt;
I have run into the following error while modifying JSF pages in JDeveloper 10.1.3.3 on openSUSE.
While modifying the page contents using the JDeveloper editor, the page stops working when accessed from the browser and you get an Internal Server Error with a JspCompileException but nothing else. The page was still accessible from the internal JDeveloper Design editor and would complie correctly from inside JDeveloper.
&lt;/p&gt;
&lt;p&gt;
A remedy that sometimes worked was to remove a few components from the page put them back and then hope it would work.
&lt;/p&gt;
&lt;p&gt;
Eventually I came up with the following simple trick. Just remove all contents from &lt;code&gt;~/jdevhome/mywork/WorkSpace/ViewController/classes/.jsps&lt;/code&gt; and rebuild your project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5673339466100079934?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5673339466100079934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5673339466100079934' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5673339466100079934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5673339466100079934'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/jdeveloper-10133-jsp-compiler-errors-in.html' title='JDeveloper 10.1.3.3 JSP Compiler Errors in JSF faces'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-320601418601762503</id><published>2007-10-18T12:07:00.001+02:00</published><updated>2007-10-18T15:20:46.948+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>Delphi: How to install BDE on a client machine</title><content type='html'>&lt;p&gt;
Suppose you have a Delphi application that access data using the Borland Database Engine (BDE) and you wish to deploy it on a user's client computer. If you compile the project without runtime packages and no BDE support is required, then merely copying the EXE file on the target computer is usually enough.
&lt;/p&gt;
&lt;p&gt;
Now installing BDE on a client computer is performed as follows :
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    Locate the file &lt;code&gt;bdeinst.cab&lt;/code&gt; located in &lt;code&gt;C:\Program Files\Common Files\Borland Shared\BDE&lt;/code&gt;.
  &lt;/li&gt;
  &lt;li&gt;
    Open it using winZip or something equivalant.
  &lt;/li&gt;
  &lt;li&gt;
    The .cab file contains only one file BDEINST.DLL. Extract this to the users client computer.
  &lt;/li&gt;
  &lt;li&gt;
    Use the command &lt;code&gt;regsvr32.exe bdeinst.dll&lt;/code&gt; from the command prompt to perform the installation.
  &lt;/li&gt;
  &lt;li&gt;
    Run your application
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
BDE un-installation can be performed by folloowing these steps :
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;
    Delete the folder containing BDE data
  &lt;/li&gt;
  &lt;li&gt;
    Delete the BDEADMIN.CPL file in the Wiindows\System folder, in order to get rid of the control file applet 
  &lt;/li&gt;
  &lt;li&gt;
    Use regedit in order to delete the key &lt;code&gt;HKEY_CURRENT_USER\Software\Borland\BDEAdmin&lt;/code&gt;
  &lt;/li&gt;
  &lt;li&gt;
   Next locate &lt;code&gt;HKEY_LOCAL_MACHINE\Software\Borland&lt;/code&gt; and delete the subkeys &lt;code&gt;BLW32&lt;/code&gt;, &lt;code&gt;Borland Shared&lt;/code&gt; and &lt;code&gt;Database engine&lt;/code&gt;. 
  &lt;/li&gt;
  &lt;li&gt;
    Reboot your machine
  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;strong&gt;Note :&lt;/strong&gt; Having said all that I would like to give you an extract from the file bdedeploy.txt located at the BDE installation directory.
&lt;pre&gt;
2. BORLAND-CERTIFIED INSTALLATION PROGRAMS
===========================================================
Borland products which include redistribution rights
include an Borland-certified install program, such as
InstallShield Express, to ensure proper installation and
uninstallation of your applications so that they co-exist
well with other applications which use the Borland Database
Engine (BDE) including those created with Visual dBASE,
Paradox, Delphi, and C++Builder.

Borland has also provided BDE and SQL Links installation
information to other install vendors such as Sax Software,
WISE Software, Great Lakes Business Systems (GLBS) makers
of the WISE install tool and Eschalon Development so that
their products can also be ensured to be fully compatible
with the BDE.

From time to time, Borland Software Corporation may, 
at its discretion, certify additional installation programs 
for use as the Borland Certified Install Program for this 
product.
  
Also check the Borland-sponsored announcement newsgroups:

  news:borland.public.announce
  news:borland.public.bde

3. BDE DEPLOYMENT (ALL DATABASE APPLICATIONS)
===========================================================
3.1 Deploying the BDE
---------------------
A Borland-certified installation program provides all
needed functionality and steps for redistributing the
Borland Database Engine (BDE), including:

  * Selecting files to redistribute
  * Determining final directory locations
  * Comparing versions of BDE files
  * Creation of BDE aliases
  
Follow the instructions of the particular installation
program used for specific steps to create an installation
program that includes the BDE.
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-320601418601762503?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/320601418601762503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=320601418601762503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/320601418601762503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/320601418601762503'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/delphi-how-to-install-bde-on-client.html' title='Delphi: How to install BDE on a client machine'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3517552158615493340</id><published>2007-10-17T13:01:00.000+02:00</published><updated>2007-10-17T13:16:21.912+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>JSF How to create and use dependent list boxes</title><content type='html'>&lt;p&gt;
Back in 2006, Frank Nimphius has written two excellent articles about using AJAX style combo (or list) boxes in a web page that filter one another based on values of a master detail relationship. I have to admit that thanks to him, my users have one less reason to grumble :-)
&lt;/p&gt;
&lt;p&gt;
The first one is entitled &lt;a href="http://www.orablogs.com/fnimphius/archives/001775.html" target="_blank"&gt;ADF Faces: How-to build dependent lists boxes with ADF and ADF Faces&lt;/a&gt; and the second one &lt;a href = "http://www.orablogs.com/fnimphius/archives/001779.html" target="_blank"&gt;ADF Faces: How-to build dependent lists boxes with ADF and ADF Faces Part - II&lt;/a&gt;
&lt;p&gt;
&lt;p&gt;
Thank you Frank.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3517552158615493340?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3517552158615493340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3517552158615493340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3517552158615493340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3517552158615493340'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/jsf-how-to-create-and-use-dependent.html' title='JSF How to create and use dependent list boxes'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-6840592795809825912</id><published>2007-10-17T11:39:00.001+02:00</published><updated>2007-10-17T12:42:53.392+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP: How to tell if user input is a number</title><content type='html'>&lt;p&gt;
ABAP casts between types by just sequentially copying (as many as the size of the target type) bytes from one memory area to an other and then checks if the new contents of the target memory area can be perceived as the appropriate type. As a general rule strings and character objects are always copied left while numbers get copied right justified)
&lt;/p&gt;
&lt;p&gt;
This little code fragment will get a number out of a string and convert it to practically any numeric format.
&lt;/p&gt;
&lt;pre&gt;
        DATA :
           temp_str(10) type c value '1234,34'.
           my_number TYPE f.

*       If the value of temp_str is comming from user input of from any other
*       user or ABAP dictionary type then it is also wise to execute something like
        CONDENSE temp_str.

*       You may want to execute this if you --like me -- your 
*       decimal symbol is a comma
        REPLACE ',' WITH '.' INTO temp_str.

        CATCH SYSTEM-EXCEPTIONS conversion_errors = 4.
          my_number = temp_str.
        ENDCATCH.
        IF sy-subrc &lt;&gt; 0.
          MESSAGE e888(sabapdocu) WITH temp_str ' is not a number'.
        ENDIF.
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-6840592795809825912?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/6840592795809825912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=6840592795809825912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6840592795809825912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/6840592795809825912'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/abap-how-to-tell-if-user-input-is.html' title='ABAP: How to tell if user input is a number'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-707029275508993527</id><published>2007-10-12T10:01:00.002+02:00</published><updated>2008-03-18T14:59:37.013+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP-Classification'/><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP Obtaining an object's characteristics from the classification system</title><content type='html'>&lt;p&gt;
The easiest way to get a list of all the characteristics of an object  is to use the &lt;code&gt;BAPI_OBJCL_GETCLASSES&lt;/code&gt; BAPI. The function requires that you supply an object key, the database table where the object is stored, the class type of the obect to look for -- e.g. '001' for material or '023' for batch --  and finally whether or not to return the entire list of characteristics.
&lt;/p&gt;
&lt;p&gt;
The return value consists of a table containing all the classes the object is currently assigned and if requested three additional tables with values of the object characteristics, one for string valued, one for numeric and one for currency.
&lt;/p&gt;
&lt;p&gt; 
Information about objects, db tables and corresponding class types is stored in the &lt;strong&gt;inob&lt;/strong&gt; table.  So one way of getting all this would be to write code like :
&lt;/p&gt;
&lt;pre&gt;
  DATA : 
    wa_inob TYPE inob, 
    my_object LIKE inob-objek.

  CLEAR wa_inob.
  CONCATENATE my_matnr my_batch INTO my_object.
  SELECT SINGLE * 
    FROM inob 
    INTO wa_inob
    WHERE objek = my_object.
&lt;/pre&gt;
&lt;p&gt;
So calling the BAPI would be as straight forward as ....
&lt;/p&gt;
&lt;pre&gt;
  DATA :
    class_list TYPE STANDARD TABLE of bapi1003_alloc_list.
    valueschar TYPE STANDARD TABLE OF bapi1003_alloc_values_char, 
    valuescurr TYPE STANDARD TABLE OF bapi1003_alloc_values_curr, 
    valuesnum  TYPE STANDARD TABLE OF bapi1003_alloc_values_num,
    return     TYPE STANDARD TABLE OF bapiret2.

  CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
    EXPORTING
      objectkey_imp         = wa_inob-objek
      objecttable_imp       = wa_inob-obtab
      classtype_imp         = wa_inob-klart
      read_valuations       = 'X'
      keydate               = sy-datum
*     language              = 'E'
    TABLES
      alloclist             = class_list
      allocvalueschar       = valueschar
      allocvaluescurr       = valuescurr
      allocvaluesnum        = valuesnum
      return                = return.
&lt;/pre&gt;
&lt;p&gt;
Determining if an object has indeed been assigned classification information is performed by checking the &lt;code&gt;return&lt;/code&gt; table value. Correct classification means that the return table contains one line with field "TYPE" set to 'S', "ID" set to 'CL' and NUMBER set to 741. (When no allocations are found number is 740). So before trying to read any characteristic values is safer to test like this. 
&lt;p&gt;
&lt;pre&gt;
     FIELD-SYMBOLS
        &amp;lt;ret&gt; TYPE bapiret2.

     READ TABLE return INDEX 1 ASSIGNING &amp;lt;ret&gt;.

*   Check that object allocations exist
    IF  sy-subrc = 0 AND
        &amp;lt;ret&gt;-id = 'CL' AND
        &amp;lt;ret&gt;-number = 741.

      ....
&lt;/pre&gt;
&lt;p&gt;
Now getting a specific value from let's say the string valued characteristics can be accomplished by code similar to following, which gets the value of a characteristic named QUALITY:
&lt;/p&gt;
&lt;pre&gt;
  FIELD-SYMBOLS :
    &amp;lt;fs&gt; TYPE bapi1003_alloc_values_char.

  READ TABLE valueschar WITH KEY charact = 'QUALITY' ASSIGNING &amp;lt;fs&gt;.

  if &amp;lt;fs&gt; IS ASSIGNED.
*   The language independent value of the characteristic is 
    my_quality_id = &amp;lt;fs&gt;-value_neutral.
*   The language dependent i.e. the one that will appear in the
*   result table of CL30N is 
    my_quality_descr = &amp;lt;fs&gt;-value_char.
  ENDIF.
&lt;/pre&gt;
&lt;p&gt;
&lt;strong&gt; NOTE:&lt;/strong&gt; The following approach is generic and is supposed to work fine on all systems. In our system however (Release 4.6C) the inob table does not have an index on inob-objek, so the SELECT SINGLE statement is executed by performing sequential reads. One way to overcome this would be to manually create the index. The other, as far as I am concerned, is to know beforehand the type of objects and classes that your program deals with, and therefore hard code the database table to 'MARA' or MCH1' and the class type to '001' and '023' for materials and batches respectively.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-707029275508993527?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/707029275508993527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=707029275508993527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/707029275508993527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/707029275508993527'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/abap-obtaining-objects-characteristics.html' title='ABAP Obtaining an object&apos;s characteristics from the classification system'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-3995919101477864240</id><published>2007-10-09T13:01:00.000+02:00</published><updated>2007-10-09T13:11:03.991+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>JavaScript Best practices</title><content type='html'>&lt;p&gt;
Just came up with an excellent article on JavaScript.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;a href="http://www.javascripttoolbox.com/bestpractices/" target="_blank"&gt; http://www.javascripttoolbox.com/bestpractices/
&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Thank you Mr  &lt;a href="http://www.mattkruse.com/"&gt;Matt Kruse&lt;/a&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-3995919101477864240?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/3995919101477864240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=3995919101477864240' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3995919101477864240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/3995919101477864240'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/javascript-best-practices.html' title='JavaScript Best practices'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8811741069031832012</id><published>2007-10-05T09:39:00.000+02:00</published><updated>2007-10-05T10:09:15.412+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>HTML Code for searching your site with Google.</title><content type='html'>&lt;p&gt;
I had seen this done in many sites and to be honest I always thought of it as a fancy trick for showing off HTML skills. Lately while using Steve Muench's &lt;a href="http://radio.weblogs.com/0118231/" target="_blank"&gt;Blog&lt;/a&gt; I realized that this little HTML form turns out to be of &lt;i&gt;ultimate&lt;/i&gt; use. Then I said ok let's do it and ended up looking at HTML code from various sites....Finally I ended up with the following solution, that you can copy at use as is, Just replacing my site with yours.
&lt;/p&gt;
&lt;hr/&gt;
&lt;pre&gt;
&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;form&lt;/span&gt;&lt;span style="color: #008000;"&gt; action=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"http://www.google.com/search"&lt;/span&gt;&lt;span style="color: #008000;"&gt; method=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"get"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;table&lt;/span&gt;&lt;span style="color: #008000;"&gt; border=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"0"&lt;/span&gt;&lt;span style="color: #008000;"&gt; align=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"center"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;input&lt;/span&gt;&lt;span style="color: #008000;"&gt; maxlength=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"255"&lt;/span&gt;&lt;span style="color: #008000;"&gt; value=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;""&lt;/span&gt;&lt;span style="color: #008000;"&gt; name=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"q"&lt;/span&gt;&lt;span style="color: #008000;"&gt; size=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"31"&lt;/span&gt;&lt;span style="color: #008000;"&gt; type=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"text"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;input&lt;/span&gt;&lt;span style="color: #008000;"&gt; value=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"Google Search"&lt;/span&gt;&lt;span style="color: #008000;"&gt; type=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"submit"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;input&lt;/span&gt;&lt;span style="color: #008000;"&gt; value=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;""&lt;/span&gt;&lt;span style="color: #008000;"&gt; name=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"sitesearch"&lt;/span&gt;&lt;span style="color: #008000;"&gt; type=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"radio"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                The Web&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;input&lt;/span&gt;&lt;span style="color: #008000;"&gt; checked value=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"abakalidis.blogspot.com"&lt;/span&gt;&lt;span style="color: #008000;"&gt; name=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"sitesearch"&lt;/span&gt;&lt;span style="color: #008000;"&gt; type=&lt;/span&gt;&lt;span style="color: #aa0000;"&gt;"radio"&lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;/&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;                This Blog&lt;/span&gt;
    &lt;span style="font-weight: bold;color: #000000;"&gt;        &amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="font-weight: bold;color:     #000000;"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span style="font-weight: bold;color: #000000;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;hr/&gt;
&lt;p&gt;
Thank you &lt;a href="http://www.kate-editor.org/"&gt;Kate&lt;/a&gt; for the messy HTML color syntax.:-)
&lt;/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8811741069031832012?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8811741069031832012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8811741069031832012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8811741069031832012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8811741069031832012'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/html-code-for-searching-your-site-with.html' title='HTML Code for searching your site with Google.'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-309401103258523479</id><published>2007-10-03T13:52:00.000+02:00</published><updated>2007-10-10T08:31:09.766+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LDAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Java: How to tell if an LDAP user is member of a group</title><content type='html'>&lt;p&gt;
Here is a Java class that I use in order to determine if a user of an LDAP server is a member of a group. The class uses the Mozilla LDAP SDK available for download from &lt;a href="http://www.mozilla.org/directory/javasdk.html" target="_blank"&gt;Mozilla&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
In many JSF applications this class lies in the heart of my UserInfo managed beans allowing or f orbiting access to various parts of the application.
&lt;/p&gt;
&lt;p&gt;
Things you need to fill before using it are :
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; server name or IP address &lt;/li&gt;
&lt;li&gt; Server port&lt;/li&gt;
&lt;li&gt; A user name and a password that will allow your code to execute queries on the LDAP Server &lt;/li&gt;
&lt;li&gt;The base DN to start the search at &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; The usual place to find these values is the LDAP server itself. If you server is an Oracle IAS 10.2 infrastructure then check the file &lt;code&gt;$ORACLE_HOME/install/portlist.ini&lt;/code&gt;.
&lt;hr/&gt;
&lt;pre&gt;
package ab.util.ldap;

import java.util.Enumeration;

import netscape.ldap.LDAPAttribute;
import netscape.ldap.LDAPConnection;
import netscape.ldap.LDAPEntry;
import netscape.ldap.LDAPException;
import netscape.ldap.LDAPReferralException;
import netscape.ldap.LDAPSearchResults;

public class MyLDAP 
{
    public static final String ldapHost = "ldap.shelman.int";
    public static final int ldapPort = 3060;
    private static final String authid = "cn=orcladmin";
    private static final String authpw = "my_password";
    private static final String base = "cn=groups,dc=shelman,dc=int";

    /**
     * isGroupMember -- determine if user belongs to an LDAP group
     *
     * #param group name of group to examine
     * #param user name user to search for emembership+-
     */
    public static boolean isGroupMember(String group, String user) 
    {
        String member = "cn=" + user.toLowerCase();
        String filter = "(cn=" + group + ")";
        String[] attrs = { "uniquemember" };
        boolean result = false;

        LDAPConnection ld = new LDAPConnection();
        // System.out.println("Attempting to connect :"  + today.toString());
        try {
            // connect to server and authenticate
            ld.connect(ldapHost, ldapPort, authid, authpw);
            // issue the search request
            LDAPSearchResults res =
                ld.search(base, ld.SCOPE_SUB, filter, attrs, false);
            // loop on results until complete
            while (res.hasMoreElements()) {
                try {
                    LDAPEntry entry = res.next();
                    LDAPAttribute atr = entry.getAttribute(attrs[0]);
                    Enumeration enumVals = atr.getStringValues();

                    while (enumVals != null &amp;&amp; enumVals.hasMoreElements()) {
                        String val = (String)enumVals.nextElement();
                        // convert to lower case
                        val = val.toLowerCase();

                        if (val.indexOf(member) &gt;= 0) {
                            result = true;
                            break;
                        }
                    }

                } catch (LDAPReferralException ex) {
                    // ignore referal exceptions
                    continue;
                } catch (LDAPException ex) {
                    System.out.println(ex.toString());
                    continue;
                }
            }
        } catch (Exception ex) {
            System.out.println("Error communicating with LDAP Server " +
                               ldapHost + " Port " + ldapPort);
            System.out.println(ex.toString());
        }

        // finished searching. try to disconnect
        if (ld != null &amp;&amp; ld.isConnected()) {
            try {
                ld.disconnect();
            } catch (LDAPException ex) {
                System.out.println(ex.toString());
            }
        }

        // return whatever found
        return result;
    }
}
&lt;/pre&gt;
&lt;hr/&gt;
&lt;p&gt; 
The package ldapjdk-4.17-38 is included in the distribution of all openSUSE systems. For openSUSE 10.2 the package is available for download from &lt;a href="http://download.opensuse.org/distribution/10.2/repo/oss/suse/noarch/" target="_blank"&gt;here&lt;/a&gt;. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-309401103258523479?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/309401103258523479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=309401103258523479' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/309401103258523479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/309401103258523479'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/10/java-how-to-tell-if-ldap-user-is-member.html' title='Java: How to tell if an LDAP user is member of a group'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1756018604638872874</id><published>2007-09-27T14:52:00.000+02:00</published><updated>2007-09-27T15:01:07.445+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle ADF'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>ADF Tables. Changing the colour of negative valued columns</title><content type='html'>&lt;p&gt;
My users asked me if it would be possible to display negative values of an ADF table using a different colour than the rest.
&lt;/p&gt;
&lt;p&gt; 
The solution turned out to be something as simple as defining two CSS classes like this :
&lt;/p&gt;
&lt;pre&gt;
.redFont {
    color: Red;
}
.blueFont {
    color: Navy;
}
&lt;/pre&gt;
&lt;p&gt;
The last step was to bind the &lt;span style="font-weight:bold;"&gt;StyleClass&lt;/span&gt; property of the adf:outputText elements using the following EL expression :
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;strong&gt;&lt;code&gt;#{row.myColumn.value &gt; 0 ? 'blueFont' : 'redFont'}&lt;/code&gt;&lt;/strong&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1756018604638872874?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1756018604638872874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1756018604638872874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1756018604638872874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1756018604638872874'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/09/adf-tables-changing-colour-of-negative.html' title='ADF Tables. Changing the colour of negative valued columns'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-8525169064500246518</id><published>2007-09-17T08:50:00.000+02:00</published><updated>2007-09-17T09:02:39.564+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SuSE'/><title type='text'>SuSE Linux Yast Repositories URLs changed</title><content type='html'>&lt;p&gt; During the last week, I have  have noticed a change in the URLs of various package repositories in openSUSE.  The correct URLs are still available at the &lt;a href="http://en.opensuse.org/Additional_YaST_Package_Repositories"&gt;Additional YaST Package Repositories&lt;/a&gt; page in the openSUSE website.&lt;/p&gt;
&lt;p&gt;
If your update system starts complaining about unaccessible repositories,then I suggest you have a look. The good news is that if you start the Add remove update sources applet from YaST and select ignore or skip from the dialog boxes complaining about faulty URL's then the system gives you a chance to remove all non working update sources immediately.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-8525169064500246518?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/8525169064500246518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=8525169064500246518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8525169064500246518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/8525169064500246518'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/09/suse-linux-yast-repositories-urls.html' title='SuSE Linux Yast Repositories URLs changed'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7810230503625501613</id><published>2007-08-30T14:14:00.000+02:00</published><updated>2007-08-30T15:12:07.858+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>JSF Basics Access the HTTP Session from a backing bean</title><content type='html'>&lt;p&gt; Here is something I always seem to forget and never realy got to use :-) 
&lt;br/&gt;
Code to gain access to the HTTP session from a inside backing bean : &lt;/p&gt;
&lt;pre&gt;
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest)fc.getExternalContext().getRequest();
HttpSession session = request.getSession();
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7810230503625501613?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7810230503625501613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7810230503625501613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7810230503625501613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7810230503625501613'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/08/jsf-basic-access-http-session-from.html' title='JSF Basics Access the HTTP Session from a backing bean'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1875308330339908993</id><published>2007-08-21T11:18:00.000+02:00</published><updated>2007-10-10T08:33:16.729+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Screen Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP: How to get the Screen Table row that the cursor is in</title><content type='html'>&lt;p&gt;
Getting the row that the user cursor is in accomplished by using the GET CURSOR LINE statement. As always, we need to declare a global field named something like cur_tbl_line to hold the current table line. Then during PAI processing we need to issue statements like the following :
(&lt;code&gt;tc_mydata&lt;/code&gt; is the name of the screen table control and XXX is the screen number)
&lt;/p&gt;
&lt;pre&gt;
MODULE user_command_XXX INPUT.

* set up the current line variable
  GET CURSOR LINE cur_tbl_line.
  cur_tbl_line = tc_mydata-top_line + cur_tbl_line - 1.

* do the classic stuff
  ok_code = ok_code_XXX.
  CLEAR ok_code_XXX.

  ...
ENDMODULE.
&lt;/pre&gt;
&lt;p&gt;
Using this approach, you can get the selected line of the &lt;code&gt;tbl_mydata&lt;/code&gt; table by writing code like this
&lt;/p&gt;
&lt;pre&gt;
FORM sync_mydata_with_selection
     CHANGING
        f_none_selected TYPE c.

  FIELD-SYMBOLS
    &amp;lt;fs&gt; LIKE LINE OF tbl_mydata.

  CLEAR f_none_selected.

* give precedence to the table control selection
  READ TABLE tbl_mydata
  WITH KEY sel = 'X'
  ASSIGNING  &amp;lt;fs&gt;.

  IF sy-subrc &lt;&gt; 0.
*   No selection was made so get the current row using the
*   cursor
    IF cur_tbl_line &gt; 0.
      READ TABLE tbl_packages INDEX cur_tbl_line
        ASSIGNING &lt;fs&gt;.
    ELSE.
      f_none_selected = 'X'.     
    ENDIF.
  ENDIF.
ENDFORM.
&lt;/pre&gt;
&lt;p&gt; 
After this is executed, the header line of &lt;code&gt;tbl_mydata&lt;/code&gt; contains the selected row and if your user has not selected anything then &lt;code&gt;f_none_selected&lt;/code&gt; will have a value of &lt;code&gt;'X'&lt;/code&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1875308330339908993?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1875308330339908993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1875308330339908993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1875308330339908993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1875308330339908993'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/08/abap-how-to-get-screen-table-row-that.html' title='ABAP: How to get the Screen Table row that the cursor is in'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-5293000217972344022</id><published>2007-08-03T13:51:00.000+02:00</published><updated>2007-08-21T10:48:02.439+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Screen Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP: Gettting the selected column</title><content type='html'>&lt;p&gt;
Every TABLEVIEW control defined in an ABAP program contains a cols field that contains information about selected columns. Whether or not column selection is allowed is set by the tableview object's properties in the screen painter. (see also the relevant image for the posting &lt;a href="http://abakalidis.blogspot.com/2007/07/abap-how-to-setup-screen-containing.html"&gt; How to setup a Screen containing a Table&lt;/a&gt; a few days back.
&lt;/p&gt;
&lt;p&gt;
One common use for column selection is sorting, so an example sorting function that sorts a global table named &lt;code&gt;tbl_my_data&lt;/code&gt; based on the selected column might look like this :
&lt;/p&gt;
&lt;pre&gt;
FORM sort_table USING  sort_mode LIKE sy-ucomm.
  FIELD-SYMBOLS
    &lt;selected_col&gt; TYPE cxtab_column.

* find out if a column is selected.
  READ TABLE tc_mytab-cols
    WITH KEY selected = 'X'
    ASSIGNING &amp;lt;selected_col&gt;.

  IF sy-subrc &lt;&gt; 0.
    MESSAGE s888(sabapdocu) WITH 'No column is selected'.
    EXIT.
  ENDIF.

* sort according to the selected column
  CASE sort_mode.
    WHEN 'SORT_ASC'.
      CASE &amp;lt;selected_col&gt;-index.
        WHEN 1.
          SORT tbl_mydata ASCENDING BY field1.
        WHEN 2.
          SORT tbl_mydata ASCENDING BY field2.
        WHEN OTHERS.
          MESSAGE s888(sabapdocu) WITH 'Not yet implemented'.
      ENDCASE.
    WHEN 'SORT_DSC'.
      CASE &amp;lt;selected_col&gt;-index.
        WHEN 1.
          SORT tbl_mydata DESCENDING BY field1.
        WHEN 2.
          SORT tbl_mydata DESCENDING BY field2.
        WHEN OTHERS.
          MESSAGE s888(sabapdocu) WITH 'Not yet implemented'.
      ENDCASE.
  ENDCASE.
ENDFORM.                    " sort_table
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-5293000217972344022?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/5293000217972344022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=5293000217972344022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5293000217972344022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/5293000217972344022'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/08/abap-gettting-selected-column.html' title='ABAP: Gettting the selected column'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-7185917597427184999</id><published>2007-08-02T07:58:00.000+02:00</published><updated>2007-08-02T08:18:00.362+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SuSE'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>SuSE Linux: Speeding up boot time by getting rid of zmd</title><content type='html'>&lt;p&gt;
Here is a cool post I found at &lt;a href="http://www.linuxquestions.org" target="_blank"&gt;linuxQuestions.org.&lt;/a&gt;. If you feel that your openSUSE 10.x Linux box is taking too much time to boot, then it might be a good idea to remove &lt;a href="http://en.opensuse.org/Zmd" target="_blank"&gt;ZMD&lt;/a&gt; altogether.
&lt;/p&gt;
The actual details can be found &lt;a href="http://www.linuxquestions.org/questions/showthread.php?t=483059" target="_blank"&gt;here&lt;/a&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-7185917597427184999?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/7185917597427184999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=7185917597427184999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7185917597427184999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/7185917597427184999'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/08/suse-linux-speeding-up-boot-time-by.html' title='SuSE Linux: Speeding up boot time by getting rid of zmd'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1908110696125487216.post-1983663425000000908</id><published>2007-07-31T10:48:00.000+02:00</published><updated>2007-08-06T13:15:20.875+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Screen Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='ABAP'/><title type='text'>ABAP: Responding to changes on screen fields</title><content type='html'>&lt;p&gt;
The general case for checking user input during PAI can be summarized as follows :
&lt;/p&gt;
&lt;pre&gt;
PROCESS AFTER INPUT.

  FIELD fieldA MODULE check_fieldA ON REQUEST.
  ...
  FIELD fieldB MODULE check_fieldB ON REQUEST.

&lt;/pre&gt;
&lt;p&gt;
Any messages of type e or w executed during execution of the corresponding modules will cause SAPGui to stop processing, return focus to the appropriate field and execute the module again until no messages are thrown. 
&lt;/p&gt;
&lt;p&gt;
If you wish to perform the same check on both fields then the fields can be chained.
&lt;/p&gt;
&lt;pre&gt;
PROCESS AFTER INPUT.
  CHAIN.
    FIELD :
            fieldA,
            fieldB

    MODULE check_fieldA_and_B ON CHAIN-REQUEST.
  ENDCHAIN.
&lt;/pre&gt;
&lt;p&gt;
if the field to be checked belongs to an internal table accessed via a &lt;a href="http://abakalidis.blogspot.com/2007/07/abap-how-to-setup-screen-containing.html"&gt;table control&lt;/a&gt; then the checking and processing phase should be carried out as follows:
&lt;/p&gt;
&lt;pre&gt;
PROCESS AFTER INPUT. 
  ...
  LOOP AT tbl_mydata.
    CHAIN.
      FIELD
              tbl_mydata-my_field.

      MODULE check_tbl_mydata_my_field ON CHAIN-REQUEST.
    ENDCHAIN.

    MODULE write_table_line.

  ENDLOOP.
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1908110696125487216-1983663425000000908?l=abakalidis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abakalidis.blogspot.com/feeds/1983663425000000908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1908110696125487216&amp;postID=1983663425000000908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1983663425000000908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1908110696125487216/posts/default/1983663425000000908'/><link rel='alternate' type='text/html' href='http://abakalidis.blogspot.com/2007/07/abap-responding-to-changes-on-screen.html' title='ABAP: Responding to changes on screen fields'/><author><name>Athanassios Bakalidis</name><uri>http://www.blogger.com/profile/11722066740354628402</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://2.bp.blogspot.com/-ES2twTbIoDI/Ta_fshMO5bI/AAAAAAAAAQI/NjVr5RM1ANM/s220/me-bw.jpg'/></author><thr:total>0</thr:total></entry></feed>
