tag:blogger.com,1999:blog-70615482024-02-28T17:29:22.353+01:00J2EE development with Oracle productsUnknownnoreply@blogger.comBlogger35125tag:blogger.com,1999:blog-7061548.post-1134139144108522012005-12-09T15:22:00.000+01:002007-03-29T20:25:36.630+02:00J2EE - Oracle Enterprise Users SecurityOracle Enterprise Users Security make it possible to combine SSO, JAAS, JDBC-Connection Pooling (J2EE-DataSouce) and VPD (Row Level Security) in conjunction with Proxy Authentication and single stored LDAP Users/Roles.<br /><br />Depending of the securit requirements and used product or feature stack, many different configurations possible. Following I will demonstrate the scenario how to use Oracle Enterprise Users Security with connection pooling in an Java EE environment.<br /><br /><br />Suppose you have 3 user types:<br />1. <span style="FONT-WEIGHT: bold">Enterprise User</span>: The LDAP users which connect to the DB without any DB resources (No DB create user command is required!)<br />2. <span style="FONT-WEIGHT: bold">Global Schema User</span>: The DB-Schema how the enterprise user is automaticly mapped to.<br />3. <span style="FONT-WEIGHT: bold">JDBC Pool User</span>: The user used to create the connection pool with only connect rights. That user has no resource or other permissons.<br /><br />Required steps:<br /><br /><strong>1.</strong> Create the LDAP V3 User Structure with any LDAP Tool or command<br /><br /><strong>2.</strong> <a href="http://www.oracle.com/technology/deploy/security/db_security/howtos/eus-how-to.html">Use the Oracle Enterprise Security Manager and Map the LDAP Roles to DB Roles </a><br /><br /><strong>3.</strong> create the oracle pool user: create jdbcpooluser identified by MyPassword123<br /><strong>4.</strong> grant connect to jdbcpooluser<br /><br /><strong>5.</strong> Permit the Global-Schema user to connect through the jdbc pool user: alter user global_schema grant connect through jdbcpooluser<br /><br /><strong>6.</strong> On each connect swich the jdbc connection from the pool to the LDAP user:<br /><span style="font-family:courier new;">properties.put(oraConnection.PROXY_DISTINGUISHED_NAME, username);<br />oraConnection.openProxySession(OracleConnection.PROXYTYPE_DISTINGUISHED_NAME,´properties); </span><br /><br />Within Springframwork you can overwrite the doGetConnection methode of UserCredentialsDataSourceAdapter class to get the connection hook before Sring makes any DB access.<br /><br />To establish this inside a JSF-Application you must overwrite the SpringPhaseListener to bound the principal to the current Thread:<br /><span style="font-family:courier new;font-size:85%;">FacesContext fc = FacesContext.getCurrentInstance().getExternalContext(). </span><br /><span style="font-family:courier new;font-size:85%;">Principal j2eePrincipal = fc.getUserPrincipal(); // Bound the context to the current thread with your helper class in usage of the InheritableThreadLocal static variable BmaierContextHolder.createContext(j2eePrincipal);</span><br /><span style="font-family:courier new;font-size:85%;"></span><br />Afterward you should overwrite the methode <span style="font-family:courier new;">doGetConnection</span> of <span style="font-family:courier new;">UserCredentialsDataSourceAdapter</span> class as followed:<br /><br /><span style="font-family:courier new;font-size:85%;">protected Connection doGetConnection(String username, String password) throws SQLException { </span><br /><span style="font-family:courier new;font-size:85%;">... </span><br /><span style="font-family:courier new;font-size:85%;">Connection connection = getTargetDataSource().getConnection(username, password); ... </span><br /><span style="font-size:85%;"><span style="font-family:courier new;">if(connection instanceof oracle.jdbc.OracleConnection){ BmaierSecurityContext sc = BmaierSecurityContextHolder.getNgcmSecurityContext();</span> </span><br /><span style="font-family:courier new;font-size:85%;">username = sc.getPrincipal().getName(); </span><br /><span style="font-family:courier new;font-size:85%;">// we grant DB-proxy without explicit password delivery - make SSO possible!</span><br /><span style="font-family:courier new;font-size:85%;">password = "";</span><br /><span style="font-size:85%;"></span><br /><span style="font-size:85%;"><span style="font-family:courier new;">OracleConnection oc = (OracleConnection)connection;<br />properties.put(oraConnection.PROXY_DISTINGUISHED_NAME, username);<br />oraConnection.openProxySession(OracleConnection.PROXYTYPE_DISTINGUISHED_NAME, properties);<br /><br />return oraConnection;</span></span><br /><span style="font-size:85%;"><span style="font-family:courier new;">}<br /></span></span><br />This make it possible to use J2EE/JAAS-Authentication in conjunction with secured and pooled database connections.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1126112329125664022005-09-07T18:12:00.000+02:002005-09-08T16:02:49.066+02:00BPEL Binary FileAdapterwithin Oracle BPEL you have the choice to interprete file data as XML stream or as binary data. In the case of binary data the imput type will be a base64 encoded string representation. To decode the Base64 String you can use following java snipped:<br /><br /><code><br /> CubeDOMElement doc = (CubeDOMElement)getVariableData("myVariable", "opaque","/ns2:opaqueElement");<br /> String str = (String)doc.getData();<br /> byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(str);<br /><br /></code>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1124440338652155612005-08-19T10:28:00.000+02:002005-08-19T18:17:50.203+02:00Print BPEL Variable to StdoutTo trace BPEL Variables you can use the java task:<br /><br /><span style="font-family:courier new;"><bpelx:exec><br /><br /><strong>CubeDOMElement element = (CubeDOMElement)</strong>getVariableData ("MyVariable", "payload","/ns2:myData");<br /><br />System.out.println(<strong>doc.asXML()</strong>);<br /><br /><br /></bpelx:exec></span><br /><br />I use following command to make the output visible:<br />tail -f C:\%ORACLE_HOME%\opmn\logs\OraBPEL~OC4J_BPEL~default_island~1Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1124279553454656222005-08-17T13:28:00.000+02:002005-08-17T13:52:33.460+02:00Deploy additional BPEL Process ArchivesIt's a normal way to structure and separate java code from BPEL project. To deploy this dependend JAR-Archives automatically with your BPEL-Project, you must create the following Directory structure within your BPEL Project:<br /> <br /><blockquote><strong><table><tr><td>- BPEL-INF</td><td>- classes</td><td> </td></tr><br /> <tr><td></td><td>- lib <td><td></td><td> </tr></table></strong></blockquote>and copy the required jar archives or classes to that directories.<br /><br />However, while developing with JDev, you get an compile error as long as you don't create a deployment-dependency to a the jar deployment profile of the other project. Hint: this dependency will not be evaluated from the BPEL deployment process!Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1124277982377632002005-08-17T13:13:00.000+02:002005-08-17T13:26:22.383+02:00Output BPEL-Variable to OutputStreamHere is an example to write any BPEL-Variable to System.out or any other stream:<br /><br /><bpelx:exec import="org.w3c.dom.*"/><br /><bpelx:exec import="javax.xml.parsers.*"/><br /><bpelx:exec import="javax.xml.transform.*"/><br /><bpelx:exec import="javax.xml.transform.dom.*"/><br /><bpelx:exec import="javax.xml.transform.stream.*"/><br /><br />TransformerFactory transformerFactory = TransformerFactory.newInstance();<br />Transformer transformer= transformerFactory.newTransformer();<br />PrintStream outStream = System.out;<br />Result output = new StreamResult(outStream);<br />DOMSource source = new DOMSource((org.w3c.dom.Node) getVariableData("ReceiveFromRMRFileEvent_Read_InputVariable","RMR"));<br /><br />transformer.transform(source,output);<br /><p></p>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1124275700945947682005-08-17T12:43:00.000+02:002005-08-17T12:58:44.030+02:00BPEL: User Defined PreferencesOracle' BPEL deployment descriptor bpel.xml includes the undocumented section "preferences" to configure user defined properties. The generic BPEL Administration console BPELConsole allow the admistration of all variables at runtime without redeployment.<br />Sample:<br /><BPELSuitcase><br /><BPELProcess id="MyProzess" src="myProzess.bpel"><br /><strong><preferences></strong><br /><strong><property name="myTempDir">c:\temp</property > </preferences><br /></strong></BPELProcess><br /></BPELSuitcase><br /><br /><strong>Attention: the position of the preference section is very important. It must be the first element after the BPELProcess tag to work correctly.<br /></strong><br />There are two build-in functions to read this properties:<br />ora:getPreference(String name); in each xml expression andgetPreference in the java inline sectionUnknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1121266464698090022005-07-13T16:26:00.000+02:002005-07-13T17:17:23.250+02:00WISIF - BPEL Java Binding ErrorWithin <a href="http://www.orablogs.com/reynolds/archives/000611.html">WISIF Java Binding</a> you get properly an compile error for methode binding without paramters (eg. public Boolean ping();) like following:<br /><br />[Error ORABPEL-10902]: compilation failed [Description]: in "bpel.xml", XML parsing failed because "notification operation not supported.In WSDL at MyService.wsdl", operation "ping" of portType "{http://xmlns.xxx.com/ch/rule/service}RLPortType" is a notification operation (The endpoint sends a message), which is not supported in this version. See chapter 2.4 of WSDL spec 1.1.Make sure the operation is "one-way" type or "request-response" type.". [Potential fix]: n/a.<br /><br />To solve this problem you must define an message for empty parameters within portType section:<br /><br /><b><message name="myPingRequest"> </message> </b><br /> <message name="myPingResponse"> <br /> <part name="pingOutput" type="xsd:boolean"/> <br /></message><br /><br /><br /><portType name="myPortType"><br /> <operation name="ping"> <b><br /> <input name="myPingRequest" message="tns:myPingRequest"/> </b><br /> <output name="myPingResponse" message="tns:myPingResponse"/><br /> </operation><br /></portType>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1120722094875317412005-07-07T09:37:00.000+02:002005-07-13T18:27:03.896+02:00Oracle Business Rule Engine - JSR 94Oracle offers a new <a href="http://www.oracle.com/technology/products/ias/business_rules/index.html">Java based rule engine</a> based on the JSR-94. Last view days I have the chance to test the rule enigin within an BPEL project to solve dynamic and high performance object manipulation requirements.<br />Now I'm very inspired about the performance and the ease of use. The main reason of this is the established Rule syntax like Java programming language. and the possiblility to mix Java objects and Java code with Rule RL without restrictions. This make it easy to integrate rules in Java code and manipulate or make dessisions depending of the current program status.<br /><br />However, the web based rule author is currently in beta status and not realy usfull for complex rules. So I recommend to write your rule in the RL-Syntax and load the rules from file instead repository usage. This means you can omit the rule generation call java methode ruleSession.generateRL( props ) from the XML-Repository. Instead this use simple file loading of your own RL-Syntax file.<br /><br />Now, have fun with Oracle Business Rules!Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1118837548346218532005-06-15T14:03:00.000+02:002005-06-15T14:12:28.350+02:00Change XSLT engine within BPELI heard Oracle XDK XSLT engine should be faster than Apache XALAN engine. If you which, you can change the XSLT engine with the <strong>xmlns:ora namespace </strong>declaration in your BPEL process XML declaration as following:<br /><br /><br />Change <strong>xmlns:ora</strong> to <strong>xmlns:ora=</strong><a class="moz-txt-link-rfc2396E" href="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"><strong>"http://schemas.oracle.com/bpel/extension/xpath/function/xdk"</strong></a> in the bpel <process>....Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1114785987357340782005-04-29T13:56:00.000+02:002005-04-29T16:47:06.756+02:00ContextRoot JSFHow to get the ContextRoot in an JSF environment: #{<strong>facesContext.externalContext.requestContextPath</strong>} in my configuration">Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1109848580227919942005-03-03T12:06:00.000+01:002005-03-03T12:16:20.236+01:00UIX 2.2.x can't handle Struts TagsThe <strong><global-forwards></strong> could not be used in conjunction with uix:struts. This is founded in Struts-TagLib handling. All global-forward tags are bounded at rendering time to the link (Macro funktionality) and not while runtime like <action> elements (/save.do).<br />A good practice with and without UIX is the usage of the <action> element with a simple forwad attribute instead of <global-forwards>.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1105959785384895202005-01-17T11:23:00.000+01:002005-03-03T11:58:48.576+01:00OC4J Debuglevel<p>-<strong>verbosity</strong> is my favorite OC4J startparameter to get OC4J debug output. The range is defined from 1-10:<br /><br /><strong>$JAVA_HOME/java -jar oc4j.jar -verbosity 10</strong><br /><br />Today I need a additional parameter to get more information about the used DataSource:<br /><br />java -Ddatasource.verbose=true -Dhttp.session.debug=true -jar oc4j.jar -verbosity </p><p>HTTP Debugging</p><ul><li><strong>http.session.debug</strong> = Provides information about HTTP session events</li><li><strong>http.cluster.debug</strong> = Provides information about HTTP clustering events</li><li><strong>http.error.debug</strong> = Prints all HTTP errors </li></ul><p>JDBC Debugging</p><ul><li><strong>datasource.verbose</strong> = Provides verbose information on creation of data source and connections using Data Sources and connections released to the pool, etc,</li><li><strong>jdbc.debug</strong> = Provides very verbose information when JDBC calls are made</li></ul><p>EJB Debugging</p><ul><li><strong>ejb.cluster.debug</strong> = Turns on EJB clustering debug messages</li><li><strong>transaction.debug</strong> = Provides debug information on transactions, useful for JTA debugging</li></ul><p>RMI Debugging </p><ul><li><strong>rmi.debug</strong> = Prints RMI debug information</li><li><strong>rmi.verbose</strong> = Provides very verbose information on RMI callsJMS Debugging</li><li><strong>jms.debug</strong> = Prints JMS debug information<br /></li></ul><p></p><p><br /><a href="http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html">http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.html</a> </li><ul></ul>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1105608984848980912005-01-13T10:10:00.000+01:002005-01-13T16:20:29.286+01:00Get the serialized ADF-RowKey in uiXMLWithin a UIX-Table you can get the serialized ADF-RowKey with the EL-Expression <strong>${uix.current.rowKeyStr}.</strong> This undocumented feature allow you to bind the key to a link for table actions instead to use the singleSelection element:
<br />
<br />Example to delete a row with a link into each table row:
<br />
<br /><span style="font-family:courier new;"></span>
<br /><span style="font-family:courier new;"><link text="${uix.current.EmployeeId.attributeValue}"> </span>
<br /><span style="font-family:courier new;"><boundAttribute name="destination"> </span>
<br /><span style="font-family:courier new;"><concat> </span>
<br /><span style="font-family:courier new;"><contextProperty select="ui:contextURI"/> </span>
<br /><span style="font-family:courier new;"><fixed text="/<strong>deleteEmp.do?rowKeyStr</strong>="/> </span>
<br /><span style="font-family:courier new;"><dataObject source="<strong>${uix.current.rowKeyStr}"/</strong>> </span>
<br /><span style="font-family:courier new;"><fixed text="&event=delete"/> </span>
<br /><span style="font-family:courier new;"></concat> </span>
<br /><span style="font-family:courier new;"></boundAttribute> </span>
<br /><span style="font-family:courier new;"></link></span>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1105544759170802532005-01-12T16:36:00.000+01:002005-01-12T16:45:59.170+01:00How to use the JAZN API to manage OC4J users Here is a sample code to change the password in the jazn.xml file in usage of the JAZN API:
<br />
<br /><span style="font-family:courier new;"><strong>changeJaznUserPassword</strong>(String realm, String userName, String password){</span>
<br /><span style="font-family:courier new;"></span>
<br /><span style="font-family:courier new;"> RealmManager realmMgr = JAZNContext.getRealmManager(); </span>
<br /><span style="font-family:courier new;"> Realm realm = realmMgr.getRealm(realm); </span>
<br /><span style="font-family:courier new;"> UserManager userMgr = realm.getUserManager();
<br /> RealmUser user = userMgr.getUser(userName);</span>
<br /><span style="font-family:courier new;"> XMLRealmUser xmlrealmuser = (XMLRealmUser)realm.getUserManager().getUser(userName);
<br /> if(xmlrealmuser == null)
<br /> throw new Exception("The specified user does not exist in the system.");
<br /> xmlrealmuser.setCredentials(userPwd, serRepeatedPwd);
<br />
<br />// to refresh automaticlly you must set the property "<em>external.synchronization = true</em>" in <em>jazn.xml - see previous blog</em>
<br /></span><a name="1022805"></a><span style="font-family:courier new;">userMgr.refresh();
<br /></span>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1105543804021090862005-01-12T16:14:00.000+01:002005-01-12T16:34:17.996+01:00How to tell a running OC4J to refresh external updated Users (jazn-data.xml) To tell a running OC4J instance to refresh the cached users after updating the jazn-data.xml manually, you must set the following parameter in the <strong>jazn.xml</strong> file
<br />
<br /><property name="<strong>external.synchronization</strong>" value="<strong>true</strong>">
<br />
<br /><a href="http://www.tju.cn/docs/oas90400/web.904/b10325/configja.htm">see also jazn documentation:</a>
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1103716073205985772004-12-22T13:47:00.000+01:002004-12-29T14:38:16.230+01:00Write your own JSP EL-Functions to secure your web appFrank has a very good description to use the J2EE security model to secure your web pages fine granular (<a href="http://www.orablogs.com/fnimphius/archives/000600.html">ADF UIX: Enabling and disabling page compression in UIX</a>). However I have an extention to this: Within the ADF UIX Framework you can easily extend EL and write your own EL methode like ${isUserInRole('GuestRole')}. As you know UIX was the initial idea to specify JavaServer Faces. So with UIX you can write for each component your own renderer. This means you can write your own Java methodes and call it within the EL renderer like this:
<br />
<br /><submitButton disabled="${ctrl:<strong>isUserInRole</strong>(uix, 'GuestUserRole')}" text="Save" >
<br />
<br />To accomplish this you must write the following code:
<br />
<br /><span style="font-family:courier new;">public final class ELFunctions{
<br />public static Boolean isUserInRole(Object uix, String role) throws Exception{
<br />ControllerImplicitObject uixObj = (ControllerImplicitObject)uix;
<br />boolean isInRole = uixObj.getBajaContext().getServletRequest().isUserInRole(role);
<br />return new Boolean(isInRole);
<br />}
<br />}
<br /></span>
<br />After writing your static Java EL Function you must write a framework factory class. This is accomplished by usage of the UIExtention Framework:
<br />
<br />public class ELFunctionExtension implements UIExtension {
<br />static Class funcClass = com.bm.ui.common.ELFunctions.class;
<br />
<br />static Class getFuncClass(String className){
<br />try {
<br />Class clazz = Class.forName(className);
<br />return clazz;
<br />}
<br />catch(ClassNotFoundException classnotfoundexception) {
<br />throw new NoClassDefFoundError(classnotfoundexception.getMessage());
<br />}
<br />}
<br />
<br />public void registerSelf(ParserManager parserManager) {
<br />XMLUtils.registerFunctions(parserManager, "<a href="http://xmlns.oracle.com/uix/controller">http://xmlns.oracle.com/uix/controller</a>",
<br />funcClass != null ? funcClass : (funcClass = getFuncClass ("com.bm.ui.common.ELFunctions")));
<br />}
<br />
<br />public void registerSelf(LookAndFeel lookandfeel) { }
<br />
<br />}
<br />
<br />
<br />Additional you must register the UIExtention in the WEB-INF/uix-config.xml file:
<br />
<br /><span style="font-family:courier new;"><ui-extensions>
<br /><extension-class> com.bm.ui.common.ELFunctionExtension </extension-class>
<br /></ui-extensions>
<br /></span>
<br />
<br />Now you can access the isUserInRole() method directly from the uiXML code:
<br />
<br /><submitButton disabled="$<strong>{!ctrl:isUserInRole(uix,'PowerUserRole')</strong>}" text="Save" >
<br />or
<br /><submitButton disabled="${<strong>not ctrl:isUserInRole(uix,'PowerUserRole')</strong>}" text="Save" >
<br />or
<br /><submitButton disabled="${<strong>ctrl:isUserInRole(uix,'GuestUserRole')</strong>}" text="Save" >
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1103492847908210162004-12-19T22:38:00.000+01:002004-12-19T22:47:27.910+01:00ADF: How to edit the current selected rowThere are may possibilities to edit the current selecte row in usage of ADF-Bindings, ADF- BC4J and uiXML .
<br />
<br /><ul><li>First you can do the task with a table and input fields into the same page . This approach is very simple and also used within Jdev generated sample code. The underling bindingModel associate to the identical page name and so the bounded edit fileds associate always the same model.
<br /></li><li>Next to edit the current row into an other page without hidding only the table or edit elements, you must change the associated BindingModel in the new page to the calling page. This is done in five steps: create a new ADF Struts DataAction, change the requested modelName in the getBindingContainerName() methode of your overwritten oracle.cabo.adf.rt.InitModelListener. Additional you should copy all bindingControls from the original UIModel to the underling Model. Into the uiXML page you should call the associated struts action after setting the current row:
<br />
<br /><singleSelection model="${bindings.EmployeesViewIterator}" text="Select and "> <primaryClientAction> <fireAction source="EmployeesView0" event="select"> </fireAction>
<br /></primaryClientAction>
<br />....
<br /><event name="select">
<br /><compound>
<br /><set target="${bindings.EmployeesViewIterator}" property="currentRowIndexInRange" value="${ui:tableSelectedIndex(uix, 'EmployeesView0')}"/>
<br /><struts:action path="/selectEmp.do">
<br /></struts:action>
<br /></compound>
<br /></event>
<br />
<br />The rest is automatically done by ADF.
<br /></li><li>A other way is to write our own DataAction for the current user selection. Remove the single selection element from uiXML table and add a column with the following selection link:
<br />
<br /><column>
<br /> <columnFormat columnDataFormat="numberFormat"/>
<br /><columnHeader>
<br /><sortableHeader model="${ctrl:createSortableHeaderModel(bindings.EmployeesView,'EmployeeId')}"/>
<br /></columnHeader>
<br /><contents>
<br /><link text="${uix.current.EmployeeId.attributeValue}">
<br /><boundAttribute name="destination">
<br /><concat> <contextProperty select="ui:contextURI"/>
<br /><fixed text="/selectEmp.do?<strong>id</strong>="/>
<br /><dataObject source="<strong>${uix.current.EmployeeId.attributeValue}"/</strong>>
<br /><fixed text="&event=<strong>select</strong>"/>
<br /></concat>
<br /></boundAttribute>
<br /></link>
<br /></contents>
<br /></column>
<br />
<br />Afterward the associated adf struts action should set the current row and navigate to the edit page with the struts action forward tag:
<br />
<br />public void on<strong>Select</strong>(DataActionContext ctx){
<br /> String <strong>id</strong> = (String)evalEL("<strong>${param.id}",</strong>ctx);
<br /> JUIteratorBinding iter = (JUIteratorBinding)evalEL("${bindings.EmployeesViewIterator}", ctx);
<br /> Key key = new Key(new Object[] {<strong>id</strong>});
<br />Row[] rows = iter.getViewObject().findByKey(key,1);
<br /> iter.setCurrentRowWithKey(key.toStringFormat(true));
<br />}</li></ul>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1103394327158599212004-12-18T19:12:00.000+01:002004-12-18T20:06:25.393+01:00How to evaluate any parameter in ADF-Actions You can easiely evaluate any parameter including servlet, request or ADF binding parameters with the Expression Language Syntax (EL).
<br />
<br />
<br /><span style="font-family:courier new;">/** Evaluate an EL (expression language) Expression and return the result </span>
<br /><span style="font-family:courier new;">* @param expression EL Expression to evaluate </span>
<br /><span style="font-family:courier new;">* @param ctx The DataAction context. </span>
<br /><span style="font-family:courier new;">* @return The object identified by the EL expression </span>
<br /><span style="font-family:courier new;">*/ </span>
<br /><span style="font-family:courier new;">public Object evalEL(String expression, DataActionContext ctx) { </span>
<br /><span style="font-family:courier new;">Evaluator eval = Evaluator.getEvaluator(ctx); </span>
<br /><span style="font-family:courier new;">return eval.getValue(expression); }</span>
<br />
<br />
<br />An example to retrive a request parameter into an adf action:
<br />...
<br />
<br /><span style="font-family:courier new;">String myImputParam = (String)evalEL(ctx, "${param.myInputParam}");</span>
<br />
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1102582660815373802004-12-09T08:59:00.000+01:002004-12-10T18:11:18.080+01:00Spring Toplink Integration I am very happy to annonce Oracle's Springframwork support. The integration includes the Toplink Persistence Framework like Hibernate. <a href="http://www.oracle.com/technology/products/ias/toplink/preview/spring/index.html">http://www.oracle.com/technology/products/ias/toplink/preview/spring/index.html</a>
<br /> ... numerous thanks Jim Clark!
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1098553154739746122004-10-23T19:24:00.000+02:002004-10-23T19:39:14.740+02:00Excellent Architecture... a good architecture can be more than J2EE: <a href="http://www.allianzarena.de/impinc/fotogalerie/20042.php?actpos=11">http://www.allianzarena.de/impinc/fotogalerie/20042.php?actpos=11</a>
<br />
<br />I'm proud to announce the J2EE community our first success illumination test in Munich (Soccer Station). This is a very good example of extreme building and best architecture practice!
<br />
<br />.. be inspired!
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1094914479939149722004-09-11T16:42:00.000+02:002004-09-11T16:58:39.790+02:00Struts versus JavaServer Faces (JSF)<a href="http://forum.java.sun.com/thread.jsp?forum=427&thread=553126">Many people compare Struts with JSF</a>. My experience on both give me the opinion to say there is a complete different development approach with JSF.
<br />The only equals between JSF and Struts are the external XML defined states of the controller. The JSF-controller concept is much more comparable with Swing-Component (MVC) and not central managed like struts. Additional, Struts is only a Servlet-Controller based on the MVC-2 Pattern and does not include UI-Components with Rendering Delegation Pattern, Statemanagement, full I18N support, component validators etc.
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1094827789235603142004-09-10T16:30:00.000+02:002004-09-10T21:49:42.933+02:00Fetch children from any service method in ADF-TreebindingWith <a href="http://radio.weblogs.com/0118231/2004/07/20.html#a354">ADF-TreeBinding</a> you have the only possibility to get the children nodes from the same BeanClass used to render the current node self. Therefor you must add a getter method that return a collection of childrens in the node bean. There is no possibility to delegate the call to an other service routine e.g. to a delegate class. With the <a href="http://www.dofactory.com/patterns/PatternProxy.aspx">proxy pattern </a>you can solve this problem easily. You must wrap the node bean in a proxy class and delegate each call to wrapped node expect your <span style="font-family:courier new;">getChildren</span>() method. This method can use any service class to retrieve the children nodes and store the returned children's as proxies in the instance. Additional you must bind the proxy to the tree and not the node bean. This little trick make it ease to avoid the ADF-Binding restrictions.
<br />
<br />Example code:
<br />
<br /><span style="font-family:courier new;font-size:85%;">class MyNode implements Node {
<br />...
<br />int getId() {...}
<br />String getName() {...}
<br />List getChildren(){...}
<br />...
<br />}
<br />
<br />class ProxyNode implements Node {
<br />Node node = null;
<br />Service service = null;
<br />ProxyNode(Service service, Node node) {
<br />this.node = node;
<br />this.service = service;
<br />}
<br />
<br />String getName(){
<br />// delegate to org node
<br />return node.getName();
<br />}
<br />
<br /><span style="color:#ff9900;">List getChildren(){
<br />if(node.getChildren() == null){
<br />return service.getChildrenNodes(node.getId());
<br />}
<br />return node.getChildren();
<br />}
<br /></span>...
<br />}
<br />
<br /></span>
<br />Attention, the tree binding fetch alway the actual selected node and all nodes of his children nodes to know which rendering mode to use (icon, link ...)
<br />
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1094680375087835602004-09-08T22:33:00.000+02:002004-09-08T23:58:33.846+02:00J2EE Web Authentication in conjunction with BC4J and JDBC Proxy Authentication<a href="https://cwisdb.cc.kuleuven.ac.be/ora10doc/network.101/b10773/admnauth.htm">Proxy Authentication</a> is designd to address connection performance problems associated with three-tier. Specifically, it allows to designate an already opend connection from a pool to a specific user with his privileges without logout and login each time.
<br />BC4J-Framwork use the Strategie Pattern to customize the login and connection process. With JDeveloper 10g there is an default Implementation to use the feature. There are only tow single steps to use this feature in conjunction with J2EE login:
<br />
<br />
<br /><ul><li>Set Connection Factory property <span style="font-family:courier new;">jbo.ampool.sessioncookiefactoryclass to oracle.jbo.http.OCISessionCookieFactory</span> in bx4j.xcfg (use the connfiguration dialog for the root Application module) </li><li><strong>or </strong>set follow Java option: -Djbo.ampool.sessioncookiefactoryclass=oracle.jbo.http.OCISessionCookieFactory</li><li>Create a J2EE Login Page (<a href="http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-security-JAAS.html">Example in usage of OC4J</a>)</li><li>After successfull login you should call any methode to set the new user </li></ul>
<br /><span style="font-family:courier new;">String DEFAULT_PWD = "myDefaultPwd123";</span>
<br /><span style="font-family:courier new;">HttpContainer c = HttpContainer.getInstanceFromSession(session); c.setSessionCookie("myRootAppModule",null); // <a href="http://www.oracle.com/technology/products/jdev/howtos/bc4j/howto_dynamic_jdbc.html">More informations about getInstanceFromSession</a></span>
<br /><span style="font-family:courier new;">MyEnvInfoProvider.session.setAttribute(Configuration.DB_USERNAME_PROPERTY, request.getRemoteUser());
<br /></span>
<br /><span style="font-family:courier new;">This Example works also with an x.509 certificate: <a href="http://www.oracle.com/technology/oramag/oracle/03-may/o33trends.html">see</a></span>
<br />
<br />
<br /><a href="http://www.oracle.com/technology/products/jdev/howtos/bc4j/howto_dynamic_jdbc.html">Example of complete Connection Strategy for BC4J</a>
<br />
<br /><a href="http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/9i_jdbc/OCIMidAuthSample/Readme.html">More infos about proxy authentication</a>
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1094214681273206942004-09-03T14:14:00.000+02:002004-09-03T16:06:29.976+02:00ADF POJO BindingI was wondering why the native POJO binding doesn't allow creation of new objects (insert). After a look I found out there is not creation supported in the default DataControl implementation class (<span style="font-family:courier new;">DCGenericDataControl</span>) of POJO. To suppot the insert operation you must create and register your own DataControl in the <span style="font-family:courier new;">DataBinding.cpx</span> file and overwrite the <span style="font-family:courier new;">createRowData(DCRowContext)</span> method. To implement the method you can use the TopLink example found under: <span style="font-family:courier new;">../jdev/BC4J/scrc/adfmsrc.zip/oracle.adf.model/generic/toplink/TopLinkDataControl.java
<br /><em></em></span>
<br />Afterward you must also overwrite the <span style="font-family:courier new;">isOperationSupported</span>(...) in your DataControl to enable the MenuBar buttons (check byte parameter with <span style="font-family:courier new;">DCDataControl</span> static <span style="font-family:courier new;">DCDataControl.OPER_DATA_ROW</span>... ).
<br />
<br /><em>Ist not allowed to use only the new operator and insert the bean into the collection!!! </em>
<br />
<br />The same requirement exist for the DeleteOperation. You must also overwrite the <span style="font-family:courier new;">removeRowData()</span> Methode as above described.
<br />
<br />A BUG in the ADF code prevent JClient to refershe automaticly the iterators and show the new data. You can fix it for your own: Unpack ../jdev/BC4J/scrc/adfmsrc.zip and uncomment the if(!cont<span style="font-family:courier new;">ainsRow(row)) </span>in the methode <span style="font-family:courier new;">insertRow(Row)</span> and <span style="font-family:courier new;">insertRowAtRangeIndex(int, Row)</span> of o<span style="font-family:courier new;">racle/adf/model/generic/DCRowSetIteratorImpl.java
<br /></span>
<br />
<br />
<br />Unknownnoreply@blogger.comtag:blogger.com,1999:blog-7061548.post-1092950603252722292004-08-19T22:47:00.000+02:002004-08-19T23:29:20.993+02:00JSF Facet contra UIX Named ChildrenJSF introduce <a href="http://www.exadel.com/tutorial/jsf/components/next.html">facet</a> (<f:facet name="header">) tag to address elements inside a parent tag and have control over it. This is a anti pattern for general XML developer and very badly to handle with other specs. as XMLSchema.
<br />Old UIX implementation use for that a more common XML syntax (<f:heander>) and name this named children . Index children are the opposite and used to arrange each elements in a sequence For this UIX (old impl.) use the ((<contents>). Tag. Unfortunately Oracle UIX / JSF implementation must also use the new facet syntay to be spec compliant.
<br />Unknownnoreply@blogger.com