Thanks, Scott.  

What you explained about IRIS was what someone told me about Cache, lol!  I'd be interested to know other perspectives on the grouping of products and what they are, but what you've said makes sense.

I might rephrase my problem with globals: let say I've been using Cache/MUMPS for many years and all my data is in globals.  With the advent of ObjectScript and studio, I would like to take a more object oriented approach to manipulating my data.  How would I create a class to do that?

^PERSON(1) = "MIKE|MALE|DEVELOPER"

^PERSON(2) = "SCOTT|MALE|MASTER PROGRAMMER"

How would I create a class to do the CRUD ops on these existing globals?

Thanks!

Mike

Thanks!  I'm familiar with SET and $PIECE.

So I have my global that exists already:

^PERSON(1) = "Mike|Male|Dev"

Can I turn that into an object? 

PERSON.1 = "Mike D"

Let me read below as to what Chris has said as well and see if that helps.

MD

Right, I've been working with the documentation and training, but I came here because I don't think it's always very clear.

In your example here you've use .%Save() to save to the Person table.  Is that the same thing as the ^PERSON global? 

Based on what I've tried, I would say it is not.  So you see I'm trying to use ObjecScript and object to update my ^PERSON global.

Does that make sense?

MD

Ah yes, I see this now!  Thank you!

I can see the ^(Package).PersonD global created in our global exploration tool, however it won't let me read it.  When I load and run the routine in the terminal and do a ZW I get data that looks like this:

person1=<OBJECT REFERENCE>[1@Test.MXD.Person]

The status indicator for the %Save shows success (1).  

Now how do I do it the other way around?  Let's say a global ^PEOPLE already exists?   How do I create a class do deal with that?  If I create a class User.People, the global ^User.PeopleD will be created when I want it to use ^PEOPLE.

MD

@Roberto Cahanap @Roberto Cahanap 

Tagged both because maybe you created a new profile.  

Interested to know if you've successfully implemented unit testing with Cache at your company.  I have been assigned to work with my team on unit testing and I wanted to see how others have done it.

Is there a way to contact people privately?

Thanks @Roberto Cahanap 

The catalyst for my initial post was simply reading the package and class documentation for %UnitTest.  I noticed that whoever set up our unit testing framework here was only using the %TestCase class and %Manager class.  There are many other classes in the package, and I'm trying to get a sense if we are utilize the tools in the package to the greatest extent.  

The other half of it is that I'm a very new programmer (brand new pretty much) and I'm not accustom to unit tests.  I'm curious to know how others do it so I can see where's there common ground and where people differ.

I'm going to watch the presentation linked above and then get back with more questions.

MD

Michael Davidovich · Mar 11, 2019 go to post

@Ben Spead @Evgeny Shvarov 

I watched the video, thank you!

As a new Cache developer, I'm curious to know if TestCoverage will ever be implemented in a future release of ObjectScript in the %UnitTest framwork versus why it stands alone as in InterSystems developed OpenExchange project.

Still learning the differences between Cache, ObjectScript, all the InterSystems' applications and how it all intersects with what my company has been doing in Mumps for the past 30 years.  

If I can reel back to some basics, however.  Because I never really written a complex applications, my sense of testing as always been "write a little, run it, write a little run it," and usually that was in Java.  It was easy to write a driver class or main method to test the code and see what was going on.  I suppose in a more complex system that is always growing, you need something like this unit test framework to single out these classes to run without writing a separate driver class, or at least in this case TestManager is acting as that driver class.  Am I on the write track on how to think about this?

Thanks for everyone's help!

Michael Davidovich · Mar 11, 2019 go to post

Ah, ok!  That's a smart way to explore the need and interest in a feature rather than just develop and release in a vacuum. 

Hi @Charles Cross!

I don't think your link pasted right.

To answer your question . . . I would lean twoards programmatically.  It's a mumps routine that prompts the user for some inputs and then builds out a temporary database with the required data and then writes it to a file with tab deliminators. 

You're not the first to mention the XML solution, so I will look into this.

Mike

@Chris Thompson 

Thanks!

Re the JSON and REST call, are you basically saying create a web service that serves the report in JSON format, and then use https://github.com/exceljs/exceljs to write the XLS file?

Do you have any links or discussion on the ADO .net package?  I think the problem here is that if it's not Cache no one want to touch it.  If someone has to use .net that idea would get squashed right away :(

Mike

I will have to keep playing with this.

I created the class and tried to run it (in SAMPLES) and when I pressed run it launched the management portal login and made me log in (it appeared it was trying to log into another namespace which might be significant).

An Excel file started to open but I got the 'wrong format/corrupt data' message.  I thought maybe there was an issue since I'm running from samples, but it's trying to do something in the other namespace (we call it DVL).  So I tried logging into the management portal first and switched the namespace to SAMPLE and then ran the report.  Same thing happened as above: had me try to log into DVL portal.

I'll keep playing as it seems hopeful, but it may be a limitation on how our system was configured (which I'm too new to have much influence to change).

Mike

Michael Davidovich · Apr 29, 2019 go to post

For those following along, the direction we've decided is to output the files as XML data.  So I am trying to use the %XML.Writer and %XML.Adapter classes to do this, but the documentation is thick and difficult to understand.  For example, I'm trying write to write the following tag and attributes:

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">

</Workbook>

I can't seem to figure out how to write the tag with more than one attribute.  The documentation says I can add an additional property and note "XMLPROJECTION="ATTRIBUTE", but that then required the initialization of these attributes every time we create the object.  I would rather it be a parameter so it's remains static.  Also you can define a property or parameter with a ":" which makes it difficult.

Does InterSystems have a tutorial  on this somewhere?  A video?  I would love some help.  

For the record, I'm a very new programmer if you do offer thoughts, context helps.

Mike

Michael Davidovich · Sep 12, 2019 go to post

@Flávio Lúcio Naves Júnior 

Check out my thread: https://community.intersystems.com/post/use-cache-write-excel-files

Basically people mentioned using Zen, Apache POI or Python.

What we ended up doing was reverse engineering a Excel spreadsheet and using the %XML.Writer class, created functions to build out an XML file that is built and optimized for Excel.  The problem is that you're left with just and XML file and not a true Excel file.  We are working on that post processing challenge now.

Hope this helps!

Michael Davidovich · Nov 14, 2019 go to post

Thanks, Benjamin.

I didn't realize that an application had to be created.  I have it working now. 

The link Eduard provided was helpful.

Thank you both!

Dmitriy, this is awesome and thank you for your work on this!

I've looked through the issues and the discussion and I don't think I've seen anyone post feedback about password security.  Thought I'd discuss here before posting it as an 'issue'.

In our org, we can develop locally, sure, but usually we are developing in a low level development namespace on the server, thus we are usually connecting to the server.  In our org our username and password happen to also be the same credentials for our Windows login, network, everything really.  

Are there ways to avoid hard coding the password in the extension settings?  Or is this a feature that can be developed?

That said, it seems you have to specify the namespace in the settings as well.  Is there a faster way to toggle between namespaces?

Thank you!

Mike

The link seems to just take me to the overall leader board.  

Am I missing something?

This is going well for me so far laugh

Nevermind.


"Note: You need to sign in to Advent of code  (e.g. with Github or Google account) to see the leaderboard and participate in the contest."
 

Thank you @Eduard Lebedyuk 

Turns out my problem was 1) bad code and 2) I'm getting a <MAXSTRING> error when building out my JSON object.

Obviously long strings aren't enabled in our instance(s) of Cache . . . and I would probably need to make a really really solid business case to the people who can own and enable that setting.

Can/will moving to an async style of API help this?

{
   "errors": [   {
      "code": 5002,
      "domain": "%ObjectErrors",
      "error": "ERROR #5002: Cache error: <MAXSTRING>zBN0010+91^CLAIMS.mxdavidovich.ApiTestv1.1",
      "id": "CacheError",
      "params": ["<MAXSTRING>zBN0010+91^CLAIMS.mxdavidovich.ApiTestv1.1"]
   }],
   "summary": "ERROR #5002: Cache error: <MAXSTRING>zBN0010+91^CLAIMS.mxdavidovich.ApiTestv1.1"
}
 

Soooo, what is UDL form?  A Google search shows Universal Design for Learning, but I can't seem to find a spec for writing code.

Also, I'm still using Studio.  I've saved a project called AOC.prj and created a class AOC.Day1 in USER, but I can't find the source folder for USER to start a git repo and push it up.  Nor can I save the project to anywhere but the namespace.  Anyone else using Studio?

Trying to remain positive here as I haven't even coded the first day yet because of my set up challenges :(

Thanks Evengy :)

Yeah, I think my plan is to code and run in ObjectScript and then once correct, copy to a file in NotePad++ and commit changes from there.

Does that sound right?

I went home and put the community edition on my laptop, however, I will see if I can follow the steps in your article here at work.

Thanks!

Michael Davidovich · Dec 13, 2019 go to post

@Carmen Logue 
Thanks, Carmen!  I'm not sure I can add too much to your Alpha development I personally haven't been using the OBDC to connect into Cache.  What I do know is that some other groups have used ODBC to connect into Cache with SQL projections.  

My team want's to avoid projections specifically (at this point at least) because we tend to only use them to get data from Cache to our Data Warehouse (Oracle).  Other than that, we still traverse our database via globals and good old MUMPS programming.  The project I'm working on is taking those many many routines that we have that traverse globals for reporting, and transforming the data to JSON streams.  An %CSP.REST API will call those routines and provide the data to a Tableau web data connector so we can get instant, live data without projecting our whole database.  

I'm just getting start with Tablaue and Cache so I may have some more input in the future.

Best,

Mike

Michael Davidovich · Dec 16, 2019 go to post

@Dmitry Maslennikov 

I'm wondering if you can talk me through your Day 3 code?  Specifically the draw function.

I'm terribly confused on where crossType and crossSteps are being set.

Also the InterSystems documentation clearly shows how to use $LB on the right side of an equals operator, but I haven't seen it on the left side or understand how that works:

Set grid(y, x) = $Listbuild(type, steps)

I guess simply it's setting that node in the array to a list of two elements, type and step?

Maybe by Christmas I'll get to day 5! Haha!

Mike

Michael Davidovich · Dec 17, 2019 go to post

Thanks, after spending some time with this I see it way more clearly now.  

I was on the right track using $LB in my code, but I'm not efficiently storing my coordinates for each wire and I'm get a MAXSTRING error.

More tomorrow.

Best,

Mike