Tuesday, February 28, 2012

ADF popups : Note to self

When using a popup dont have a trigger from your button onto the area in which your popup is.

Behaviour: popup.show in code brought back nothing no popup and the code works elsewhere.
Solution: move the popup to an area outside of the refreshed area.


Friday, February 24, 2012

ADF_FACES-30124 Multiple forms detected on viewId: Rich client currently has some limitations in dealing with multiple forms

Check for multiple af:form tags in your page - there might be one in your template if you are using one.

Really now wtf : Jdeveloper 11.1.1.6 released

Warning Rant to follow :
So where is 11.1.2.2 which has weblogic 10.3.6 and why two streams why not migrate the SOA/ Webcentre stuff etc to 11.1.2 and be done with it. I vote for one stream for all.

Interesting addtitions:
Drag and Drop on Touch Devices: On touch devices like tablets, the component drag and drop has a different gesture than with the mouse. An item that can be dragged must activated by a tap and hold gesture. The item will change its appearance to indicate that it can be dragged once held long enough. The same gesture applies to reordering table columns. Tap and hold the column header, then drag it to reorder the columns.

MySQL Support: ADF Business Components have been tested with MySQL 5.5

Improved Compression of JavaScript: By using improved obfuscation techniques, the size of the compressed ADF JavaScript libraries has decreased by an average of 20% across all libraries.

https://blogs.oracle.com/jdeveloperpm/entry/jdeveloper_11_1_1_6
http://www.oracle.com/technetwork/developer-tools/jdev/downloads/jdeveloper11116-1377208.html

Thursday, February 23, 2012

ADF: Help my pages have dissapered from jazn-data.xml configuration

I opened my jazn-data and I had no task flows and web pages in the resource grants section.
Shock and horror : I had made sure the show resource with and without grants was on (little lock and key icons) still not happening.

Then I realized my mistake : ALWAYS have your Source Project set correctly to the view project mine was set to my build project. *embarrassed*





Wednesday, February 22, 2012

Hudson ADF ojdeploy build failure (Too many open files)

I moved our hudson server  (just zip up the $HUDSON_HOME directory and copy it across very easy) to a new redhat machine and the builds started failing with the error (Too many open files).

This indicates that my open file limit has been reached for my user. - check this with the
ulimit -n [this command check the users limit for open files ulimit -a to check all limits]
and lsof -p <pid> | wc -l [get the pid by doing a ps -ef | grep hudson]

To address this the easy way vi /etc/security/limits.conf and add/ edt the following lines (my was the default 1024):
* soft nofile 2048
* hard nofile 2048


Tuesday, February 21, 2012

ADF : Automated testing lessons learned

Ok needed to help with some performance testing of our ADF apps login process and struggled a bit with some of the stuff so here are my findings:

Firefox and Tamper Data: https://addons.mozilla.org/en-US/firefox/addon/tamper-data/

So so handy for catching all your post and get parameters cookies and headers. A must for automated testing to see what is going on in your app. More of a diagnostic tool.

JMeter:  http://jmeter.apache.org/
Really really cool once I had found Chris Muirs post on setting up jmeter for ADF. (link below).
You can make complicated test cases here very easily and run them any number of times in the ide.
Very handy for doing volume testing.

BadBoy: http://www.badboy.com.au/
If you want something that will record what you are doing/ click in your browser and export your scripts to JMeter for automated testing this is the tool for you.

Selenium:http://seleniumhq.org/
Holy moly this is so easy to use and test with - just fire up firefox start the selenium ide add on and start recording - everything just WORKS. You can export this to junit tests and watch as all the magic happens. Really really cool.


Also dont try anything fancy with the login just use j_username and j_password posting to j_security_check. See attached script. http://dl.dropbox.com/u/63575405/Script.jmx

http://one-size-doesnt-fit-all.blogspot.com/2010/04/configuring-apache-jmeter-specifically.html

I like the selenium using unit tests for most of my stuff but I find jmeter incredibly handy for quick perfomance testing.


Friday, February 17, 2012

Nexus vs Artifactory : My experience


Nexus : 1.9.2.4
Artifactory : 2.3.3.1

We needed a repository manager for our maven builds and decided to evaluate  Nexus (I had used Artifactory many time before and needed no evaluation).

I found the Nexus UI was slicker and easier to use than Artifactory also like the file system storage idea. Very cool product.

Unfortunatley we ran into some issues the Nexus builds we were doing where slower and kept timing out and blocking the repos.
(The error was : this is 3 (re)try, cause: java.net.SocketException: Connection reset)
NOTE: we are going through a proxy to get to the internet and could be the cause of the Nexus problem

This was probably a configuration issue but I could not find a solution easily.
So hi-ho hi-ho its back to Artifactory we go.

Wednesday, February 8, 2012

MDS Overview Link

http://www.oracle.com/technetwork/developer-tools/jdev/metadataservices-fmw-11gr1-130345.pdf

Will be posting more here once have setup my MDS repo again for 11.2.1.0 dont think it is any different though.

SVNKit: get local working file revision number

  public final static String getSvnVersionNumber(File file) throws SVNException {
    SVNClientManager clientManager = SVNClientManager.newInstance();
    return String.valueOf(clientManager.getStatusClient().doStatus(file, false).getRevision().getNumber());
  }

Monday, February 6, 2012

ADF Maven : A little bit of mojo Model project

I was testing the much improved maven stuff in Jdev for my ADF project and found a couple of differences in my produced jar and the ADF ojdeploy produced one.

First I needed to include the xml, jpx and properties stuff in my jar in the build\resources tag:


<resource>     <directory>src/</directory>      <includes>       <include>**/*.xml</include>        <include>**/*.jpx</include>       <include>**/*.xcfg</include>       <include>**/*.properties</include>     </includes> </resource>
Then I needed the adfm.xml and oracle.adf.common.services.ResourceService.sva files all the other files where just text files so I am ignoring them for now.

So for this I created a mojo plugin and included it in my build step

 

      <plugin>         <groupId>za.co.test.plugins</groupId>
        <artifactId>my-plugins</artifactId>
       <version>1.0-SNAPSHOT</version>
        <executions>
          <execution>
            <phase>compile</phase>             <goals>               <goal>adfJarMetadataGenerator</goal>             </goals>           </execution>         </executions>       </plugin>



Onto the plugin:
Create a new maven project in Jdev and make surte the packaging is of type maven-plugin.

Then create a java class (your mojo) and extend org.apache.maven.plugin.AbstractMojo
The @goal sudo annotation denotes the name of your plugin that you will use in the calling project.

/**
 * This should generate the extra meta data for adf jar projects.
 * @goal adfJarMetadataGenerator
 * @phase compile
 */
public class ADFClassMetaDataGenerator extends AbstractMojo {

The @parameter annotation denotes and xml tag that you can pass data to your mojo from the calling project.http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

/**
 * @parameter
 */
private String adfmFileName = "classes/adfm.xml";
/**
 * @parameter  expression="${project.build.sourceDirectory}"
 */
private File srcDirectory = new File("src/");
 /**
 * @parameter
 */
private String svaFileName = "classes/oracle.adf.common.services.ResourceService.sva";


You then need an   public void execute() throws MojoExecutionException { method.
This will go though your project and find the location of your Model.jpx file and your bc4j.xcfg this will allow you to generate the adfm.xml.

adfm.xml
      StringBuilder adfmBuilder =
        new StringBuilder("\n").append("\n").append("  
          bc4jFormatName).append("\"/>\n").append("
          "\"/>\n").append("
\n");


Then parse the Model.jpx to find all the application modules for the ResourceService.sva.

oracle.adf.common.services.ResourceService.sva
StringBuilder svaBuilder =  new StringBuilder("#:__PROLOG__:ADF_LibraryDependencies:!;ADF_DataControl:ADF_BusComps\n");
      //for each data control
for(DataControl dc : dcs) {
svaBuilder.append("#:ADF_DataControl:oracle.adf.library.rc.appmodules.AppModuleURLDescriptor:0,").append(dc.getAmName()).append(",").append(dc.getDataContolName()).append(",").append(dc.getFormattedJpxFileName()).append("\n");
      }
      svaBuilder.append("#:__EPILOG__:\n").append("oracle.adf.library.rc.dependencies.LibDepsServiceStrategy ADF_LibraryDependencies\n").append("oracle.adf.library.rc.dcxdatacontrols.DataControlServiceStrategy ADF_DataControl\n").append("oracle.adf.library.rc.buscomp.BusCompServiceStrategy ADF_BusComps\n");

Then just create these files and you are done.

Do a clean install and you can now use the generator in any of your projects.

Note: This is still a work in progress hopefully I get time to finish it off and I will publish the plugin. But it should give you a good idea of what to do.