go to post Dmitry Maslennikov · Aug 26, 2016 Yes, you still have to ask user for login password, and should check it in Caché, so, you just should try to connect with user's login/pass, and so, you can validate him.
go to post Dmitry Maslennikov · Aug 26, 2016 I did not show how you made connection to the Caché, and looks like, your Java application has hardcoded login password which used to connect to server. so, I may only suggest, that you use code like this Class.forName ("com.intersys.jdbc.CacheDriver").newInstance(); CacheDataSource ds = new CacheDataSource(); ds.setURL("jdbc:Cache://127.0.0.1:1972/SAMPLES"); Connection dbconn = ds.getConnection("_SYSTEM","SYS"); Last string is Caché login password, so you should use here user's login and password. Any works from your application should be with user's login.
go to post Dmitry Maslennikov · Aug 25, 2016 You can use $order to order all users, in global set FF="" for { set FF = $order(^Users(FF)) quit:FF="" set isAllowed = $get(^Users(FF, "SETTINGS", "isAllowed")) write:isAllowed !,"User ",FF," is allowed" }
go to post Dmitry Maslennikov · Aug 24, 2016 As I remember, you could create user TRM or TELNET, with routine %PMODE, and will get access without authentication.Don't remember how it was in 5.0, but currently default login/password is _SYSTEM/SYS
go to post Dmitry Maslennikov · Aug 24, 2016 UDL format is for classes only, and this format how that classes looks in Studio. Export web files, available as any others in XML format with $system.OBJ.Export() USER>d $system.OBJ.Export("/csp/user/*.*","export.xml") Exporting to XML started on 08/24/2016 20:52:44 Exporting CSP/CSR or file: /csp/user/ML_Util.js Exporting CSP/CSR or file: /csp/user/menu.csp Exporting CSP/CSR or file: /csp/user/showsource.csp Export finished successfully. And all web files stores as files in the directory for this web-application, so you can get it directly, but native export/import works only in XML
go to post Dmitry Maslennikov · Aug 22, 2016 You should not read stream which you got from request, just pass it to $fromJSON, because it understand streams too.
go to post Dmitry Maslennikov · Aug 18, 2016 Macros - a part of the ObjectScript compiler that converts macro code into usable Caché ObjectScript code.Routine - a callable block of user-written code that is a Caché ObjectScript program.
go to post Dmitry Maslennikov · Aug 18, 2016 Documentation about $horolog Contains the local date and time for the current process.
go to post Dmitry Maslennikov · Aug 18, 2016 Why do you name it macro ?Maybe you mean MAC routine ? I highly recommend to read this tutorial about CacheObjectScript usually you can call routine by simple command do ^routine but sometime you need to call directly to concrete label in that routine do label^routine() but in this case if you use curly brace style, you should public such method in routine label() public { write "Hello World!" } or in old style label() write "Hello world!" quit
go to post Dmitry Maslennikov · Aug 17, 2016 As I see you a talking about Ensemble REST service. In this case I am not 100% sure, I think pInput only contains some binary data, or json. But forms data any should be available with %request.
go to post Dmitry Maslennikov · Aug 17, 2016 So, you had to start with such explanation.Well, does not matter what do you set in Accept header, if you don't use it by yourself. Like, you should check incoming content type and send an error if it is not accepted. This Header change nothing in incoming data, if data was sent in another format.To read data, you should know that %request has three different ways for getting data. You have already known in %request.Content, which usually contains binary streams. Then %request.MimeData, and %request.Data, it is a Multidimensional properties, and %request has some getters for them, %request.GetMimeData and %request.Get. MimeData, needs when client send data in multipart mime format, such as several files or so on. And %request.Data, in all most cases, and you should look at this property and method %request.Get("somename")
go to post Dmitry Maslennikov · Aug 17, 2016 Well, in this case you should set Header Accept, with needed one or more formats, more info in wiki set %response.SetHeader("Accept","text/plain")
go to post Dmitry Maslennikov · Aug 17, 2016 If you use %CSP.REST, you can set needed ContentType in any called method XData UrlMap { <Routes> <Route Url="/text" Method="GET" Call="GetText" Cors="false" /> </Routes> } ClassMethod GetText() { set %response.ContentType="text/plain" write "test" quit $$$OK } and test ➜ ~ curl -v http://localhost:57774/api/app/text * Trying ::1... * Connected to localhost (::1) port 57774 (#0) > GET /api/ambulance/text HTTP/1.1 > Host: localhost:57774 > User-Agent: curl/7.49.1 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 17 Aug 2016 17:54:28 GMT < Server: Apache < CACHE-CONTROL: no-cache < EXPIRES: Thu, 29 Oct 1998 17:04:19 GMT < PRAGMA: no-cache < CONTENT-LENGTH: 4 < Content-Type: text/plain; charset=utf-8 < * Connection #0 to host localhost left intact test%
go to post Dmitry Maslennikov · Aug 17, 2016 if you need add a string, you should concatenate it with operator _+ converts all types to number, and doing arithmetical operator add7_"" became "7"+"5apples" became 5
go to post Dmitry Maslennikov · Aug 17, 2016 Both of this are completely different products. Where: Ensemble is an Integration platform, and DeepSee is an Business IntelligenceAlso, you can look at some learning courses from InterSystems, about Ensemble and DeepSee and Caché
go to post Dmitry Maslennikov · Aug 17, 2016 because + is an operation for numbers, and yes, answer is correct, because 5 + 7 is 12if you expected to see "5apples7 orange", in this case you should use concatenate operator "_"write "5apples" _ "7 orange"
go to post Dmitry Maslennikov · Aug 17, 2016 Macro is $$$. Anyway, a little excerpt from documentation $ Dollar sign (36): Intrinsic (system) function prefix: $name(parameters).Special variable prefix: $name.$Znnn (a name beginning with $Z) can be a user-defined function or special variable defined using %ZLANG language extension library. It can also be an intrinsic (InterSystems supplied) function or special variable.Regular expression end of string anchor; for example, (USA)$.In ZBREAK debugging, a single-step breakpoint.As first character at terminal prompt, load interactive subshell.$$ Double dollar sign: Extrinsic (user-written) function prefix: $$name(parameters). $$ is returned by $STACK when context was established by an extrinsic function reference.Prefix to a routine name to directly invoke that routine.$$$ Triple dollar sign: Macro invocation prefix.
go to post Dmitry Maslennikov · Aug 16, 2016 What do you mean by dynamic sessions ?Web sessions in Caché only two types, preserve or not. Preserve just keep working in the same process, for all request in this session, and keeps every locks. By default sessions, instead, only keeps data in %session.Data, and release locks after end of request.
go to post Dmitry Maslennikov · Aug 10, 2016 You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_ So, you may try this code. set ipCountry=%request.GetCgiEnv("HTTP_CF-IPCOUNTRY")