JDeveloper and ADF
How to get list of all application module names from a Model project?
Hi All,Is there any way I can get list of all the available root application module names from a ADF BC Model project programmatically? Once I know the root AM, I can use the public java.lang.String getApplicationModuleNames(boolean inclLoadedOnes, boolean fromDef) to get the nested AMs. But how do I get the available root application module names programmatically ? Please let me know if there are any APIs for this. ThanksAshwini
You can get to the root application module using below code from one of the existing application module Impl - import oracle.jbo.server.DBTransaction; DBTransaction txn = (DBTransaction)this.getTransaction(); AppModule rootApp = txn.getRootApplicationModule(); rootApp.getApplicationModuleNames(); // Returns an array of names of the nested Application Modules that are currently loaded within this Application Module.
Thanks Srini but this won't help. I want to get the list of all the root application modules in a POJO. I cannot write this inside app module impl. Going through parsing bc4j.xcfg is the last option, but I want to know if there is already any API for this. Is there any way to get this DBTransaction outside app module? May be by providing JNDI name etc? ThanksAshwini
Ashwini - By POJO, do you mean a backing bean? Because nesting of application modules can happen dynamically based on how the taskflow transaction option is configured. That was just to point out that nesting may not be static always. If you are trying to do this via a backing bean, you can still write this code in AMImpl and invoke it as a method binding which would be the easiest option. Maybe some more clarity on what you are trying to achieve would help.
try like this... Map sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); BindingContext context = (BindingContext)sessionMap.get(BindingContext.CONTEXT_ID); context.getDefaultDataControl().getApplicationModule();
hi, check below once, may it will help u- oracle.adf.model.BindingContext context = BindingUtils.getBindingContext(); DCBindingContainer bc = (DCBindingContainer)context.getCurrentBindingsEntry(); DCDataControl dc = bc.findDataControl("XYZDataControl"); .... ... ViewObject vo = dc.getApplicationModule().findViewObject("ABCVO"); .... ..... thanks,prashant
Thanks to all your replies. #Srini - by POJO - I mean a independent Java Class - could be referred as service class, preferably in Model project. Since it is independent of any AppModule Impl classes, I want to see if I can get any reference of all the available App Modules in the project.#Puthanampatti - I tried the code you have given, but it doesn't give me the actual list of objects within the Module, returns a null object.#Prashant - I really cannot do any hardcoding. So all I want is - without doing any kind of hardcoding (since I don't know any of the name) - I want to get list of all app modules. This is required for a reusable program - since it would be a question as why is it needed. I have gone through pretty much each method that I could see in the list of available API documentation. But could not find any. So would like to know if you ADF Experts have found any such method already or if I missed anything. Thanks,Ashwini
Since it is a stand-alone java class, then none of the FacesContext code would work for you. And your source of truth would be the nested modules defined in the application modules XML file. Are you then not better off parsing the AppModule xml file to determine the nested modules using a simple DOM Parser?
Thanks Srini. I guess the only way out is to parse the xml file to get list of app modules. Thanks all once again for your replies. -Ashwini
Please close the thread Ashwini by marking the correct answer. Forum users generally track unanswered threads to respond and this would come up on that list.
Problem in deploying ADF application
Jdeveloper 11g project set-up question
Need a Simple Example Program That Uses Bounded Task Flow Template
How to set up fixed height in ADF layout component
ADF 11g + View controler resource bundle
How to deploy ADF-BC (SDO) with ANT
deploying from jdeveloper without data sources
Opening new nonmodal window from action of commandImageLinkCommandButton
ADF Application creating multiple BPEL processes
Printable page and showPrintablePageBehavior
How to capture a data change event in Swing/ADF application?
Create a ADF component by Class.forName (11g)
how to set logoImagePath in oracle Dynamic Tabs Shell
How to display a small sized font text just below the inputText using ADF