Event handling to listen directory file changes?

I want to write a Java program that watches directories for changes. If there are any new files, or files are deleted in a directory, notify the user. I think this is a multi-thread program that watches files changes in specific directories. But I don't know what listener that the program should implements. please help!!

There are no events that do what you ask (actually, there are native OS events in Win32 that do this, but I suspect that isn't what you are going for).
You'll need to write your own event source for this (and hey, if you are feeling crazy, you could even create your own event type - FolderChangedEvent or such).
Start a thread that wakes up periodically and checks the contents of a specified folder for changes. If there is a change, fire your event to any listeners.
Now, how you actually define a change in a folder is an entirely different matter. It may be sufficient to calculate a CRC (or Adler32) on the modified date of all files in the folder, then compare that to a previous version to see if there has been a change.
If you have to drop into sub-folders, you'll need to create a recursive call to do that.
- K

Similar Messages

  • Listening for file changes

    i have a properties file. I need to monitor for the changes to the file and send intimation to all the files using the properties file. How shall i do it with out modifying the files which are executing it. i.e i need to suspend the execution of the threads and reload the values.

    set up a File object that represents the props file.
       File f = new File ("propsFile");   On start up, note the lastModified() time
    In a low priority thread, keep polling the lastModified() method to check if the file has been reloaded.
    Set up an event handler mechanism to notify and call all interested objects that would want to take some action if and when the file's been modified.
    ram.

  • How to do Local (Client) Directory/File changes?

    Ok, here's one I could not find on the net nor these forums..
    How can I have a CFM page that will list all files in a
    client's directory ... basically, I am looking for a directory
    watcher/listener for a client's directory using cold fusion ..
    Any hints?

    ShannaraAlaska wrote:
    > Any hints?
    Recognize the difference between a server and a client in a
    server/client system and then one does not ask questions like
    "how can
    my server sneak in and spy on the clients system against all
    security
    models designed to protect them from this violation."
    Short answer: NO -- you can not do this. [And this is a good
    thing.]
    A little longer answer. If you are on a well defined network
    and the
    server and the client machines are on the same domain and you
    want to
    define a domain user that has permissions to read the desired
    directories across the network. You could configure CF to run
    as this
    user and use UNC paths to access the client machine.
    Otherwise, no there is no way for ColdFusion, or any server
    application,
    to read or watch a clients directory. Just imagine the havoc
    if every
    website you visited could start snooping around well known
    directories
    on your computer.

  • Global event handler for preinitialize

    Is there anyway to add a global event handler on the
    components preinitialize event?
    What I need to do is to be able to enable / disable, and show
    / hide component dynamically based on a access list. My plan was to
    have a global event handler that listens to the preinitialize
    event, at that time, checks if the user has access to the component
    or not. If not, I'll disable / hide the component.
    What I did so far is:
    in my main app.mxml file, I have:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    preinitialize="preinit(event)"
    so the preinit() function is invoked on the app's
    preinitialize event.
    Then I have the preinit() function (see attached code below).
    However, it does work as there is no trace message printed.
    I changed to use KeyBoardEvent.KEY_DOWN and that seems
    working when I press any key.
    I also tried to use the app.stage.addEventListener() but the
    stage object is null in the preinitialize event.
    Thanks in advance for your help.

    Thank you for follow up on my question.
    I do know these two properties. But that does not solve the
    problem. Let me explain it with an example.
    That's say, when the user logs in, I loads the access list.
    Then the app displays a panel with some form entries. If I am able
    to register a global event listener for the component
    initialization events, I can check the permission and optionally
    hide some components. Otherwise, I would need to programmatically
    travels my component tree to evaluate each component individually
    to set there visible/includeInLayout properties, which is error
    prone.
    The problem is that the component is visible to one user but
    would be hidden to another, so it can not be set at the design
    time.
    The approach I am using right now is to extend the default
    components to add an event listener. But I'd like to know if it is
    possible to register a global event listener to be notified when
    any component is created. As my first post says, I tried to use the
    systemManager and listen to the PREINITIALIZE event, but that
    didn't get always get invoked.

  • Unregister Event Handler OIM 11g

    Hi
    I have created a event handler and registered the same within OIM 11g. it gets executed as expected after create user (post process). next i changed some of the code within my custom event handler. and registered the plugin after i unregistered the old one. unfortunately i still see the old output in my logs
    i have purged the metadata chache, i have bounced the OIM but no luck..
    Are there any steps / checks i need to follow after i unregister the event handler.. and also plz confirm whether we need to follow all the steps of registration of event handler every time we make changes to the event handler class. uhhh.. its really time consuming when
    thanks
    shiv

    Hi,
    Please make sure you are shipping updated JAR files in plugin.zip and re-register.
    Follow below steps to re-register plugin,
    1.     Unregister plugin using below command
    ant -f pluginregistration.xml unregister
    2.     Prepare plugin.zip with updated JAR file.
    3.     register plugin using below command
    ant -f pluginregistration.xml register
    You do not need to restart OIM server after re-register and need not to import eventhandler.xml unless you change version of plugin.
    Also you can verify registered plugin details in plugin table with following query (Run on OIM DB),
    select * from plugins;
    Thanks,
    Pradeep.

  • Event handling in seperate class

    hello... i have a gui w/ a series of combo boxes, text fields, etc. (call this the GUI file)
    upon pressing a button, i need to run a series of event handling that will use info from many of these components
    i would like to create a separate java file for the button event handling, but need this file to have access to many componets in the GUI file - does anyone know a nice way to do this?

    i'm not quite sure how to do that... in my GUI class,
    I construct the actuall gui within the constructor..
    then i have a simple driver that creates an instance
    of class GUI and calls the constructor... how can I
    pass a reference of the GUI to the handler in that
    scenario??it would be better if you post your code. Some people like me can't just imagine.

  • Group RCDC Event Handler Bug?

    I have added a field in the Group RCDC in a Tab (grouping) called "Admin" and marked it as Required within the RCDC.
    Now, if I were to take an existing group that has a Member Selection of "Criteria-Based" and change it to "Manual" and click "OK" without populating the "required" field in the other tab, I would be re-directed to
    the field with the note "The required field cannot be empty" as expected. However, if I fill out the field and submit the request, I noticed it doesn't clear the underlying "Filter" attribute and the request fails with "Group validation
    failed: Static group cannot update membership filter".
    I believe this is related to the fact that the Group RCDC has a built-in event handler when the "Member Selection" changes. But doesn't modify the "Filter" attribute unless you go to the "Members" tab? Seems the even handler
    is ignored or overridden by the event handler that checks for Required fields to be populated?
    Anyone else run into this?

    I have added a field in the Group RCDC in a Tab (grouping) called "Admin" and marked it as Required within the RCDC.
    Now, if I were to take an existing group that has a Member Selection of "Criteria-Based" and change it to "Manual" and click "OK" without populating the "required" field in the other tab, I would be re-directed to
    the field with the note "The required field cannot be empty" as expected. However, if I fill out the field and submit the request, I noticed it doesn't clear the underlying "Filter" attribute and the request fails with "Group validation
    failed: Static group cannot update membership filter".
    I believe this is related to the fact that the Group RCDC has a built-in event handler when the "Member Selection" changes. But doesn't modify the "Filter" attribute unless you go to the "Members" tab? Seems the even handler
    is ignored or overridden by the event handler that checks for Required fields to be populated?
    Anyone else run into this?

  • Save Event Handler?

    Hey scripters!  I mostly develop plugins with the C++ sdk, so forgive my ignorance.  I was just wondering if it is at all possible (in a script) to make event handler that "listens" for a save event?

    I'm not sure how it works using Patch Panels, but if you want to register an event in a Flex panel using the Photoshop Panel SDK ( CSXSLib ) you register the event in the panel
    CSXSInterface.instance.evalScript("PhotoshopRegisterEvent", charToInteger("save").toString());
    ExternalInterface.addCallback("PhotoshopCallback", PhotoshopCallback);
    The 'Per Layer Metadata' sample in the SDK has more info

  • Funny/odd event handling

    Hi All,
          Ran into this really wierd bug - wasn't sure whether anyone might be interested.
    An event producer loop (LocalBytesAtPort value-change) is throwing it's event, even though the Error-case is executing.
    If the value-change-node is being called, the the bytes-at-port probe should show data, but it doesn't.  The error probe (from inside error case) is getting fresh values.  Yet event-loop is ticking over and handling value change at the same period as the value-change producer. 
    I know this is cryptic, but I hit Post too soon    and have to explain it in a short time!
    Cheers
    P.S. There's supposed to be a 16color bmp, (bmp is only option) but can't post it!
    Message Edited by Dynamik on 04-26-2006 11:57 PM
    Message Edited by Dynamik on 04-26-2006 11:58 PM
    When they give imbeciles handicap-parking, I won't have so far to walk!

    Hi tst,
    Re: bmp blocking - at 16colors it was only 330K!
    Anyway, I did look for other places the LocalBytesAtPort might be changed, but the FP indicator is only updated from one place - the producer loop via Value (signaling).  After messing with it, it started working - but what did I do?  I accidentally left a 11ms wait in the producer-loop!?
    Re posting as 7.1, Looked over th VI to assess the damage (from missing VIs) if only top-level was supplied - not too bad...
    To reiterate, [before 11ms timeout was added] the Error-case was executing every 1111ms, but Event handler was receiving a Value-change event for LocalBytesAtPort!
    Leading-up to the error condition [w/out 11ms TO], there are several thousand Serial-Character VISA Events in rapid succession.  I had a problem firing notifiers with for-loops without a wait, maybe this is related...
    Cheers!
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    Dvr.Sky.TXRDaemon.vi ‏227 KB

  • About CL_GUI_ALV_GRID's event-handling & PAI/PBO

    Hi, all,
    I met a problem when using CL_GUI_ALV_GRID's event-handling.
    I created a simple event-handling-class with an event-handling-method for DOUBLE-CLICK event of CL_GUI_ALV_GRID. And the event-handling-method, only makes some changes to the contents of itab to be shown in ALV_GRID.
    The problem is: In my idea, after event-dispatch and event-handling in PAI, subsequent PBO will be called. Since SET_TABLE_FOR_FIRST_DISPLAY is called in PBO, I would saw the changed itab shown. BUT, I saw the contents of the itab remaining unchanged.
    * PAI module, DISPATCH the event
      CASE OK_CODE.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
    I debugged, and found that, after event-handling-method, PBO module doesn't execute.
    That's my wondering, after the preceding PAI, shouldn't the subsequent PBO appear? OR is event-handling different from other user actions?
    Many thanks.

    Hi,
    for double click you need explicit handler ,
    just check it.
    REPORT  ZTEST1234    MESSAGE-ID ZZ                           .
    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID,  "First
          G_GRID1 TYPE REF TO CL_GUI_ALV_GRID. "Second
    DATA: L_VALID TYPE C,
          V_FLAG,
          V_DATA_CHANGE,
          V_ROW TYPE LVC_S_ROW,
          V_COLUMN TYPE LVC_S_COL,
          V_ROW_NUM TYPE LVC_S_ROID.
    DATA: OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM,
          G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST', "First Container
          G_CONTAINER2 TYPE SCRFNAME VALUE 'TEST1',"Second container
          GS_LAYOUT TYPE LVC_S_LAYO.
    DATA:BEGIN OF  ITAB OCCURS 0,
         VBELN LIKE LIKP-VBELN,
         POSNR LIKE LIPS-POSNR,
         LFDAT like lips-vfdat,
         BOX(1),
         HANDLE_STYLE TYPE LVC_T_STYL,
         END OF ITAB.
    *       CLASS lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
    **Hot spot Handler
        HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                          IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
    **Handler to Check the Data Change
        HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                             OF CL_GUI_ALV_GRID
                             IMPORTING ER_DATA_CHANGED
                                       E_ONF4
                                       E_ONF4_BEFORE
                                       E_ONF4_AFTER,
    **Double Click Handler
        HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                         IMPORTING E_ROW E_COLUMN ES_ROW_NO.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *Handle Hotspot Click
      METHOD HANDLE_HOTSPOT_CLICK .
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW_ID.
        V_COLUMN = E_COLUMN_ID.
        V_ROW_NUM = ES_ROW_NO.
        MESSAGE I000 WITH V_ROW 'clicked'.
      ENDMETHOD.                    "lcl_event_handler
    *Handle Double Click
      METHOD  HANDLE_DOUBLE_CLICK.
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW.
        V_COLUMN = E_COLUMN.
        V_ROW_NUM = ES_ROW_NO.
        IF E_COLUMN = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
        ENDIF.
        IF E_COLUMN = 'POSNR'.
          MESSAGE I000 WITH 'Click on POSNR row number '  E_ROW.
          "with this row num you can get the data
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    **Handle Data Change
      METHOD HANDLE_DATA_CHANGED.
        CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
          EXCEPTIONS
            FINISHED = 1
            OTHERS   = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDMETHOD.                    "HANDLE_DATA_CHANGED
    ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
    *&             Global Definitions
    DATA:      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
                G_HANDLER TYPE REF TO LCL_EVENT_HANDLER, "handler
                G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER. "Container2
    *- Fieldcatalog for First and second Report
    DATA: IT_FIELDCAT  TYPE  LVC_T_FCAT,
          X_FIELDCAT TYPE LVC_S_FCAT,
          LS_VARI  TYPE DISVARIANT.
    *                START-OF_SELECTION
    START-OF-SELECTION.
      SELECT VBELN
             POSNR
             FROM LIPS
             UP TO 20 ROWS
             INTO CORRESPONDING FIELDS OF TABLE ITAB.
    END-OF-SELECTION.
      IF NOT ITAB[] IS INITIAL.
        CALL SCREEN 100.
      ELSE.
        MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
      ENDIF.
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    FORM CREATE_AND_INIT_ALV .
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
    "First Grid
      CREATE OBJECT G_CUSTOM_CONTAINER
             EXPORTING CONTAINER_NAME = G_CONTAINER1.
      CREATE OBJECT G_GRID
             EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
    "Second Grid
      CREATE OBJECT G_CUSTOM_CONTAINER1
             EXPORTING CONTAINER_NAME = G_CONTAINER2.
      CREATE OBJECT G_GRID1
             EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
    * Set a titlebar for the grid control
      CLEAR GS_LAYOUT.
      GS_LAYOUT-GRID_TITLE = TEXT-003.
      GS_LAYOUT-ZEBRA = SPACE.
      GS_LAYOUT-CWIDTH_OPT = 'X'.
      GS_LAYOUT-NO_ROWMARK = 'X'.
      GS_LAYOUT-BOX_FNAME = 'BOX'.
      GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
      GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
      CREATE OBJECT G_HANDLER.
      SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
    *  SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
      SET HANDLER G_HANDLER->HANDLE_DATA_CHANGED FOR G_GRID.
    data: ls_outatb like line of itab,
          v_index type sy-tabix.
    DATA: LS_EDIT TYPE LVC_S_STYL,
            LT_EDIT TYPE LVC_T_STYL.
    LOOP AT ITAB INTO ls_outatb WHERE POSNR = '000010'.
        V_INDEX = SY-TABIX.
        LS_EDIT-FIELDNAME = 'VBELN'.
        LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
        LS_EDIT-STYLE2 = SPACE.
        LS_EDIT-STYLE3 = SPACE.
        LS_EDIT-STYLE4 = SPACE.
        LS_EDIT-MAXLEN = 8.
        INSERT LS_EDIT INTO TABLE LT_EDIT.
        INSERT LINES OF LT_EDIT INTO TABLE ls_outatb-handle_style.
        MODIFY ITAB INDEX V_INDEX FROM ls_outatb  TRANSPORTING
                                          HANDLE_STYLE.
      ENDLOOP.
    * setting focus for created grid control
      CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
        EXPORTING
          CONTROL = G_GRID.
    * Build fieldcat and set editable for date and reason code
    * edit enabled. Assign a handle for the dropdown listbox.
      PERFORM BUILD_FIELDCAT.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    **Vaiant to save the layout
      LS_VARI-REPORT      = SY-REPID.
      LS_VARI-HANDLE      = SPACE.
      LS_VARI-LOG_GROUP   = SPACE.
      LS_VARI-USERNAME    = SPACE.
      LS_VARI-VARIANT     = SPACE.
      LS_VARI-TEXT        = SPACE.
      LS_VARI-DEPENDVARS  = SPACE.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
    **Calling the Method for ALV output for First Grid
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          IS_VARIANT           = LS_VARI
          IS_LAYOUT            = GS_LAYOUT
          I_SAVE               = 'A'
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
    **Calling the Method for ALV output for Second Grid
       CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
    *    EXPORTING
    *      IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
    * Set editable cells to ready for input initially
      CALL METHOD G_GRID->SET_READY_FOR_INPUT
        EXPORTING
          I_READY_FOR_INPUT = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      -->PT_EXCLUDE text
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_fieldcat
    *       Fieldcatalog
    FORM BUILD_FIELDCAT .
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-EDIT      = 'X'.
      X_FIELDCAT-OUTPUTLEN = '10'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Item'(025).
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
        L_POS = L_POS + 1.
        X_FIELDCAT-SCRTEXT_M = 'Del Date'(015).
      X_FIELDCAT-FIELDNAME = 'LFDAT'.
      X_FIELDCAT-TABNAME = 'ITAB'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '10'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
    ENDFORM.                    " build_fieldcat
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF G_CUSTOM_CONTAINER IS INITIAL.
    **Initializing the grid and calling the fm to Display the O/P
        PERFORM CREATE_AND_INIT_ALV.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Regards
    vijay

  • Need Help with Event Handler Code - Doesnt come up in Event Handler Manager

    Hello there,
    Below is the code snippet that I am using to create a event handler:
    package com.oracle.events;
    import com.thortech.util.logging.Logger;
    import com.thortech.xl.client.events.tcBaseEvent;
    import com.thortech.xl.dataobj.tcDataObj;
    import com.thortech.xl.util.logging.LoggerModules;
    public class tcCheckOvrallProvStatusUDFs extends tcBaseEvent
         private static Logger logger = Logger.getLogger(LoggerModules.XL_JAVA_CLIENT);
         public tcCheckOvrallProvStatusUDFs()
              setEventName("Generating tcCheckOvrallProvStatusUDFs");
    * @Override
    * @throws Exception
         protected void implementation() throws Exception {
              tcDataObj data = getDataObject();
              String OIDProvStatus = data.getString("usr_udf_oidusrprovstatus");
    String EBSProvStatus = data.getString("usr_udf_ebstcausrprovstatus");
              if (OIDProvStatus.equals("Provisioned") && EBSProvStatus.equals("Provisioned")) {
                   setOverAllProvStatus(data);
         * @param data
         * @throws Exception
         private void setOverAllProvStatus(tcDataObj data) throws Exception
              data.setString("usr_udf_ovrrscprovstatus", "Provisioned");
    Its a simple code that I am using to populate value of a UDF field depending on the value of other 2 fields. I want to trigger it on Post-Insert and Post-Update events.
    But even if I restart the OIM server after placing the successfully compiled file (0 errors, 0 warnings) into the EventHandlers folder of OIM_HOME; it doesnt show up in the Design Console -> Development Tools -> Business Rule Definition -> Event Handler Manager. :( In order to create a event handler i need that file to show up in the lookup of event handlers/adapters. This JAR file doesnt come up over there.
    Is there anything missing within the code ?
    What else needs to be specified?
    Please provide some guidance.
    Thanks,
    - jhb.

    Now I have placed this JAR file in JAVATasks folder - made an entity adapter - in the event handler manager - i gave the class name/event handler name as 'setUDFValue' and the package as 'project5'. But now im getting it 'DOBJ.EVT_NOT_FOUND - Event Handler not found' error.
    package project5;
    import java.util.Hashtable;
    import Thor.API.Exceptions.tcAPIException;
    import java.util.Hashtable;
    import java.util.HashMap;
    import com.thortech.xl.util.config.ConfigurationClient;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import Thor.API.Operations.tcUserOperationsIntf;
    import java.lang.System;
    import Thor.API.Exceptions.tcUserNotFoundException;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class setUDFValue {
    private static final String SMTP_HOST_NAME="mail.smtp.host";
    public setUDFValue() {
    // public static void main(String[] args) {
    // setUDFValue.setvalue("jatinbhatt");
    // setUDFValue.sendemail("[email protected]","[email protected]");
    public static void setvalue(String UserID) {   
    try
    System.setProperty("XL.HomeDir", "F:/oim/oimserver/xellerate");
    System.setProperty("log4j.configuration",
    "F:/oim/oimserver/xellerate/config/log.properties");
    System.setProperty("java.security.policy",
    "F:/oim/oimserver/xellerate/config/xl.policy");
    System.setProperty("java.security.auth.login.config",
    "F:/oim/oimserver/xellerate/config/auth.conf");
    System.out.println("Startup...");
    System.out.println("Getting configuration...");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    System.out.println("Login...");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","oimadmin1");
    System.out.println("Getting utility interfaces...");
    tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    HashMap userMap = new HashMap();
    String str1 = null;
    String str2 = null;
    userMap.put("Users.User ID",UserID);
    userMap.put("Users.Status", "Active");
    tcResultSet userResultSet = null;
    try {
    userResultSet = moUserUtility.findAllUsers(userMap);
    } catch (tcAPIException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    for (int i=0; i<userResultSet.getRowCount(); i++)
    userResultSet.goToRow(i);
    str1 = userResultSet.getStringValue("USR_UDF_OIDUSERPROV");
    str2 = userResultSet.getStringValue("USR_UDF_EBSUSERPROV");
    // System.out.println(userResultSet.getStringValue("USR_UDF_OIDUSERPROV"));
    // System.out.println(userResultSet.getStringValue("USR_UDF_EBSUSERPROV"));
    if (str1.equals("Provisioned") && (str2.equals("Provisioned") || str2.equals("NA")))
    userMap.put("USR_UDF_OVRRSCPROVSTATUS","Provisioned");
    moUserUtility.updateUser(userResultSet,userMap);
    moUserUtility.close();
    }catch (Exception e){
    e.printStackTrace();
    ERROR:
    ERROR RMICallHandler-63 XELLERATE.SERVER - Class/Method: tcDataObj/ runEvent encounter some problems: project5.setUDFValue
    java.lang.ClassCastException: project5.setUDFValue
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcUSR.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
         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:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SecurityRoleInterceptor.invoke(SecurityRoleInterceptor.java:47)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at tcUserOperations_RemoteProxy_6ocop18.updateUser(Unknown Source)
         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:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Thanks,
    - jhb.

  • Problem reading custom property file from custom event handler.

    Hi,
    My custom event handler needs some bits of information that I have set up in a property file. However, when the event handler runs it throws a FileNotFound exception - actually its because permission was denied.
    I have added the code System.getProperty("user.name") to find out the actual user that the event handler is running as. It reports that "oracle" is the user.
    That's great. However, the permissions on the file will allow oracle to read/write the file. If I log onto the server where OCDB runs (as oracle), I can vi the file.
    The file is owned by another user, but the "oracle" is a member of the group that has read/write (we're running on a unix box). The file is not 777.
    The event handler is actually calling a static utility method that returns the Properties. This utility is used elsewhere in other custom apps in conjunction with OCDB (on the same server). It works there, so the utility is functioning correctly.
    Is there something going on that I'm missing? Like somehow the event handler is acually runn as somebody else?
    Here is the node log.
    2007/07/17 12:52:16 [oracle.ifs] [37] 434364 system FINE: Error /opt/csc/sfi/configuration/sfi.properties (Permission
    denied) Additional INFO: java.io.FileNotFoundException: /opt/csc/sfi/configuration/sfi.properties (Permission denied)
    Thanks in advance for the help.
    Winston

    Matt,
    Sorry to have wasted your time. It was a server reboot issue. The ocdb server hasn't been restarted since early July. We added the users and groups late last week. Although we tested on line, the server wasn't quite up to speed with the new changes.
    We bounced the server and all is well.
    Thanks
    Winston

  • How to receive the custom event in the listening portlet (No backing file)

    I have couple of portlets (JPF based). Portlet A is firing an event
         public Forward processAction()
              PortletBackingContext context =PortletBackingContext.getPortletBackingContext(this.getRequest());
              String message = "XXXXX";
              context.fireCustomEvent("customevent", message);
              Forward forward = new Forward("success");
              return forward;
    I have configured the Portlet B's eventhandler to listen for the 'customEvent' and invoke the pageFlowAction 'listenForEvent'
         @Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "test2.jsp") })
         public Forward listenForEvent() {
              Forward forward = new Forward("success");
              return forward;
    Portlet B's method listenForEvent is indeed getting invoked, but is there a way I can retrieve the 'Event' object (as fired by Portlet A) inside the listenForEvent. I could have done this via the Backing file, but for some reasons i cann't use the backing file. Is there a way i can get the CustomEvent and the associated payload in my listening JPF portlet, without a backing file?
    The WLP version is 10.3

    Hello,
    I originally said:
    All you should need to do is to modify the method signature for your event-receiving method. The method signature should be:
    public void listenforEvent(HttpServletRequest request, HttpServletResponse response, Event event)
    where Event is a com.bea.netuix.events.Event object. You can then cast this to a CustomEvent object.
    But I mis-read your earlier post about catching the custom event and invoking a pageflow action. When you do that, you will lose the custom event's payload (your message), and there is no way to retrieve it from your pageflow action.
    The only way you can actually retrieve the event's payload is using a backing file for the portlet, with a method having the signature I mentioned above. You can then set a request attribute with the event's payload and still have it invoke the pageflow action, at which time you could retrieve the request attribute value-- assuming you don't need to run this portlet over WSRP. Over WSRP, the event-handling and pageflow action-invoking lifecycles will happen with independent request objects, so you would need to store the event payload in session to work over WSRP.
    Kevin
    Edited by: kfrender on Aug 31, 2009 3:34 PM

  • [svn:fx-trunk] 12481: Because of the Change/Changing changes in VideoPlayer , we need to also listen for a CHANGE as well as the CHANGE_END, CHANGE_START, THUMB_PRESS, and THUMB_RELEASE events.

    Revision: 12481
    Revision: 12481
    Author:   [email protected]
    Date:     2009-12-03 18:48:17 -0800 (Thu, 03 Dec 2009)
    Log Message:
    Because of the Change/Changing changes in VideoPlayer, we need to also listen for a CHANGE as well as the CHANGE_END, CHANGE_START, THUMB_PRESS, and THUMB_RELEASE events.
    Also, when clicking on the track and animating, the scrubbar's playedArea should move along with the thumb.  We do this by using pendingValue, rather than value in updateSkinDisplayList().
    QE notes: -
    Doc notes: -
    Bugs: SDK-24528
    Reviewer: Kevin
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24528
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/ScrubBar.as

    My first observation is that you don't reraise the error in the CATCH handler. That is bad, because it makes the proceedure fail silently which may be very difficult to troubleshoot.
    The version numbers for Change Tracking are indeed database-global. MIN_VALID_VERSION can be different for different tables, if they have different retention periods. But if they all have the same retention period, it seems likely that MIN_VALID_VERSION
    would increase as the database moves on.
    I'm not sure about your question Can we use the CHANGE_TRACKING_CURRENT_VERSION even though we want to download subset of data from the table (only records matching for one data_source_key at a time). Where would you use it? How would you use
    it?
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Is it possible to get an event notificati​on when a file is changed ?

    Dear,
    I have to do something on a file or folder when this is changed from outside the program. I can write a loop and look regularly to the change date. However to avoid unnecessary CPU processing, I would like to be notified when a file is changed. Can this be done by events in LabVIEW ?
    Thanks in advance for your reaction.
    Best regards,
    Marc

    Marc VH wrote:
    Dear,
    I
    have to do something on a file or folder when this is changed from
    outside the program. I can write a loop and look regularly to the
    change date. However to avoid unnecessary CPU processing, I would like
    to be notified when a file is changed. Can this be done by events in
    LabVIEW ?
    LabVIEW
    has not a build in disk event handler. On Windows I would call the
    Windows API functions FindFirstChangeNotification together with the
    according event handling APIs. Or maybe since LabVIEW does not run on
    9x systems anyhow anymore use ReadDirectoryChangesW instead.
    Enclosed is a simple example using FindFirstChangeNotification. It is
    all enclosed in one VI using an internal shift register. This limits
    the function to be used for on change notification at the same time
    only. In order to make it deal with multiple change notifications one
    would have to change quite a bit of the VI, possibly taking out the
    create, retrigger and close operation into individual VIs passing an
    uInt32 between them for the change notification handle.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    WIN File Change Notification.zip ‏29 KB

Maybe you are looking for

  • Database Access in Java (Count field incorrect)

    Was given a stock tracking application to be edited for use as a Student/Admin login application which accesses a database and adds/deletes/edits student information. When I try to login, I get the following error: [Microsoft][OBDC Microsoft Access D

  • Airport express Blinks Yellow After Setup

    I'm sure this has been asked before, but I couldn't find the answer. I'm running windows xp on my desktop and have a DLink wireless router. I'm trying to use airport express to stream music to my stereo. I've had it up and running in the past, but my

  • Oracle 11g : ORA-00384 insufficient memory to grow cache

    Hi , I am trying to manually set the db_cache_size and I am getting the following error : SQL> alter system set sga_max_size=100M scope=spfile; System altered. SQL>alter system set db_cache_size=50M scope=spfile ERROR at line 1: ORA-32017: failure in

  • Selling price - PR00

    I want to seen the selling price of all matl in a plant what is the Tcode? plreply guru

  • Icloud encountered an error when trying to connect to the server

    I get this error everytime I try and sign in to icloud.com on my work desktop.  I have tried IE8, and Chrome (latest version) on my Windows xp machine.  any suggestions.  I know my office uses Websence to restrict internet access but it is hard to be