go to post Dmitry Maslennikov · Sep 27, 2016 Ok, looks like, it does not matter who tried to connect to cache, any terminal access is forbidden. You should allow Password or Unauthenticated method for %Service_Terminal.
go to post Dmitry Maslennikov · Sep 27, 2016 first sample is correct, but depends on what is login.scr contains. This file should only contains 'answers' for login. so, it is a plain file, with login and password, in each line, and last empty file. login<\n> password<\n> <\n> - it is just a line break, which is required
go to post Dmitry Maslennikov · Sep 22, 2016 I'm just in the begin, I'm working on developing FHIR-based application, and currently it's enough, mostly because so far for production.
go to post Dmitry Maslennikov · Sep 21, 2016 in your code,obj - it is some object, it may have some ID or not, if it just createdname1 - it is a value for property name in that objectbut I completely don't understand why is here name2 and name3, and what do you suppose should be happens after this line ?and how it should save data in other objects which we even don't know which ?you should know somehow which objects you want to update. If you know only some other properties, you can use SQL command UPDATE
go to post Dmitry Maslennikov · Sep 21, 2016 What does you mean ? In this case we get all data in property Name, if you need data from other property just use it. Write !,obj.Address
go to post Dmitry Maslennikov · Sep 21, 2016 You should actually read this tutorial. Every class, has some types of elements, and some of them like Property and Parameter may contains some data. Property stores data for every objects in this class, Parameter, for class itself. In your example, saving data to properties of object was right. But in method PrintDetails, you try to read data from Parameter, not from property. To read data from property you should open this object before, but you also need to know an ID for such object. #; open object by known ID set obj=##class(Sample.Employeedetails).%OpenId(1) #; if obj is empty, so this object could't be found, and open #; ouptut property Name for this object Write !,obj.Name
go to post Dmitry Maslennikov · Sep 21, 2016 Please forget about old-way programming. We now have so many features out-of-the-box which helps write understandable code quite easy. set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="c:\csvfile.csv" while 'fs.AtEnd { set line=$listfromstring(fs.ReadLine(), ",") #; in line you will get listbuild for all columns in a row } class %Stream.FileCharacter helps to read text files, which may contain text in different codepages, and line ends. Or if you need to read some binary data, which should have some conversion on the fly, use %Stream.FileBinary.
go to post Dmitry Maslennikov · Sep 21, 2016 I've already answered for exactly the same question at google groupsIn first you should look at the official documentation which is available online here. You have very old system, so you should install new version of Ensemble at new windows server. Installation Guide And copy all of you data from old server to new. But it is may be very difficult task, without knowledge about your application.As well you should look at Cache Upgrade checklists archive and latest, and Ensemble Release Notes
go to post Dmitry Maslennikov · Sep 20, 2016 Why you so sure ?I remember that i'm already answered about this issue a week ago, but as I see that question disappeared, so I repeat my answer again.As I see you writing HTML Page body inside method OnHTTPHeader, which is not related to do such things, any content for response should be in OnPage method.
go to post Dmitry Maslennikov · Sep 20, 2016 I've used Delphi so long ago, and could be mistaken. But to be sure that application is not interactive, it should not have any visual components. And as I remember you should start developing from Console Application. To check that actually it does work correctly, you may try with real console tool, something like: dir, md, etc.. You may try this $zf(-2,"dir > testdir.txt"), if after executing this code testdir.txt file will appaer with content for some folder, you'll see that it's work. And it means that in your application should be changed something to be as console application.
go to post Dmitry Maslennikov · Sep 19, 2016 You can find any sent data as in CSP pages, just because %CSP.REST inherits %CSP.Page. So, you can read it from %request.Content. Very parse JSON, only on versions since 2016. s obj = {}.$fromJSON(%request.Content) You may read more about newest support for JSON in articles here.
go to post Dmitry Maslennikov · Sep 19, 2016 It does not matter CSP-page or terminal process, for $ZF(-1). Only one issue which may be in your case, if this application is interactive. In this case, Windows may prevent to run such application, just because it works as a service, but it is possible to change it if you allow interactive mode for service of this instance Cache.
go to post Dmitry Maslennikov · Sep 19, 2016 If to talk about REST and best practices, then I should say, to update some object or all collection you should use method PUT, while POST should be used only for creating new objects.What about updating objects, actually it it could be inside objects. And I hope that InterSystems has some optimizations in this case. But I think it is mostly depends on you objects, how difficult they are, and how often you should change this objects. And you of course you can use some profile tools, to understand how many time spends while object is changing and for what. In may opinion in first you should keep it as is, just update all properties from request, without any checking. Some time it is possible that checking for changes, may take more time, when just save it all.
go to post Dmitry Maslennikov · Sep 17, 2016 If anybody interesting in it. I've published repository with working example of HAPI-FHIR server which is working with Caché.
go to post Dmitry Maslennikov · Sep 17, 2016 I managed to work it, I've just extended Cache dialect for Hibernate, and changed GlobalTemporary table which is not support DROP to LocalTemporaryTable. And changed column type for boolean, for supported in Caché data type bit. And looks like, I get working FHIR server which stores all data in Caché. public class CacheDialect extends Cache71Dialect { public CacheDialect() { super(); this.registerColumnType(Types.BOOLEAN, "bit"); } @Override public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() { return new LocalTemporaryTableBulkIdStrategy( new IdTableSupportStandardImpl() { @Override public String generateIdTableName(String baseName) { final String name = super.generateIdTableName( baseName ); return name.length() > 25 ? name.substring( 1, 25 ) : name; } @Override public String getCreateIdTableCommand() { return "create global temporary table"; } }, AfterUseAction.DROP, null ); } }
go to post Dmitry Maslennikov · Sep 17, 2016 Actually there are two causes, of this. First, is a quite simple, installation script looking at previous installation, and can't change if it was already installed in another folder. But next reason, it is just a small typo in installation script, which suit only for silent install. file package/csp_gateway/parameters contains CSPGATEWAY_DIR variable instead of CSPGATEWAYDIR you may just add this line to your installation script, to fix this error. sed -i '' -e 's/CSPGATEWAY_DIR/CSPGATEWAYDIR/g' ./package/csp_gateway/parameters And I think, you should ask WRC to fix this error in all next builds.
go to post Dmitry Maslennikov · Sep 17, 2016 To find way how to compare time, you should remember format for $horolog, which is has two parts separated with comma. First of part it is a date, which is actually numbers of days since 1841 year, so $horolog=1 it is 01/01/1841. Next part is a seconds in a day, no more than 86400, and may have milliseconds after point. Know it, you can easily convert $horolog to seconds and compare them SAMPLES>set date1=$zdth("01/02/2016 10:00") SAMPLES>set date2=$zdth("01/02/2016 20:00") SAMPLES>zwrite date1,date2 date1="63919,36000" date2="63919,72000" SAMPLES>write ($piece(date1,",")*86400+$p(date1,",",2))>($p(date2,",")*86400+$p(date2,",",2)) 0 SAMPLES>write ($piece(date1,",")*86400+$p(date1,",",2))<($p(date2,",")*86400+$p(date2,",",2)) 1 You can also use SQL function DATEDIFF, to see difference in seconds between to dates SAMPLES>write $system.SQL.DATEDIFF("ss",date1,date2) 36000 SAMPLES>write $system.SQL.DATEDIFF("ss",date2,date1) -36000 SAMPLES>write $system.SQL.DATEDIFF("ss",date1,date1) 0
go to post Dmitry Maslennikov · Sep 16, 2016 Why are you so sure in that ?Any examples of code, and application, which you want to call.Looks like you want to start something like notepad or so on, which you expected to see. You just can't see what was launched because it is interactive application, but with $zf(-1) you you should use only command-line applications, just because it is server. And such behavior exists since Windows Vista. As I remember you can change it, you just should allow to interact with desktop, in the settings for Caché service.
go to post Dmitry Maslennikov · Sep 16, 2016 In your question and comment I see two tables iagentbySkillsetStat and iSkillsetStat. Are you sure that you working with right table which contains such property ?
go to post Dmitry Maslennikov · Sep 16, 2016 You can only use array instead of list of exported elements. USER>zw list list("a(1).gbl")="" list("a(3).gbl")="" USER>d $system.OBJ.ExportToStream(.list,.stream) Exporting to XML started on 09/16/2016 11:19:58 Exporting global: ^a(1) Exporting global: ^a(3) Export finished successfully.