Article Ed de Moel · Aug 29, 2019 7m read

Some time ago, InterSystems introduced the concept of %DynamicObjects.
This feature is a powerful tool that makes it very easy to convert any string of JSON text to objects and vice versa.
However, in the work that J2 Interactive is doing for our customers, there are a couple of things that "need some tweaking".

Very often, we create REST services for our customers. Those services have a payload (in JSON format) that contains information that our customer expects in the form of an object that is proprietary to them.
We can easily convert that JSON stream to a %DynamicObject, but, if we try to

3
2 1380
Article Sabit Issakhan · Aug 29, 2019 3m read

Hello everyone! 

Recently I search how to convert Cyrillic to Latin with Cache Object Script, but didn't find anything and decided to write ourselves, 

So here code: 

//Create Class method

ClassMethod convertRussionToEnglish(word As %String)
{

   //add array of transliteration system
    Set convertArray = $LB(
        $LB("а","a"),$LB("б","b"),$LB("в","v"),$LB("г","g"),$LB("д","d"),$LB("е","e"),$LB("ё","e"),$LB("ж","zh"),$LB("з","z"),
        $LB("и","i"),$LB("й","y"),$LB("к","k"),$LB("л","l"),$LB("м","m"),$LB("н","n"),$LB("о","o"),$LB("п","p"),
10
0 1034
Announcement Anastasia Dyubaylo · Aug 26, 2019

Hi Developers!

InterSystems Developers Community today unites more than 7,000 developers from all over the world. Since 2016, our community has been growing and improving for you, our dear developers! 

Together we've done a lot over these years, and much more is planned for the future!

So, who makes our community better every day? Who tries for all of us and improves the space for developers?

Let's warmly greet our team:

7
1 865
Question Alexey Maslov · Jun 14, 2018

I am still working on a generic task where I need to apply journal file records to another database. Initially I didn't want to use Journal.Restore class methods as I need to perform some data transformation, and it seemed that the clearest way to achieve it was to read journal file record by record using %SYS.Journal.Record API. 

This approach worked (with some help from @Dmitry Maslennikov and @Eduard Lebedyuk), while it turned that the processing speed of %SYS.Journal.Record:List query was very slow, about 1MB of journal data per second on a mid-range server.

Therefore my second try was to

8
0 633
Discussion Evgeny Shvarov · May 1, 2019

Hi Community!

Sometimes I meet a method which accepts 10+ parameters.

And often I need only the 8th parameter  to  pass. And I call the method something like:

do ##class(Some.Feature).Method(,,,,,,,"flag")

And I don't like this method when I call it like this cause, you know, often I just miss the number of commas and raise some other flag I wanted.

How do you avoid this situations? 

If you meet such a code, how do you call it and sure that you didn't miss the number of ","?

What is a good number of parameters in a method and f you need to pass more parameters in a method what do you do?

27
1 1859
Question Oliver Wilms · Aug 26, 2019

Hello,

I started a post when I tried to display a line graph on a dashboard:

https://community.intersystems.com/post/dashboard-line-graph

This did not work very well. I switched gears and now I have a Zen Page that includes a Zen Report in iFrame. However my line chart does not display a line.

This is my Report class:

/// AETMON.Report
Class AETMON.Report Extends %ZEN.Report.reportPage
{
/// Class name of application this report belongs to.
Parameter APPLICATION;
/// Specifies the default display mode used for this report if
/// the URL parameter, <var>$MODE</var>, is not present.
Parameter DEFAULTMODE A

4
0 332
Question Victor Ferreira · Aug 27, 2019

Good morning,
I'm working with a persistent data class and need to know which classes are evoquing it.
Is there a tool in the system to do it, similar to use the F12 key to follow a class?

2
0 281
Announcement Michelle Spisak · Aug 26, 2019

Now available from InterSystems Learning Services: the August 2019 newsletter!

See what's going on with Learning Services at the Global Summit, including:

  • Achieve certification in one or more subjects

  • Dive into InterSystems IRIS™ on your own machine

  • Attend a Personal Training session to get your questions answers

  • Optimize your training plan for yourself or members of your team

  • Get steep discounts on classroom courses

Want to stay up to date? Subscribe today!

0
0 232
Question Nic Lorenzen · Feb 28, 2016

Hello everyone!

Does anyone know of a library that can be used to create Mock objects for Objectscript classes?

Right now, my team has been building mock objects by hand to help circumvent dependencies when writing and executing unit tests, but I always wondered if someone had ever created a Mock library like Mockito to help quicken the process. 

Thanks!

4
0 1185
Question Pravin Barton · Aug 23, 2019

Hello all, I'm trying to write tests for an interoperability production using %UnitTest.TestProduction. I'd like to control the behavior of the SOAP operations so they don't actually connect to external systems when I'm testing. My first thought for this is to create a mock outbound adapter class that answers with some configured class method:

Class UnitTest.Helper.Integration.MockSoapAdapter Extends EnsLib.SOAP.OutboundAdapter
{

Property MockAdapterAnswerClass As %String;

Property MockAdapterAnswerMethod As %String;

Parameter SETTINGS = "MockAdapterAnswerClass,MockAdapterAnswerMethod";
4
1 365
Question Satyendra Singh · Oct 2, 2018

HI,

I have been using evaluation version of Cache 2017.2, it was working fine and I was using Cache studio, SMP  & Cache Terminal/console till yesterday.

Today, cache was in shutdown status, then I restarted.  But, Cache terminal is not working and showing as Access Denied while otherthings like studio and SMP is working as expected. I checked all security level services on SMP, all are fine and enabled.

Can anyone help me to diagnose the problem and make it working.

Thanks.

9
0 2257
Question Rodolfo Moreira dos Santos · Aug 21, 2019

Hello, I have a task created in my task manager, calling my Business Service class, and it's working fine.
But I need to know the ID of the task, I searched within the class  %SYS.Task.Definition and found nothing related.

Class Example.Tasks Extends %SYS.Task.Definition{Property BusinessService As %String [ InitialExpression = "Example" ];Method OnTask() As %Status{
  SET tSC = $$$OK
  TRY {
  
  SET tSC = ##Class(Ens.Director).CreateBusinessService(..BusinessService,.tBS)
  SET tRequest = ##class(Ens.Request).%New()
  SET tSC = tBS.OnProcessInput(tRequest,.tResponse)
  KI
7
0 570
Question Oliver Wilms · Aug 13, 2019

Hello,

I want to create a dashboard with a line graph that shows system availability over time. I used this code to create a Dashboard:

            Set tItem = ##class(%DeepSee.UserLibrary.Link).%New()
                Set tItem.fullName = "Availability"
                Set tPage = "Availability.UI.CSVImport.zen"
                Set tItem.href = $system.CSP.GetPortalApp($namespace,tPage)_tPage
                Set tItem.title = "Availability"
                Set tSC = tItem.%Save()

 

I have a process in place that stores the data in a SQL table with three properties: 

CreatedDate,
7
0 417
Article Rubens Silva · May 22, 2017 3m read

EDIT: This article has been updated with up-to-date information about the Port project, which now includes a tutorial for basic usage.
The Port project is something that I've introduced more than two years ago but I hadn't enough room to elaborate a tutorial on how to use it till now.


First, the motivation:

I started this project several months  years ago when I noticed that most of the Studio's source control implementations weren't project based but instead namespace based.

5
2 814
Question Stephen Wilson · Aug 21, 2019

The .NET Core Identity model has an IPasswordHasher<> interface for  for 

  • Hashing a password so that it can be stored in a database
  • Verifying a provided plain-text password matches a previously stored hash. 

I am getting invalid password errors during the login process when the .NET Core Identity model computes a hash from a plain text input and compares it to a password hash value I've returned from Caché. The default hashing algorithm is PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, and 10,000 iterations (detailed article on .NET Core Identity PasswordHasher). The algorithm Caché uses is probably different which may be why I am getting errors.

6
1 3209
Article Jean Millette · Aug 22, 2019 3m read

Our team is reworking an application to use REST services that use the same database as our current ZEN application. One of the new REST endpoints uses a query that ran very slowly when first implemented. After some analysis, we found that an index on one of the fields in the table greatly improved performance (a query that took 35 seconds was now taking a fraction of a second).

We saw this improvement on our development system and our test system. However, when we moved the code to the production system, the query still took “forever”. What went wrong?

  • We checked that the code was properly
4
0 565