Skip to main content

Posts

Showing posts from July, 2011

ADF BC Service Interface Deployment slowly so I dont forget

Foolproof way to get this stuff deploying for OUR enviroment: Model Project Right click --> Project Properties Deployment Remove all old deployments Create new Deployment (New Button) Select Business Component Service Interface from the drop down Enter Deployment Profile Name: ModelDeploy Click ok Edit each project and in the JAR Options select Compress Archive When editing the EJB Module in File Groups > Project Outputs > Filters select all tick boxes from model folder down in tree. Save All EAR Right click --> Application Properties Deployment [Project Name]Deploy Select Application Assembly Tick all

Java 7

So Java 7 was released yesterday. Here are a few things I found interesting taken from the release guide. Some very nice features that I have been waiting for for a long time - my favorites are the Stings in switch and catching multiple exceptions but that is just me. For the full story http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html or  http://download.oracle.com/javase/7/docs/ Language Binary Literals - 0b or 0B.  Ok but I wont be using it so much. Underscores in Numeric Literals - Any number of underscore characters ( _ ) can appear anywhere between digits in a numerical literal. This may be quite confusing for my brain 52 == 5___2 weird but I suppose it helps with grouping Strings in switch Statements - You can use the String class in the expression of a switch statement. FINALLY been waiting for this. Type Inference for Generic Instance Creation - You can replace the type arguments required to invoke the constructor of a generic...

*** NOT ADF - Glassfish custom login module

Step 1) Write your custom module - there are enough examples out there - I used ( http://x-techteam.blogspot.com/2008/03/glassfish-login-module-simple-example.html ) Step 2) Add to login.conf [glassfish location]\glassfish\domains\[domain name]\config yourRealm{     za.co.jaas.realm.YourLoginModule required; }; Step 3) Admin console setup Goto admin console : http://localhost:4848 and Login Goto Cconfigurations\[Your config]\Security\Realms Click new button ClassName: za.co.jaas.realm.YourRealm (choose second custom radio button) Name:     yourRealm Press the ok button BIG BIG NOTE: (Save yourself hours of time) Tick Default Principal To Role Mapping in configurations\[Your config]\Security\ and save stop glassfish REDEPLOY APPLICATION start glasfish NOTE : When writing a startup script please remeber to start db before start of Assfish otherwise you will have some strange funky errors.

ADF manual LOV binding backing bean selected value

Ok so I tried this a whole bunch of ways and this is the way I will follow from now on to save my self MUCH hassle. What I want is a VO based SelectOneItem that has an empty selected item which is selected by default. Also the value of the SelectItem must be custom and NOT index based. The Backing Bean   private String selectedCode = null;   public String getSelectedCode() {     return selectedCode;   }   public void setSelectedCode(String selectedCode) {     this.selectedCode = selectedCode;   } The jspx page              <af:selectOneChoice value="#{viewScope.yourBean.selectedCode}"     label="#{viewBundle.JSPXNAME_LBL_YOURLABEL}"     required="#{bindings.YourLovCode.hints.mandatory}"     shortDesc="#{bindings.YourLovCode.hints.tooltip}" id="soc4"     styleClass="colspec_medium" unselectedLabel="" valuePa...

Adding an ADF LOV to the aether

1) Create the View Object This is done as you would create any VO and add the VO to the application module. Dont forget to refresh Data Controls section. 2) Bind LOV on page defs (Executable section) Navigate to the page you want to add the LOV to Click on the bindings tab. Click the green plus button on the Executables section Select iterator Press ok Select your newly created VO Press OK    3) Add a List to bindings Press the green plus button on the Bindings Section Select list then ok Standalone select one value list then ok  Select your Iterator from the base data source list Select your display attribute 4) Create SelectItem on page   Add the following tag to your page REMEMBER that LovCode must be replaced by your newly create binding                   <af:selectOneChoice value="#{bindings.LovCode.inputValue}" label="#{viewBundle.COMMISSION_LBL_COMM...

Error Handling ADF

Created a custom error handler to customize any exceptions that come along. (We throw message keys from the model layer and handle them auto-magically in the handler) . Create an exception handler class. Add the attribute ErrorHandlerClass   to the root Application tag to DataBindings.cpx ErrorHandlerClass="za.co.transcode.adf.mdm.model.messages.ReferenceCustomMessageHandler". NOTE: This is not production ready code and needs a few performance tweaks but you will get the idea. This is in our common project you would just override this class in the dependant projects with skipLists and overrideList populated ( skipList = {{"java.lang.NullPointerException", null}, {" java.sql.SQLException ", "1234"}} OR overrideList = {{"java.lang.SQLException", "9999", "This should never happen"} } ) Code for custom handler: package za.co.transcode.adf.common.model.messages; import java.sql.SQLException; import oracle.adf....