Page 1 of 1

export an Application via Script (TM1 Api)

Posted: Fri Mar 23, 2018 10:53 am
by Nitrel
Is it possible to export an already published application inside TM1 Application Web (Version PA 2.0.3) using a script (TM1 API)?
Hope someone here have an idea how this can be possible

Chris

Re: export an Application via Script (TM1 Api)

Posted: Mon Mar 26, 2018 11:25 am
by MariusWirtz
Yes. You can use TM1py to load a TM1 (Excel-) Application into python.
Once you have it in python you can save it as an xlsx file or do something else with it.

Here is a sample how to load a TM1 Excel Application and save it into a file:

https://github.com/cubewise-code/TM1py- ... ication.py

Marius

Re: export an Application via Script (TM1 Api)

Posted: Wed Apr 11, 2018 1:24 pm
by Nitrel
@MariusWirtz

Thanks a lot for this very nice answer

Re: export an Application via Script (TM1 Api)

Posted: Wed Apr 11, 2018 3:58 pm
by tomok
Nitrel wrote: Wed Apr 11, 2018 1:24 pm @MariusWirtz

Thanks a lot for this very nice answer
You do realize that all this is going to do is give you the Excel file, with whatever contents were in it when it was published. Correct? If that's all you want why not just grab it from the }Externals folder in the data directory?

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 8:59 am
by Nitrel
Hello Guys, i have played arround with your answers and everything doesnt work .
Someone any Idea how i can transfer already published Application from test to prod-environment

Chris

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:06 am
by Elessar
Hi,

I assume that server name is used in your worksheet formulas, and that's why the application does not work on another server

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:10 am
by Nitrel
but if you exporet manualy and import manualy on another system it is working fine ?

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:17 am
by Elessar
Stop, what do you mean by "application"? :)

It's a worksheet application made by Perspectives/PAX, or it's a "TM1 Applications" application with approval hierarchy and CubeViews/Websheets in it?

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:18 am
by Nitrel

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:26 am
by Nitrel
it's a "TM1 Applications" application with approval hierarchy and CubeViews/Websheets in it

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 9:48 am
by Elessar
"TM1 applications" are based on the application server (Tomcat/Websphere), not on the TM1 server. So TM1 API will not help here
TM1 app maintenance tool can export/import only rights

I think the only way to automate this is to write a batch/powershell script which:
1. Stops target application server
2. Copies application files (GUID.model, GUID.admin and GUID.security files located in tm1/webapps/web-inf/applications folder) from source server to target server
3. Starts target application server

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 10:17 am
by Nitrel
let me try

Re: export an Application via Script (TM1 Api)

Posted: Thu Aug 30, 2018 11:31 am
by Nitrel
Strange behaviour,

i publish an application
i stop the service
i delete all files within tm1/webapps/web-inf/applications folder
i start the service
open the Tm1 Application Web and the application is still there and i can see thtat there is an fole recovered in tm1/webapps/web-inf/applications folder

So how i can delete it first correctly?

Re: export an Application via Script (TM1 Api)

Posted: Fri Aug 31, 2018 12:27 pm
by Elessar
Do not delete files: just copy with replace them from source server.

Note: application's information is stored both on application server (security, views list, application properties), and on TM1 server (approval states, owners, etc): application GUID is a key to TM1server-AppServer interaction. TM1 can restore application from only TM1 server, and it does when there is application's information in TM1Server's cubes and there are no files for this application in application server's folder.