export an Application via Script (TM1 Api)

Post Reply
Nitrel
Posts: 17
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 » Fri Mar 23, 2018 10:53 am

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: 2
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 » Mon Mar 26, 2018 11:25 am

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: 17
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 » Wed Apr 11, 2018 1:24 pm

@MariusWirtz

Thanks a lot for this very nice answer

User avatar
tomok
MVP
Posts: 2483
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 » Wed Apr 11, 2018 3:58 pm

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: 17
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 » Thu Aug 30, 2018 8:59 am

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
Posts: 147
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: export an Application via Script (TM1 Api)

Post by Elessar » Thu Aug 30, 2018 9:06 am

Hi,

I assume that server name is used in your worksheet formulas, and that's why the application does not work on another server
Sorry for my English ;)

Nitrel
Posts: 17
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 » Thu Aug 30, 2018 9:10 am

but if you exporet manualy and import manualy on another system it is working fine ?

User avatar
Elessar
Posts: 147
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: export an Application via Script (TM1 Api)

Post by Elessar » Thu Aug 30, 2018 9:17 am

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?
Sorry for my English ;)

Nitrel
Posts: 17
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 » Thu Aug 30, 2018 9:18 am


Nitrel
Posts: 17
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 » Thu Aug 30, 2018 9:26 am

it's a "TM1 Applications" application with approval hierarchy and CubeViews/Websheets in it

User avatar
Elessar
Posts: 147
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: export an Application via Script (TM1 Api)

Post by Elessar » Thu Aug 30, 2018 9:48 am

"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
Sorry for my English ;)

Nitrel
Posts: 17
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 » Thu Aug 30, 2018 10:17 am

let me try

Nitrel
Posts: 17
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 » Thu Aug 30, 2018 11:31 am

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
Posts: 147
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010
Location: Russia

Re: export an Application via Script (TM1 Api)

Post by Elessar » Fri Aug 31, 2018 12:27 pm

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.
Sorry for my English ;)

Post Reply