cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Save or copy instance.pdf in unmanagedDisk

querrec
Explorer
0 Likes
697

I need to get instance of document already sheduled with format pdf and save it in specific unmanaged disk:

I have a list of instances of a webi document, i need to get all there instances .pdf  .csv or .xlsx and save them on specific folder (unmanagedDisk).

How can i copy this intance.pdf in specific folder with java sdk or restfull webservice?

Thanks in advance!

View Entire Topic
DellSC
Active Contributor
0 Likes

Here's the logic I would use in Java to copy the files to another location on the disk:

1.  Get the root folder of the OutputFileRepositoryServer using something like the following code (code was written in C#, you'll need to translate to Java...)

    private string getOutputServerPath()
    {
      string result = string.Empty;
      string query = "Select * From CI_SYSTEMOBJECTS Where SI_FRIENDLY_NAME like 'Output%'";
      
      using (InfoObjects servers = _common.BOEInfoStore.Query(query))
      {
        if (servers.Count >= 1)
        {
          Server server = (Server)servers[1];
          FileServerAdmin serverAdmin = new FileServerAdmin(server.ServerAdmin);
          result = serverAdmin.RootDirectory;
          //strip off trailing backslash
          if (result.Substring(result.Length - 1) == "\\")
            result = result.Substring(0, result.Length - 1);
        }
      }
      return result;
    }

2.  Find the report that you're looking for and get its SI_ID value

3.  Get the list of instances for that report by running a query similar to this:

Select SI_ID, SI_NAME, SI_KIND, SI_FILES from CI_INFOOBJECTS where SI_PARENTID = <SI_ID of the report template> and SI_KIND <> 'Webi'

4.  For each instance found from the above query,  you can find the file by getting the SI_FILES property bag and  replacing "frs://Output" with the root folder for the output file repository found in Step 1 for the first item in the property bag.  You would then just copy the file where you need it.  You'll probably also need to rename the file because, IIRC, the file names are a CUID value and don't reflect the name of the instance.  I highly recommend using the QueryBuilder tool to look at the SI_FILES property of several instances so that you know what you're working with.

Also, the SI_KIND property will tell you what kind of file you're dealing with.

-Dell

 

Ask a Question