go to post Dmitry Maslennikov · Apr 25, 2017 command WRITE, outputs $listbuild in binary format, if you would use ZWRITE, it would show you $lb I've just made variable from your output USER>zzdump val 0000: 02 01 04 01 61 61 04 01 4A 4A ....aa..JJ USER>zwrite val val=$lb("","aa","JJ") Just read the documentation and you will get everything needed to work with $listbuild
go to post Dmitry Maslennikov · Apr 24, 2017 Caché stores data from tables in globals in $listbuild format. So you can use $listget, to get value from the particluar column, but you should know number for your column.
go to post Dmitry Maslennikov · Apr 7, 2017 Look at the documentation Menu, Edit-> Find or Find in files
go to post Dmitry Maslennikov · Mar 26, 2017 you should look at XSLT, it can help transform xml as you need ClassMethod SplitXML() { for item="market","product" { set params("path")="/doc/"_item Set tSource=##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1)_"||XML").Data Set tXSL=##class(%Dictionary.CompiledXData).%OpenId(..%ClassName(1)_"||XSL").Data // Transform the source according to the XSL Set tSC=##class(%XML.XSLT.Transformer).TransformStream(tSource,tXSL,.tOutput,,.params) If $$$ISERR(tSC) Quit write !! // Output the result to the screen Set tSC=tOutput.OutputToDevice() } } XData XML { <?xml version="1.0"?> <doc> <header></header> <product><test>1</test></product> <market><test2>2</test2></market> </doc> } XData XSL { <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="path"></xsl:param> <xsl:output method="xml" indent="no"/> <xsl:template match="/"> <xsl:copy-of select="$path"/> </xsl:template> </xsl:stylesheet> } will output like below USER>d ##class(Test).SplitXML() <?xml version="1.0" encoding="UTF-8"?><market><test2>2</test2></market> <?xml version="1.0" encoding="UTF-8"?><product><test>1</test></product>
go to post Dmitry Maslennikov · Mar 26, 2017 you can do it with ccontrol tool Syntax: ccontrol create <instance name> <parameters> Description: Create an instance's entry in the Cache registry. Parameters: directory=<installation directory name> versionid=<version identifier> Example: ccontrol create mystuff directory=/usr/cachesys versionid=2008.2.0.357.0
go to post Dmitry Maslennikov · Mar 10, 2017 In Caché there is no any such classification for errors. Developer should decide it depends on his own tasks and needs.
go to post Dmitry Maslennikov · Mar 6, 2017 this port is from internal Apache which was installed by default with Caché. And should be used only in development.For production, or pre-production, you should use some external WebServer, IIS (if you use Windows), Apache or Nginx. You can find more information about configuration all of this webservers, in the documentation.
go to post Dmitry Maslennikov · Feb 28, 2017 If you would look carefully to your code, you would see this placeall HTML should be between &html< and >But in your code, some of HTML outside of this command.
go to post Dmitry Maslennikov · Feb 27, 2017 Looks like you forgot to define web application for your REST Service. Please look at the documentation. And at this part:Each subclass that has its own entry point must have its own CSP web application. You define the CSP web application and specify its security for on the Management Portal’s [Home] > [Security Management] > [Web Application] page, which you can access by clicking System Administration, Security, Applications, and Web Applications. When you define the CSP web application, you set the Dispatch Class to the name of the custom subclass of %CSP.REST and specify the first part of the URL for the REST call as the name of the application.
go to post Dmitry Maslennikov · Feb 24, 2017 Since 2011.1 version was added %vid to achieve some paging functionality. Some more details. SELECT *, %vid FROM (SELECT ....) v WHERE %vid BETWEEN 5 AND 10
go to post Dmitry Maslennikov · Feb 23, 2017 Looks like, you call this service in the wrong way. I would suggest, that you call it by URL http://localhost:57772/csp/samples/REST.DocServer.cls while you should use this URL http://localhost:57772/csp/samples/docserver/namespaces But before you should activate application /csp/samples/docserver, for details look at the documentation.
go to post Dmitry Maslennikov · Feb 11, 2017 $case is used to convert one value to another. Like, you have some code, but you need a display text for it, you can do so: set display=$case(gender,"F":"Female","M","Male",:"Unknown") $select returns value when meets the first true condition. It needs if can't compare only one variable, or you have some more conditions. write $SELECT(0=$ISVALIDNUM(x):"not a number",x=0:"zero",""=$NUMBER(x,"I"):"not an integer",x#2=1:"odd",1:"even")
go to post Dmitry Maslennikov · Feb 7, 2017 Hi Greg, It is a very interesting question. I can't give you all that you want, but I'll try to give some hints. Deploy ScriptIn first, you are looking for some script. While you have to execute some script from Operation System, you have different ways how to do it. And here again, depends on what are you going to inside Caché. As you working on some Linux system, I'll start from it.Linux:To start some script inside of Caché you may use csession tool, in two ways: specify some routine or class, which will be executed at once, and after finish, that code csession will exit. In this case, you have to use some internal code, which already ships by InterSystems, or you can install some of your code.csession ENSEMBLE -UUSER ##CLASS(package.class).method()or you can write some COS code, generated in your script, or just in a text file near to script. And send this code to csession. csession ENSEMBLE -UUSER < deploy.mac Windows:On a Windows system, you don't have csession tool. But here available another tool cterm.you can also specify routine namecterm /console=cn_ap:ENSEMBLE[USER]:^%Dbut cterm also support special scripts format, which supports even interactive mode.For both Windows and Linux also possible to launch executable file cache, and call your code in almost the same way as it does csession.DeployTo launch that script, you can use any of Continuous Integration system, which you like. I would recommend Jenkins, it is an opensource project, has lots of plugins, and supports multi servers installation. You can configure to launch your script, just by timetable, every time. Or check if appeared some new commits in your chosen System of control version (Subversion or so on), since it was run last time. Multi-server version may help have some different servers with a secondary installation of Jenkins, and control all of them from the master node.Last time I found GitLab for myself, it quite good git server, with CI service inside. Supports multiple runners for CI, and you can choose which runner should execute some stages. You can easily configure multiple tasks which will be run after every commit. Like build, test and deploy if everything is OK.
go to post Dmitry Maslennikov · Jan 25, 2017 You can get list of routines with a query StudioOpenDialog in class %RoutineMgrTo edit routine you have at least two ways. Open it via class %Routine which is just a stream with a code inside. So, you can create a new stream, with a new content, and replace old one. Another way is to use commands: ZLOAD, ZINSERT, ZSAVE.
go to post Dmitry Maslennikov · Jan 18, 2017 You can try to export all from MySQL, and import to Caché, with command Do $SYSTEM.SQL.DDLImport("MySQL","_SYSTEM","C:\export.sql") You can also do import in the System Management Portal. Or migrate data from ODBC source.
go to post Dmitry Maslennikov · Jan 13, 2017 Good choice, I'm already using gitlab in our company, with closed sources. In our process, I even deploy to our own windows server. Our application on Angular 2. it is our gitlab-ci.yml, I've removed deploy stage. image: node:5 stages: - test - build cache: key: "$CI_PROJECT_NAME/$CI_BUILD_REF_NAME" paths: - ./node_modules/ before_script: - export PATH=$PATH:./node_modules/.bin/ - npm install tslint_job: stage: test tags: - linux - docker script: - ng lint test_job: stage: test tags: - linux - docker script: - karma start --browsers PhantomJS --single-run build_job: stage: build tags: - linux - docker artifacts: expire_in: 1 week paths: - dist/* script: - ng build --aot-prod --bh "./"
go to post Dmitry Maslennikov · Jan 12, 2017 You can reset all changes which you did, when you start newly created container from an image. Use docker run with a flag --rm to remove container after exit.
go to post Dmitry Maslennikov · Jan 11, 2017 Hi Natasa,Yes, lots of time. Look at examples:ccontainermain ecp-client example here
go to post Dmitry Maslennikov · Jan 11, 2017 look at this iconfound here/opt/ensemble/csp/broker/portal/icon_ensemble.png
go to post Dmitry Maslennikov · Jan 6, 2017 Unlicensed trial version, have only 1 license unit available. So if you have already opened Studio, connected to this server, this license unit already busy. You may try to close Studio, and all other tools, such as terminal, and System Management Portal, and try again.