Monday, June 20, 2011

Admin Applets not working @Content Server

I installed content server 11.1.1.3 on windows7 32 bit. The admin applets were working fine just after installation. But later i re-installed oracle database, created new schemas with rcu 11.1.1.4, and updated java version to 1.6.0_21 from 1.6.0_18. Now the admin applets are not working. :-\


Now, whats the reason for this????


Here it is: It was as simple as it should have been. The browser (IE) was having java 1.6.0_26 ad-on. But it was not working. So i ran the application on mozilla and installed java 1.6.0_26 plugin and the applets started working. Surprise was, now the applets were working on IE as well :).


So problem was only because of java version used by the browser.

Saturday, June 18, 2011

Unable to retrieve information for document @Content Server

This is the first time i connected my content server with ADF and tried to retrieve a html page. But on running the  application i received following error:

Event generated by user 'anonymous' at host 'CIS'. Unable to retrieve information for 'MyPC16200000040'. Unable to find latest released revision for item 'MyPC16200000040':

An error has occurred. The stack trace below shows more information. !csUserEventMessage,anonymous,CIS!$!csUnableToGetRevInfo2,MyPC16200000040!csGetFileUnableToFindRevision,csGetFileRevMethodLabel_LatestReleased,MyPC16200000040 intradoc.common.ServiceException: !csUnableToGetRevInfo2,MyPC16200000040 at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2071) at intradoc.server.Service.buildServiceException(Service.java:2207) at intradoc.server.Service.createServiceExceptionEx(Service.java:2201) at intradoc.server.Service.createServiceException(Service.java:2196) at intradoc.server.DocCommonHandler.determineID(DocCommonHandler.java:657) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
......
Caused by: intradoc.common.ServiceException: !csGetFileUnableToFindRevision,csGetFileRevMethodLabel_LatestReleased,MyPC16200000040 at intradoc.server.utils.FileRevisionSelectionUtils.computeDocumentRevisionInfo(FileRevisionSelectionUtils.java:487) at intradoc.server.DocCommonHandler.determineID(DocCommonHandler.java:652)
.......


Now whats the reason?????


Finally, i got the solution for this and that was a bit surprising. The content that i was accessing, was uploaded using WebDAV(Desktop integration). The file was not indexed properly and was not even opening from content server. I re-uploaded the file using new item option and got rid of this error.

Friday, June 3, 2011

JBO-25221: Method not supported Exception @ADF


This has been an exception day. I received two new exceptions, one mentioned in previous post and next is below:

oracle.jbo.InvalidOperException: JBO-25221: Method AppModuleDataControl.EmployeeView1.getRowStatus() not supported
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:491)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2134)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3020)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:257)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1625)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2141)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:730)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252) at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
at BackingBeanClass.onCancel_CancelButtonApp3(BackingBeanClass.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)

I was getting this error while calling a method defined in viewobjectimpl class from backing bean. When i tried  system.out.print in the viewobjectimpl method, i found that the method is not even called.

So the reason of this exception was that, the view controller project that i was using was not build at the time i created the application. I created a new ADF Viewcontroller Project later. So the problem was, this view controller project was not dependent on model project in the application. That why when the method in viewobjectimpl was never called. To resolve this, open the view controller project properties and add model.jpr Build Output under the Dependencies.

JBO-25004: Definition name of type Form Binding Definition is invalid @ADF

I got following error message when i ran my application first time:

oracle.jbo.InvalidDefNameException: JBO-25004: Definition name sessiondef.3App_CancelButton.CancelButttonPageDef of type Form Binding Definition is invalid.
at oracle.jbo.mom.DefinitionManager.validateSessionDefName(DefinitionManager.java:509)
at oracle.jbo.mom.DefinitionManager.findSessionDefObject(DefinitionManager.java:548)
at oracle.adf.model.binding.DCBindingContainerDef.findSessionDefObject(DCBindingContainerDef.java:328)
at oracle.adf.model.binding.DCBindingContainerDef.findDefObject(DCBindingContainerDef.java:290)
at oracle.adf.model.binding.DCBindingContainerReference.getDef(DCBindingContainerReference.java:107)
at oracle.adf.model.BindingContext.findBindingContainerDefByPath(BindingContext.java:1555)
at oracle.adf.model.BindingRequestHandler.isPageViewable(BindingRequestHandler.java:371)
at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:247)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:189)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

In my case, the reason of above error was wrong package name ie 3App_CancelButton. I created a page in a folder named 3App_CancelButton under web content and generated its page definition file. The file was generated it self under package named 3App_CancelButton, which is not a valid package name. To remove this, rename the package using Refactor->Rename to a valid name.

Wednesday, June 1, 2011

Insert row at the End of Table @ADF

In order to add a row at the end of the table and make the inserted row to be current row, we can write following code on the action of a button having partial submit property set to true:

public void insertRowAtLast()
{
   CollectionModel cmodel= (CollectionModel)table.getValue();
   JUCtrlHierBinding adfmodelbind= (JUCtrlHierBinding) cmodel.getWrappedData();
   DCIteratorbinding itr=adfmodelbind.getDCIterator();
   
   Row row_last=itr.getNavigatableRowIterator().last();
   Row row_new=itr.getNavigatableRowIterator().createRow();
   row_new.setNewRowState(Row.State_INITIALIZED);
  
   int lastrow_index=itr.getNavigatableRowIterator().getRangeIndexOf(row_last);
   itr.getNavigatbleRowIterator().insertRowAtRangeIndex(lastrow_index+1,row_new);
   itr.setCurrentRowWithKey(row_new.getKey().toStringFormat(true));


  AdfFacesContext.getCurrentInstance().addPartialTarget(table);
}


To make the newly inserted row to be visible after table refreshes, set the DisplayRow attribute of the table to selected.

Dynamic Navigation in Un-Bounded Task Flow

If the outcome in an unbounded task flow is to be decided based on some user input, then we can use below code to decide which control flow case to follow. In this example the navigation to another page is decided by the user action on the popup. If user press OK the control flow case is followed.

First configure the dialog listener of the dialog used in the popup to capture the DialogEvent in a managed bean.

 public void confirmAction(DialogEvent dialogEvent) 
 {  
  DialogEvent.Outcome result = dialogEvent.getOutcome(); 
  if (result == DialogEvent.Outcome.ok) 
  { 
    NavigationHandler navigationHandler = FacesContext.getCurrentInstance().getApplication().getNavigationHandler(); navigationHandler.handleNavigation( FacesContext.getCurrentInstance(), null, "Control_Flow_Case"); 
  } 
}

Here Control_Flow_Case can be based on some user input as well. However NavigationHandler can't be used in case of bounded task flow. In that case, we will need to set the viewId on the ViewPort that can be accessed through ControllerContext.