Teach Yourself e.net - Syspro
Teach Yourself e.net - Syspro
Teach Yourself e.net - Syspro
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Sample Applications<br />
As you can see from the sample code presented above, the functions that call a method<br />
function and require XML transformation will also have to provide the XSL string for the<br />
actual transformation. These are typically .xsl file stored in a directory on the server that<br />
can be loaded by a function and submitted as a string variable. You will need to create<br />
your own stylesheet files for the business objects that you will be using.<br />
The following code sample shows how an application would call the Query.Query method<br />
already described in the previous section.<br />
Example 10.30. Calling the Query Method in ASP.NET VB codebehind<br />
'********************************************************<br />
'-- Query does a query using the special xml string<br />
' provided as input and returns xml/html<br />
'********************************************************<br />
'Parameters:<br />
'Uid:- GUID returned by Logon<br />
'BusObject:- business object used to<br />
'<br />
do query<br />
'XmlIn:- The xml to be used in query - can have a<br />
'<br />
xsl directive<br />
'XmlTransform:- Parameter will specify if<br />
' server/client side transform is required<br />
'XslIn:- The XLS used to transform the<br />
' incomming xml preferably as a server<br />
' path ie. "c:\......mac.xsl"<br />
'ContentType:- ByRef parameter<br />
' representing the content type to be returned by IIS<br />
'********************************************************<br />
'Returns:_ Whatever the transform does with<br />
' the xml, used mostly to generate HTML.<br />
'********************************************************<br />
Function Query(ByVal Uid As String, ByVal BusObject \<br />
As String, ByVal XmlIn As String, ByVal XmlTransform \<br />
As String, ByVal XslIn As String, ByRef ContentType \<br />
As String, Optional ByVal returnLink As Boolean = \<br />
True, Optional ByVal BubleExc As Boolean = False) As String<br />
Try<br />
'Case statement to toggle between server/client<br />
'side transform<br />
Select Case XmlTransform<br />
Case "C" 'Prefers a client side transform<br />
Return <strong>Syspro</strong>Query(Uid, BusObject, XmlIn)<br />
Case "S" 'Prefers a server side transform (Default)<br />
ContentType = "text/html"<br />
Return Transform(<strong>Syspro</strong>Query(Uid, BusObject, XmlIn), XslIn)<br />
End Select<br />
10–43