Can you have a Parameterizable LOCATION for a %Stream.FileCharacterGzip property?
I want to make the LOCATION for a %Stream.FileCharacterGzip property we have in a class parameterisable (as in stored in a global), so it can be different for different customers. Is that possible? I've tried doing it a few different ways:
Creating a parameter
Parameter STREAMLOC = {^websystem("auditstream-location")};
then I tried to reference that in the
Property HTMLZIPDoc As %Stream.FileCharacterGzip(LOCATION = ..#STREAMLOC);
but the compiler doesn't like that.
I've also tried adding something to %OnOpen and %OnNew:
Method %OnOpen() As %Status [ Private, ServerOnly = 1 ]
{
S ..HTMLZIPDoc.%Location=^websystem("auditstream-ziplocation")
Quit $$$OK
}
Method %OnNew() As %Status [ Private, ServerOnly = 1 ]
{
S ..HTMLZIPDoc.%Location=^websystem("auditstream-ziplocation")
Quit $$$OK
}
but that didn't work either. Is it possible?
Comments
Method %OnNew(InitVal As %String) As %Status
{
Do ..HTMLZIPDoc.%LocationSet("c:\temp\zips")
Return $$$OK
}
Hi
Thanks that did work when I took out the %OnOpen. What I was trying to do was copy from an existing
Actually, it wasn't quite working. When I reopened the class it couldn't access the file property as it was looking at the default stream location rather than the one it was filed with, so thought it was empty! It doesn't appear to save the directory along with the filename in the D global. So I'm having to do a workaround when I open the object I set a variable to the HTMLZIPDoc.Filename, piece out just the filename part then put the directory and a slash on the front and put it back into HTMLZIPDoc.Filename and that seems to work. If anyone has a better solution let me know. thanks.
You can set ..HTMLZIPDoc.Filename to any filepath you need.