Posts

Showing posts from 2012

Wishing you a Merry Christmas and Happy New Year !!!

Image
New Year is the time to unfold new horizons and realize new dreams, to rediscover the strength and faith within you, to rejoice in simple pleasures and gear up for a new challenges. Wishing you a merry Christmas and a truly fulfilling new year 2013 !!!

Lifecycle of an ADF Fusion web page with regions

While talking to ADF application developers, I received many questions on life cycle of a page with region displaying a task flow, and also on transaction management. In this post I'm sharing the Appendix of my book Oracle ADF Real World Developer’s Guide , which may answer many of your questions on this area. This chapter is absolutely free for you. You just need to click on the link given below to grab this resource :)  Download   To download the complete Chapter, click here   

Using MethodPermission for securing business service methods

In this post, I'm sharing some tips on using MethodPermission  for securing business service methods. In fact this post is an excerpt from  Chapter 14 Securing Fusion Web Applications from my book Oracle ADF Real World Developer’s Guide . This chapter is absolutely free for you. You just need to click on the link given below to grab this resource :)  Download  To download the complete Chapter, click here Securing business service methods Preventing unauthorized access to business services is very critical for any enterprise application. ADF security offers method permission definitions for the purpose of addressing such scenarios. Method permissions check if a user has the right to execute a method defined in the application. ADF security allows you to secure access to methods defined in the application through the oracle.adf.share.security.authorization.MethodPermission class. To define method permissions in an application, perf...

Programmatically Generated ComboboxLOV (without using ADF Model)

Image
While working with different teams, noticed that there are teams(not many) who want to use af:inputComboboxListOfValues without using ADF model. If you have such use cases, then this post is for you. This post contains a sample for programmatically populated af:inputComboboxListOfValues component, without using ADF model. In fact the core pieces used in this example are copied from ADF Faces demo source. This sample is useful if you use ADF Faces without ADF model(binding layer) and still want to implement ComboboxLOV. The following diagram( Also see similar discussion in Oracle® Fusion Middleware Web User Interface Developer's Guide ) illustrates ListOfValuesModelthe model class used by the LOV component. In this diagram, you can also see it's association with the QueryModel and TableModel classes, which are used by the LOV UI component. Take a look at the ListOfValuesModelImpl.java in the attached sample to get a feel of the implementation. This class creates LOV fo...

How does ADF binding interact with EJB components?

Image
If you are very curious to learn the architecture of EJB Data Control (a deep dive in to the implementation, not just high level blocks) and really want to learn how ADF bindings interacts with EJB components, then this post is for you. In this post, I'm sharing Chapter 13 Building Business Services with EJB   from my book Oracle ADF Real World Developer’s Guide . This is absolutely free. You just need to click on the link given below to grab this resource :)  A sneak peek at the architectural diagram of ADF binding for EJB: The details of the components listed in the above block diagram are available in this chapter. You can also find a sequence diagram illustrating how each components are getting engaged when UI access data from EJB through ADF binding. Following topics are discussed in detail: The architecture of a Fusion web application, using EJB as a business service  Oracle ADF binding architecture for EJB  How does ADF Model data bin...

Do you know what is a Composite View Object?

Oracle ADF Business Component stack offers something known as composite view object.Did you know that? The composite view objects help you to combine hierarchical results from two or more master detail view objects linked through a view link into a single composite view with flattened query retrieving the same result set. For example, consider the Department and Employee hierarchies built using the Department and Employee view objects, linked through a view link. You can build a composite view object at runtime by combining these two view objects as shown in the following code snippet. This feature is explained in the Appendix of the book Oracle ADF Real World Developer’s Guide. You are free to download the Appendix from packtpub site. Yes, its absolutely free !!! //In application module implementation class public void createCompositeDeptEmpVO() { ViewDefImpl compVODef = (ViewDefImpl)createCompositeViewDef("DeptEmpDetail", "DeptEmpDetail"); ...

Win a free copy of the 'Oracle ADF Real World Developer’s Guide'

A great opportunity for you to win free copy of  'Oracle ADF Real World Developer’s Guide'. Please visit following blog post from Dimitrios Stasinopoulos for more details :  http://dstas.blogspot.co.uk/2012/11/win-free-copy-of-oracle-adf-real-world.html

Oracle ADF Real World Developer’s Guide - Q & A

This post is dedicated for answering any queries(or clarifications) on the topics discussed in my book Oracle ADF Real World Developer’s Guide . Please post your queries in the Comments section of this blog post.

Oracle ADF Real World Developer’s Guide is Published!!!

Image
I am pleased to announce the release of my book on ADF -  Oracle ADF Real World Developer’s Guide . Yes, it is available in your local book stores now ! Book Details : Paperback : 590 pages [ 235mm x 191mm ] Release Date : October 2012 ISBN : 1849684820 ISBN 13 : 9781849684828 Author(s) : Jobinesh Purushothaman Topics and Technologies : All Books, Enterprise, Oracle  This book is designed to take programmers beyond visual and declarative programming model and enable them  to customize the framework features to meet the real world application development challenges. Many of the framework features are discussed along with real-life use cases and code samples which will definitely help developers to design and develop successful enterprise applications. To learn more, visit http://www.packtpub.com/oracle-application-development-framework-real-world-developers-guide/book . Book Reviews... https://b...

Packt Publishing reaches 1000 IT titles and celebrates with an open invitation

Recently I finished writing a book for packtpub . It was really a great experience and learning for me. Now I'm  glad to learn that Packtpub is about to publish its 1000th title. Here is the press release: Birmingham-based IT publisher Packt Publishing is about to publish its 1000th title. Packt books are renowned among developers for being uniquely practical and focused, but you’d be forgiven for not yet being in the know – Packt books cover highly specific tools and technologies which you might not expect to see a high quality book on. Packt is certain that in its 1000 titles there is at least one book that everyone in IT will find useful right away, and are inviting anyone to choose and download any one of its eBooks for free over its celebration weekend of 28-30th Sep 2012. Packt is also opening its online library for a week for free to give customers an easy to way to research their choice of free eBook. Packt supports many of the Open Source projects covered by its books ...

Oracle ADF Essentials ( Core ADF framework) is now free to develop and deploy !!!

Image
From Oracle site - Oracle ADF Essentials is an end-to-end Java EE framework that simplifies application development by providing out-of-the-box infrastructure services and a visual and declarative development experience. Oracle ADF Essentials is free to develop and deploy. Read the full story here:  http://www.oracle.com/technetwork/developer-tools/adf/overview/adfessentials-1719844.html

ADF sessions at Oracle Open World (San Fracisco Sep 30 - Oct 4 2012)

Image
Here is the consolidated schedule for ADF sessions for Oracle Open World 2012 Oracle ADF and Fusion Development https://oracleus.activeevents.com/connect/focusPDF.do?focusID=21149  You may also be interested in.... Chris Tonas's keynote for developers - Monday 10:45 at Salon 8 in the Marriot - The Future of Development for Oracle Fusion—From Desktop to Mobile to Cloud ADF Meetup - Wed 4:30-5:30 at the OTN Lounge in the Howard street tent - meet other ADF users and the ADF product managers btw,I do have a couple of sessions this time. See you there... CON3316 - Building Performant Oracle ADF Business Components to Meet Tomorrow’s Needs (Oracle Develop)   CON3389 - Cross-Breeding of Component Libraries in JSF 2.0 Applications(JavaOne)

Nesting Application Modules at Runtime

You can nest application module on the fly. Following code snippet illustrates the APIs for nesting application module at runtime. Note that nested AM shares same transaction context with the calling AM. //In application module implementation class public void nestAMIfRequiredAndInvokeMethod() { ApplicationModuleImpl hrAM = null; boolean generatedLocally = false; try { //Check whether the HRAppModule is already nested hrAM =(ApplicationModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("HRAppModule"); //create a new instance of the HRAppModule, if not nested already if (hrAM == null) { hrAM = (ApplicationModuleImpl)this.getDBTransaction().createApplicationModule("demo.HRAppModule"); generatedLocally = true; } //Invoke business methods if (hrAM != null) { hrAM.doSomethin...

Oreder your copy of "Oracle ADF Real World Developer’s Guide" today!

Image
I am pleased to announce the release of my book on ADF -  Oracle ADF Real World Developer’s Guide . Yes, it is available in your local book stores now ! Book Details : Paperback :  590 pages [ 235mm x 191mm ] Release Date :  October 2012 ISBN :  1849684820 ISBN 13 :  9781849684828 Author(s) :  Jobinesh Purushothaman Topics and Technologies :  All Books, Enterprise, Oracle This book is designed to take programmers beyond visual and declarative programming model and enable them  to customize the framework features to meet the real world application development challenges. Many of the framework features are discussed along with real-life use cases and code samples which will definitely help developers to design and develop successful enterprise applications. To learn more, visit  http://www.packtpub.com/oracle-application-development-framework-real-world-developers-guide/book . Book Reviews... https://blogs.oracle.com/onesiz...

Using JUnit, Ant and Hudson for Continuous Integration

Tutorial for using Unit, Ant and Hudson for Continuous Integration. Check this out - Using JUnit, Ant and Hudson for Continuous Integration

Part1 - Hiding Unwanted Operators in Advanced mode of af:query Component

Oracle ADF helps you to build af:query component declaratively by dropping view criteria defined in a view object on to a page. While building view criteria you can create custom operators or remove built-in operators (displayed in advanced mode of af:query component) for each view criteria item by adding <CompOper/> to the view object XML file. Note that you may need to do it manually, there is no editor support for the same. This concept is explained in developers guide under the topic - How to Create Custom Operators or Remove Standard Operators . The attributes used in <CompOper/> as as follows: Name: Specify an id for the operation. ToDo: Set to 1 to add this custom operator. Set to -1 to remove an operator. OperDescStrCode: Specify the id used in the message bundle to map to the description string. Oper: Set to a value that will be used programmatically to denote this operation in the SQL statement.  MinCardinality: If there is an input r...

Disabling UI Component With ADF Faces JavaScript API

Following example illustrates how to disable UI component using ADF Faces Java Script API. This example disables  af:inputText when you click the button. Note that af:inputText has set unsecure="disabled" and clientComponent="true". You must set these properties appropriately to  set component properties in the client side.  unsecure   A whitespace separated list of attributes whose values ordinarily can be set only on the server, but need to be settable on the client. Currently, this is supported only for the "disabled" attribute. Note that when you are able to set a property on the client, you will be allowed to by using the the .setProperty('attribute', newValue) method, but not the .setXXXAttribute(newValue) method. For example, if you have unsecure="disabled", then on the client you can use the method .setProperty('disabled', false), while the method .setDisabled(false) will not work and will provide a javascript e...

Oracle JDeveloper 11.1.2.2 is Out

Oracle JDeveloper 11.1.2.2 is Out. Check it out- Download  Release Notes Whats new?

Creating View Criteria having Exists clause at run time

This post is in continuation of one of my old post Creating View Criteria having Bind Variables at run time . In this post I'm sharing sample for creating view criteria with Exists clause at run time. The following code snippet illustrates the API usage for creating View Criteria with Exists clause. public void buildVCWithExistsProgrammatically(String departmentName, String email) { //Following code snippet defines view criteria on DepartmentsView //This view criteria contains 2 ViewCriteriaItem //1. A normal ViewCriteriaItem for DepartmentName attribute //2. The second ViewCriteriaItem is based on Exists clause DepartmentsViewImpl voDept = getDepartmentsView1(); voDept.clearWhereState(); VariableValueManager vvm = voDept.ensureVariableManager(); ViewCriteria vcDept = voDept.createViewCriteria(); vcDept.setName("TempVC"); ViewCriteriaRow vcrDept = vcDept.createViewCriteriaRow(); ...

JavaOne and Oracle Develop India 2012

 JavaOne and Oracle Develop are coming back to India! Mark your calendar for the return of JavaOne and Oracle Develop – the powerhouse events that offer the developer community two days of unparalleled education, intense and informative debate, and numerous networking opportunities JavaOne and Oracle Develop India Hyderabad International Convention Center. 3-4 May, 2012. More details are here : http://www.oracle.com/javaone/in-en/oracledevelopprogram/index.html Oracle ADF Sessions : http://www.oracle.com/javaone/in-en/oracledevelopprogram/sessions/adf-fad/index.html

Conditionally Resetting Task Flow Displayed In a Popup

Use Case  A task flow is embedded in af:poup. The content needs to be reset each time user view this. Solution Use activation and active property to control  the life span of task flow.Activate task flow when user  open the popup window. Deactivate it when popup is disposed. Please see developer guide to learn more about these properties:    Configuring Activation of an ADF Region Download  You can download the sample workspace from here . The main.jsf page contains a task flow(dept-task-flow) with a search view embedded inside an  af:popup . Each time you invoke the popup, the search panel state in the popup is reset as the task flow is re-activated each time. [ Runs with Oracle JDeveloper 11.1.2.1.0 (11g R2PS1) + HR Schema] Learn More ... There are a lot more points like this. If  you are curious to learn the internals of the ADF Business Components and ADF Binding Layer,  the following book is for you - ...

Specifying Converter for a Dynamic UI Component

The following code snippet illustrates the API usage for setting JSF converter for a UI component added at runtime. RichInputDate inputDate1 = new RichInputDate(); Application application= FacesContext.getCurrentInstance().getApplication(); DateTimeConverter dateTimeConverter= (DateTimeConverter) application.createConverter("javax.faces.DateTime"); dateTimeConverter.setPattern("yyyy dd mm"); inputDate1.setConverter(dateTimeConverter); Tag doc  for af:inputDate says that - Developers can programmatically attach a converter. That converter should be obtained by Application.createConverter(), rather than simply calling new DateTimeConverter(). Otherwise, some functionality will be missing, e.g. client conversion and validation, and the date picker will only display as an input field without the date-time popup (the popup relies on the client conversion and validation support)

Refreshing a Specific Cell in dvt:pivotTable

The following code snippet may help you to partial refresh a specific cell in dvt:pivotTable component (Thanks Chadwick Chow for this tip) UIPivotTable pt = getUIPivotTable(); CellIndex current = pt.getCellIndex(); try { // Get desired Data Cell DataCellIndex index = new DataCellIndex(2, 0); // sets currency pt.setCellIndex(index); // ppr the cell RequestContext.getCurrentInstance().addPartialTarget(pt.getCellComponent()); } finally { // restore currency pt.setCellIndex(current); }

Filtering af:table Without Using ADF Model

You might have seen filterable table demo in ADF Rich Client Demo App- http://jdevadf.oracle.com/adf-richclient-demo/faces/components/table/filterableTable.jspx . Today's my post is based on this item.If you want, you can download the demo source and run it locally by following the instructions given in this page http://www.oracle.com/technetwork/developer-tools/adf/documentation/adf-faces-rc-demo-083799.html In this post I'm sharing an example illustrating table filtering with hand made FilterableQueryDescriptor . This example reuses the same implementation from rich client demo for building the custom FilterableQueryDescriptor. The TableFilterBean::processTableFilter()  method has the logic for extracting the filter criteria passed by the client. Logic for filtering the actual collection is not added - it's not there in ADF Rich Client Demo as well ;-) Download You can download the sample workspace from here . Check out TableFilterBean class - You may see more c...

Forcefully Executing a View Accessor

To execute view accessor 'brutally' whenever frameworks refers view accessor row set, add the following in your parent view object implementation class. @Override protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO, Row masterRow, Object[] values){ if ("<viewlink accessor attribute name>".equals(assocDef.getName())) { accessorVO.clearCache(); } return super.createViewLinkAccessorRS(assocDef, accessorVO, masterRow, values); } Learn More ... There are a lot more points like this. If  you are curious to learn the internals of the ADF Business Components and ADF Binding Layer,  the following book is for you -   Oracle ADF Real World Developer’s Guide . More details about this book can be found in this post-  http://jobinesh.blogspot.in/2012/07/pre-order-your-copy-of-oracle-adf-real.html

IE Compatibility Mode and ADF Faces

Straight to the point :) You cannot use Internet Explorer in compatibility mode while running ADF Faces pages.Please see Supported Platforms in the following link  http://jdevadf.oracle.com/adf-richclient-demo/docs/release.html .  Recently a check has been added in ADF Faces framework to alert you if the browser and document modes are not equal to the version number of the Internet Explorer that  you are running. How Do You Find Out The Compatibility View Settings for IE? Click Alt on your IE browser. That will bring up a new menu. Click Tools > Compatibility View settings.  In the Compatibility View Settings dialogue window,  locate the URL for your application from Compatibility View list and then click Remove. Also, uncheck all compatibility mode options as appropriate. While running your page, you can check the compatibility mode of the browser by  pressing F12 (if your on IE 9 ...

Free online Oracle ADF eCourse !

Oracle has launched  FREE  self-paced "eCourse" on ADF. Check this out - https://apex.oracle.com/pls/apex/f?p=44785:24:0::NO::P24_CONTENT_ID,P24_PREV_PAGE:6022,1 http://download.oracle.com/tutorials/jtcd3/ecourse_adf_part1/html/temp_frameset/index.htm

Oracle JDeveloper and Oracle ADF 11g Release 1 (11.1.1.6.0)

Check it out   Oracle JDeveloper and Oracle ADF 11g Release 1 (11.1.1.6.0)

Programmatically Starting Transaction in a Task Flow

Sometimes static transaction settings for a task flow may not be really flexible enough to meet your use case requirements. For instance, based on the  invocation context(based on the caller) a task flow may need to either start new transaction or skip the transaction altogether. A simple example illustrating the programmatic transaction creation is attached in the post. Take a look at the  dept-task-flow-definition in the example which uses 'TxnInitializer' method for programmatically starting new transaction based on the input parameter(Transaction) value set by the caller. Here is the code snippet : public void beginNewTransaction() { BindingContext context  = BindingContext.getCurrent(); String dataControlFrameName  = context.getCurrentDataControlFrame(); DataControlFrame  dcFrame  = context.findDataControlFrame(dataControlFrameName ); dcFrame.beginTransaction(new TransactionPr...

Using oracle.adf.view.rich.util.ResetUtils for programmatically resetting page content

Background - Custom reset implementation that is discussed in an old post - http://jobinesh.blogspot.com/2009/10/reset-content-of-web-page.html Today I noticed a Utility class for resetting component tree - oracle.adf.view.rich.util.ResetUtils::reset(UIComponent startComponent) It resets all editable value holders under the 'startComponent'. Hope this may save some of your time.

JSF Component ID must start with a letter...

If you are are on ADF 11gR2 and seeing the following error when you run the application, then change the component id to match with JSF spec :) The following exception occurred: oracle.mds.exception.MDSRuntimeException: JSF Component ID must start with a letter. at oracle.mds.internal.el.ELUtils.getValue(ELUtils.java:150) See section 3.1.1 Component Identifiers in the following pdf http://download.oracle.com/otn-pub/jcp/jsf-2.0-fr-full-oth-JSpec/jsf-2_0-fr-spec.pdf It says .... Every component may be named by a component identifier that must conform to the following rules: ■ They must start with a letter (as defined by the Character.isLetter() method). ■ Subsequent characters must be letters (as defined by the Character.isLetter() method), digits as defined by the Character.isDigit() method, dashes (‘-’), or underscores (‘_’). To minimize the size of responses generated by JavaServer Faces, it is recommended that component identifiers be as short as possible. If a com...

dvt:pieGraph with GraphDataModel Sample

Sharing a simple example for dvt:pieGraph that uses manually created GraphDataModel(hand coded data model without using ADF binding). Download You can download the sample workspace from here . Check out PieBean.java to get a feel of implementation. [Runs with Oracle JDeveloper 11g R2 PS1]

Upload Limits for Web Browsers

Thing I learned today... There are known upload size restriction for various browser. You can see details here http://www.motobit.com/help/scptutl/pa98.htm So, if you are using af:inputfile to upload huge files and configured all file upload parameters as described here , still not able to make upload to work with huge files, check out the browser support for the same.

In-Memory Filtering Without Affecting Default Row Set

Noticed the following requirement (multiple times) while working with ADF developers - Find out rows in the default row set that meets specific conditions - In other words, perform in-memory filtering without affecting the primary row set. By default, when you apply in-memory filtering  using ViewCriteria or RowMatch, they are applied on default row set.The following code snippet may help you to perform in memory filtering without affecting your default row set- CountriesViewImpl countriesViewImpl = (CountriesViewImpl)getCountriesView1(); countriesViewImpl.executeQuery(); //Define VC for in-memroy filtering ViewCriteria vc = countriesViewImpl.createViewCriteria(); vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE); ViewCriteriaRow vcr1 = vc.createViewCriteriaRow(); vcr1.setAttribute("CountryName", "LIKE A%"); vc.add(vcr1); //Override 'protected' findByViewCriteriaForViewRowSet in CountriesViewImpl //and mark it as 'publi...

Displaying Transaction Log When User Commits a Transaction

I'm attaching a simple example that illustrates a possible solution to display number of rows(new, modified,  deleted) posted to database when user commits transaction. This example overrides EntityImpl::doDML(int operation, TransactionEvent e) method to track the status of entities and save the log in UserData hash table object from the DBTransaction. The custom AppModuleImpl::commitTransactionWithStatusLog() does the commit and returns the transaction log as Map to the client which is displayed on the UI in the 'statusbar' facet for the table(wrapped by af:panelCollection). If you are interested, take a look at the custom variable binding in the page definition file in the attached sample. This basically does the wiring job  for the returned Map by commitTransactionWithStatusLog() method. May be useful for you later :) Download You can download the sample workspace from here . [Runs with Oracle JDeveloper 11.1.2.1.0 (11g R2PS1)...

Consuming ADF BC model project components from another project !

Image
This year, let me start my posts with a simple topic. There are multiple ways to expose a project for use by other projects. One obvious approach is generate an ADF library artefact and consume it from other projects. This is documented in Fusion Middleware Fusion Developer's Guide - Packaging a Reusable ADF Component into an ADF Library Adding ADF Library Components into Projects    The above things are well and good. However if you you want to consume a ADF BC model project within same workspace, there is an easy way. To consume business components defined in a model project from another model project within the same work space, Right click the model project which consumes business components from other model projects in the same workspace and select Project Properties.In the Project Properties dialogue window, select the Dependencies tab and add the 'supplier' Project by either selecting Build Output option or Jar archive option . The above steps is enoug...