Archive for the ‘ADFBC’ Category

Source: https://sites.google.com/site/joeztechland/how-to–in-adf

ADF BC (Model)

ADF Faces (UI)
Bindings:
– DataProvider code example: here

VOs: Single, Shared VO Instance or Multiple?

Page Behavior:
– Prevent initial page render: adfFacesInitialContext Render Issues: here and here

Passing Data as Parameters (how to get data from point A to point B)
1. Data Bindings
– Value is set in bindings tab via NDValue property: This value can be EL and reference backing bean methods (that return a value), scopes (pageFlowScope, requestScope)
— this makes the value available to the resource that it is bound to and whose param has the NDValue. T

2. Task Flows
– URL Params: Capture in Task Flow properties. Move to a scope: ex: pageFlowScope.varname (tf param is copied to destination)
– Method Calls:
Created w/ TF Method Call: Method name entered manaully into Method call or through D&D onto TF method Call.
Params set in Property Window for Method
Can use return value for Navigation or not
— Create method call in TF and then associate method with it and then its params
– Method call via D&D from Data Control onto TF:
Params set in PageDef

3. SetCurrentRowWithKey (or KeyValue)
– With Command Link:
Set row – in bindings row.RowKeyStr (rowkey=row.rowKeyStr)
And link sends action for navigation
Command link action listener calls rowkey.execute – passes current row and navigate to destination and executes query from rowkey.execute

4. Page Params
– Add Params to Pagedef. Give Params a source (value = ex: pageFlowScope.xxx)
– then , can use params w/ service methods
Method: param1 NVDValue = bindings.paramname (note: bindings not pageFlowScope)

5. SetAction Listener to store values: main way to copy values using from: and to:

Use setCurrentRowWithKey/Value (video)
– use setCurrent to auto fire findbykey() – on entry to new page – keeps the new page current withthe current row
– can fire action so can be used (typically IS used ) for navigation
– task flow with search and edit forms and flows
– table in edit – add setcurr call. set its text value to column EL value and delete that value
– in bindings, setcurrr rowKey NDValue to value from column (key col)
— If key value is a string and can be viewed as normal data, use …WithKeyValue
— If key is obtained by getKey() on a VO , then it is sthe serialized string version of key and use …WithKey

Use ExecuteWithParams

Expose ADFbc as Web Service

Expose Web Service as Data Control

Query Component:
– Read only fields in query comp: open ER#10431603
– Capture internal components events/reference: ER or not possible
– Auto suggest on internal fields: ER#9797027
– Popup content headers not sizing correctly: Fixed in 11.1.1.4
– How to tell view criteria used by query comp: here
– Save Queries across sessions: here

Train Component:
– Validating train flow: here

Exception Handling:
– multiple callbacks to DCErrorHandlerImpl http://forums.oracle.com/forums/thread.jspa?threadID=1805073
– how to show multiple messages for a single exception http://forums.oracle.com/forums/thread.jspa?threadID=1805074
– how to configure logging for Utils buildFacesMessage http://forums.oracle.com/forums/thread.jspa?threadID=1805075
– HTML tags returned from DCErrorMessage.getHTMLText() http://forums.oracle.com/forums/thread.jspa?threadID=1805076
– DCErrorHandlerImpl sub-class super(true) or super(false)at http://forums.oracle.com/forums/thread.jspa?threadID=1805078
– DCErrorHandlerImpl.processMessage() method http://forums.oracle.com/forums/thread.jspa?threadID=1807859

and more
– the phase when exceptions are translated to JSF FacesMessage objects http://forums.oracle.com/forums/thread.jspa?threadID=2134598
– an EL expression that evaluates the type of exception http://forums.oracle.com/forums/thread.jspa?threadID=2151981
– abstract method handleException() cannot be accessed directly http://forums.oracle.com/forums/thread.jspa?threadID=2151982
– how to designate custom code as an exception handler http://forums.oracle.com/forums/thread.jspa?threadID=2151983
– ExceptionHandler implementation and activity marked as “Exception
– Handler” http://forums.oracle.com/forums/thread.jspa?threadID=2151984

Tips and Tricks:
LOVs:
Returning non key value: query lov col, as “code” make attribute a key attribute. In LOV usage on VO, return code into the desired text field

ViewCriteria
Can have VC criteria = literal with no value if bind vars will not be used.

Source: OTN JDeveloper Forum

All

Just successfully deployed a JSF/ADF-BC4J app developed in Jdev 10.1.3.3 to Tomcat-6.0.14 and MySQL 5.0

Thought I would share since i could not find anything out there that gave me the steps for this configuration combo.

Assumptions:
1. install MySQL 5.0 database with some tables.
2. install Tomcat-6.0.14 (http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/) probably any 6.x build would be same
3. Application Modules developed in Jdev are currently configured to run on MySQL (SQL92 flavor / Java type mappings)
4. This is for ADF-BC4J only. TopLink would require add’l steps, though I assume the only difference would be add’l jar files

I did all development in Jdev using the internal OC4J and a local MySQL before deploying to Tomcat.

Steps:
1. copy following jars from <JDEV_INSTALL> to <TOMCAT_HOME>\lib\
(Note that ‘Tools -> ADF Runtime Installer’ does not work for Tomcat 6.x, so this has to be manual)

\BC4J\lib\adfcm.jar
\BC4J\lib\adfm.jar
\BC4J\lib\adfmweb.jar
\BC4J\lib\adfshare.jar
\BC4J\lib\bc4jct.jar
\BC4J\lib\bc4jctejb.jar
\BC4J\lib\bc4jdomorcl.jar
\BC4J\lib\bc4jimdomains.jar
\BC4J\lib\bc4jmt.jar
\BC4J\lib\bc4jmtejb.jar
\BC4J\lib\collections.jar
\BC4J\jlib\bc4jdomgnrc.jar
\BC4J\jlib\adfmtl.jar
\BC4J\jlib\adfui.jar
\jlib\commons-cli-1.0.jar
\jlib\xmlef.jar
\jlib\share.jar
\mds\lib\mdsrt.jar
\mds\lib\concurrent.jar
\diagnostics\lib\ojdl.jar
\jlib\jdev-cm.jar
\jlib\commons-el.jar
\jlib\oracle-el.jar
\jlib\jsp-el-api.jar
\toplink\jlib\toplink.jar
\toplink\jlib\antlr.jar
\BC4J\lib\adfbinding.jar
\lib\xmlparserv2.jar
\lib\xml.jar
\lib\xsqlserializers.jar
\lib\xsu12.jar
\ord\jlib\ordhttp.jar
\ord\jlib\ordim.jar
\sqlj\lib\runtime12.jar
\sqlj\lib\translator.jar
\jdbc\lib\ojdbc14.jar
\jdbc\lib\ojdbc14dms.jar
\lib\dms.jar
\javacache\lib\cache.jar
\BC4J\jlib\dc-adapters.jar
\BC4J\jlib\adf-connections.jar
\webservices\lib\wsdl.jar
\webservices\lib\orajaxr.jar
\webservices\lib\orawsrm.jar
\webservices\lib\wsclient.jar
\webservices\lib\orasaaj.jar
\webservices\lib\xsdlib.jar
\webservices\lib\mdds.jar
\webservices\lib\wssecurity.jar
\webservices\lib\orawsdl.jar
\jlib\osdt_core.jar
\jlib\osdt_cert.jar
\jlib\osdt_xmlsec.jar
\jlib\osdt_wss.jar
\jlib\osdt_saml.jar
\jlib\ojpse.jar
\jlib\oraclepki.jar
\j2ee\home\jazncore.jar
\j2ee\home\lib\http_client.jar

2. copy <JDEV_INSTALL>\BC4J\redist\webapp.war to <TOMCAT_HOME>\webapps\webapp.war

3. in your application’s webroot, create a META-INF folder containing a single file, named ‘context.xml’, with the following (enter your appropriate values as usual):

<?xml version=”1.0″ encoding=”UTF-8″?>
<Context
antiJARLocking=”true”
antiResourceLocking=”true”
reloadable=”true”>
<Resource
auth=”Container”
name=”jdbc/MySqlDS”
type=”com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource”
factory=”com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory”
driverClassName=”com.mysql.jdbc.Driver”
maxIdle=”2″
maxWait=”5000″
url=”jdbc:mysql://<HOSTNAME>:<PORT>/<DATABASE>?&ultraDevHack=true&capitalizeTypeNames=true&pedantic=true”
user=”<USERNAME>”
password=”<PASSWORD>”
databaseName=”<DATABASE>”
port=”<PORT>”
maxActive=”10″/>
<Manager
className=”org.apache.catalina.session.PersistentManager”
saveOnRestart=”false”/>
</Context>

4. in all Application Modules, set the Configuration to use a ‘JDBC Datasource’ with the name set to the named datasource in the context.xml created above, e.g.: ‘java:comp/env/jdbc/MySqlDS’

5. create a deployment profile with ‘Platform -> target connection’ set to the Tomcat instance (need to create an entry in ‘Connections -> Application Server’ for it to show up) make sure to include the correct mysql-connector.jar in the ‘WEB-INF/lib’ contributors.
Right-click -> Deploy to your tomcat

6. Make sure MySQL is on and fire up Tomcat, and youre set.

Hope it helps
Sami