Saturday, December 05, 2009

How to run eBusiness Suite R12 using IE8


IE8 is not supported for R12 as yet but it does work by disabling a security setting related to Cross Site Scripting (XSS). This solution works on Vista 64 using IE8 on Release 12.1

Here is how to do it:
Firstly we need to add the EBS application server to trusted sites within IE as we definitely do want the IE8 XSS filter active for general Internet browsing.
1. In IE8 Select Tools->Internet Options->Security(tab)->Trusted Sites
2. Click Sites and type in the hostname of the server running R12, untick Require HTTPS if needed and add the website to the list of trusted sites. Hit close.
3. Still in the Security tab click the custom level button and scroll right to the bottom and the third option from the bottom at the time of writing is 'Enable XSS Filter" set the option value to Disable.

Make sure you only disable the XSS filter for Trusted sites which should be a small list of intranet servers that you trust the content from.

Tuesday, December 09, 2008

Browse JAR, WAR and EAR files in Explorer


Found this really neat method if getting the Windows Zip Explorer Compressed (zipped) Folders extension to read JAR, WAR and EAR files in Windows Explorer.


Instructions
Open notepad and paste the below Registry Entries into a text file named ear-jar-war.reg, save it on your desktop and then run it. This will associate the three types with the the Zip shell extension: Compressed (zipped) Folders
If any of the extensions are associated with something else, Compressed (zipped) Folders will now appear in the recommended programs for these file types so you can associate them manually.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.jar]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"

[HKEY_CLASSES_ROOT\.jar\CompressedFolder]

[HKEY_CLASSES_ROOT\.jar\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CLASSES_ROOT\.jar\OpenWithProgids]
"CompressedFolder"=""

[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.war]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"

[HKEY_CLASSES_ROOT\.war\CompressedFolder]

[HKEY_CLASSES_ROOT\.war\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CLASSES_ROOT\.war\OpenWithProgids]
"CompressedFolder"=""

[HKEY_CLASSES_ROOT\.war\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.ear]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"

[HKEY_CLASSES_ROOT\.ear\CompressedFolder]

[HKEY_CLASSES_ROOT\.ear\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_CLASSES_ROOT\.ear\OpenWithProgids]
"CompressedFolder"=""

[HKEY_CLASSES_ROOT\.ear\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

Oh and of course back up your registry before running. As you can see from above it only adds some keys to HKEY_CLASSES_ROOT, tested in XP, but at your own risk and all that ;)

Monday, July 07, 2008

How to find, share and back up JDeveloper code templates


JDeveloper code templates are stored in the JDevHome folder in an XML file called java.tpl. This is one file worth backing up if you have a lot of custom code templates.

The file is in [Drive:]\JDevHome[Version]\system\oracle.jdeveloper.[version] eg.

C:\JDev\IDE\JDevHome10.1.3.3_1\system\oracle.jdeveloper.10.1.3.41.57

Sunday, May 11, 2008

Free software I wouldn't be without


Here are some tool-utilities-programs I wouldn't be without. All free and very useful:
PuTTY : SSH Client : Link
UnxUtils: grep, cut and ls your way around Windows : Link
CutePDF : Convert ANY document to PDF : Link
Foxit: Lightweight fast PDF reader: Link
XML Notepad : Free XML tool from Microsoft : Link
Collabnet Subversion : Powerful source control : Link
TortoiseSVN : Explorer extension and GUI for Subversion: Link

Wednesday, May 23, 2007

J2EE Container Managed Security: How to reference the current user


When J2EE container managed security is used the User Principal can be referenced in a number of ways:


Expression Language
       <af:outputText value="#{facesContext.externalContext.userPrincipal.name}"/>

Managed / Backing Bean
       ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
String userName = ectx.getUserPrincipal().getName();
System.out.println("Current user: " + userName);

ADF BC Application Module
       String userName = getUserPrincipalName();
System.out.println("Current user: " + userName);


Tuesday, March 27, 2007

Programmatically removing all entities from a view object

Recently I had a case where I needed to remove all rows from a view object and found that there was no existing method to do this.
The case for doing such an action is where there is a Master-Detail relationship and the detail relation is used only of there is a certain condition met in the master. If the condition is met then the detail is required, however if the user changes their mind then we need a way of removing any records that may have been created in the detail.

By adding the following method in the View Object Implementation class we can safely delete all records in the view object:

    public void removeAllRows(){
// rangeSize is -1
Row[] rows = getAllRowsInRange();
for (int r = 0; r < rows.length; r++)
if (rows[r] != null)
rows[r].remove();

}

Saturday, March 24, 2007

How to reduce coding by extending Managed Beans

After coding many backing/managed beans it became clear to me that there were a few things that I seem to be doing over and over, these were:
  • Getting values from the binding layer
  • Setting values in the binding layer
  • Executing operation bindings
  • Using a combination of the above in a backing bean method

The logical thing to do was be to but my code for doing this into a class and extend this class for all of my managed beans. The class is called JSFBean and uses the binding "#{bindings}" to access the binding container. The three methods in the class (so far) are: execute, getValue and setValue.

The bean which I have called JSFBean includes these three methods and some basic error handling. When creating a backing bean simply add "extends JSFBean" to the class definition.

JSFBean.java:
package com.delexian.ui.backing;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.binding.OperationBinding;

public class JSFBean {

public JSFBean() {
}

public DCBindingContainer getBindings() {
FacesContext fc = FacesContext.getCurrentInstance();
ValueBinding vb = fc.getApplication().createValueBinding("#{bindings}");
DCBindingContainer dc = (DCBindingContainer) vb.getValue(fc);

return dc;
}

public boolean execute(String operation){
DCBindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding(operation);
if (operationBinding == null){
FacesContext fc = FacesContext.getCurrentInstance();
fc.addMessage("Invalid Operation", new FacesMessage(operation + " is not a valid operation for this page"));
return true;
}

operationBinding.execute();

return operationBinding.getErrors().isEmpty();
}

public Object getValue(String el){
FacesContext fc = FacesContext.getCurrentInstance();
ValueBinding expr = fc.getApplication().createValueBinding(el);
return expr.getValue(fc);
}

public void setValue(String el, Object value){
FacesContext fc = FacesContext.getCurrentInstance();
ValueBinding expr = fc.getApplication().createValueBinding(el);
expr.setValue(fc, value);

}

}



An example usage in a backing bean Employees.java, extends JSFBean:
package com.delexian.ui.backing;

public class Employees extends JSFBean {
public Employees() {
}

public String calculate_action() {
execute("CalculateCommission");
execute("Commit");
return null;
}
}