Wednesday 1 February 2012

Reset Image Prefix in Oracle APEx.

Incase u wanna change the Image Prefix being used in your application express then

Run command >cmd


Change the current directory to apex41\apex\utilities.

C:\apex41\apex\utilities > sqlplus
 username : sys as sydba
Password :*****

sqlplus > @reset_image_prefix.sql
It will prompt for entering the new prefix ..

Enter in the form of [/i/]   , so current should be /j/.

Make sure your Application express instance is down else run it in resticted mdoe.


Now you Images will be refered in workspace using the /j/ instead of /i/ and these changes are updated by Oracle apex automticatically for the exisiting references .


Managing Oracle APEX application exports.

There are several ways to manage the export of the Oracle Apex application

1) From developer environment of Oracle apex or from command prompt .

2) To create a Database Job and call the APEX EXPORT script for Automatic export.
     There are two programs available fro achiving this , one is for exporting entire application and another is    to export the application by splitting scripts for its components.


Steps :-


Got to the installation folder of your apex instance.

cmd  > cd C:\apex41\apex\utilities

C:\apex41\apex\utilities >   java oracle.apex.APEXEport 

it will list you the usage of the command

C:\apex41\apex\utilities>java oracle.apex.APEXExport -db NTHAKUR-W7.CORP.icgcnet
.com:1521:XE -user sys -password hello -instance 

Details:-
============

.
1) To use APEXExport, a JDK of version 1.5 or greater must be used. Additionally, the Oracle JDBC
class libraries must be in your CLASSPATH.
To set the CLASSPATH, following are some examples:
export CLASSPATH=.:${ORACLE_HOME}/jdbc/lib/ojdbc5.jar
...from the Bash shell or ...
set CLASSPATH=%CLASSPATH%;.\;%ORACLE_HOME%\jdbc\lib\ojdbc5.jar
...from Windows environments.


2) From the apex/utilities directory, issue the command:
java oracle.apex.APEXExport
 
...returns the following output with both usage directions and examples.
Usage APEXExport -db -user -password -applicationid -workspaceid -instance -expWorkspace -skipExportDate -expPubReports -expSavedReports -expIRNotif -expTranslations -expTeamdevdata -expFeedback -deploymentSystem -expFeedbackSince -debug
-db: Database connect url in JDBC format
-user: Database username
-password : Database password
-applicationid : ID for application to be exported
-workspaceid : Workspace ID for which all applications to be exported or the workspace to be exported
-instance : Export all applications
-expWorkspace : Export workspace identified by -workspaceid or all workspaces if -workspaceid not specified
-skipExportDate : Exclude export date from application export files
-expPubReports : Export all user saved public interactive reports
-expSavedReports: Export all user saved interactive reports
-expIRNotif : Export all interactive report notifications
-expTranslations : Export the translation mappings and all text from the translation repository
-expFeedback : Export team development feedback for all workspaces or identified by -workspaceid to development or deployment
-expTeamdevdata : Export team development data for all workspaces or identified by -workspaceid
-deploymentSystem : Deployment system for exported feedback
-expFeedbackSince : Export team development feedback since date in the format YYYYMMDD
Single Application Example:
APEXExport -db candy.us.oracle.com:1521:ORCL -user scott -password tiger -applicationid 31500
All Applications in a Workspace Example:
APEXExport -db candy.us.oracle.com:1521:ORCL -user scott -password tiger -workspaceid 9999
All Applications in an Instance Example:
APEXExport -db candy.us.oracle.com:1521:ORCL -user system -password manager -instance
Export All Workspaces Example:
APEXExport -db candy.us.oracle.com:1521:ORCL -user system -password manager -expWorkspace
Export Feedback to development environment:
APEXExport -db candy.us.oracle.com:1521:ORCL -user scott -password tiger -workspaceid 9999 -expFeedback
Export Feedback to deployment environment EA2 since 20100308:
APEXExport -db candy.us.oracle.com:1521:ORCL -user scott -password tiger -workspaceid 9999 -expFeedback -deploymentSystem EA2 -expFeedbackSince 20100308
 
 
 
APEXExportSplitter Usage Instructions
-------------------------------------
The program APEXExportSplitter can be used used to split Oracle Application Express export files
into separate SQL scripts. This is useful for management of files corresponding to
the discrete elements of an Application Express application.
 
1) To use APEXExportSplitter, a JDK of version 1.5 or greater must be used.
To set the CLASSPATH, following are some examples:
export CLASSPATH=.:$CLASSPATH
...from the Bash shell or ...
set CLASSPATH=%CLASSPATH%;.\;
...from Windows environments.
 
2) From the apex/utilities directory, issue the command:
java oracle.apex.APEXExportSplitter
 
...returns the following output with usage directions.
Usage java oracle.apex.APEXExportSplitter filename
-help : < print this syntax >
-flat : < flat file structure >
-debug : < print debug info >
-update : < create update file >
-nochecksum : < don't check for changes >
 
 
 
3) To split an application export file (f123.sql in this example) creating sub directories for
each component type, issue this command:
java oracle.apex.APEXExportSplitter f123.sql
4) To split an application export file (f123.sql in this example) containing the component type
in the file name (not creating any directories), issue this command:
java oracle.apex.APEXExportSplitter f123.sql -flat
 
 

 

 

Tuesday 24 January 2012

Positioning more than one region as child to parent region in apex




As many of them havte observed that in Oracle APEX we place loads of issues when it comes to positionsing the child region or item in the region.

Recently , i had encountered an requirement where i need to position the many regions as child for a parent region .

I looked into apex 3.0 , we didnt have parent region assignment option itself .

I looked into apex 4.0 , we had it , good enough .

But then again though i was especifying a region to be dispalyed in second col it was disaplying in the not being effected in position , and even there was huge problem with loook and feel.


 I thought y not use Oracle Apex javascript api , and i found very gud function called $dom_MakeParent.

Wanna see demo click here

Steps :-

Step 1):- Create one html region on the page , name it as parent region .
          Edit its source as

       <table>
<tr> <td id="cel1"> </td> <td id="cel2"> </td> </tr>
<tr> <td id="cel3"> </td> <td id="cel4"> </td> </tr>
      </table>


step 2) create multiple html regions change their static ids as child1id, child2id,child3id,child4id correspondingly.

step 3) edit page include this code on HTML header region of the page .

function assignparent()
{
alert('called');
// $dom_MakeParent(p_Node,p_Parent)
$dom_MakeParent('childid','cel1');
$dom_MakeParent('child2id','cel2');
$dom_MakeParent('child3id','cel3');
$dom_MakeParent('child4id','cel4');
alert('done');
}


Step 4) create a button name :- make child , url redirect : javascript:assignparent.

step 5) create another html region and set its parent as parent region which u have created and position 6



Now run the page , u can see last html region is already a child , now click make parent button and see the difference.

see Demo here

Making many regions as child region in Oracle apex dynamically

Exploring Oracle apex 4.1

Lets have look @ what we have in Oracle apex 4.1 .............

wokay lets gooo :)


The first change is Oracle apex Help link ... :(

1) It no more points to the PDF developer guide on our local instance ...it takes us to apex.oracle.com guide :(  , now incase i m working offline then i cannot access the Help link :(  ( Huh)

2) The Sample application link had more no of smaple applications with  examples sqon collections , database application and websheet application even :D

3) The learn more link of Oracle APEX points to the link , which opens another application , which is a websheet apex application , hence giving us gud idea how best we can use our websheet applications .

4) Web sheet application were simply a static pages with no dynamic data , but i found that 4.1 allows us to integrate the sql queries in the websheet . Along with this it even has come up with concept of data grid ... ( i remebred i encountered this term when i was doing by 12th and was working on Visual basic , data grid is nothing but a drag and drop tool , where we can enter certain data in form of excel and then perform basic db operations , i guess it will create the  respective table :D... though i didnot cross check as there was no developer edit option in Websheet :( huh.

 The demonstration section of the learning area is quite interesting and gives us amazing confidence of what all is possible in apex , i remebered in one my assignments i was struggling with the
" Hierarchy example" and here oracle apex 4.1 comes with the solution itself :D grt to know that :D .

XML example is very very interesting ... it teaches you how to play with XML data :D.
Dashboard region is an excellent Example of the Dynamic content .


Seriously i m dam excited to dirty my hands on this examples :D .. you will even love it for sure ;)


Again Forms examply thats Data entry in the tutorial list , it just gave a simple example to come out with the old look n fell of form and give a very refreshing look of jquery .

Go thru even Oracle maps and other example even .


5)  In a case , you have to upgarde you application suppose changing names of the items and lablels and all ... then now its made easier , who donot have to navigate each time to different pages to look for item .

You have something called utilities @ apex 4.1 @ application level even , in the right side you can see page utitlites , region utilties , item utilties , you can see all corresponding objects and change them here , rather than struggling and navigating to diff pages. You can edit all othem labels , help text and subsriptions in one go :)



6)My fav one is Methods on Tables Utility

Home >  SQL workshop > Utility > Methods on tables.

This uitilty will create an API for you on a table .
U need to input table name and it will create package containing all possible dml operations  on tables with  select_operation ( called get_tablename ) procedure .

The most best part was it was using md5 checksum function which most of the developers donot use to update the database .  This will avoid data integirty .


-- build MD5 function for table "AGENDA"
   function "BUILD_AGENDA_MD5" (
      "P_AGENDA_ID" in number,
      "P_MEETING_ID"  in number,
      "P_SELECT_AREA" in varchar2  default null,
      "P_AGENDA_ITEM" in varchar2  default null,
      "P_DATE_TODAY"  in date      default null,
      "P_COL_SEP"     in varchar2  default '|'
   ) return varchar2 is
 
   begin
 
      return utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5(input_string=>
         "P_MEETING_ID"  ||"P_COL_SEP"||
         "P_SELECT_AREA" ||"P_COL_SEP"||
         "P_AGENDA_ITEM" ||"P_COL_SEP"||
         "P_DATE_TODAY"  ||"P_COL_SEP"||
         ''
      ));

Oops Mobile Template in Oracle APEX 4.1 ???

Here goes my post for something interesting , i must say in which i  was always interested thats Oracle apex 4.1 with mobile themes.

I was customizing my themes to check what all other various options available.

I happened to encountered a word called Mobile ... i refreshed the page ... to see is it illusion ... I saw it again , it was Mobile  in the tab