up
- Log in to post comments
up
I think the most important part of source control file structure is mirroring package structure in Studio, since that is the view we spend the most time with. That said it looks something like this:
root/
Package1/
Class.cls
Class2.cls
Routine.mac
Include.inc
Package2/
Class.cls
Class2.cls
Routine.mac
Include.inc
Additionally:
Can you execute in SMP:
SELECT cast('0x1F' AS varbinary(1549))Not sure why
0x1F8B08000000...
is unescaped though.
How do you propose to store static strings?
That was fast.
I'm assuming you don't want spoilers here beyond that?
Yes, for now.
I would like to, on every file change export the whole project to XML
What do you want to achieve with that?
Then stored sql procedures/custom queries or result sets are the way to go.
You'll need to write a method that returns what you need and expose it to SQL via one of the abovementioned methods.
You can project collection property as a child table.
Property MyList as list of Object(STORAGEDEFAULT="array");
Note that it changes class storage, so existing data should be moved to the correct new place.
Several months ago I wrote a small utility class to accomplish exactly that.
Or if you don't have a lot of different classes and data dependencies, you can just export to XML, add STORAGEDEFAULT and import XML.
Is it possible to change underlying data model so that 1 row = 1 main object?
Class UserPrefs {
Property Username;
/// Color/Number are keys, and this can be indexed
Property Preferences As Array Of %String(SQLPROJECTION = "table/column");
Parameter ROWLEVELSECURITY = 1;
///Updated for each row when the property 'Preferences' changes
Property %READERLIST As %String [ SqlComputeCode = {set {*} = ##class(Users).%SecurityPolicy()}, SqlComputed, SqlComputeOnChange = Preferences ];
}You can use SQL to insert into child table. Not sure if it would actually trigger a %READERLIST recalculation (maybe try %%INSERT) but worth a try.
16.2 has %ZEN.Auxiliary.altJSONProvider, which has same method signatures but may be preferable (faster).
Excel can import data from any ODBC data source.
Traced stuff to %SOAP.WebBase and for example in WriteSOAPHeaders there are these lines:
$$$XMLSetBuffer(" </"_..#SOAPPREFIX_":Header>")
$$$XMLWriteLineI guess there's really no way to remove new lines without a very heavy customization.
Using SQLComputeCode and SQLComputeOnChange %READERLIST property is stored but gets recalculated on every SQL and Object INSERT/UPDATE/%Save:
Class Utils.RLS Extends %Persistent
{
Parameter ROWLEVELSECURITY = 1;
Property %READERLIST As %String [ SqlComputeCode = {set {*} = ##class(Utils.RLS).GetAccess({%%ID})}, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ];
Property data As %String;
ClassMethod GetAccess(Id) As %String
{
return:Id>3 "_SYSTEM"
return "%All"
}
/// do ##class(Utils.RLS).Fill()
ClassMethod Fill(N = 5)
{
do ..%KillExtent()
for i=1:1:N {
&sql(insert into Utils.RLS(data) values(:i))
}
zw ^demo.testD,^demo.testI
do ##class(%SQL.Statement).%ExecDirect(,"select * from "_$classname()).%Display()
}Target system is very fastidious about XML. I aim to eliminate all possible variables that may affect XML processing.
Show user SQL result without opening objects?
What's the use case for iterating over all (or even a big slice of) objects?
Sure, that's default behavior.
Custom queries can be used. Check the examples there. Or you can just iterate over data global and call %OpenId.
To get user/pass? Sure:
set sc = #class(Ens.Config.Credentials).GetCredentialsObj(.cred, "caller.class", "Ens.Config.Credentials", "CredentialsId") write cred.Username write cred.PasswordGet()
Are long strings enabled?
I'd start without base64 decode just to check how ftp works.
I think this would be enough to work (1st argument in Store is a full filename and second is a stream you want to put there):
ClassMethod DecodeBase64HL7ToFileFaxing(base64 As %Stream.GlobalBinary, Ancillary As %String, FileName As %String) As %String
{
set ftp=##class(%Net.FtpSession).%New()
if 'ftp.Connect("xxxxx","xxxxx","xxxxxx") $$$LOGINFO("Unable to connect to inteng11")
if 'ftp.Store(FileName, base64) $$$LOGINFO("Unable to write file")
if 'ftp.Logout() $$$LOGINFO("Failed to logout")
quit $$$OK
}It looks more like column-level security.
If you have Ensemble production defined you can call BS or BO from Cache ObjectScript using testing service.
Or you can just use %Net.FtpSession object to store stream on a remote server.
That error can be removed by setting MANAGEDEXTENT class parameter to 0 as Extent Manager would stop tracking globals for that class.
You'll need:
I used this kit, it has a lot of additional parts for starter projects.
I've also done user user authentication in Caché using RFID cards.
Cool!
Currently all the classes are in one folder (and as there's 6 classes currently, that's ok), but is there any reason not to separate them further into folders by package?
3. CSP Debugging
Does it include REST debugging?