Skip to Content
avatar image
Former Member

Corrupt folder in cFolders

Hello we have a folder in cFOlders that can't be opened, deleted, touched. We get "Technical error."

Is there any way to 'fix' corrupt folders?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 30, 2006 at 10:57 PM

    Badri, thanks for the tip. How do I get to the document guid and what is the best funtion/method to copy the document? Just if you happened to know from the top of your head. Thansk, Elena

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This is kind of trial code please run this for sample data..

      then after successful run may be u can try for your problematic folder..

      you can get the col_id topic_id and other things from the URL of the page or

      by right clicking on the URL link and properties...

      What i am doing in the code is using the existing COPY AND PASTE functionality in the cFolders

      to copy the docs across folders...

      HAPPY CODING

      DATA ls_clipboard_el TYPE cfx_ts_clipboard_element.
      DATA doc TYPE REF TO if_cfx_common.
      DATA str TYPE REF TO cl_cfx_structure.
      
      DATA: lp_common_folder  TYPE REF TO cl_cfx_common_folder,
            lp_folder         TYPE REF TO cl_cfx_folder,
            lp_common_folder1 TYPE REF TO cl_cfx_common_folder,
            lp_folder1        TYPE REF TO cl_cfx_folder  .
      DATA lp_col_app          TYPE REF TO cl_cfx_col_application.
      DATA l_folder_str        TYPE        string.
      DATA i_col_id TYPE string.
      DATA i_area_id TYPE string.
      DATA i_topic_id TYPE string.
      DATA l_fol_id TYPE sysuuid_c.
      
      lp_col_app       = cl_cfx_col_application=>get_instance( ).
      *problematic folder ids
      *i_topic_id = '43D8170097961F1CE10000000A4241A6'.
      i_col_id  = '43CF788859C84303E10000000A4241A6'.
      i_area_id = '43CF788959C84303E10000000A4241A6'.
      
      CALL METHOD cl_cfx_context_ui=>initialize
             EXPORTING
                 i_col_id              = i_col_id
                 i_area_id             = i_area_id
                 i_topic_id            = i_topic_id
      *           I_DOC_ID              =
                 i_object_type         = 'fol'
               IMPORTING
                 e_fol_id              = l_folder_str.
      
      l_fol_id = l_folder_str.
      
      DATA: lp_col TYPE REF TO cl_cfx_collaboration,
            oref   TYPE REF TO cx_root .
      lp_col = cl_cfx_collaboration=>initialize( i_col_id ).
      
      
      TRY.
          lp_common_folder = cl_cfx_folder=>get_folder_for_id( l_fol_id ).
          lp_folder ?= lp_common_folder.
          lp_folder->initialize_docs( ).
      
        CATCH cx_root INTO oref.
      
      ENDTRY.
      
      *lp_folder will have the docs that can be retrieved..from that problem folder
      
      TRY.
          DATA str_tab TYPE cfx_t_string.
          DATA lt_item      TYPE cfx_t_string.
          DATA ls_item      TYPE string.
          DATA lp_iterator TYPE REF TO cl_cfx_iterator.
          DATA lp_iterator_elem TYPE REF TO  if_cfx_iterator_element.
          DATA obj_type TYPE cfx_t_object_type.
      
          lp_iterator = lp_folder->get_document_list( ).
          CALL METHOD cl_cfx_common_document=>get_doc_ids
            EXPORTING
              ip_doc_list  = lp_iterator
            IMPORTING
              et_documents = str_tab.
      
          DATA count TYPE i.
          DATA str_wa TYPE string.
      
          count = lp_iterator->get_count( ).
          DO count TIMES.
            READ TABLE str_tab INDEX sy-index INTO str_wa.
            IF sy-index = 1.
              lp_iterator_elem = lp_iterator->get_first( ).
            ELSE.
              lp_iterator_elem = lp_iterator->get_next( ).
            ENDIF.
            obj_type = lp_iterator_elem->get_object_type( ).
      *    CONCATENATE 'fol' l_fol_id INTO ls_item SEPARATED BY space.
      
            CONCATENATE obj_type str_wa INTO ls_item SEPARATED BY space.
      
            APPEND ls_item TO lt_item.
      
          ENDDO.
      
      *lt_item willl have the items that have to copied from in a structure..
      
          CALL METHOD cl_cfx_fol_ui=>copy_selected
            EXPORTING
              it_item   = lt_item
              i_col_id  = i_col_id
      *          IMPORTING
      *            e_msg_txt = p_msg_txt.
          .
      
      * Destination folder
          i_col_id  = '43D816F897961F1CE10000000A4241A6'.
          i_area_id = '43D816F997961F1CE10000000A4241A6'.
          i_topic_id = '43DF3B1D362571C7E10000000A4241A6'.
          CALL METHOD cl_cfx_fol_ui=>insert
            EXPORTING
              i_col_id              = i_col_id
              i_area_id             = i_area_id
              i_topic_id            = i_topic_id
              i_role                 = ''
      *  IMPORTING
      *    E_MSG_TXT              =
      *    E_BGROUND_PROCESS      =
      *    E_BGROUND_PROCESS_INFO =
              .
      
        CATCH cx_root INTO oref.
      
      ENDTRY.
      
      
      

  • avatar image
    Former Member
    Jan 30, 2006 at 12:42 AM

    Hi

    Check whether you have given access rights to anyone.?

    I hope you don't have much information in this folder. If so make a search for all the documents and copy it to a new folder.

    Cheers

    Badri

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 31, 2006 at 04:38 PM

    Thank you Badri. You're a genius.

    Just one more thing, my user keeps on asking me why this happened and is it the supplier that put a bad document in there. I hate to blame it on the supplier since this is a first time that this has happened to us. Why do you think this happens?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Elena,

      Its difficult to pinpoint the cause for the corruption. One way of finding is going through the change log/History.

      The best way to put forward is that when the document was stored by the client.There might have been some strange characters or an issue with storing the correct information into the records. This way you still let them know to be careful next time they use and not blaming them as well

      Cheers

      Badri