on 2024 Jan 31 1:27 PM
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!
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
AFAIK, there is no way to just copy them from instances to another folder, even using one of the SDKs. The only way I know of to do this is to download the files from the instances and then re-publish them to the correct folder. This is not difficult using either of the SDKs you mention.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
11 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.