How to setup Custom method to return id

Using the OE Schema and Customers table for simplicity. I want a method such as:
public String getCustomerIdFromCustEmail(String email);
I want to call this from an Action class in a JDev 10.1.2 ADF BC Struts JSP application. A call such as:
String idValue = getCustomerIdFromCustEmail("[email protected]");
(returning a string is not necessary. This could be a long or int value.)
Questions:
Where does this method belong? Entity, view or app module?
What is the best way to code this? In a non J2EE app I would just create a connection object, run a query and return the result. So what is the BEST way in a JDEV J2EE application to perform the same thing?
If I use a whereclause, I don't want to change the current status of the customers view object, I may be using it, I may not. So how do I keep the data non-messed up.
Thanks!

Here is the stack trace (it's BIG). If possible, could someone point out how to go through one of these. What am I looking for. I want to be able to solve these problems myself!
Exception: JBO-30003: The application pool (apptrack.model.datamodel.ApptrackModuleLocal) failed to checkout an application module due to the following exception:
06/11/01 14:35:41 JBO-30003: The application pool (apptrack.model.datamodel.ApptrackModuleLocal) failed to checkout an application module due to the following exception:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.PCollException, msg=JBO-28010: Error while getting next sequence value for PS_TXN_seq from database
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1772)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1768)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2611)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:441)
     at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:230)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:411)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:406)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.doBeginRequest(WSApplicationModuleImpl.java:2619)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.beginRequest(WSApplicationModuleImpl.java:2607)
     at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1243)
     at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:76)
     at oracle.adf.model.BindingContext.get(BindingContext.java:411)
     at oracle.adf.model.BindingContext.findDataControl(BindingContext.java:283)
     at apptrack.controller.strutsactions.LoginAction.onSubmit(LoginAction.java:95)
     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:324)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
     at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
     at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:477)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:235)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:126)
     at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
     at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
     at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
oracle.jbo.PCollException: JBO-28010: Error while getting next sequence value for PS_TXN_seq from database
     at oracle.jbo.PCollException.throwException(PCollException.java:39)
     at oracle.jbo.pcoll.OraclePersistManager.queryNextCollectionId(OraclePersistManager.java:1451)
     at oracle.jbo.pcoll.PCollManager.register(PCollManager.java:560)
     at oracle.jbo.pcoll.PCollection.<init>(PCollection.java:102)
     at oracle.jbo.pcoll.PCollManager.createCollection(PCollManager.java:460)
     at oracle.jbo.server.DBSerializer.setup(DBSerializer.java:153)
     at oracle.jbo.server.DBSerializer.reservePassivationId(DBSerializer.java:251)
     at oracle.jbo.server.ApplicationModuleImpl.reserveSnapshotId(ApplicationModuleImpl.java:4981)
     at oracle.jbo.server.ApplicationModuleImpl.reservePassivationId(ApplicationModuleImpl.java:4963)
     at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:7742)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:3923)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:1915)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1739)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1768)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2611)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:441)
     at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:230)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:411)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:406)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.doBeginRequest(WSApplicationModuleImpl.java:2619)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.beginRequest(WSApplicationModuleImpl.java:2607)
     at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1243)
     at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:76)
     at oracle.adf.model.BindingContext.get(BindingContext.java:411)
     at oracle.adf.model.BindingContext.findDataControl(BindingContext.java:283)
     at apptrack.controller.strutsactions.LoginAction.onSubmit(LoginAction.java:95)
     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:324)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
     at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
     at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:477)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:235)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:126)
     at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
     at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
     at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: ORA-02289: sequence does not exist
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:625)
     at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:112)
     at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:430)
     at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:1003)
     at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:462)
     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1109)
     at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1270)
     at oracle.jbo.pcoll.OraclePersistManager.queryNextCollectionId(OraclePersistManager.java:1435)
     at oracle.jbo.pcoll.PCollManager.register(PCollManager.java:560)
     at oracle.jbo.pcoll.PCollection.<init>(PCollection.java:102)
     at oracle.jbo.pcoll.PCollManager.createCollection(PCollManager.java:460)
     at oracle.jbo.server.DBSerializer.setup(DBSerializer.java:153)
     at oracle.jbo.server.DBSerializer.reservePassivationId(DBSerializer.java:251)
     at oracle.jbo.server.ApplicationModuleImpl.reserveSnapshotId(ApplicationModuleImpl.java:4981)
     at oracle.jbo.server.ApplicationModuleImpl.reservePassivationId(ApplicationModuleImpl.java:4963)
     at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:7742)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:3923)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:1915)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1739)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1768)
     at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2611)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:441)
     at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:230)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:411)
     at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:406)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.doBeginRequest(WSApplicationModuleImpl.java:2619)
     at oracle.jbo.common.ws.WSApplicationModuleImpl.beginRequest(WSApplicationModuleImpl.java:2607)
     at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1243)
     at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:76)
     at oracle.adf.model.BindingContext.get(BindingContext.java:411)
     at oracle.adf.model.BindingContext.findDataControl(BindingContext.java:283)
     at apptrack.controller.strutsactions.LoginAction.onSubmit(LoginAction.java:95)
     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:324)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
     at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
     at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:477)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:235)
     at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:126)
     at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
     at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
     at java.lang.Thread.run(Thread.java:534)

Similar Messages

  • Illustrator CC how to setup custom document profile

    How do I set up a custom document profile in Illustrator CC and save it for future use?
    I do not see any way to save it.

    1.  Re: Illustrator CC how to setup custom document profile
           Francesco Della Peruta     Sep 11, 2013 11:31 AM  (in response to dinnys)   
    I think you have to create a new document, set all your preferred options, leave it empty, and save it as a template file, ready to reuse .
    Otherwise you can:
    Create a new document, set all your preferred options, leave it empty, and save it in the same folder of the adobe preset.
    To find the correct path select the preset profile menu, in the new document window, and choose browse.
    I hope this help"

  • How to expose custom methods of servlet as web services

    Can i know how to expose the custom methods of the servlet as web services. if it is not posssible then what alternate ways are possible other than ejbs?
    regards

    Hi
    I want to know that whether the custom methods of servlet can be exposed as webservices or not?
    Secondly is there init method like we have in servlets so that we can do all the one time loading in the init() method.
    regards

  • How to code a method that returns string for class object

    I have a class named Address.
    public class Addresss{   
    private String street;   
    private String city;            // instance variables  
    private String zipcode;}I have been asked to write a method that returns a string for Address object. I dont understand how to create address object.Can anyone pls help me understand.
    do I have to write (for creating object)
    Address addressObject  = new Address(); ( coding method that returns a string for address object) ---> I really dont understand this part.

    looks almost right. The problem is that your method name AddressBookEntry does not match the name of your class AddressBook and therefore is not a constructor.
    Furthermore, you probably need to make a distinction between a single entry into the address book which consists of a single name and a single address, (which is just what you have done) and an address book itself which is probably a list of AddressBookEntries
    So for your code I would change the class that you called "AddressBook" to "AddressBookEntry" and have a third class that represents the collection of AddressBookEntries.
    Now to be honest, I don't know why you keep the name split apart from the street address portion of the address. I would be more inclined to keep the name as a field of the address itself, but it's your code, you carve it up the way you like.

  • How to map the method action return value directly into screen using variables?

    Hi,
    My JDev version is 11.1.1.6.3.
    I have a 'MethodAction' defined in PageDef file, that goes to model layer and return String value. As this needs to be executed during initializing of pageDef, I have also added an 'InvokeAction' for that.
    <executables>
               <invokeAction id="invokeSayHelloId" Refresh="ifNeeded"
                                    Binds="sayHello"/>
               <variableIterator id="variables">
                    <variable Name="Name" Type="java.lang.String"/>
               </variableIterator>
    </executables>
    <bindings>
              <methodAction id="sayHello" InstanceName="HrAMDataControl.dataProvider"
                                     DataControl="HrAMDataControl" RequiresUpdateModel="true"
                                     Action="invokeMethod" MethodName="sayHello"
                                     IsViewObjectMethod="false"
                                     ReturnName="data.HrAMDataControl.methodResults.sayHello_HrAMDataControl_dataProvider_sayHello_result">
                                        <NamedData NDName="pName" NDValue="Michael John" NDType="java.lang.String"/>
             </methodAction>
    </bindings?
    Requirement:
    I want to map the return value of this method action directly into screen by making use of PageDef variables.
    Question:
    I. I need to know how to map this return value direcly as exprssion against PageDef variable.
    2. If Question 1 is achievable, assuming the method action returls List instead of String (I know well it returns 2 items), can I map the 1st Item against Variable 1 and 2nd Item against Variable 2 directly?
    Thanks in Advance.
    Ragu

    Thanks Frank, but If I directly map the MethodAction's result to UI, there are chances where it might get executed whenever I refresh the UIComponent (UIComponent to which the methodAction result is mapped. Isn't so??). Instead, If I invoke the MethodAction using InvokeAction, I can get the control on when it should get invoked (using RefreshCondition). If I assign the variable to UIComponent (Assume I've mapped the method action result to variable using expression), refreshing of UIComponent will not cause any performance issue I feel.
    Correct me If I am wrong.

  • Class extends JComponent how to use custom methods?

    I have a class Block which extends JPanel
    code is hereprivate class Block extends JLabel{
              boolean top;
              Block(int a,Color c){
                   setSize(40 + a*10,20);
                   setBorder(BorderFactory.createMatteBorder(40+a*10,0,0,0,c));
              void setTop(boolean b){
                   this.top = b;
              boolean getTop(){
                   return top;
         }I need to use getTop() method of certain block in class implementing MouseMotionListener
    I used getComponent() method like this
    e.getComponent().getTop()but it didn't work and gave
    HanoiTowers.java:59: cannot find symbol
    symbol : method getTop()
    location: class java.awt.Component
    if(e.getComponent().getTop()){}
    error
    Is there some other way to do this?

    Antti_ wrote:
    I have a class Block which extends JPanelahem, I believe that it extends JLabel.
    Is there some other way to do this?You could cast I suppose:
              Component c = e.getComponent();
              if (c instanceof Block)
                System.out.println(((Block)c).getTop());
              }

  • How to implement custom methods on form submit

    I'm a newbie to ADF environment, coming from pl/sql world. I have already tried default drag and drop functionality for forms. But, with new requirements, I need to write some custom code to create and update form. I read about managed beans, but didn't quite understand it. Any pointers to examples are appreciated.
    Regards,
    Surya
    Edited by: sgodavar on Sep 29, 2010 1:13 PM

    Suganth,
    Sometimes, the default form to create and edit built (drag and drop) on top of BCs may not be enough to code all the business logic. In that case, I'm looking for the basic steps involved to implement such custom logic. For example, I may need to call a managed bean or some stored procedure from ADF faces. Since, I'm totally new to ADF, I don't know how to go about it and right way to do it in ADF environment. Any pointers to such examples are appreciated.
    Regards,
    Surya

  • How to use getContent() method in custom JSP Provider to display a HTML Pag

    Hi,
    If anybody knows how to use getContent() method to use in custom jsp providers (developed by ourselves) so that it can be used to retrieve a jsp page (a simple html page) ..
    I want the code in the provider java file to for the getContent method...
    Pls. get back to me asap....if any body has implemented a custom jsp provider...as it's urgent...
    I have alreday placed the JSP file in the directory structure /etc/opt/SUNWps/desktop/default/channel_dir..But still the jsp is not being displayed..
    Pls get me the getContent() method code to retrive the JSP file..
    satyabrata

    Hi,
    You don't have to do anything in the custom JSPProvider's getContent method except the call {  return super.getContent(request,response); } . If all you want is just to show your jsp, then create a channel from the default JSPProvider, and edit the property contentPage of that channel from samplecontent.jsp to your jsp name, save the changes and login again. You should see your JSP.
    Sanjeev.

  • How to call Apps Module Custom Method from Entity Object / View Object ?

    Hi All,
    I create a custom method in AppsModuleImpl.java. How can I call that custom method from a setter method on Entity Object / View Object ?
    (I have tried to use Configuration.createRootApplicationModule(amDef,config); but it is not the correct way, is it? )
    Below is my code :
    The setter on MyEntityImpl.java :
    public void setKodeprd(String value) {
    setAttributeInternal(KODEPRD, value);
    if (getProduct() != null) {
    // CALL the getSalesPrice custom method from here, HOW ??
    The Application Module custom method :
    public Number getSalesPrice(String priceCode, String kodePrd) {
    Number price = new Number(0);
    String [] theKey = {priceCode, kodePrd};
    Key priceKey = new Key(theKey) ;
    ViewObject SalesPrice = getSalespricedView1();
    Row[] salesPriceRow = SalesPrice.findByKey(priceKey, 1);
    price = ((SalespricedViewRowImpl)salesPriceRow[0]).getPrice();
    SalesPrice.remove();
    return price;
    Thank you for your help,
    xtanto

    inside the EntityObjectImpl :
    YourAppModuleImpl am = (YourAppModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("YourAppModuleorServiceName");

  • How to detect JBO Exception from within Apps Module Custom Method ?

    Hi all,
    I have a custom method in apps module (AM) to set "Status" attribute to "A' in an antity, this is for approval.
    Also there is a rule that the transaction cannot be approved if it is already cancelled by another user (in multi user environment).
    The problem is :
    If the AM custom method fail (because it throws JBOException in the entity setter method), How can I know that it fails ?
    and report it back to the backing beans that call the custom method ?
    Thank you for your help,
    xtanto
    Below is the code :
    1. create a custom method in AM to do : setStatus ("A") ;
    public void approve(){
    ViewObject bphVo = findViewObject("BpHView1");
    BpHViewRowImpl vBphViewRow = (BpHViewRowImpl)bphVo.getCurrentRow();
    vBphViewRow.setStatus("A");
    2. Do a validation inside setStatus method of the entity :
    public void setStatus(String value) {
    if (! getCancel() == true )
    setAttributeInternal(STATUS, value);
    else
    throw new JboException("Error ! transaction already cancelled");
    3. On backing beans :
    public String approveButton_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("approve");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    System.out.println("There is JBO Error !!");
    return null;
    else{
    commitButton_action();
    return "back";
    }

    Try this code:
    approveButtonAction()  {
    String navigationString = null;
    try {
    Object result = operationBinding.execute();
    naviagionString = success;
    catch (JboException e) {
       navigationString = null;
       (DCBindingContainer)bc.cacheException(e);
    } finally {
    if(navigationString != null)
      return commitButtonAction();
    else
      return navigationString;
    }

  • How to detect if a user has changed a record using a custom method?

    I am in the process of developing a test case application using ADF JSF and a collection of Java objects that are not populated by a database.
    Details of what I have developed so far can be found on this post:
    how to create a new record using a custom method?
    Is it possible to detect if a user has changed the value(s) of a record?
    I have set the edit page up (as described in the other post) and this works fine, but how could I tell if the user has changed something on that record. This is what I would like to do, but am not sure how to achieve it or whether it is possible....
    when the user puts a record in edit mode, take a copy of that record
    then when the user presses save or exit to navigate away from the edit page do a comparison between the original values and the potentially changed ones
    then depending on the outcome of the comparison call an appropriate action
    Thanks in advance for your help
    David

    If you just want to know if the value has changed you can put it in a while loop and use shift registers to see if the value has changed.
    Brian
    Attachments:
    Changed.vi ‏22 KB

  • How to use ApplicationModule custom methods in JSP?

    I have an ApplicationModule for which I have defined several custom methods (in the ApplicationModuleImpl class). I wish to invoke these methods from a JSP. I'm having trouble getting a scriptable reference to the application module object in the JSP. I can get data from the view objects using the jbo:xxx data tags, but I can't get any sort of reference to the application module object that would allow me to invoke the methods. I have tried editing the application module to expose the methods as client methods, but still can't get a reference to them.
    My main questions:
    1. Is there a way to invoke the custom methods somewhere between the jbo:ApplicationModule tag and the jbo:ReleasePageResources tag?
    2. Is there a way to declare and use the application module without using the jbo:ApplicationModule tag? Would I ever benefit from doing this?

    Alan, here's how to call a custom method String getSomeInfo() that I've created on my application module, MyModule in this example. Also, in this example the id parameter in the ApplicationModule tag is "am" (<jbo:ApplicationModule id="am"...):
    First, edit your application module. In the app module editor, go to the Client Methods tab and move getSomeInfo into the selected list.
    Next, edit your JSP to call your custom method.
    <% MyModule myAm = (MyModule)am.useApplicationModule(); String someInfo = myAm.getSomeInfo(); %>
    You also have to add the correct import statements to the page tag in your JSP:
    <%@ page contentType="text/html;charset=windows-1252" import="oracle.jbo.*, MyModule.common.*"%>
    Hope this helps
    Blaise

  • How to get currentRow in an Application Module custom method?

    I have written a custom method in the BC4J AppModule. In that custom method I want to update a row. But I do not know how to getCurrentRow in my custom method.

    this is probably better since nobody is giving other solutions:
    Repost: Simple question but no one answers

  • How to map AM method return values in the bean

    Hello -
    I have this requirement to map AM method return values in the bean as explained below. Please suggest a solution.
    Scenario: I am calling an AM method, which returns a String object on page load.
    AMImpl Method-
    public String getProfileName (){
    return "Profile";
    I wish to catch this retun value in the Bean Variable on page Load. I have created a methodAction biding on page and invokeAction to call this method on Page Load, but I don't know how to catch this value in the bean. Please suggest how to achieve this. Also, I need to achieve this in jsp page. I can't use TaskFlow for this.
    I am using ADF 11g.
    Regards -
    Rohit
    Edited by: Rohit Makkad on Apr 21, 2010 12:23 AM

    Hi, I think there are two ways, from the data control drag n drop the methods return value to the page. This way a binding for that will be created at the page definition eg retVal.
    and in the backing bean you can access it by calling resolveExpression("#{bindings.retVal.inputValue}")
    You can also call your method directly from the backbean
    ((YourAppModuleImpl) getBindings().getDataControl().getApplicationModule()).yourMethod();
    public DCBindingContainer getBindings() {
    return (DCBindingContainer) resolveExpression("#{bindings}");
    I dont know if the second method suits you
    Tilemahos

  • [ADF-UIX] passing selected items to a custom method, how?

    Hi,
    ADF-UIX can be tricky, and im stuck atm building some functionality, I hope
    someone here can point me in a good direction
    I have a multipleSelection table filled with data from a ViewObject. I also
    have 2 MessageChoice components also filled with data from 2 ViewObjects.
    I made a custom method in my AppMod accepting 3 params and dragged that method
    on to a DataAction. And I have a submit button calling the DataAction.
    Now comes the tricky part, how can I pass the selected rows (radiobuttons) and
    the selected items from my MessageChoices to my custom method.
    I know I have to change something in paramNames[0].value but what exactly, specialy
    the multiselect from my table.
    Thanks in advance for any tips :)

    "what's the application module"
    JDev 10.1.3 leverages an Application Development Framework (ADF) that you can learn about here: http://download-east.oracle.com/docs/pdf/B25947_01.pdf
    Specifically, you'll want to look at chapters 2, 4, & 8 in the developer's guide to understand the framework and to understand how to use application modules to call service methods from a JSF page. You can also search this forum as there are other threads discussing this topic, but I'd recommend reviewing the developer guide first.
    This article I also found helpful:
    http://www.oracle.com/technology/products/jdev/tips/muench/mostcommon/index.html
    From my (short) experience, I've learned that you can call methods either using a bean or service methods on the Application Module. Since I am using ADF Business Components (BC), I try to implement any methods that interact with the BC's (view objects, etc.) as service methods on the Application Module (AM). If my method needs to purely implement logic related to the UI or Navigation, then I implement a method on a bean. The other case where I implement a method on a bean is if I need to do some pre-processing (i.e., gather info. about the state of the UI) prior to calling a service method on the AM (an example of this can be found in the dev guide related to the tableSelectMany component) - so there are some cases where the bean method will call a method on the AM - but again, if the method will update the model I try to use a method on the AM to accomplish this. Understanding the ADF framework is the first step (see the dev guide), and then I'd recommend looking at the SRDemo and previous posts on this forum.
    Finally, one thing that is really cool - if you define a service method on your AM, it shows up in the data control pallette - you can drag and drop the method on the .jspx page and all of the bindings/wiring is done automatically for you (including handling passing of parameters.)
    hope this helps.

Maybe you are looking for

  • ITunes no longer sees iPhone

    Suddenly, after I upgraded to Leopard, iTunes ceased launching when I plugged in the phone. The phone charges, but iTunes does not see it. iPhoto does, but iTunes does not. I reset the phone, reinstalled iTunes, and restarted the computer, to no avai

  • Indesign CS5 won't install

    Background: I had been using InDesign CS5 for a couple years on my Win7 Ultimate x64 machine.   A year and a half ago, I reloaded the OS and didn't reinstall InDesign as I didn't need it then.  It's used for a once-yearly project near year-end. My In

  • Report SQL problem

    hi all, need some help in oracle report 6i, I have a SQL statement like SQL> select p.person_id, p.person_name, p.birth_date,max(cg.effective_start_date) "Last Concession", add_months(max(effective_start_date),24) "Next Concession" from person p, con

  • Keyboard shortcut to place cursor in Effects and Presets search box?

    Hi! Is there is a keyboard shortcut that will place the cursor in the search box of the Effects and Presets panel?  Ctrl + 5 activates the panel, but I still need to click to get the cursor into the search box and be able to type my search. I have RS

  • BAPI_CATIMESHEETMGR_INSERT - BAPI_CATIMESHEETMGR_INSERT - MULTIPLE ROWS

    Hi to all, I'm using bapi BAPI_CATIMESHEETMGR_INSERT to insert hours in CAT2 Transaction (timesheet ) . The function seems to be working fine . The only thing that I don't understand is why it splits records on multiple rows.  For example I append re