Caché

Syndicate content 116 

Hi Team,

I am using Angular 7 with angular material for my client application that connects and obtains Access token from IRIS Authorization Server (OAUTH 2.0) to access REST APIs that reside on the resource server with delegated authority security option. The only problem that I am facing right now is exposing the important information such as JWT (encoded Access token) token information which stores in the browser’s local storage and not secure to handle XSS Attacks if it may happen. All the confidential information is easily accessable from the browser (F12->Application tab->local storage)

0   0 1
0

answers

0

comments

0

views

0

rating

Hi guys!

Portrait of  Madame X, Gustave Caillebotte.

One of the features I like in InterSystems ObjectScript is how you can process array transformations in a specific method or a function.

Usually when we say "process an array" we assume a very straightforward algorithm which loops through an array and does something with its entries upon a certain rule.

The trick is how you transfer an array to work with into a function. 

One of the nice approaches on how to pass the information about an array is using $Name and Indirection operator. 

Below you can find a very simple example which illustrates the thing.

Last comment 45 min 43 sec ago
+ 2   1 2
77

views

+ 2

rating

What is the process in importing a role from one server to another server?

Let's say Server A is our main server that we maintain all of our resources / roles / users. We would like to get these over to Server B, Server C, Server D, etc.

It looks like when we import, there are tables and resources left in the destination servers that are not in the source server. It looks like whatever was in the destination server that was not part of the source server was not deleted from the import.

What is the proper way of exporting/importing a role so that this does not happen?

Last answer 1 hour 28 min ago
0   0 1
0

comments

11

views

0

rating

 

Estimated reading time: 6 minutes
 

Hello everyone,

I was first introduced to TDD almost 9 year ago, and I immediately fell in love with it. 
Nowadays it's become very popular but, unfortunately, I see that many companies don't use it. Moreover, many developers don't even know what it is exactly or how to use it, mainly beginners.

 

 

Overview

My goal with this article is to show how to use TDD with %UnitTest. I will show my workflow and explain how to use cosFaker, one of my first projects, which I created using Caché and recently uploaded to OpenExchange.

So buckle up and let's go.

Last comment 4 hours 41 min ago
+ 17   5 1
167

views

+ 17

rating

I have an xml that has non standard characters and I would like to transform it with xslt  so that those characters render in the format  &#nnn here is what I have so far any help appreciated 

xslt

 

 

<!--?xml version="1.0"?-->
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="Windows-1252" indent="yes" omit-xml-declaration="yes" method="xml">
>  <xsl:template match="/Recordset">
    <recordset><xsl:apply-templates></xsl:apply-templates></recordset>
  </xsl:template>
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*">
      <xsl:apply-templates>
    </xsl:apply-templates></xsl:apply-templates></xsl:copy>
  </xsl:template>
</xsl:output></xsl:transform>
 

XML

Last comment 1 days ago
0   0 4
0

answers

52

views

0

rating

Referencing this post:

https://community.intersystems.com/post/producing-json-sql

I'm not sure how to actually interact with the result set I get from doing something like this.  I want to return something like:

[{"field1":1, "field2":2}, {"field1":2, "field2":10}]

I'm finding it very difficult to get it in this format, since %Print appends a newline onto the end of the {} object it prints.

Here's the closest I've gotten:

set query = "select JSON_OBJECT('field1': field1, 'field2":field2) from MyTable where x=? and y=?"

    set tStatement = ##class(%SQL.Statement).%New()
    set qStatus = tStatement.%Prepare(query)
    if qStatus'=1 {WRITE "%Prepare failed:" DO $System.Status.DisplayError(qStatus) QUIT

Last answer 5 days ago Last comment 1 days ago
0   1 1
80

views

0

rating

Continuing on from my last post, I am posting my succesful output for the Day 2 Part 1 below.

A full explanation of Day 2 part 1 can be found at: https://adventofcode.com/2018/day/2 and the input can be found

at: https://adventofcode.com/2018/day/2/input

A brief description of this exercise is that you receive a sequence of strings.

You have to count the if any duplicate or triplicate chars exist in the string.  Multiples will exist, but if you find multiple ldupicates / triplicates you will count them once.

At the end of sequence of strings you have to SUM the no. of duplicate / triplicate chars and multiply them together to get a simple check sum value.

I created 2 methods, one to import the data and the second to analyse the strings and populate the duplicate count and triple count properties

Last comment 2 days ago
0   0 2
63

views

0

rating

I'm using callin to get global values.

Here's a simple function to get string value from global and return it:

int GetGlobalStr(char *global, CACHE_EXSTRP result)
{
    int push = CACHEPUSHGLOBAL(strlen(global), global);

    // narg Number of subscript expressions pushed onto the argument stack.
    int narg = 0;

    // flag - Indicates behavior when global reference is undefined:
    // 0 — returns CACHE_ERUNDEF
    // 1 — returns CACHE_SUCCESS but the return value is an empty string.
    int flag = 1;

    int get = CACHEGLOBALGET(narg, flag);

    int pop = CACHEPOPEXSTR(result);

    return ZF_SUCCESS;
}

I get global value in result successfully. However I need to iterate over $lb. How can I do that?

Last answer 3 days ago Last comment 3 days ago
0   0 3
58

views

0

rating

I needed to know programmatically if last ran failed or not.

After some exploring, here's the code:

ClassMethod isLastTestOk() As %Boolean
{
  set in = ##class(%UnitTest.Result.TestInstance).%OpenId(^UnitTest.Result)
  for i=1:1:in.TestSuites.Count() {
    #dim suite As %UnitTest.Result.TestSuite
    set suite = in.TestSuites.GetAt(i)
    return:suite.Status=0 $$$NO
  }
  quit $$$YES
}

Last comment 5 days ago
+ 1   1 4
232

views

+ 1

rating

Hi All,

I would like to download odbc drivers for Cache database to be able to install it on our SQL server.

I am trying to create a linked server to Cache database.

I couldn't find a link for the drivers, there was one post with FTP reference to download but it doesn't seem to work.

I will be grateful for any help.

Thank you

Sap.

Last answer 4 April 2019 Last comment 5 days ago
0   0 1
83

views

0

rating

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

{
    "CaptureSource":2,
    "RecipientID":"ID34",
    "Document": {
        "Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
        "EventDate":"2019-01-14T13:23:46",
        "FileExtension":"pdf",
        "FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA......"

      },
    "ActionRequired":false,

Last answer 5 days ago
0   1 2
0

comments

122

views

0

rating

Hello,

When i click on the menu to  run the  Data import wizard  from MP, i receive following CSP error

<UNDEFINED>zOnPageHEAD+229^%cspapp.exp.utilsqleximwizardcontent.1 *schemaname : CSP Error

 

It is happening for all the namespaces. Looks like some permission issue.  Same issue with Data Export wizard. Help to resolve this will be appreciated.

I am using

Cache for Windows (x86-64) 2017.2.2 (Build 865_0_18763U)

Thanks,

Jimmy Christian.

 

Last answer 6 days ago Last comment 6 days ago
0   0 1
25

views

0

rating

Hello All,

There are few tools for SQL optimization available and even query builder has Show Plan to give us an estimation of the resources needed to execute.

 

For Methods - Is there anything similar ??

I would like to see a similar approach as to the time taken for method to execute.

Is Studio Debugger only option ??

Last answer 6 days ago
0   0 3
0

comments

36

views

0

rating

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

Last answer 6 days ago Last comment 6 days ago
0   0 2
45

views

0

rating

After many sleepless nights it's a pleasure to announce the newer, better, moderner ObjectScript compiler which implemented pretty much everything you ever wanted to have in modern ObjectScript:

  • Design objective of this new compiler is to parse reasonable subset of current ObjectScript syntax which will look readable for stranger, and not scare them with 1 letter syntax. The good start for compiler was the old-good COS Guidelines from here https://github.com/intersystems-ru/cos-guidelines
  • For reasons we mentioned above we do not parse 1 letter syntax. It's declared evil;
  • We do not handle dotted syntax for the same reason - modern syntax with {} is proper replacement for dotted syntax blocks;

But we not only parse the modern ObjectScript syntax, we have implemented finally the long-standing request which we always dreamed about. Closures!

Last comment 6 days ago
+ 8   3 4
240

views

+ 8

rating

Index to Articles

Hi All

It's been 6 weeks since my original article sad
- - - - -but I have been busy on this project smiley

I have been looking at/thinking about a replacement for ZEN for around 12 months but only really started in depth 4 months ago.
Also been in IT for long enough that I can "get a feel" for a product/technology and make decisions accordingly without going into great detail. 
Any new technology has a learning curve and I don't want to waste time and effort on something that won't fly. 
And, as always, I am looking to minimise the learning curve as I want to concentrate on delivering business benefit. 

Last comment 7 days ago
+ 15   0 4
430

views

+ 15

rating

Hello, 

Till the end of this summer, I have few hours per day that I can spare. I am keen to invest those hours by being part of a good project as a Technical Consultant  where I can extend my expertise and connect with fellow colleagues of the community.

I have been associated with Intersytems technologies including Cache, Ensemble, Zen, DeepSee for almost a decade and have a good understanding of the same.  It was by chance that I ventured into these technologies. Initially I had been working with Sun Microsystems as an Integration Consultant for few years and that's why switching to Ensemble / Cache wasn't tough as they are an integration tool too. Training sessions at Boston also have definitely helped me make the switch

0   0 1
0

comments

42

views

0

rating

First, my $ZVERSION:

Cache for OpenVMS/ALPHA V7.x (Alpha) 2010.1.6 (Build 952_2 + Adhoc 17754) 3-JAN-2018 14:32:54.07

Second, my issue:

I believe my current villain is “incremental compiling.” I was able to compare early compile output with later compile output:

Compilation started on 04/10/2019 10:46:32 with qualifiers 'cuk'
Compiling class UnitTests.Task3496 incremental compile detected
Compiling routine UnitTests.Task3496.2
Compilation finished successfully in 0.800s.

... several compiles later...

Compilation started on 04/10/2019 13:35:33 with qualifiers 'cuk'
Compiling class UnitTests.Task3496
Compiling routine UnitTests.Task3496.1
Compilation finished successfully in 0.999s.

The problem that I am having today is that the %STACK is showing my code executing code that has been commented out

0   0 0
0

answers

0

comments

22

views

0

rating

I'm attempting to use the .NET Entity Framework provider that is provided by InterSystems (see: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_eframe).  In our environment, the "Support Delimited Identifiers" option is turned off and we are not allowed to turn it on without significant testing effort.  When this setting is off, the SQL that is generated by the Entity Framework provider is not considered valid and therefore the provider doesn't work (it DOES work, however, when this setting is turned ON).

Do you know of any way to work around this issue? Again, we don't have the option of turning the "Support Delimited Identifiers" option ON unfortunately.

Last answer 4 April 2019 Last comment 9 days ago
0   0 1
33

views

0

rating

Hi,
I am facing issue during LDAP lookup like whenever I used product group parameter in AD explorer to search data from application I am getting empty result. If I set product group parameter as null then based on distinguished name result is generated in application. So if anyone knows about how LDAP works and how parameters are set in AD explorer then please let me know.

Thanks in advance.

0   0 0
0

answers

0

comments

12

views

0

rating

 For Data Synchronization inside Caché you have a range of ways to synchronize objects and tables.
At DB level you can use Shadowing  or Mirroring 

This works excellent and if you need just a part of your data to be synchronized you may split your
data into smaller pieces using Global mapping 
Or if you need bi-directional synchronization on Class/Table level you can use the Object Synchronization Feature 


The limit of all these excellent features:
They just work from Caché/IRIS to Caché/IRIS.

Last comment 9 days ago
+ 7   1 2
81

views

+ 7

rating

Hello everyone,

 

I'm trying to migrate the IDE for programming in COS, we normally use the Studio, but we want to use a more modern IDE. Our team has knowledge with Visual Studio plataform, but we couldn't configurate the compiler and terminal, I installed the extension InterSystems ObjectScript and tried to configurate to connect with my local machine, unfortunately the connection don't sucessed.

Someone has material for how i can connect and compile? Some material i saw show how to use the compiler, but not how can i do the configuration.

 

Best regards,
Flávio. 

Last answer 3 April 2019 Last comment 9 days ago
0   0 3
122

views

0

rating