Hi,
I am trying to use classes within an AEX file for a web application but am not getting the results expected when running the code under the Application Server compared to the developer (both are latest version and build 3044-4041).
When I run this code in the interactive window, I get the expected results (essentially, just echoing back the config file name):
dim trConf as xmlConfiguration = new xmlConfiguration("C:\A5Webroot\portalConfig.xml")
?"Config file: " + trConf.cFile
= "Config file: C:\A5Webroot\portalConfig.xml"
However when I copy and paste the code into a web page and run it with the App Server I get this:
Config file:
The classes are very basic:
#### Base Class ####
define class global configuration
dim cFile as c
function configuration as c(configFile as c)
cFile = configFile
end function
end class
#### Sub-class ####
define class global xmlConfiguration INHERITS configuration
dim protected dom as p
dim protected queryStr as c
function xmlConfiguration as c(configFile as c)
cFile = configFile
end function
function protected parseXML as v()
'Load the XML file into a variable
xml = get_from_file(cFile)
dom = *XML_Document(xml)
end function
function getValue as c(tag as c,type as c)
queryStr = "*tag = '" + tag + "' .and. name = '" + type + "'"
parseXML()
q = dom.QueryElement(queryStr)
getValue = q.Output("*value")
end function
end class
The intention is to build the base class out to be able to use different file and database types that could be shared between projects. The classes are in an aex file called shared_code.aex which is under the document root - C:\A5Webroot\classes. The web page is finding and using the correct aex but does not seem to be setting the cFile property when run under the App Server.
Any thoughts or suggestions? Let me know if additional info is needed.
-Doug
I am trying to use classes within an AEX file for a web application but am not getting the results expected when running the code under the Application Server compared to the developer (both are latest version and build 3044-4041).
When I run this code in the interactive window, I get the expected results (essentially, just echoing back the config file name):
dim trConf as xmlConfiguration = new xmlConfiguration("C:\A5Webroot\portalConfig.xml")
?"Config file: " + trConf.cFile
= "Config file: C:\A5Webroot\portalConfig.xml"
However when I copy and paste the code into a web page and run it with the App Server I get this:
Config file:
The classes are very basic:
#### Base Class ####
define class global configuration
dim cFile as c
function configuration as c(configFile as c)
cFile = configFile
end function
end class
#### Sub-class ####
define class global xmlConfiguration INHERITS configuration
dim protected dom as p
dim protected queryStr as c
function xmlConfiguration as c(configFile as c)
cFile = configFile
end function
function protected parseXML as v()
'Load the XML file into a variable
xml = get_from_file(cFile)
dom = *XML_Document(xml)
end function
function getValue as c(tag as c,type as c)
queryStr = "*tag = '" + tag + "' .and. name = '" + type + "'"
parseXML()
q = dom.QueryElement(queryStr)
getValue = q.Output("*value")
end function
end class
The intention is to build the base class out to be able to use different file and database types that could be shared between projects. The classes are in an aex file called shared_code.aex which is under the document root - C:\A5Webroot\classes. The web page is finding and using the correct aex but does not seem to be setting the cFile property when run under the App Server.
Any thoughts or suggestions? Let me know if additional info is needed.
-Doug
Comment