Get Name of Page Being Accessed

How to I determine the name of the XSQL page currently being accessed?
I want to include a generic logging function, and need to be able to access the name of the page being requested through an included page.
Thanks!

Hi,
You can use a helper method like this to retrieve the name of the page inside a custom action handler:
// Get the name of the current page from the current page's URI
private String curPageName(XSQLPageRequest req) {
String thisPage = req.getSourceDocumentURI();;
int pos = thisPage.lastIndexOf('/');
if (pos >=0) thisPage = thisPage.substring(pos+1);
pos = thisPage.indexOf('?');
if (pos >=0) thisPage = thisPage.substring(0,pos-1);
return thisPage;
You can find this in XSQL FAQs in the documentation. For more details look into Oracle9i XML Developer's Kits Guide - XDK.
Hope that helps.
OTN team@IDC

Similar Messages

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How to get the Portal Page name from PLSQL?

    Can anyone tell me how to get the portal page name from my dynamic page using plsql?
    Apparently you can get the page id and work it out from there, but my calls to get the page id are not returning any values anyway.
    My code for attempting to get the page id is below.
    <oracle>
    declare
    v_pageid varchar2(30);
    begin
    v_pageid := wwpro_api_parameters.get_value('_pageid', '/pls/portal30');
    htp.print('Page is '|| v_pageid);
    end;
    </oracle>
    Ideally I'd actually just like to get the page name. Is there a straightforward way to do this?
    Thanks in advance!
    Sarah

    Few clarifications -
    1. wwpro_api_parameters cannot be used to get default portal
    page parameters such as '_pageid', '_dad', '_schema' etc.,
    2. Page information can be obtained through any components which
    are available in that particular page. For example, in case of
    dynamic page, we need to publish it as a portlet and add it to the
    page. This process creates necessary packages in the DB, but we
    will not have access to the portlet methods.
    So, I would prefer creating a simple DB provider & portlet and access
    page title from its show method as follows -
    //Declare local variable l_page_id, l_page_title as varchar2
    select page_id into l_page_id from wwpob_portlet_instance$ where
    portlet_id = p_portlet_record.portlet_id and
    provider_id = p_portlet_record.provider_id;
    select name into l_page_title from wwpob_page$ where id=l_page_id;
    More information on DB provider can be found at
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.database.providers.html
    Secondly, usage of wwpro_api_parameters.get_value method is
    incorrect. This method expects two arguments -
    <ul>
    <li><b>p_name : </b> The name of the parameter to be returned.</li>
    <li><b>p_reference_path : </b> An unique identifier for a portlet instance on the current page.</li>
    </ul>
    p_reference_path would be something like 99_SNOOP_PORTLET_76535103 and not some type of path as its name suggests.
    The following code fragment fetches all parameters available
    for a portlet.
    Note : Copy this code into 'show' method of your portlet.
    //Declare l_names, l_values as owa.vc_arr
    * Retreive all of the names of parameters for this portlet
    l_names := wwpro_api_parameters.get_names(
    p_reference_path=>p_portlet_record.reference_path);
    * Retreive all of the values of parameters for this portlet
    l_values := wwpro_api_parameters.get_values(p_names=>l_names,
    p_reference_path=>p_portlet_record.reference_path);
    //Loop through these arrays to get parameter information
    htp.p('<center><table BORDER COLS=2 WIDTH="90%" >');
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(wwui_api_portlet.portlet_heading('Name',1));
    htp.tableData(wwui_api_portlet.portlet_heading('Value',1));
    htp.tableRowClose;
    if l_names.count = 0 then
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.p('<td COLSPAN="2">'
    ||wwui_api_portlet.portlet_text(
    'No portlet parameters were passed on the URL.',1)
    ||'</td>');
    htp.tableRowClose;
    else
    for i in 1..l_names.count loop
    htp.p('<tr ALIGN=LEFT VALIGN=TOP>');
    htp.tableData(l_names(i));
    htp.tableData(l_values(i));
    htp.tableRowClose;
    end loop;
    end if;
    htp.p('</table></center>');
    Hope it helps...
    -aMJAD.

  • Cannot a get JSP page instance from a page being destroyed

    We have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
    OracleJSP:
    JSP Error:
    Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
    Exception:
    javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
         at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
         at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
         at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
         at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
         at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
         at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
         at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
         [SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
         at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
         at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
         at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
         at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:536)
    All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
    We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
    --matt

    We have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
    OracleJSP:
    JSP Error:
    Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
    Exception:
    javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
         at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
         at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
         at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
         at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
         at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
         at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
         at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
         [SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
         at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
         at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
         at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
         at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
         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(JAZNFilter.java:283)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:536)
    All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
    We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
    --matt

  • I get problem loading page (error 404) it says the page cannot be found when i try to access the game Mobsters through my mysapce account and i cannot access it no longer through firefox and i want to find out why i cant, can you guys please help?

    i cant access my mobsters account through myspace. every time i try to access it i get "problem loading page" "this page cannot be found" "404 error" and it wont let me access it. myspace works fine but as soon as i click on the mobsters app i get the 404 error, this page cannot be found, problem loading page! can you please help?
    == This happened ==
    Every time Firefox opened
    == i try to access mobsters game through myspace

    I dont understand the answer
    '''''""The problem can be solved by opening FF and choosing Tools...Add On's...select the SEARCH addon and choose UNINSTALL...restart FF browser when asked, then reload Mobsters. This worked for me. The suggestion on the 404 that says to remove Search via Add/Remove Programs is completely BS, as Search doesnt show there. ""'''''

  • I can no longer access itunes store on my mac. i get a blank page and no error msg.

    I have used itunes successfully in the recent past, but no only get a blank page. I am an old non techy woman, please help.

    LTE indicates cellular. Tap Settings > Cellular then switch Cellular Data ON.
    If your Wi-Fi is working, then you should be able to access the internet.
    Reset the device:
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    If that doesn't help, tap Settings > General > Reset > Reset All Settings
    If that doesn't help, tap Settings > General > Reset > Reset Network Settings
    You will have to re enter your Wi-Fi password.
    * No data is lost due to a reset
    If nothing above has helped, try here >  iOS: Troubleshooting Wi-Fi networks and connections

  • My Apple Macbook hard drive crashed and I had to replace. Now trying to reload CS5 and having issues. When I click download from Adobe download page, a screen pops up saying "Access Denied". I have serial number, but don't even get to a page to enter. Ple

    My Apple Macbook hard drive crashed and I had to replace. Now trying to reload CS5 and having issues. When I click download from Adobe download page, a screen pops up saying "Access Denied". I have serial number, but don't even get to a page to enter. Please help…Thanks!!

    Make sure you have cookies enabled and clear your cache.  If it continues to fail try using a different browser.
    You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS5: http://prodesigntools.com/all-adobe-cs5-direct-download-links.html

  • How to get the jsp page name in jsp?

    how to get the jsp page name in jsp? how the jsp get the jsp page name dynamic.
    thanks in advance.

    Try request.getServletPath()

  • I get a 404 error when accessing my website which is supported by Apple.  The message says that the server can't find my page.  My browser is Safari.  How can I fix this when it just stopped working today?

    I get a 404 error when accessing my website which is supported by Apple.  The message says that the server can't find my page.  My browser is Safari.  How can I fix the problem when it failed just today?

    If you uploaded to MobileMe, it's no longer available. Apple's closed MobileMe and stopped offering web hosting.
    (116252)

  • I get a 404 error when accessing my website which is supported by Apple.  The message says that the server can't find my page.  My browser is Safari.  How can I fix this?

    I get a 404 error when accessing my website which is supported by Apple.  The message says that the server can't find my page.  My browser is Safari.  How can I fix this?

    If you uploaded to MobileMe, it's no longer available. Apple's closed MobileMe and stopped offering web hosting.
    (116252)

  • Trying to access server remotely. Have Static IP from ISP but if I type that address into browser I get router login page. How do I get RDP

    Hi Guys, Please help.  I am trying to run remote desktop from internet.  I have just been given a static IP address from my ISP and when I type it into browser I get router login page.  I want to be able to use Remote Desktop.  I can
    use RDP on the LAN and works great but not from external (internet).  I don't know how to get static IP address to open windows login page or RDP to connect when I put IP address into RDP..  I have Windows 2003 server running. 

    Check your router for free ports. You may use http port number "80" to port forward the request to your server. In your firewall settings, create a new rule to allow incoming http request. Before that enable NAT in your router for LAN and assign
    a static IP address for the server machine. It would make port forwarding easier.

  • Getting troubles in getting the JSP page

    hi friends,
    Let me tell u first i m using Tomcat 5.5 and Internet Explorer .
    I think i have some problem in Tomcat. Coz I have made an JSP page which has a simple coding as follows
    <%@ page language="java" contentType="text/html" %>
    <html>
    <body bgcolor="green">
    <font size=5 color="red">
    <%! int i=5%> <%= "The i value is  "+i %>
    <h1>Let's cheak if its working or not. </h1>
    </font>
    </body>
    </html>Let me tell u i don't want to do anything ,except getting valid response from a JSP page.
    i believe nothing is wrong with this page but when ever i m giving request for JSP page i m getting a blank page(a page of white colour though i have set bgcolor to be 'green'). But if i m giving request for Servlet and HTML pages then it's running fine . Can anyone advice me what to do.
    Let me tell u one more thing i.e when i m giving request 4 a JSP page the corresponding Servlet (the java file as well as .class file) is being formed by Tomcat. But still i m not getting my output.
    I hope i m clear in communicating my problem.
    Please suggest some solution what to do.
    with regards
    Arunabh

    save the above as test.jsp ..place it in webapps....
    important thing is check the path name u give in ur
    url
    http://10.32.246.55:8080/Activit/tex.jsp... in
    my system i have a folder called Activit in webapps
    so no need to mention webapps in url.... mention the
    ip address ..if u r runnin the application on the
    system where tomcat is installed then instead of ip
    address u can mention as localhost .. do
    mention port no. also ... think by default port no is
    8080...
    it should work cauz it worked in my systemIf it worked in ur system then i suppose somthing is wrong with my tomcat. Is it so ?????
    Arunabh

  • To get top-of-page in alv list

    How get top-of-page using reuse_alv_list_display ?
    How to get checkbox into that top-of-page ? And how to access that checkbox whether it is checked or not ? And if checked to get into next step of program promptly ?

    hai  Anirban Datta,
    REPORT YBALV_FULLSCREEN_DEMO NO STANDARD PAGE HEADING.
    *"General Data
    TYPE-POOLS: SLIS.
    DATA: BEGIN OF GT_OUTTAB OCCURS 0.
            INCLUDE STRUCTURE SFLIGHT.
    DATA: END OF GT_OUTTAB,
          GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
          G_EXIT_CAUSED_BY_CALLER,
          GS_EXIT_CAUSED_BY_USER TYPE SLIS_EXIT_BY_USER,
          G_REPID LIKE SY-REPID.
    *"Callback
    DATA:
        GT_EVENTS      TYPE SLIS_T_EVENT,
        GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
        G_STATUS_SET   TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
        G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',
        G_TOP_OF_PAGE  TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
        G_TOP_OF_LIST  TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',
        G_END_OF_LIST  TYPE SLIS_FORMNAME VALUE 'END_OF_LIST'.
    *"Variants
    DATA: GS_VARIANT LIKE DISVARIANT,
          G_SAVE.
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM LAYOUT_INIT USING GS_LAYOUT.
    PERFORM EVENTTAB_BUILD USING GT_EVENTS[].
    GS_VARIANT-REPORT = G_REPID.
    G_SAVE           = 'A'.
    START-OF-SELECTION.
    *"Data Selection
      PERFORM SELECT_DATA TABLES GT_OUTTAB.
    END-OF-SELECTION.
    *"List Header for Top-Of-Page
    PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
    *"Display List
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
           I_BACKGROUND_ID    = 'ALV_BACKGROUND'
           i_buffer_active    = 'X'
           I_CALLBACK_PROGRAM = G_REPID
           I_STRUCTURE_NAME   = 'SFLIGHT'
           IS_LAYOUT          = GS_LAYOUT
           I_SAVE             = G_SAVE
           IS_VARIANT         = GS_VARIANT
           IT_EVENTS          = GT_EVENTS[]
         I_SCREEN_START_COLUMN    = 0     "Use coordinates for
         I_SCREEN_START_LINE      = 0     "display as dialog box
         I_SCREEN_END_COLUMN      = 0
         I_SCREEN_END_LINE        = 0
      IMPORTING
           E_EXIT_CAUSED_BY_CALLER = G_EXIT_CAUSED_BY_CALLER
           ES_EXIT_CAUSED_BY_USER  = GS_EXIT_CAUSED_BY_USER
      TABLES
           T_OUTTAB = GT_OUTTAB
      EXCEPTIONS
           PROGRAM_ERROR = 1
           OTHERS        = 2.
    IF SY-SUBRC = 0.
      IF G_EXIT_CAUSED_BY_CALLER = 'X'.
    *"  Forced Exit by calling program
    *"  <do_something>.
      ELSE.
    *"  User left list via F3, F12 or F15
        IF GS_EXIT_CAUSED_BY_USER-BACK = 'X'.       "F3
    *"    <do_something>.
        ELSE.
          IF GS_EXIT_CAUSED_BY_USER-EXIT = 'X'.     "F15
    *"      <do_something>.
          ELSE.
            IF GS_EXIT_CAUSED_BY_USER-CANCEL = 'X'. "F12
    *"        <do_something>.
            ELSE.
    *"        should not occur!
    *"        <do_Abnormal_End>.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ELSE.
    *"Fatal error callin ALV
    MESSAGE AXXX(XY) WITH ...
    ENDIF.
    *"Form routines
    FORM SELECT_DATA TABLES RT_OUTTAB LIKE GT_OUTTAB[].
    *"- Selection of data to be displayed
      SELECT * FROM SFLIGHT INTO CORRESPONDING FIELDS
                       OF TABLE RT_OUTTAB
                       UP TO 00030 ROWS.
    ENDFORM.
    FORM LAYOUT_INIT USING RS_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *"Build layout for list display
      RS_LAYOUT-DETAIL_POPUP      = 'X'.
    ENDFORM.
    FORM EVENTTAB_BUILD USING RT_EVENTS TYPE SLIS_T_EVENT.
    *"Registration of events to happen during list display
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
          EXPORTING
               I_LIST_TYPE = 0
          IMPORTING
               ET_EVENTS   = RT_EVENTS.
      READ TABLE RT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE G_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO RT_EVENTS.
      ENDIF.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
               I_LOGO             = 'ENJOYSAP_LOGO'
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM .
    FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE
                                            SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
    LIST HEADING LINE: TYPE H
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      LS_LINE-INFO = TEXT-100.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    STATUS LINE: TYPE S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = TEXT-101.
      LS_LINE-INFO = TEXT-102.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
      LS_LINE-KEY  = TEXT-103.
      LS_LINE-INFO = TEXT-104.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    ACTION LINE: TYPE A
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'A'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      LS_LINE-INFO = TEXT-105.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    ENDFORM.
    Regards.
    Eshwar.

  • Check if file is being accessed

    Vinothkp:
    I am trying to check if a file is open or not using Java. I did get a partial solution. It is:
    Take the filename.
    Rename the file to a different name
    If the new filename exists, then it is not being used by another program( which in turn means that the file is not open).
    If the file is accessed by some other program, then Windows (which is my target OS right now) is not letting the rename happen. So, if the new filename does not exist, it means the file is open.
    Now, the problem is here. If we try that for a Word Document, it works fine. For a pdf, it works great. And I guess it works for most of the files. But, I tried that out for a .txt document. Even if the file is open, it creates a new file under the new filename. So, the check does not work.
    Any comments, help?
    Related Thread: http://forum.java.sun.com/thread.jspa?threadID=662171
    Thanks.
    Ajaimes:
    What if you copy it and then try to delete the original file?
    ChuckBing:
    What are you wanting to do that causes you to want to know:
    a "file is open", whatever that means?
    Warnerja:
    Now, the problem is here. If we try that for a Word
    Document, it works fine. For a pdf, it works great.
    And I guess it works for most of the files. But, I
    tried that out for a .txt document. Even if the file
    is open, it creates a new file under the new
    filename. So, the check does not work.I'd bet the .txt file isn't "open" either. By "open" do you mean you have Notepad running with the contents of that file displayed in its window? That doesn't mean the file is "open" at all. That would just mean Notepad HAD opened it, read the contents into memory, and likely closed it. Then it showed the memory contents in a window.
    Vinothkp:
    >What if you copy it and then try to delete the original file?
    Message was edited by:
    ajaimesIn that case, the file will be deleted. Then, when you save the opened file, it will save as a new file. Then, how would you know if the file is being accessed or not?
    However, this could be the possible reason.....
    I'd bet the .txt file isn't "open" either. By "open"
    do you mean you have Notepad running with the
    contents of that file displayed in its window? That
    doesn't mean the file is "open" at all. That would
    just mean Notepad HAD opened it, read the contents
    into memory, and likely closed it. Then it
    showed the memory contents in a window.
    By: warnerjaYes. That is probably right. Now, I have some improvement in understanding what is happening. This does not happen with the other types of files like Word Documents, etc. Why? Dont they do the same thing? And Then, in the case of .txt files, how can we know if the file is open or not.
    I will reframe the title a little bit here: How can we check if a file is being accessed by other program or not?
    Any more comments or ideas.
    Thanks.
    Warnerja:
    Just because something like Notepad is displaying what it saw in the file doesn't mean the file is being accessed by anything.
    You have a weird 'requirement'.
    If you "print" the contents of the file and hand out copies to people to look at, do you need your application to know if anyone is currently looking at the paper too? It's being "accessed" just as much in that situation as it is when Notepad has it displayed on your screen.

    Well, let me explain more on what I m trying to do.
    I want to check if a file is being edited or not. If it is not being edited currently, I want to move the file to a different folder. If it is being, edited, the application will be rest assured that even after moving the file to a different location, the file will not be right. It will be an old copy.
    So, if I were to do this to Word documents, I am good. But, for text documents, I am not able to do this.
    I understand what Warnerja says:
    "Just because something like Notepad is displaying what it saw in >the file doesn't mean the file is being accessed by anything."But, when MS Word access a ".doc" file, it holds something and prevents renaming of the file. In that case, it is open and ALSO being accessed by an application right?
    Any more comments?
    Thanks.

  • APEX Pages - User Access List with NTLM

    Hi,
    I'm building several APEX Applications, and using NTLM as its Authentication Scheme. With this, the users won't have to type any user and password. And their user name stated in top right screen.
    I'd like to build another application to administer users of all created APEX Applications. So I'd like to build 3 tables:
    1. users (hold user name, and user data)
    2. pages (hold APEX Applications pages)
    3. access_list (hold combined data of users and pages and access flag)
    The last table will give me an SQL that can be used to create page level Authorization Scheme.
    The problem is:
    I cannot find a way to get a list of user ids to pre-populated the table users. Is there a way that an administrator user use an LOV of all NTLM user instead of typing domain\user to this application? OR is there a better and elegant way to create User Access List with NTLM.
    Your helps will really help me, and thanks in advance.
    Regards,
    Aulia

    This is kind of a followup to Scott's post. Instead of using your own tables to map user accounts to permissions etc, why not simply use LDAP to query the NT domain global catalog?
    You can tell what users are members of particular AD groups and control access to functions based on AD group membership. Then you would only need one table that maps Apex functionality to AD groups.
    That's what we do. Our account management people add users to different security groups and they get access to our apex app based on those groups. The type of access is controlled by the group to which they belong.
    If you try to capture a list of all users, you'll be constantly trying to keep your list of users in sync with your AD/NTLM accounts.
    Or I guess you could simply use LDAP queries inside the database to get a list of ALL your users in a nightly batch. Wouldn't help for people added in the middle of the day, but maybe that doesn't happen often in your company.
    I have posted code on using Active Directory LDAP with dbms_ldap inside the database. Shouldn't be too much trouble to modify that code to scan your directory for users every night. Search for "dbms_ldap" in this forum.

Maybe you are looking for