Saturday, June 23, 2012

Start Production Weblogic Server Automatically When Server Machine Starts.

In this post I am going to explain, how you can configure Production Weblogic Server Machine to start weblogic services, automatically when Administrator logs-in. The same you can achieve when only machine
starts, but you would not able to see command window when you get logged-in.

Weblogic Production Server - 10.3.3.0 (11g)
Server Machine OS - Windows Server 2008 SP1 64 Bit , Intel Xeon Processors (2)

1.  Logged into your server machine.

2.  Check the location of startWebLogic.cmd command script at 'C:\Oracle\Middleware3
     \user_projects\domains\sbgom\bin\' according to your filesystem.

3.  Anywhere in your filesystem create a .bat file & name as 'weblogicAutoStart'. Explicitly check the
     .bat extension by looking properties of file.

4.  In the batch file write start /min %SystemRoot%\system32\cmd.exe /k"C:\Oracle\Middleware3
     \user_projects\domains\sbgom\bin\startWebLogic.cmd" & Save.

5.  Note the /min parameter is only to start command window in minimized mode. You can remove if dont
     want.

6.  Now you can invoke this bat file when Admin logs-in by Windows Task Scheduler.

7.  Open the Task Scheduler from Administrative Tools in Control Panel.

8.  In the Task Scheduler right click to Create Task. In the Wizard dialog, in Name field of General Tab give
     an appropriate task name like 'WebLogicAutoStart'.

9.  In the Trigger Tab click New button. Select At Logon from dropdown & choose Specific User or 
     Group radio button.

10.In the Actions Tab, click New button & select Start A Program from dropdown in Edit Action dialog.

11.Click Browse button to locate your bat file & Press OK & OK. Its done.



How to reload whole jsf/jspx page from bean in JDeveloper 11g ?

Oracle JDeveloper 11.1.1.3
ADF Faces Rich Components


Sometimes requirement is to refresh whole jspx page from root . By simple java bean code this can achieve.
 public String refreshPage_action() {  
    FacesContext fctx = FacesContext.getCurrentInstance();  
    String pageToRefresh = fctx.getViewRoot().getViewId();   //getting View Id of current page  
    ViewHandler viewHandler = fctx.getApplication().getViewHandler();      
    UIViewRoot viewRoot = viewHandler.createView(fctx, pageToRefresh);   //ViewRoot for current page  
    viewRoot.setViewId(pageToRefresh);  
    fctx.setViewRoot(viewRoot);     //set the viewroot in facesContext to reload  
    return null;  
 }   

How to remove installed extensions in JDeveloper 11g ?

Windows 7 Enterprise
Oracle JDeveloper 11.1.1.3

From Help > Check For Updates menu, you can install new extensions either from 'Search Update Centers' or 'Install From Local File'.

When you want to remove those extensions from IDE manually, you can goto filesystem & should remove
the related .jar files. This would completely remove the extension.

The location in my machine is - C:\Oracle\Middleware11g\jdeveloper\jdev\extensions.

Alternatively, the extension can be disabled or enabled from JDeveloper.
From Tools > Preferences > Extensions the list of installed extensions can be found.
Deselect desired extension to stop loading in IDE.

In future, if same extension want to use again, this can be enabled from here.

Thursday, June 21, 2012

Edit Dynamic Tab Shell Layout (DynamicTabShell.jspx) page in JDeveloper 11g


Windows 7 Enterprise
Oracle JDeveloper 11.1.1.3
WebLogic Server 10.3.3.0

This post is about to show the steps involved to edit the Dynamic Tab Shell Layout (DynamicTabShell.jspx) page in Jdev11g-ADF.

1.  Goto this location C:\Oracle\Middleware11g\jdeveloper\adfv\jlib, according to your installation folder.
2.  Create a folder CUSTOMIZATION.
3.  Open CMD command promt.
4.  Navigate to 'C:\Oracle\Middleware11g\jdeveloper\adfv\jlib\CUSTOMIZATION' by CD command.
5.  Execute in CMD 'C:\>jar xf oracle-page-templates-ext.jar'. Your JDK should be
     registered in PATH variable under Environment Variables in your machine.
     Command Prompt should return with no errors. IF necessary you can put exact path of
     'oracle-page-templates-ext.jar' .
6.  Now, navigate by windows explorer
     'C:\Oracle\Middleware11g\jdeveloper\adfv\jlib\CUSTOMIZATION\ORACLE\UI\PATTERN\
     DYNAMICSHELL\
7.  While opening Jdev already, double click to open 'dynamicTabShell.jspx' in IDE.
8.  Now, you are ready to Edit the template page as per your need. Main requirement is to decrease the
     bottom space in page. You can also edit other things.
9.  After editing Save the file & Close from IDE.
10.Now, its time to re-package all the extracted files. Navigate to 'CUSTOMIZATION' folder in CMD.
11.Type 'jar cfM0 oracle-page-template.jar *'. [0~Zero]
12.This will create a 'oracle-page-template.jar' packaged file containing edited jspx file & others, in same
     location.
13.Copy 'oracle-page-template.jar' file & paste in 'C:\Oracle\Middleware11g\jdeveloper\adfv\jlib' or under
     middleware installation directory.

14.Now, you can use this jar file in your project to use edited dynamicTabShell.jspx.
15.By default your project will be using 'Oracle Extended Page Templates' reference with
     'oracle-page-templates-ext.jar' file from path 'C:\Oracle\Middleware11g\jdeveloper\adfv\jlib'.

16.Open your Application.jws, right click 'ViewController > Properties > Libraries & Classpath'.
17.Remove the 'Oracle Extended Page Templates' in the Classpath Entries.
18.Add 'oracle-page-template.jar' from 'C:\Oracle\Middleware11g\jdeveloper\adfv\jlib', by
     clicking 'Add/Jar directory'.
19.Click OK & run application to see new changes in template page & you done !

Be careful, when you take these source project files in other machine. You should also ship
'oracle-page-template.jar' & save in that machine & re-register in Classpath Entries with exact path.