adf source code for 12.1.3

i was trying to find a workaround to show text on left-positioned-af:panelTab-component-tabs. this link shows related oracle community question.

so i searched for a class named something like *Tab*Renderer*.class in JDeveloper install folder. i thought if i could find the class and decompile it, it might reveal some clues.
but search results were suprising as following.

search results

using source code for af:panelTab, i simply added a span html tag for text value and it rendered like this:

left positioned tabs with text

 

then i wondered if i could find any other source codes. at the end of the day, i realized that jdev install folder holding a bunch of adf libraries’ source code including :

jdev121300\jdeveloper\adfc\src\adf-controller.zip
jdev121300\jdeveloper\adfc\src\adf-controller-api.zip
jdev121300\jdeveloper\adfc\src\adf-controller-rt-common.zip
jdev121300\jdeveloper\adfc\src\adf-controller-schema.zip
jdev121300\jdeveloper\adfc\src\adf-controller-security.zip
jdev121300\jdeveloper\adfc\src\adf-pageflow-dtrt-src.zip
jdev121300\jdeveloper\adfc\src\adf-pageflow-fwk.zip
jdev121300\jdeveloper\adfc\src\adf-pageflow-impl.zip
jdev121300\jdeveloper\adfdt\src\adfdt_common_src.zip
jdev121300\jdeveloper\adfdt\src\adf-dt-at-rt_src.zip
jdev121300\jdeveloper\adfdt\src\adf-view-databinding-dt-core_src.zip
jdev121300\jdeveloper\adfdt\src\adf-view-unified-databinding-dt-core_src.zip
jdev121300\jdeveloper\adfv\src\adf-richclient-api-src.zip
jdev121300\jdeveloper\adfv\src\adf-richclient-impl-src.zip
jdev121300\jdeveloper\adfv\src\adf-richclient-security.zip
jdev121300\jdeveloper\adfv\src\trinidad-api-src.zip
jdev121300\jdeveloper\adfv\src\trinidad-impl-src.zip
jdev121300\jdeveloper\BC4J\src\adfbcsvc-client-src.zip
jdev121300\jdeveloper\BC4J\src\adfbcsvc-share-src.zip
jdev121300\jdeveloper\BC4J\src\adfbcsvc-src.zip
jdev121300\jdeveloper\BC4J\src\adf-businesseditor_src.zip
jdev121300\jdeveloper\BC4J\src\adf-dynamic-faces-src.zip
jdev121300\jdeveloper\BC4J\src\adf-em-configsrc.zip
jdev121300\jdeveloper\BC4J\src\adf-faces-changemanager-rt-src.zip
jdev121300\jdeveloper\BC4J\src\adf-faces-databinding-rt-src.zip
jdev121300\jdeveloper\BC4J\src\adflibrary-src.zip
jdev121300\jdeveloper\BC4J\src\adfm-sqldc-src.zip
jdev121300\jdeveloper\BC4J\src\adfmsrc.zip
jdev121300\jdeveloper\BC4J\src\adfmwebsrc.zip
jdev121300\jdeveloper\BC4J\src\adf-sec-idm-dc.zip
jdev121300\jdeveloper\BC4J\src\adf-share-base-src.zip
jdev121300\jdeveloper\BC4J\src\adf-share-ca-src.zip
jdev121300\jdeveloper\BC4J\src\adf-share-glassfish-src.zip
jdev121300\jdeveloper\BC4J\src\adf-share-security-src.zip
jdev121300\jdeveloper\BC4J\src\adf-share-support-src.zip
jdev121300\jdeveloper\BC4J\src\adf-t2p-cloner-src.zip
jdev121300\jdeveloper\BC4J\src\bc4jdomgnrc-src.zip
jdev121300\jdeveloper\BC4J\src\bc4jhtmlsrc.zip
jdev121300\jdeveloper\BC4J\src\bc4jimdomains.zip
jdev121300\jdeveloper\BC4J\src\bc4jrecordersrc.zip
jdev121300\jdeveloper\BC4J\src\bc4jsyscatsrc.zip
jdev121300\jdeveloper\BC4J\src\bc4jtestersrc.zip
jdev121300\jdeveloper\BC4J\src\datatagssrc.zip
jdev121300\jdeveloper\BC4J\src\dvtjclientadfsrc.zip
jdev121300\jdeveloper\BC4J\src\jmxdc-src.zip
jdev121300\jdeveloper\BC4J\src\resourcebundle-api-rt-src.zip
jdev121300\jdeveloper\dvt\src\dvt-basemaps.zip
jdev121300\jdeveloper\dvt\src\dvt-databinding-dt-ide.zip
jdev121300\jdeveloper\dvt\src\dvt-databindings.zip
jdev121300\jdeveloper\dvt\src\dvt-faces.zip
jdev121300\jdeveloper\dvt\src\dvt-facesbindings.zip
jdev121300\jdeveloper\dvt\src\dvt-jclient.zip
jdev121300\jdeveloper\dvt\src\dvt-jclient-gui.zip
jdev121300\jdeveloper\dvt\src\dvt-shared-js.zip
jdev121300\jdeveloper\dvt\src\dvt-trinidad.zip
jdev121300\jdeveloper\dvt\src\dvt-utils.zip

i think this is an easter egg .) like alta ui; jdev 12.1.3(announced Jun 2014) was already containing alta ui(announced Oct 2014).

 

it’s like opening pandora’s box…

handling un-resizable facesmessage popup

if you start working with adf 11g r2 or 12c, at some point you try to resize facesmessage popups. by default, this message popup size is 250px by 250px. and there is no configuration to change it easily.

i also searched for it on internet and oracle community forum. there is one workaround from Duncan Mills.

here, i try to explain another workaround. this method works with adf skinning and skin selectors.

before workaround, following screen shows how facesmessage popup behaves.

Popup before workaround

simply, i added new skin to project. then i override af:dialog skin-selector as follows:

af|dialog {
  -tr-default-content-width : -1;
  -tr-default-content-height : -1;
}

after restarting project, message popup looks much better. i try with IE8, Firefox 29, Chrome 34 and Safari 5.1.7. it seems working.

Popup after workaround

as far as i know, there is only one issue with this workaround. if you look at generated html with a browser extension like chrome developer toolbar, there is a warning sign. but it is not preventing any functionality.

CSS warning

sample application is built with jdeveloper 12.1.2.0.0.

if you use this workaround and discover any issues, please feel free to share it.

how to change default “open application” folder of jdeveloper

as your project grows, you keep opening and closing different jdeveloper applications. if you are not using jdeveloper’s default application folder path, say c:/JDeveloper/mywork, you should be trying to navigate in open application diagram to your own folder.

to make life easier, you can change default folder for open application dialog of jdeveloper as in following screenshot. you need to change path attribute of workDirectory tag in %appdata%\JDeveloper\_related_jdev_system_folder_\o.jdeveloper\applications.xml.

applications.xml

passivation / activation for custom view attribute types(domains)

as i mentioned at previous post, we can use custom view attribute types to store complex data types. in this short post, i will show how to maintain passivation/activation mechanism for these custom attribute types.

if our custom domain type class implements Serializable, we have little to do for supporting passivation. same as following screenshot, we can set Value Serializer Class parameter to oracle.jbo.domain.DefaultValueSerializer.

we can also implement our own value serializer class. in this case, we should implement oracle.jbo.domain.ValueSerializer class and getXMLContentNode(Document xmlDoc, java.lang.Object attrValue)getXMLContentValue(Node attrNode) methods.

managing custom view attribute type(domain) for programmatic view objects

programmatic view objects are useful for temporary data storing and processing. i use these view objects mostly when there are third party services that provide complex data types. after getting required data, i programmatically search some info in complex type and insert some of them to programmatic view object.

when processes are getting longer and new requirements are appeared, i call same service (cheap to call in the beginning of project) to get same data in later steps instead of creating new attributes to view object. i know that this is not a best practice but we developers sometimes have this kind of technical debts.

in this post, i will write about custom attribute type for storing complex data types retrieved from -let’s say- services.

first we need a test type which simulates our third party service return type. let’s call it TestType. this is a simple POJO with two fields long field1, String field2. then we need an encapsulating class that implements oracle.jbo.domain.DomainInterface, call it TestTypeDomain. This is how i implement:

private TestType type;
public TestTypeDomain(TestType t1) {
  super();
  this.type = t1;
}
public Object getData() {
  return this.type;
}

and we can add new attribute to programmatic view object.

after some testing code added to application module to fill programmatic view object, following screenshots show how TestType can be used.

and this is jsf fragment page code using TestType fields.

this is not a complete solution. if we work with programmatic view objects, we should think about adf passivation/activation mechanism. i will prepare a post about this soon.

how to hide adf tree leaf node icons

if you are working with Oracle ADF, you must have a menu with af:tree component here or there. i also used af:tree as main menu, but there was this annoying expand icon for leaf nodes. i googled it for a while and searched in forums, nothing has appeared. so i solved this with kind of tricky solution.

this is how a recursive af:tree looks like with expand icons on leaf nodes:

as you see, we can’t figure out which one is leaf node that has no child. you should try to expand to see if there are child nodes:

and here is tricky part. we need a 10px * 10px white spacer image and some inline styling in af:tree nodeStamp facet. initial facet code is:

<f:facet name="nodeStamp">
  <af:outputText value="#{node}" id="ot1"/>
</f:facet>

then i added af:image and css positioning. but most important part is rendered attribute.

<f:facet name="nodeStamp">
  <af:group id="g1">
    <af:image id="i1" source="/i/spacer.png" rendered="#{node.children == null}"
              inlineStyle="position: absolute; margin-left:-17px;
                           border: 2px solid white; width: 15px; height: 10px;"/>
    <af:outputText value="#{node}" id="ot1"/>
  </af:group>
</f:facet>

i added red border styling to make easy to see where spacer image is located and how it covers expand icon.

this tricky solution has challenges like adf skinning. i am using blafplus-rich skin family and white spacer is suitable for me. if you have another skin, you may need different image or css styling.

i prepared test application with Oracle JDeveloper 11.1.1.4.0.

first post

hi reader, in this blog i will keep my thoughts and practices about software. i am planning to write mostly about java and oracle technologies. but it will take some time to start posting and to progress.