export an Application via Script (TM1 Api)

Post Reply
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

export an Application via Script (TM1 Api)

Post 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
MariusWirtz
Posts: 29
Joined: Sat Apr 08, 2017 8:40 pm
OLAP Product: TM1
Version: 10.2.2.6
Excel Version: 2016

Re: export an Application via Script (TM1 Api)

Post 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
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post by Nitrel »

@MariusWirtz

Thanks a lot for this very nice answer
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: export an Application via Script (TM1 Api)

Post 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?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post 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
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: export an Application via Script (TM1 Api)

Post 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
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post by Nitrel »

but if you exporet manualy and import manualy on another system it is working fine ?
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: export an Application via Script (TM1 Api)

Post 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?
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post by Nitrel »

Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post by Nitrel »

it's a "TM1 Applications" application with approval hierarchy and CubeViews/Websheets in it
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: export an Application via Script (TM1 Api)

Post 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
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post by Nitrel »

let me try
Nitrel
Posts: 19
Joined: Fri Oct 08, 2010 9:40 pm
OLAP Product: TM1
Version: all Versions
Excel Version: all Versions

Re: export an Application via Script (TM1 Api)

Post 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?
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: export an Application via Script (TM1 Api)

Post 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.
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
Post Reply