4 Replies Latest reply on May 13, 2010 9:42 AM by 746458

    get native file in ucm (ucm and terastack solution working together)


      We use oracle universal content management server (ucm). A lot of files are stored on the hard disk of the system using this content management system. Now we are using Terastack Solution (http://www.hie-electronics.com/) to create backup of the data. The TeraStack Solution is an optical data storage system designed and manufactured to improve performance through affordable and reliable data storage management. Terastack solution archives (writes) all files to dvds and then a module of it truncates all these files to zero byte in size to save disk space. Now terastack solution watches all archived files. If an application tries to open such a file, it intercepts this, blocks this request, then restores the file from the dvd. During this process calling application just waits for the file to open. After restoring terastack solution sends a signal to the calling application, and the file with full contents is opened in the application.

      Now here is the problem:

      Files are check-in oracle content server. Terastack solution has burned these files to dvd and made these files to zero byte in size. Now when we click a link in content server to get a checked-in file (native file), terastack solution intercepts it, restore the file from dvd, then an open/save dialog box open to either open or save the file to a location. We save the file to a folder, open this file and come to know that there is no content in the file. It is still a zero byte file.

      When we checked the file at original location (remember ucm stores files in vault folder), we came to know that file is actually restored successfully by the terastack solution but the content server returned a zero byte file. When we click the link for the same file again to get native file in ucm then we get a fully restored file. i.e. on the first try to get native file we get a zero byte file although it is restored by terastack solution successfully. And on the second try we get file with full contents. On the second try, file has already been restored by terastack solution during the first try and terastack solution ignores files greater than zero byte in size, that’s why client gets a correct file on second try. Having size greater than zero means file is already restored.

      The link in ucm that is used to get native file does not point directly to the desired file. It calls some code in ucm that transmit the required file back to the client. Something like this:

      I think what is going on here is, when we click on a link to get native file that is zero byte in size, content server creates a response for the file, append the size of the file (currently zero) to the header of the response along with other info, and then tries to transmit the file to the client. At this point, terastack solution intercept the request and restore the file. After restoring terastack solution send signal to calling application that file is restored. But the server has already created request for the file and it is not updated during or after the restore, that’s why client gets zero byte file.

      What I want is somehow force the content server to wait until file is fully restored by terastack solution and then transmit the fully restored file to client. Is there any configuration setting for ucm that will achieve the goal?

      Any setting in bin/intradoc.cfg or config/config.cfg or something else?

      Need help.

      OS: Windows XP SP3
      Content Server 10gR3 (Deployed to: IIS, JDK used: v1.5)
      TeraStack Solution (Deployed to: JBoss)
        • 1. Re: get native file in ucm (ucm and terastack solution working together)
          Is there any way to modify the source code of ucm that is used to download a file to the client?


          Currently the link that is used to get the native file calls a ucm service to download the file on the client. Can we modify this link so that the link directly points to the file in the vault folder instead of calling any service?
          • 2. Re: get native file in ucm (ucm and terastack solution working together)
            This is the sort of problem you can get when you are creative and deploy an unsupported solution...

            I think you have two options

            1)change all the links to point to the weblayout version of the file (can we assume that this link works OK) this would require a simple customization.

            2)implement your own java service for that will get the file in a way that works with terastack.

            In either case I would always be worried that there will be other places in UCM that may break because of the zero byte files.

            • 3. Re: get native file in ucm (ucm and terastack solution working together)
              Thank you for your reply. Although the links to weblayout version of files works perfectly with terastack, but we want to take backup of files in vault folder. Is it possible to change the links that are use to get native file? Can we somehow make these links to directly point to vault files? If yes please tell us how.

              A custom java service to download the native file can also work. Can you please give us a sample code and how to implement it in ucm?

              Please provide one of the solutions. I’m a new comer to ucm, so please provide instructions in more details.

              BTW, I tested the restoration of file using a test dotnet web application. I added code that downloaded a user selected file to the client. The code we used is as under:
              1. FileInfo fi = new FileInfo(filepath);
              2. Response.Clear();
              3. Response.AddHeader("Content-Disposition", "attachment; filename=" + fi.Name);
              4. Response.AddHeader("Content-Length", fi.Length.ToString());
              5. Response.ContentType = GetFileContentType(fi.Extension);
              6. Response.TransmitFile(fi.FullName);
              7. Response.End();

              GetFileContentType() function is a simple function to get content type of a file type.

              Line#4 is important here. A file is zero byte in size when a request to download a file is received by the server, and the server just appends content-length=0 in the header. So even the file is restored by the terastack afterwards, client still receives a zero byte file. At this stage our test application has the same problem, not getting a native file with full contents.

              We removed line# 4 and tried again to download a file thru our test web application. This time client got file with full contents after the file is restored. So we think this Content-Length header is the one that needs to be handled.

              You may find this information useful if you decide to build a java service solution.
              • 4. Re: get native file in ucm (ucm and terastack solution working together)
                I think you have diagnosed the cause correctly BUT I as a UCM newcomer I am not sure it is wise to try and modify the core behaviour so much! Are you not concerned about what other aspect of UCM may also break with terastack????

                With the warning over some thoughts below

                1)If this is because you want to take backups, why don't you do this at the file system level rather than using Java streaming over HTTP (that is what the GET_FILE does) this would be much much more efficient.

                2)Why can you not back up the weblayout version? Are you doing PDF conversions ro something else?

                3)Out of the box you can not point directly to the vault directory because it is not behind any sort of webserver root.

                4)You could create a symbolic link/virtual directory etc. to allow the vault directory to be exposed through the webserver front end and allow the webserver to serv content directly from the vault. ****HOWEVER UNLESS YOU ARE VERY VERY CAREFUL**** you will bypass all the UCM security that is normally enforced by the webserver filter. I would really not recommend this unless you understand in detail what you are doing.

                5)instead of not setting the content-length at all you could consider looking at the UCM database which should have the original file size. Look for the column dFileSize. However you need to be really careful here once again or you may end up truncating the response.

                6)I wish I had the time to write a Java solution for you!