Can anyone confirm if it would be possible to activate a new TI Process or Dimension, etc. from a file using the Java API?
I was planning on making a quick hot swap utility using java but Im not sure if this is possible. I can't seem to find a method that would allow this and even in the Java API guide there is a statement saying that the Java API does not allow for creating a TI from scratch and that it might be implemented "Someday". It does appear that the other APIs have a method to create from file.
Creating a new process on the server and registering the the process using the API works but it simply creates a blank TI even if there is a file in the directory that has the same name.
Any thoughts here would be greatly appreciated.
Thanks
Register new objects with the Java API
-
- Community Contributor
- Posts: 349
- Joined: Tue Aug 17, 2010 6:31 am
- OLAP Product: Planning Analytics
- Version: 2.0.5
- Excel Version: 2016
- Harvey
- Community Contributor
- Posts: 236
- Joined: Mon Aug 04, 2008 4:43 am
- OLAP Product: PA, TM1, CX, Palo
- Version: TM1 8.3 onwards
- Excel Version: 2003 onwards
- Contact:
Re: Register new objects with the Java API
I can't comment on the Java API sepcifically, but since you haven't got a reply to this, perhaps there aren't many others using it either?
From my understanding, the C API is the only one without such limitations, so why not try creating the application in .NET? I have an article and sample code here -- it's not as hard as it might seem!
From my understanding, the C API is the only one without such limitations, so why not try creating the application in .NET? I have an article and sample code here -- it's not as hard as it might seem!
Take your TM1 experience to the next level - TM1Innovators.net
-
- Community Contributor
- Posts: 349
- Joined: Tue Aug 17, 2010 6:31 am
- OLAP Product: Planning Analytics
- Version: 2.0.5
- Excel Version: 2016
Re: Register new objects with the Java API
Im not a coder by training but I have learned the basics of Java and VB. Forgive me if this sounds ignorant but, can you call the C API from .net? Or wouldn't the function for this need to be part of the VB.net API? As for .net vs C vs Java, I just find that the Java API is the easiest to code in. The whole capsule thing for TM1 Values in VB and C is a pain and seems to be handled easier in Java. Plus, TM1 comes with its own apache server now so its pretty easy to deploy web apps that way as well although its not like .net is tough either.
The big downside to Java is that your IDE's don't really help with building the front end whereas Visual Studio is a little more all in one at least for the web.
The big downside to Java is that your IDE's don't really help with building the front end whereas Visual Studio is a little more all in one at least for the web.
-
- Site Admin
- Posts: 6667
- Joined: Sun May 11, 2008 2:30 am
- OLAP Product: TM1
- Version: PA2.0.9.18 Classic NO PAW!
- Excel Version: 2013 and Office 365
- Location: Sydney, Australia
- Contact:
Re: Register new objects with the Java API
Short answer "Yes".PlanningDev wrote:Im not a coder by training but I have learned the basics of Java and VB. Forgive me if this sounds ignorant but, can you call the C API from .net? Or wouldn't the function for this need to be part of the VB.net API?
Longer answer:
(a) It's not a C API, it's a VB6/VBA/C API albeit with some functions which differ between the languages;
(b) The function declarations that appear in the standard TM1API.bas file for VB6/VBA are still used, though the data types need to be changed to allow for Longs in VB6 becoming Ints in .Net and Ints becoming Shorts.
(c) There are a few other provisos.
Longest (way, way longest answer): in the post that I made on connecting to TM1 using the .Net API I mentioned in passing that I may one day write one on using the classic API in a .Net environment and have coincidentally been working on that for the last few days. I planned to publish it on the weekend when I have time to do all of the formatting and screenshots and thought briefly about putting what I've done of it up now in response to this question, but I don't really want to do that until it's finished. (Not least because I want to ensure that the sample project runs without glitch. I have some current apps which use this method so I know that it works, but since the one that I'm using in the article is greatly simplified Murphy's Law dictates that I'll have left something important out and have to go back and edit the earlier content.) So if you can hold on for a couple of days, you'll be able to see for yourself. ("Longest" answer in the sense that the draft in Word is currently up to about 20 pages and will probably be in the 25-30 range when done. I do not expect it to have a wide readership but what the hey.)
To each their own. Some people like beetroot too.PlanningDev wrote:As for .net vs C vs Java, I just find that the Java API is the easiest to code in.
It is. But thankfully there's an inverse relationship between how much of a pain it is and how much you use it.PlanningDev wrote: The whole capsule thing for TM1 Values in VB and C is a pain
Couldn't comment on that. If I have to spend half my time writing squiggles and don't have a decent IDE to do it in, I tend to dislike the language more than I dislike whatever I need to do with it. And that doesn't even begin to address security issues in Java. Or Oracle's distasteful little habit of trying to make a buck by lumbering you with foist-ware every time it fixes one of its many, many security issues.PlanningDev wrote:and seems to be handled easier in Java.
Actually I'm surprised that Iboglix, with its love of all things Java, hasn't added curly brackets to the TI code syntax just to p*ss me off, and reduced the font size in the Editorsaurus even more just to make sure that we have more trouble matching them up.
You're right, it's not. I was not exactly a .Net enthusiast at the outset and while it still has deficiencies (the folder selection control, for instance, is a joke) it's just so easy to get from A to B in .Net compared to VB6 and VBA.PlanningDev wrote:Plus, TM1 comes with its own apache server now so its pretty easy to deploy web apps that way as well although its not like .net is tough either.
A LOT more all in one, though once concern with that last statement; don't reinvent the wheel. Your original post suggested that you were creating objects, and that's fine and dandy... but if all you want it for is deploying TM1 numbers through a web interface I'd definitely be looking at something like TM1 Web or a supported third party solution such as OLAP Objects (which is now known as something else but can't remember what at the moment). I wouldn't be using the API to pull numbers into a Web dashboard, for instance, unless there was no other realistic choice or unless it was just as a subset of data coming from multiple sources.PlanningDev wrote:The big downside to Java is that your IDE's don't really help with building the front end whereas Visual Studio is a little more all in one at least for the web.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
- Harvey
- Community Contributor
- Posts: 236
- Joined: Mon Aug 04, 2008 4:43 am
- OLAP Product: PA, TM1, CX, Palo
- Version: TM1 8.3 onwards
- Excel Version: 2003 onwards
- Contact:
Re: Register new objects with the Java API
As Alan said, yes you can.PlanningDev wrote:Forgive me if this sounds ignorant but, can you call the C API from .net? Or wouldn't the function for this need to be part of the VB.net API?
.NET is language-independent platform -- that is, it compiles everything to what is called "intermediate language" and then compiles intermediate language to an executable. The language you choose to write in is just a syntactical choice, you can call all the same methods and libraries.
Many of .NET's built in functions are actually wrappers around Windows APIs which are implemented as COM dlls just like the TM1 API. This is reducing over time, with the code base becoming more "native" .NET, but there are still plenty of dependencies.
The article I linked to provides a description and a downloadable sample project in Visual Studio. It has a class that wraps the API and makes calls for you, so that should be enough to get you started.
I also have a more comprehensive object-oriented .NET API that removes the need to understand value capsules and the underlying TM1 API. I haven't released this to the public, but might be convinced to do so if there is interest.
Take your TM1 experience to the next level - TM1Innovators.net