7 Replies Latest reply: Dec 6, 2012 8:29 AM by 970471 RSS

    WebCerver Content: how to reproduce a big folder structure in one shot?

    547413
      Hello everybody,
      I'm a newbie on this tool and I need to get if, given a complex share that contains several nested folders,
      I can import the whole folders structure and its content accordingly and in such a way to replicate the structure with its metadata.
      Are there some kind of APIs to make such a custom and massive copy/checkin of folders and files?

      I would appreciate help.
        • 1. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
          benster
          It is called RIDC API.

          Good luck to find everything you need in the documentation. This is a nightmare, too much stuff for nothing.

          Start with these documents :

          Developer's Guide for Remote Intradoc Client (RIDC)
          http://docs.oracle.com/cd/E14571_01/doc.1111/e16819/toc.htm

          Oracle WebCenter Content Services Reference Guide
          http://docs.oracle.com/cd/E28389_01/doc.1111/e11011/toc.htm


          Here is how you can create folders :

          public class RIDCBean {

          IdcClientManager man = null;
          IdcClient idcClient = null;
          IdcContext idcContext = null;

          public RIDCBean() {
          man = new IdcClientManager();
          try {
          idcClient = man.createClient("idc://localhost:4444"); // ucm server connection
          idcContext = new IdcContext("weblogic", "welcome1"); // ucm credentials
          } catch (IdcClientException e) {
          // log4j...
          System.out.println(e.getMessage());
          }
          }
               
               private void createPublicFolder(String folderName, String parentFolderName, String comment) {

                    try {
                         DataBinder dbinder = idcClient.createBinder();
                         dbinder.putLocal("IdcService", "COLLECTION_ADD");
                         dbinder.putLocal("dCollectionName", folderName);
                         dbinder.putLocal("dCollectionOwner", idcContext.getUser());
                         dbinder.putLocal("dDocTitle", folderName);
                         dbinder.putLocal("dSecurityGroup", "Public");
                         dbinder.putLocal("hasParentCollectionID", "true");
                         dbinder.putLocal("dParentCollectionID", getFolderCollectionId(parentFolderName));
                         dbinder.putLocal("ignoreMaxFolderLimit", "");
                         dbinder.putLocal("dCollectionCreator", "weblogic"); // if user is admin, can specify other user
                         dbinder.putLocal("dCollectionModifier", "weblogic"); // if user is admin, can specify other user
                         dbinder.putLocal("dDocAuthor", "weblogic"); // if user is admin, can specify other user

                         dbinder.putLocal("xComments", comment);

                         idcClient.sendRequest(idcContext, dbinder);

                    } catch (Exception e) {
                         // log4j...
                         System.out.println(e.getMessage());
                    }
               }
               
          }
          • 2. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
            ryan sullivan2
            You could use WebDav (DIS) to copy/paste the folder structure into place.

            If you want to do everything programatically, you can use RIDC. There are a number of docs and blogs out there with good samples.

            Here's a good one with samples and references to the Oracle documentation:

            http://senasystems.blogspot.com/2012/03/ucm-file-operations-add-edit-delete.html

            -ryan
            • 3. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
              970471
              Here is another blog post with links to lots of RIDC code examples: http://jonathanhult.com/blog/2012/07/ridc-versus-cis/

              Jonathan
              http://jonathanhult.com
              • 4. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
                547413
                Really, I would have rather something more verbose on services to be used when 'Framework Folders' have been configured.
                Indeed I read all of the provided documentation but has anybody already moved some folders (many and structured!!) from filesystem to WebCenter using ridc?
                It looks like all of us performed something against 'Folder_g' and not 'Framework Folders', why?
                • 5. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
                  970471
                  Folders (previously known as Framework Folders) is fairly new. It is only available in 11g. Those are 2 reasons why there are not many guides about using Folders compared to Contribution Folders (folders_g).

                  http://jonathanhult.com/blog/2012/10/11g-folders-organized-optimized-modernized/

                  The Folders services are listed here: http://docs.oracle.com/cd/E28389_01/doc.1111/e11011/c08_frameworkfolders.htm

                  You can also use a debugging proxy such as Fiddler and then run different actions from the web interface and learn how WebCenter Content is using these services.

                  You could always try importing with RIDC to Contribution Folders (folders_g) and then using the built-in migration to Folders.

                  Jonathan
                  http://jonathanhult.com
                  • 6. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
                    547413
                    Dear all,
                    I did, and it had not been so difficult at the end.

                    Some metadata to add, if you need, and the method to create the folder ('Framework Folders' component) can look like the following:

                    private DataBinder run_create(DataBinder binder, String parentid) throws IdcClientException, IOException {
                              
                              File file = new File(m_filepath);
                    if (!file.exists()) {
                    System.out.println(m_filepath + " doesn't exist");
                    return null;
                    }

                         binder.putLocal("IdcService", m_service);
                         binder.putLocal("fFolderName","IamTheParent");
                         binder.putLocal("fDisplayName","aName");
                         binder.putLocal("fParentGUID",parentid);
                    binder.putLocal("fDocAccount", "");
                    binder.putLocal("fSecurityGroup", "IamAGroup");

                    ServiceResponse response = idcClient.sendRequest(connectionContext, binder);

                         return response.getResponseAsBinder();
                    }.

                    I've a doubt about the connection, now, is that to be explicitly closed?

                    Thanks a lot
                    Max
                    • 7. Re: WebCerver Content: how to reproduce a big folder structure in one shot?
                      970471
                      The following blog post by Niels Krijger entitled "Adding a file to Framework Folders in WebCenter Content using RIDC" may be of some additional help to others: http://www.nielskrijger.com/2012/10/adding-file-in-framework-folders-in.html

                      Jonathan
                      http://jonathanhult.com