Templates (e.g. XSLTs, Word documents, Crystal Report Files and other such files) are often used by third party software (Aspose, Crystal Reports, etc.) which are not capable of streaming files via the IFileObject interface. Thus, as a matter of practice, template files are maintained on the same file system where the code is executing (i.e. the web or application servers). The DistributedFile class allows for uploading a file to multiple locations. In a load-balanced server farm, this allows uploading of template files to multiple servers. Assume the following scenario for a production environment:
When writing templates to a web server, a copy of the template must be written to each of the 5 machines listed above. The configuration file for A1P1Mortgage should look something like this: <FileObject> <FileObjects> <FileObject Name="A1P1Mortgage" Type="qbo.Attachment.FileObjects.LocalFile, qbo.Attachment" Uri="C:\inetpub\wwwroot\qbo3\templates" Compression="false"/> <!-- A1P2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1P2Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1P2Mortgage\templates" Compression="false"/> <!-- A1PA1Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA1Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA1Mortgage\templates" Compression="false"/> <!-- A1PA2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA2Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA2Mortgage\templates" Compression="false"/> <!-- A1PA2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA2Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA3Mortgage\templates" Compression="false"/> <!-- The Template file object references all 5 servers above --> <FileObject Name="Template" Type="qbo.Attachment.FileObjects.DistributedFile, qbo.Attachment" Uri="A1P1Mortgage,A1P2Mortgage,A1PA1Mortgage,A1PA2Mortgage,A1PA3Mortgage" Compression="false"/> </FileObjects> </FileObject> When reading a template, only one machine needs to be used. The DistributedFile will read from the first destination listed, and each machine should list itself first to speed loading time. So the configuration for A1P2Mortgage would look slightly different: <FileObject> <FileObjects> <FileObject Name="A1P1Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1P1Mortgage\templates" Compression="false"/> <!-- A1P2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1P2Mortgage" Type="qbo.Attachment.FileObjects.LocalFile, qbo.Attachment" Uri="C:\inetpub\wwwroot\qbo3\templates" Compression="false"/> <!-- A1PA1Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA1Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA1Mortgage\templates" Compression="false"/> <!-- A1PA2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA2Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA2Mortgage\templates" Compression="false"/> <!-- A1PA2Mortgage should include a file share of it's templates folder --> <FileObject Name="A1PA2Mortgage" Type="qbo.Attachment.FileObjects.UNCFile, qbo.Attachment" Uri="\\A1PA3Mortgage\templates" Compression="false"/> <!-- The Template file object references all 5 servers above --> <FileObject Name="Template" Type="qbo.Attachment.FileObjects.DistributedFile, qbo.Attachment" Uri="A1P2Mortgage,A1P1Mortgage,A1PA1Mortgage,A1PA2Mortgage,A1PA3Mortgage" Compression="false"/> </FileObjects> </FileObject>
|
Quandis Business Objects 3 > qbo.Attachment >