Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Can you have a Parameterizable LOCATION for a %Stream.FileCharacterGzip property?

Question
Fiona Griffiths · Dec 20, 2021

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?

#Caché
Product version: Caché 2017.1

Source URL:https://community.intersystems.com/post/can-you-have-parameterizable-location-streamfilecharactergzip-property