Trait named: #TTM1ApiLibrary uses: {} category: 'Cognos-TM1-Api'! !TTM1ApiLibrary commentStamp: 'MarkusFritsche 4/28/2014 22:01' prior: 0! a simple trait used for NB callouts to TM1 library functions! !TTM1ApiLibrary methodsFor: 'library path' stamp: 'MarkusFritsche 4/28/2014 21:59'! nbLibraryNameOrHandle ^ self class nbLibraryNameOrHandle ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TTM1ApiLibrary classTrait uses: {}! !TTM1ApiLibrary classTrait commentStamp: '' prior: 0! ! !TTM1ApiLibrary classTrait methodsFor: 'library path' stamp: 'MarkusFritsche 4/28/2014 22:00'! nbLibraryNameOrHandle ^ TM1LibraryLoader getLibraryHandle! ! Object subclass: #TM1U uses: TTM1ApiLibrary instanceVariableNames: 'handle' classVariableNames: '' poolDictionaries: '' category: 'Cognos-TM1-Api'! !TM1U commentStamp: '' prior: 0! ! !TM1U methodsFor: 'library path' stamp: 'MarkusFritsche 4/28/2014 23:18'! tm1ValPoolCreate ^ self nbCall: #(TM1P TM1ValPoolCreate(self))! ! !TM1U methodsFor: 'library path' stamp: 'MarkusFritsche 4/28/2014 22:52'! tm1SystemClose ^ self nbCall: #(void TM1SystemClose(self))! ! !TM1U methodsFor: 'library path'! nbLibraryNameOrHandle ^ self class nbLibraryNameOrHandle ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TM1U class uses: TTM1ApiLibrary classTrait instanceVariableNames: ''! !TM1U class commentStamp: '' prior: 0! ! !TM1U class methodsFor: 'as yet unclassified' stamp: 'MarkusFritsche 4/28/2014 22:40'! asNBExternalType: gen "use handle ivar to hold my instance (TM1U)" ^ NBExternalObjectType objectClass: self! ! !TM1U class methodsFor: 'library path'! nbLibraryNameOrHandle ^ TM1LibraryLoader getLibraryHandle! ! Object subclass: #TM1Library uses: TTM1ApiLibrary instanceVariableNames: 'handle' classVariableNames: '' poolDictionaries: '' category: 'Cognos-TM1-Api'! !TM1Library commentStamp: '' prior: 0! ! !TM1Library methodsFor: 'library path'! nbLibraryNameOrHandle ^ self class nbLibraryNameOrHandle ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TM1Library class uses: TTM1ApiLibrary classTrait instanceVariableNames: 'uniqueSession'! !TM1Library class commentStamp: '' prior: 0! ! !TM1Library class methodsFor: 'library path'! nbLibraryNameOrHandle ^ TM1LibraryLoader getLibraryHandle! ! !TM1Library class methodsFor: 'as yet unclassified' stamp: 'MarkusFritsche 4/28/2014 23:18'! tm1SystemOpen ^ self nbCall: #(TM1U TM1SystemOpen(void))! ! !TM1Library class methodsFor: 'as yet unclassified' stamp: 'MarkusFritsche 4/28/2014 22:53'! tm1APIFinalize ^ self nbCall: #(void TM1APIFinalize(void))! ! !TM1Library class methodsFor: 'as yet unclassified' stamp: 'MarkusFritsche 4/28/2014 22:51'! tm1APIInitialize ^ self nbCall: #(void TM1APIInitialize(void))! ! Object subclass: #TM1P uses: TTM1ApiLibrary instanceVariableNames: 'handle' classVariableNames: '' poolDictionaries: '' category: 'Cognos-TM1-Api'! !TM1P commentStamp: '' prior: 0! ! !TM1P methodsFor: 'library path'! nbLibraryNameOrHandle ^ self class nbLibraryNameOrHandle ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TM1P class uses: TTM1ApiLibrary classTrait instanceVariableNames: ''! !TM1P class commentStamp: '' prior: 0! ! !TM1P class methodsFor: 'library path' stamp: 'MarkusFritsche 4/28/2014 22:43'! asNBExternalType: gen "use handle ivar to hold my instance (TM1P)" ^ NBExternalObjectType objectClass: self! ! !TM1P class methodsFor: 'library path'! nbLibraryNameOrHandle ^ TM1LibraryLoader getLibraryHandle! ! Object subclass: #TM1LibraryLoader instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Cognos-TM1-Api'! !TM1LibraryLoader commentStamp: 'MarkusFritsche 4/28/2014 22:03' prior: 0! i am a service class, which responsible to finding and loading TM1 dynamic library! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! TM1LibraryLoader class instanceVariableNames: 'session libHandle'! !TM1LibraryLoader class commentStamp: '' prior: 0! ! !TM1LibraryLoader class methodsFor: 'private' stamp: 'MarkusFritsche 4/28/2014 22:09'! loadTM1Library NativeBoost forCurrentPlatform loadModule: 'C:\Program Files\ibm\cognos\tm1_64\bin\libibmcogeay32.dll'. NativeBoost forCurrentPlatform loadModule: 'C:\Program Files\ibm\cognos\tm1_64\bin\log4cxx.dll'. NativeBoost forCurrentPlatform loadModule: 'C:\Program Files\ibm\cognos\tm1_64\bin\sslibmcogeay32.dll'. NativeBoost forCurrentPlatform loadModule: 'C:\Program Files\ibm\cognos\tm1_64\bin\tm1ulibdll.dll'. ^ NativeBoost forCurrentPlatform loadModule: self getLibraryPath ! ! !TM1LibraryLoader class methodsFor: 'private' stamp: 'MarkusFritsche 4/28/2014 22:06'! getLibraryPath ^ 'C:\Program Files\ibm\cognos\tm1_64\bin\tm1api.dll'! ! !TM1LibraryLoader class methodsFor: 'public' stamp: 'MarkusFritsche 4/28/2014 22:05'! getLibraryHandle (NativeBoost sessionChanged: session) ifTrue: [ libHandle := self loadTM1Library. session := NativeBoost uniqueSessionObject. ]. ^ libHandle ! !