I need to run Ensemble Service with special environment variables set, so it's current process for me.
- Log in to post comments
I need to run Ensemble Service with special environment variables set, so it's current process for me.
You can use Apache POI library (or call PS, but cursory googling shows that Word is a requirement via COM objects) for example to get this information. As for how explorer gets doc info - I have honestly no idea.
It's not a file property. Docx is just a zip archive, inside it is docProps/app.xml file. Here's how it looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties>
<TotalTime>4</TotalTime>
<Pages>8</Pages>
<Words>1882</Words>
<Characters>10731</Characters>
<Application>Microsoft Office Word</Application>
<Lines>89</Lines>
<Paragraphs>25</Paragraphs>
<CharactersWithSpaces>12588</CharactersWithSpaces>
</Properties>Explorer reads the app.xml file and gets information from it.
You can do the same I suppose, here's an article on that.
In your case you don't want to unpack the whole docx, check this unzip implementation for ObjectScript.
Fastest (and in non-prod environments easiest) way to save every global would be:
Docker for windows allows switching between Linux containers and native Windows containers; if you want to use Linux containers (i.e. IRIS), make sure you enabled that mode
See this section in the documentation.
What's VB got to do with this?
Looks like a locale problem.
Add to the beginning of the script:
import locale
locale.setlocale(locale.LC_ALL, 'en_US.utf8')What error are you executing?
What error are you getting?
You need to check access to table.
Try
write $SYSTEM.SQL.CheckPriv($username,"1,<TABLE>","a")Replace <Table> with your table.
Check Purge method of Ens.MessageHeader class for example. Here's how it determines cast-off date:
set %tDoNotDeleteDate = $$$timeUTCHtoUTC($s($ztimezone'<0:($H-pDaysToKeep+1)_","_($ztimezone*60),1:($H-pDaysToKeep)_","_($ztimezone*60+86400)))So 24 hours.
%ALLINDEX maybe. Also check alternate plans.
Can you show an example:
How do I search?
Tried:
https://github.com/search?q=language%3Aobjectscript&type=Codebut it yielded zero results.
Commit triggered a recalculation.

Great news!
Coloring works, but still APEX, VB, TeX.
1. Modern editors color variable based on scope. p/t in the beginning is unnecessary.
7. I mean if you develop an API all methods should accept either primitives or ByRefs or json. Not object arguments in one method, primitives in another, etc.
8. If you return %Status always return it. If you return $this always return self.
9. If your class has several instance methods and each has, let's say "debug" argument, remove this argument from methods and add "debug" as a class property.
Check this article on iterating dynamic object.
Instead of just displaying the fields you can use %Dictionary package to generate corresponding class.
After that use new %JSON.Adaptor class (or old %ZEN.Auxiliary.jsonProvider class) to parse JSON into objects.
what are you doing there?
Coding.
1 namespace == 1 project.
Yes for custom storage you'll need to check the storage for hints.
In the case of %Dictionary package check %LoadData method.
To get method description call:
set desc = $$$defMemberKeyGet(CLASS,$$$cCLASSmethod,METHOD,$$$cMETHdescription)Can you please elaborate on your question?
Do you want to start using git? If so check this series of articles.
Do you want to do some advanced git flow control? If so please describe what do you want in more detail.
SQL is a declarative language (same as HTML for example). It does not DO anything. All it is is a description of what do you want to achieve.
In the case of InterSystems IRIS (and any other dbms for that matter) we take SQL statement, parse it into AST and generate code in other imperative language from AST. Now this generated code gets executed.
In case of InterSystems IRIS we generate the code in ObjectScript language. For DROP statement it would include this line:
kill ^globalD
If you want to you actually can see generated OjectScript code. To do that
Open SMP > System Administration > Configuration > SQL and Object Settings > General SQL Settings.
Enable "Cached Query - Save Source" — This specifies whether to save the routine and INT code that Caché generates when you execute any Caché SQL except for embedded SQL.
After that purge query from portal if it already exists and execute the query again in SMP.
You'll see something like this:
Cached query %sqlcq.<NAMESPACE>.cls<NUMBER>
Go to studio and open %sqlcq.<NAMESPACE>.cls<NUMBER> class - it would contain generated ObjectScript code that executes for your SQL query.
C:\TempC:\InterSystems\Ensemble2018\mgr\Temp\b.xlsx
Replace with: C:\InterSystems\Ensemble2018\mgr\Temp\b.xlsx
Set ^%SYS("zenreport","excelserverport")=5005
Great points, Sean.
However there are, I think, areas where macros are needed:
But I definitely agree that overabundance of custom macros makes code unreadable.
Let's say you created class Point:
Class try.Point Extends %Persistent [DDLAllowed]
{
Property X;
Property Y;
}You can also create it via DDL:
CREATE Table try.Point ...It would create the same class.
After compilation our new class would have autogenerated Storage structure which is a mapping of global to data to columns and properties:
Storage Default
{
<Data name="PointDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>X</Value>
</Value>
<Value name="3">
<Value>Y</Value>
</Value>
</Data>
<DataLocation>^try.PointD</DataLocation>
<DefaultData>PointDefaultData</DefaultData>
<IdLocation>^try.PointD</IdLocation>
<IndexLocation>^try.PointI</IndexLocation>
<StreamLocation>^try.PointS</StreamLocation>
<Type>%Library.CacheStorage</Type>
}What is going on here?
From the bottom and up (bolded are important, ignore the rest):
Now our default data is PointDefaultData so let's see it. Essentially it says that global node has this structure:
So we might expect our global to look like this:
^try.PointD(id) = %%CLASSNAME, X, YBut if we output our global it would be empty because we didn't add any data:
zw ^try.PointDLet's add one object:
set p = ##class(try.Point).%New()
set p.X = 1
set p.Y = 2
write p.%Save()And here's our global
zw ^try.PointD
^try.PointD=1
^try.PointD(1)=$lb("",1,2)As you see our expected structure %%CLASSNAME, X, Y is set with $lb("",1,2) which corresponds to X and Y properties of our object (%%CLASSNAME is system property, ignore it).
We can also add a row via SQL:
INSERT INTO try.Point (X, Y) VALUES (3,4)Now our global looks like this:
zw ^try.PointD
^try.PointD=2
^try.PointD(1)=$lb("",1,2)
^try.PointD(2)=$lb("",3,4)So the data we add via objects or sql is stored in globals according to storage definitions (you can modify manually storage definition by replacing X and Y in PointDefaultData - check what happens to new data!)
Now, what happens when we want to execute SQL query?
SELECT * FROM try.PointIt is translated into ObjectScript code that iterates over ^try.PointD global and populates columns based on storage definition - PointDefaultData part of it precisely.
Now for modifications. Let's delete all the data from the table
DELETE FROM try.PointAnd let's see our global after it:
zw ^try.PointD
^try.PointD=2Note that only ID counter is left, so new object/row would have an ID=3. Also our class and table continue to exist.
But what happens on:
DROP TABLE try.PointIt would destroy the table, class and delete the global.
zw ^try.PointDClasses and tables are mappings that are read "on the fly". That's exactly it.
Stores data on disk? Meaning, that if we create these persistent classes, the data is stored twice? Once in the global node and in some other format as defined (or not defined by the class)?
The data is stored in globals and only globals. Globals themselves are physically written on disk.
But just to reiterate, how does the DDL interpret a read definition into a write definition? The data stored in the global node and the definition do line up exactly (in our case, almost not at all).
Please expand your question. Do you mean how does SELECT or DROP or whatever SQL statement against table interacts with globals?
Preface macro with /// to enable autocomplete:
///
#define $$$In...