U bent hier: Home > Blog

Make use of custom ‘Number’ converter in ADF application with Jheadstart 11g


Johan Tuitel, 20 januari 2012

When we need to convert ‘Number’ values in the front-end, we have the standard:

<af:convertNumber />

But we want a custom converter for the number values in the application.

To do this for the whole application, we need to adjust the jag-config.xml.

1. Go to ViewController > Resources > config and open jag-config.xml.

2. Search for property name=”libraries” under this property you will find

<value>default/common/common_items.vm</value>

3. Replace this one with a custom reference e.g.

<value>UrgencyRequest/common/demo_items.vm</value>

4. Next is to make this new demo_items.vm template and copy the content from the original common_items.vm template to the new template.

5. Search for #macro (NUMBER_CONVERTER) and insert a custom converter:

<f:converter binding=”#{DemoNumberConverter}” />

Example:

  #macro (NUMBER_CONVERTER)
#if(${JHS.current.item.numberItem})
<f:converter binding=”#{DemoNumberConverter}” />
#end
#end

Debugging in jDeveloper 11g: Name too long to represent


Johan Tuitel,

When I was working on a project and i wanted to debug the application i get an error:

name is too long to represent(Caused by: java.lang.InternalError: name is too long to represent)

I found out that the problem was caused by the jsff-file I was running. The file was to big to debug.

There are several methods to reduce the size of the file, my suggestion is to make use of regions.

Using CSS stylesheet to customize tab menu in ADF 11g


Johan Tuitel, 10 januari 2012

When you would like to customize the menu in ADF you have to use css.

To do this you need to understand that a tab consist of three parts

  • start(left side of the tab)
  • content(middle of the tab)
  • end(right side of the tab)

in the application we have two states of the tab, not selected and selected.

Example

Not selected Tab

(left side of the tab, not selected)

  af|navigationPane-tabs::tab-start{
    background-image: url("../img/tab_left.png") !important;
  }

(middle of the tab, not selected)

  af|navigationPane-tabs::tab-content{
    background-image: url("../img/tab_content.png") !important;
  }

(right side of the tab, not selected)

  af|navigationPane-tabs::tab-end{
    background-image: url("../img/tab_right.png") !important;
  }

Selected Tab

(left side of the tab, selected)

  af|navigationPane-tabs::tab:selected af|navigationPane-tabs::tab-start{
    background-image: url("../img/tab_left_selected.png") !important;
  }

(middle of the tab, selected)

  af|navigationPane-tabs::tab:selected af|navigationPane-tabs::tab-content{
    background-image: url("../img/tab_content_selected.png") !important;
  }

(right side of the tab, selected)

  af|navigationPane-tabs::tab:selected af|navigationPane-tabs::tab-end{
    background-image: url("../img/tab_right_selected.png") !important;
  }

We use !important to make sure that a property is always applied.

JSP page template not found


Johan Tuitel,

When I was looking in a jsff-file I saw that the pageTemplate component showed an error.

the error: JSP page template not found

This will not cause any problems to run you’re application, but it is correct to solve problems.

1. Then you have to add the url to the custom template in the

pagetemplate-metadata.xml

2. go to ViewController > Application Sources > META-INF > pagetemplate-metadata.xml

3. Add a line which define the template of the page:

<pagetemplate-jsp-ui-def>/common/pageTemplates/ExamplePageTemplate.jspx</pagetemplate-jsp-ui-def>

Reusable Component in ADF 11g


Johan Tuitel,

When I was working on a project I saw we created a few components the same, but if we had an adjustment we need to do this several times. To fix this problem you can make use of the declarativeComponent.

This component is perfect to make things work the same and maintenance easy.

1. We need to make a reusable component, create a jsff-file

  • Insert root tag with the libraries.
  • Insert in the root tag a componentDef(in which we define the content attribute’s and the content).
  • In this componentDef we add a xmlContent tag and panelGroupLayout.
  • In the xmlContent we define an attribute.
  • In the panelGroupLayout we define an inputText to show the value.

This is an example structure for the reusable component:

 <?xml version=’1.0′ encoding=”UTF-8″?>
<jsp:root xmlns:jsp=”http://java.sun.com/JSP/Page” version=”2.1″
xmlns:h=”http://java.sun.com/jsf/html
xmlns:f=”http://java.sun.com/jsf/core
xmlns:af=”http://xmlns.oracle.com/adf/faces/rich
xmlns:trh=”http://myfaces.apache.org/trinidad/html“>
<af:componentDef var=”demo” componentVar=”component”>
<af:xmlContent>
<component xmlns=”http://xmlns.oracle.com/adf/faces/rich/component“>

           <attribute>
<attribute-name>name</attribute-name>
</attribute>

</component>
</af:xmlContent>

<af:panelGroupLayout id=”demoLayout” layout=”vertical” inlineStyle=”width:1008px;”>
<af:inputText id=”demoName”
value=”#{demo.name}”
label=”Name”
readOnly=”true”
rendered=”#{demo.name != null}”
contentStyle=”color:white; font-weight: bold; font-size: 12px;”
styleClass=”DemoLabel”/>
</af:panelGroupLayout>

</af:componentDef>
</jsp:root>

2. To call this component we need to define declarativeComponent.

   <af:declarativeComponent id=”demoRegion”
viewId=”/regions/demoRegion.jsff”
name=”#{bindings.demoName.inputValue}”>

Generate taskflow and controlflow with jHeadstart 11g


Johan Tuitel, 2 januari 2012

When you made custom navigation in you’re application, but you want to keep te navigation you need to create custom templates otherwise the navigation is lost if you generate the application.

For this problem you need to create a custom taskflow with custom control-flow-case, you need to set the template TASK_FLOW_VIEW_ACTIVITIES for task-flow-control and set the template TASK_FLOW_CONTROL_FLOW_RULES.

1. open JDeveloper -> select ViewController -> right mouse button -> click Edit JHeadstart Application Definition.

Jheadstart has opened and then you select the group for who you want to generate the task-flow-control and control-flow-case.

2. select the template tab and scroll to the group Faces Config, under this group you find the templates

  • TASK_FLOW_CONTROL_FLOW_RULES
  • TASK_FLOW_VIEW_ACTIVITIES

3. Set another reference to both templates, to do this we create new templates which we adjust.

We use a search page as example.

4. Edit the TASK_FLOW_CONTROL_FLOW_RULES(the call to the page)

5. Set custom code under the from-activity-id *

<control-flow-case id=”#NEW_ID(“__”)”>
<from-outcome id=”#NEW_ID(“__”)”>showSearch</from-outcome>
<to-activity-id id=”#NEW_ID(“__”)”>Search</to-activity-id>
</control-flow-case>

6.  Edit the TASK_FLOW_VIEW_ACTIVITIES(which is the page)

<task-flow-call id=”Search”>
<task-flow-reference>
<document>/WEB-INF/adfc-config-Search.xml</document>
<id>SearchTaskFlow</id>
</task-flow-reference>
</task-flow-call>

This generate the group taskflow and you do not have any problem with generating.

Generate Managed beans in Faces-Config with jHeadstart 11g


Johan Tuitel,

When you make use of a managed beans and in particularly a bean which you want to use in the entire application, you can add a managed bean in Faces-config.xml.

This can be done manually, but we need to do this with jHeadstart.

1. Open JDeveloper -> select ViewController -> right mouse button -> click Edit JHeadstart Application Definition.

2. Select the service.

3. Select the template tab and scroll to the group Faces Config, under this group you find the template:

FACES_CONFIG

4. Create new template and add manually a managed bean in this FACES_CONFIG template.

example

<managed-bean>
<managed-bean-name>DemoClass</managed-bean-name>
<managed-bean-class>nl.transfer.beans.DemoClass</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

The benefit of doing this, is that you still can generate with jHeadstart without losing an inserted managed bean in the Faces-config.xml file.

UKOUG 2011 in Birmingham – dag 3


Marcel-Jan Krijgsman, 8 december 2011
Dit is deel 3 van een reeks van 4 artikelen in de serie UKOUG2011

Na het Engelse ontbijt vanochtend pakte ik als eerste een sessie over statistieken op gepartitioneerde objecten door Doug Burns. Met pijn in het hart liet ik Jonathan Lewis’ sessie over redo daarvoor vallen. Gelukkig werd ik niet teleurgesteld. Uit deze sessie leerde ik wat voor rare dingen er kunnen gebeuren als je statistieken op partities niet goed begrijpt. En dan nog. We werden vooral op het hart gedrukt te letten op de GLOBAL_STATS optie. Waar dat ook al weer zat moet ik nog opzoeken.

Daarna volgde ik de sessie van Frits Hoogland (van VX company) over multiblock reads in de database. Goed dat ik gegaan ben, want Frits wist te vertellen dat er sinds 10.2 dingen veranderd zijn m.b.t. dit fenomeen. Frits was duidelijk de diepte in gegaan om dit fenomeen beter te begrijpen. Lastig om het hier even te samenvatten.

Alex Gorbachev vertelde over het gebruik van Amazon’s EC2, RDS en S3 cloud diensten voor Oracle databases. Een van de lastige dingen met cloud diensten is de Oracle licenties en dat werd heel duidelijk uitgelegd. Vooral over wat er nog niet is. Ook vertelde hij over de verschillende hoeveelheden CPUs die je kunt afnemen en het blijkt dat vooral de snelheid van I/O inconsistent is. (meer…)

UKOUG 2011 in Birmingham – dag 2


Marcel-Jan Krijgsman, 7 december 2011
Dit is deel 2 van een reeks van 4 artikelen in de serie UKOUG2011

De dag begon met dat we Rene bijna kwijt waren. Je moet bij het oversteken van de straat eerst rechts kijken in Engeland, zeker als er van die kant een bus aan komt.

Mijn eerste sessie was de Oracle Security Roundtable, voorgezeten door Pete Finnigan. Daarin konden we met elkaar in discussie over de beveiliging van Oracle databases. Ik kon het natuurlijk niet nalaten om mijn stokpaardje over security awareness te bereiden, maar het bleek dat het topic security awareness ook leefde bij andere deelnemers. Ik heb beloofd een powerpoint over security awareness publiekelijk te maken en dat moet ik dus vooral niet vergeten. Verder kwamen ook de verschillende beveiligingsopties van Oracle aan bod.

Zo ging het onder andere over dubbele encryptie die steeds meer wordt toegepast door niet alleen data in de applicatie te encrypten (bijv. met dbms_crypto), maar ook met Transparent Data Encryption (een feature van de Advanced Security optie). Transparent Data Encryption zorgt voor versleuteling van data in data files en het geheugen, maar houdt iemand niet tegen om in de database erop te queriën. Andersom is data dat versleuteld wordt nog onversleuteld in het geheugen te vinden (tenzij de data buiten de database versleuteld is). (meer…)

UKOUG 2011 in Birmingham, dag 1


Marcel-Jan Krijgsman, 6 december 2011
Dit is deel 1 van een reeks van 4 artikelen in de serie UKOUG2011

Een van de belangrijkste congressen m.b.t. Oracle technologie elk jaar, is die van de UK Oracle Users Group in Birmingham. Ik kan gerust stellen dat deze conferentie voor techneuten hoog op de agenda staat.

En Transfer heeft dit jaar drie afgevaardigden die gaan spreken: Peter de Vaal spreekt over migreren van Fusion Middleware in de praktijk, René van Wijk vertelt over het optimaliseren van Weblogic Server Performance en mijn onderwerp is het runnen van een security project. Dat is trouwens de allerlaatste sessie van de conferentie.

Birmingham is al helemaal in kerstsferen

(meer…)

Eerdere artikelen »