Friday, March 15, 2013

Custom Font for Message Text Items On Self Service Page

Very often we get requirements to have custom look and feel for message text items in Self Service pages.
One of the requirement I had recently, was to show custom warning message in iExpanse page.

Here, I am explaining two ways to achieve this.

1> Using custom.xss

   > Change custom.xss file according to your requirement.
     >> Go to $OA_HTML/cabo/styles directory
     >> FTP the custom.xss file to your local system
     >> Add your custom style selector after
    <!-- Please start your customizations here -->

        <style selector= ".XXOraTestSS">
           <property name="font-family">Arial,Helvetica,Geneva,sans-serif</property>
           <property name="font-weight">bold</property>
           <property name="font-size">large</property>
           <property name="color">#cc0000</property>
        </style>


    <!-- Please end your customizations here -->

   > Put changed custom.xss file back to $OA_HTML/cabo/styles

   > Now login to application and add 'System Administration' responsibility to your user, if not added already.
 
   > Go to System Administrator > Application > Menu
     >> Search for 'ICX_SYSTEM_ADMINISTRATION'
     >> Add function 'Framework CSS Style Lookup Page' -- FWK_CSS_LOOKUP
     >> Give any Prompt name, like 'CSS Style'
     >> Save it and go to 'System Administration' responsibility, you can see the 'CSS Style' form function attached to the menu.
     >> Click on 'CSS Style', in the self service page you will be able to see your custom Style Selector  (XXOraTestSS) in the list attached to 'Style Selector'.
     >> Select 'Static Text' from Item Style and your custom Style Selector (XXOraTestSS) and 'GO'
     >> You can see the preview of your changes in 'Result of the Selection' region.
     >> If you are happy with the result.
        >> Personalize your self service page
        >> Create a new item and choose "Formatted Text" (or"Raw Text") Item Style
        >> In 'CSS Class' filed, provide your custom Style Selector (XXOraTestSS)
        >> 'Text' filed -> Put your message
        >> Apply and return to the application.

   > Remove the files from $OA_HTML/cabo/styles/cache directory
  
   > Bounce the Apache server 
     >> $INST_TOP/admin/scripts
        ./adapcctl.sh  stopall
        ./adapcctl.sh  startall

   > Login again to the application and hopefully you can see your changes.

2> Direct using HTML string

   > Personalize your self service page
     >> Create a new item and choose "Formatted Text" (or"Raw Text") Item Style
     >> In 'Text' filed, give HTML string based on your requirements
        Ex: <font face="Helvetica" color="red" size="4pt" weight="bold"><b>Test warning message</b></font>
     >> Apply and return to the application.

Wednesday, January 23, 2013

Special/French Characters Conversion

Sometimes you may get special/french characters in your data which can cause
'ORA-06502: PL/SQL: numeric or value error: character string buffer too small' error.

Example : ÖÄ é è
Reason   : These single characters taking two byte length.

To overcome this issue, either increase the length of your column(sometimes it is not advisable due to your business need/design) or use convert function to convert these characters.

--> Get the NLS Character set defined
select value
  from nls_database_parameters
where parameter='NLS_CHARACTERSET';

--> Use Convert function
CONVERT(<char>, <destination_char_set>, <source_char_set>)

> Use destination Character set as 'US7ASCII' -> US 7-bit ASCII character set
> Use Source Character set as Character set returned above.

Example : select convert('Repport ÖÄ é è  de öäå','US7ASCII','<char set returned above>')
                  from dual;

>> If it will not find any valid conversion for any character it will put '?' for that character