Monday, May 14, 2012

ADF : Open pdf file in New window or in Popup using InlineFrame




This is a draft version of ADF sample application for opening PDF file in New Window or Inline Frame.
You can download the code from here / here

Birds eye view of the app:


To Show the contents of the file, we are registering a servlet(ShowPdfServlet)  in web.xml which takes care of reading and displaying .
On the same lines, we can tweak the code to read from data base or any other place.

Application assumes, the existence of file "c:\\webcenter.pdf". Hence before you run the application make sure you place a pdf with above name. (PdfServlet.java : 44 hard coded value says the same)

To open the file in new window, I have followed ADF Code Corner Example (33).


The task flow enabled for url-invoke allowed and it should be bounded taskflow "with pages". More info @ ADF Code Corner Example.

Sample output when opens in popup.




Soon will come out with detailed post.

Thanks.







Tuesday, April 17, 2012

To reflect changes in the ADF Deployed app on Stand alone weblogic server (11.1.1.5)

I feel it is painfull task to deploy the monstrous application for **minor changes**.

Though I know that I can use hudson/CI to automate the boring deployment process(as developer this is what I feel), our team yet to sponsor good amount of time for Hudson hands on.


So we started using the following copy paste approach ( a true developer approach) to reflect the changes on the server.


Locally we generate the jar files for which changes available. We also make sure all the dependent libraries are in sync with the latest changes.

These are the locations with respect to Jdeveloper 11.1.1.5 based stand alone server.

For UI changes:
1) Go to system_folder: In Windows Run --> %Appdata% --> Jdeveloper --> system xxx folder 
2) cd DomainName/servers/ServerName/tmp/_WL_user/AppliactionName/z88prt/war/WEB-INF/lib
3) replace the ui jar and dependent jars you wish to overwrite.
4) restart the server


For UI Model/Model changes:
1) Go to system_folder: In Windows Run --> %Appdata% --> Jdeveloper --> system xxx folder 
2) cd DomainName/servers/ServerName/tmp/_WL_user/AppliactionName/z88prt/hvo6ly/APP-INF/lib
3) replace the model/uiModel jar and dependent jars you wish to overwrite.
4) restart the server


However, If there are changes to application files (say, adf-config.xml) I have to go through the complete deployment process to see the changes.
Hope it helps.


Thanks,
Srini.

Friday, March 30, 2012

Get the selected Value from SelectOneChoice(LOV) in Bean

To get the selected Value from selectOneChoice (LOV) in Bean


<af:selectOneChoice value="#{row.bindings.LevelType.inputValue}"
 id="soc3"
label="#{row.bindings.LevelType.label}"
valueChangeListener="#{backingBeanScope.GroupingBean.onSubtypLvllTypValChnge}"
autoSubmit="true">
<f:selectItems value="#{row.bindings.LevelType.items}" id="si3"/>
<f:attribute name="rowIndexVal" value="#{row.bindings.LevelType.items[row.bindings.LevelType.inputValue].label}"/>
</af:selectOneChoice>




public void onSubtypLvllTypValChnge(ValueChangeEvent valueChangeEvent) {

        valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
        Map p = ((UIComponent)valueChangeEvent.getSource()).getAttributes();
        System.out.println("Selected Value"+p.get("rowIndexVal"));
  }


One can find a different other approaches here..
http://mjabr.wordpress.com/2011/03/19/reading-the-selected-value-of-a-select-list-in-java/
http://myadfnotebook.blogspot.com/2010/09/getting-string-value-or-item-code-of.html

Tuesday, March 27, 2012

Access Resource Bundle in Bean

   
    To access resource bundle in bean

    public String getTextProp(){
        String bundle_name= "com.gppsuite.view.ViewControllerBundle";
        ResourceBundle resourceBundle =   BundleFactory.getBundle(bundle_name);
        String txt =null;
        if(resourceBundle != null)
        {
        txt = resourceBundle.getString("string_id");
        }
        return txt;
    }


Thanks Lakshman for your comments.
Including your comments in the post for the benefit of others.

2)

We can also use
java.util.ResourceBundle rb = ResourceBundle.getBundle("com/oracle/,,,,/Bundle1");
String txt = rb.getString("prop1");

3)
public String readPropertiesFile(String property){
String configureURL = null;
try{
InputStream is = ConfigureBean.class.getResourceAsStream("Engenio.properties");
Properties prop = new Properties();
prop.load(is);
configureURL = prop.getProperty(property);
is.close();
/* code to use values read from the file*/
}catch(Exception e){
e.printStackTrace();

}
return configureURL;
}

Monday, March 26, 2012

Sources for WebServices with ADF learning

Building and Using Web Services With JDeveloper 11g

Here is the one which talks discusses.. WebServices at galance



Other articles can be found here.. Those are nice

http://st-curriculum.oracle.com/obe/jdev/obe11jdev/11/index.html

Index


http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm

Developing RIA Web Applications with Oracle ADF

 

 

ADF best practice to give webservice calls: A good read

https://groups.google.com/d/topic/adf-methodology/9NPM6J64f0E/discussion 
 

Web Services with Complex Data Types in ADF 11g

https://blogs.oracle.com/shay/entry/web_services_with_complex_data
http://www.oracle.com/technetwork/testcontent/adf11g-agile-131400.pdf
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/54-ws-complex-input-type-169197.pdf

Getting old/previous value of an ADF BC attribute

Getting old/previous value of an attribute notes from the Source  Oracle Insider Article

Groovy expression to get old value:

1) Create a transient attribute and generate eoimpl or voimpl. Override the getter method with the following

return getPostedAttribute(model.EmployeeImpl.SALARY)

Posted value is which is submitted.

2) To use as part of validations we can use implicit objects available as part of groovy expression.

sample:

newValue - OldValue < oldValue *.1

Tuesday, January 31, 2012

ADF integration with Configurator

Following posts  are very nice for integrating Configurator with ADF application.

Configurator Overview
http://apps2fusion.com/at/pb/276-oracle-configurator-articles-i

Embedding Oracle Configurator in WebCenter / ADF Applications
http://www.oracle.com/technetwork/topics/newtojava/overview/ofm-ebs-blog-postings-096286.html



ADF tries to launch a URL from the taskflow. Usually the url will be a servlet which acts as mediator for calling Configurator page.
Places the user credentials and landing page info as parameters in the request  and invokes a Configurator app.
Once the task is done with Configurator, it returns a value.

Soon I will try to attach the sample that I am working on.
Protected by Copyscape Unique Content Check