Session in ADF BC

Hi..
I'm doing a time reporting application in ADF BC. Normally,users using the system will have different projects assigned to them. So, when a user logs in, he will see the different projects he is assigned to and their related tasks.
My problem is that i want to create a session for the user when he logs in. I will use the session in the search page, where the user id will appear automatically (the user don't have to input his user id to make a search). Infact in my search page, i have 2 parameters, the user id and the week number. i want to call the user id automatically in the search page. How can i do it??
regards
parvez

Hi,
if the user ID is obtained upon authentication then
- you can use a method exposed on the AM to pass the value in. E.g. say you have a method searchProject(String userId) then the argument userId can be referenced using ExpressionLangauge to a session or manage bean variable that holds the user name.
- use container managed authentication and set jbo.security.enforce to Must. This way the authenticated user is accessible from the AM by a call to getUserPrincipal()
Frank

Similar Messages

  • How to manage User Session in Adf ?

    Is there any guide line to manage the user session in adf ?

    View layer Http session if it is not a desktop based application. Model layer also you can store session using
    getSession().getUserData()But before that the information you provided is not enough. You need to describe in more detail of what session and what exactly are you looking for

  • How to use global session in ADF

    Hi all,
    My problem is that I have several sessions that connect to a table in an ADF application. If I update some data in one session and commit, the other sessions do not see it until they requery the data because they are using their own local sessions and caches. I want the changes to be seen by all the sessions. Is there something like a global session in ADF?
    Thanks in advance,
    S/\EE|)

    Hi,
    From the documentation
    "For example, say you have a page that lists all products, and a user can navigate from that page to another page to create a product. A button on this page both creates the product and navigates back to the list page. In order for the user to see the product just created, you must set the iterator binding for the product list to cacheResults=false. Doing so forces the iterator to reexecute when returning to the page and display the newly created product."
    Frank

  • Using Sessions in ADF

    How can I use sessions in ADF? Is it same as using in JSF or is there any other specific way in ADF?
    Ravi

    Hi,
    It is same as JSF
    Samples:
    From bean;
                FacesContext context = FacesContext.getCurrentInstance();
                HttpSession session = (HttpSession)context.getExternalContext().getSession(true);From jspx
                #{sessionScope.variable_name}Sireesha

  • Is there any alternative of storing session in ADF?

    Hi ..
    Is there any good alternative for storing values in session in ADF?What if the session is lost?
    Thanks
    Edited by: Lovin_JV_941794 on Mar 7, 2013 9:48 PM

    Lovin_JV_941794,
    your question is not clear to me. what do mean by
    any good alternative for storing values in session in ADFwhat is your use case? you can get an good information about different scopes from [url https://forums.oracle.com/forums/thread.jspa?threadID=1085921]this.
    ~Abhijit

  • How to handle multiple session in ADF using jdevloper11g

    Hello All
    i want to use the form in Multiple sessions.
    i have one sign up form. user enter only 4 to 5 fields & he may not fill the the manditory field & he left.but data base dont give the error to him. but next day he will come at the next day to complet his sign up i.e. when he commit the all detail that time all validation will hapen.
    for that i use one table without constrain to store the temarory detail.& use other table (with constrains) for final submition.
    1) i creat the view n entity for temparory table
    2) & also i create views n entity for Final table
    n i create one methos in viewRowImple file in that file i overrid create method from using this i set the value from tempary to final table...
    but when user left the manditory field then it allow to submit the data in temparory field but when i copy that data to final table(with constrain) n user submit the data then validation happn i.e. "this fild is mandatory".when i click this error message it goes to first screen.
    IS Thiis Possible.. in ADF

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • ADF - How to create a session in ADF

    Hi, how I would to create a schema of session im my application?

    http://docs.oracle.com/javaee/5/tutorial/doc/bnaqm.html
    1-create a View object. For example:
    SELECT USU.USUARIO, USU.TIPO_USUARIO,
    USU.VENDEDOR_NUMERO,
    usu.NOMBRE,
    Usu.FUENTE_CIA, USU.COMPANIA
    FROM VENTAS.USUARIOS USU
    WHERE USU.USUARIO = upper(:pUsuario)
    2-set parameter (:pUsuario) with default value expresion:
    adf.context.securityContext.userName
    3-Use ViewObject in backing bean with session scope.
    package view.backing;
    import java.io.IOException;
    import java.util.Date;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.jbo.Row;
    public class Usuario {
    String TipoUsuario, VendedorNumero, Nombre, FuenteCia, Compania;
    Date Hoy;
    Boolean Leido = false;
    public void Logout(ActionEvent actionEvent) throws IOException {
    String javaScriptText = "window.close();";
    ExternalContext ectx =
    FacesContext.getCurrentInstance().getExternalContext();
    HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
    String url = "VentasMenu.jspx";
    HttpSession session = (HttpSession)ectx.getSession(false);
    session.invalidate();
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("expires", "0");
    response.setHeader("Pragma", "no-cache");
    try {
    response.sendRedirect(url);
    FacesContext.getCurrentInstance().responseComplete();
    } catch (IOException e) {
    e.printStackTrace();
    FacesContext.getCurrentInstance().responseComplete();
    public Date getHoy() {
    return new java.util.Date();
    void iniciarValores() {
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    //ViewObject find user data from DB
    Row rowUsuario = bindings.findIteratorBinding("voUsuario1Iterator").getRowAtRangeIndex(0);
    if (rowUsuario != null) {
    TipoUsuario = rowUsuario.getAttribute("TipoUsuario").toString();
    VendedorNumero = rowUsuario.getAttribute("VendedorNumero").toString();
    Nombre = rowUsuario.getAttribute("Nombre").toString();
    FuenteCia = rowUsuario.getAttribute("FuenteCia").toString();
    Compania = rowUsuario.getAttribute("Compania").toString();
    Leido = true;
    public String getTipoUsuario() {
    if (!Leido) {
    iniciarValores();
    return TipoUsuario;
    public String getVendedorNumero() {
    if (!Leido) {
    iniciarValores();
    return VendedorNumero;
    public String getNombre() {
    if (!Leido) {
    iniciarValores();
    return Nombre;
    public String getFuenteCia() {
    if (!Leido) {
    iniciarValores();
    return FuenteCia;
    public String getCompania() {
    if (!Leido) {
    iniciarValores();
    return Compania;
    }

  • Access the cached session in ADF

    Hello,
    I have generated an EO A. Business logic is triggered to call a DB store procedure in EO A generated java class.
    The DB store procedure is to create list of record in A. The list of records are cached in the session and not committed yet.
    If i can access this cache, i can simply do select * from A where A.key = k to get the list of records.
    How can I do that in the entity object generated java class?
    Thanks

    Hello,
    I am using JDeveloper 11.1.1.3.0
    Actually, I want to convert a PL/SQL logic in the ADF BC.
    The original logic is using a calling a store procedure and then using a cursor to retrieve the record.
    So, when i called the same store procedure in ADF BC, how can I access the cached record in the same way as cursor?
    For example,
    A entity object/view object was created on DB table SCHED, a button is pressed to trigger the store procedure
    so that a list of schedule records of SCHED are generated but not committed.
    How can I access the generated record of SCHED?
    Thanks

  • Multiple user sessions for ADF application

    Hi All,
    We have a ADF application with 3-4 pages starting with a login screen.
    Assume we have two users, user1 and user2. In same system but different browser windows, when both users are logging in, only user2 's session is active. Though user1 logged in first and is able to perform transactions, the moment user2 logs in, user1's session is being over-written by user2 (user1's window now displays user2's information). I have observed the URL of user1 window which now changes to user2's URL (_adf.ctrl-state parameter of user2 is displayed in user1 browser)
    How do we overcome this?? We have a requirement to be able to open multiple user sessions.
    We are using JDeveloper 11.1.2.3.0 and browsers being used are IE 8, IE9 and chrome.
    Thanks,
    Deepti

    Hi,
    Continuation to my above question
    I am using these two statements in my code..
    ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
    HttpSession httpSession = (HttpSession)ectx.getSession(true);
    On any event in Window1, I gues it is getting the context and session of window2(this being the latest)..
    Shouldnt it return the context and session of the current window instead of the latest window???
    This problem is well explained here
    internet explorer 8 - How to avoid session sharing provided by IE8 programmatically in Java EE application? - Stack Over…
    I want to know.. what is the best way to handle this in ADF... We are using managed beans with request scope and using HttpSession to store few values like user Id.

  • Limit user session in ADF security

    I want single user work in web application only with a single session at any time. How can I limit user sessions?

    Hi,
    +1. How can I override ADF security (based on JAAS) credentials checking mechanism j_security_check ?+
    Why do you want to override this?
    +2. How can I store users log-in log-out information in database? Which classess and which methods must be overriden? Can you show code sample of your realisation, please?+
    Authentication is not handled by ADF but WebLogic Server. If you want to track database login information you will need to write a custom JAAS Login Module and configure it as an authentication provider in WLS
    How can I check if user closed browser?
    I would use a temporary cookie with no lifetime. This way, when the browser is closed, the cokie is unavailable, indicating that the user is good to login again. However, this then allows users to start 2 sessions using different browsers (again something you would need to check)
    Frank

  • Athentification and session in ADF

    hi everybody ,
    i want some tutoriel about authentification and management of session and roles in oracle adf
    thanks

    When you deploy a production application the Users and Roles are going to be stores in an LDAP repository and the Java EE server is going to read those from there.
    With ADF Security we basically hand off authentication to the WebLogic security system - it goes off and reads from whatever repository WebLogic is set up to use as the storage for the user/roles.
    Watch the ADF Insider about ADF Security to learn more.

  • Handling session in ADF application

    We're going to develop an application using ADF BC, JDev 11.1.1.2.0 and Weblogic 10.3. My idea is to put user specific information in a bean with session scope. I have couple of stored procedures to do some DML operations for user related data like profile, order information, etc. User logins first and multiple users may call the same procedure to insert or update or delete something. How ADF handles this scenario? Do I have to handle locking manually? If yes where and how? Thanks.

    Hi,
    ADF has the web session managed by the container. This means that a managed bean is available to the user for as long the session does not expiry (web.xml configuration) or is getting invalidated. ADF does nothing specifcally here
    if you use prepared statements to access the database then locking is not automatically handled, same for releaing the database connect. You don''t give more hints in your question, so I can't give more information in my answer. Note that if you need to make resources or information available to all usres of an application, then application scope may be better to use than a session scope. E.g. the database access could be coded in a managed bean in application scope so that the acces is shared betwene users (just no user specific state should be saved in there)
    Frank

  • Alter session with ADF App

    Hello:
    Jdev 11.1.2.3
    redhat 5.8
    oracle db 11.2.0.3
    When using an ADF Fusion Web app, what are the implications if we issue the database command:
    alter session set time_zone = -6; for a particular user
    For example, if the session is passivated? Does the database session stay with the application module on passivation? or weblogic failover?
    Or will session and users get mixed up?
    Thanks alot.

    Hi,
    you don't have a 1:1 database association in web applications. If you need to alter the database session for a user then you have to do it for each request, which means that you override the ADF BC prepareSession AM method with the statement to alter the database session. So to answer your questions
    Does the database session stay with the application module on passivation?
    No.
    or weblogic failover?
    No.
    Frank

  • Session in ADF

    hie using jdev 11g
    I have created a session bean to store logged in user information.
    Now, how should i access the created instance of this session bean every where in my view project?
    Vik
    http://adfjsf.blogspot.com
    http://twitter.com/vikceo

    Vik,
    Assuming that you have a backing bean which contains some code and you want to access the session-scoped bean from that code.
    Create an instance variable in your backing bean that s the type of whatever-your-session-scoped-bean-is, together with getters and setters. In this example, I'll use MySessionBean as the type and TheSessionBean as the name you used for the bean in adfc-config. In your backing bean:
    public class MyBackingBean
      private MySessionBean _sb;
      public void setSb(MySessionBean theBean)
        _sb = theBean;
      public MySessionBean getSb()
        return _sb;
      etc
    }Then, in the adfc-config, create a managed property for the managed bean (call it "sb") and set the value to "#{TheSessionBean}"
    Now, in your backing bean, you can just refer to "_sb" to interact with the session bean.
    This is just standard managed bean injection in JSF.
    john

  • How to set the NLS in ADF for a session?

    Hello,
    Is there a built-in way to set the NLS parameters (Oracle-specific Date Format, Language..etc..) for the current DB session in ADF?
    thanks.

    Hi there,
    From your ViewController properties under Run you can add the following java option -Duser.timezone=CET. If you want to do it at the application level then you need to do the following:
    - In your AM override the prepareSession(Session session) method with custom code to set up your NLS
    - Create a class that implements the PagePhaseListener
    - Override beforePhase(PagePhaseEvent pagePhaseEvent) method to set the locale
    public void beforePhase(PagePhaseEvent pagePhaseEvent) {
    Integer phase = pagePhaseEvent.getPhaseId();
    if (phase.equals(ADFLifecycle.PREPARE_MODEL_ID)) {
    FacesContext facescontext = FacesContext.getCurrentInstance();
    String language =
    facescontext.getExternalContext().getRequestLocale().getLanguage().toUpperCase();
    FODApplicationModuleImpl.preferredLanguage = language;
    FODApplicationModuleImpl.isWebUser = true;
    Hope this helps.
    Juaan C.

Maybe you are looking for

  • SSO between a Java EE application (Running on CE) and r/3 backend

    Hi All, Over the past few days I have been trying to implement a SSO mechanism between NW CE Java Apps and R/3 backend without any success. I have been trying to use SAP logon tickets for implementing SSO. Below is what I need: I have a Java EE appli

  • Remove the user status in Sales order

    how to remove the user status in sales order header? could you give the function module or BAPI to get this?

  • Photo Downloader and Kodak Easy Share Gallery - PAS3

    Question 1. For some reason Adobe Photo Downloader has decided to place itself into my systray. I can disable it. I can not remove it. I do not seem to be able to find any option or preference to disallow it from launching. While I have a digitral ca

  • Alt car key on lenovo u430p not working.

    hey guys, my keyboard is the multilingual french keyboard. But for some reason when i try to enter french symbols using the "Alt Car" key and then pressing the desired key - nothing happens. anybody know of a fix to this problem? being un-able to use

  • SAP License Problem in EP System

    Hi After completed the EP 7.0 ((SAP EHP1 for SAP Netweaver 7.0) installation on Sunsolaries with Oracle 10g. I start with the license installation. I manage to get the license ,but when i try to install the license into the server it show invalid.. i