Sei sulla pagina 1di 24

Deploying AJAX Document Viewer Professional Edition on IIS

Published Jan 2009 Adeptol LLC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. THE INFORMATION IN THIS PUBLICATION IS PROVIDED AS IS. WE MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Use, copying, and distribution of any software described in this publication requires an applicable software license. For the most up to date listing of product names, see WWW.AJAXDOCUMENTVIEWER.COM. All other trademarks used herein are the property of their respective owners.

Preface

This document describes how to integrate and use AJAX Document Viewer with your application.

Intended Audience
The audience of this manual is intended to be developers who are familiar with Java, Java Script, & overall Windows OS.

Revision History
The following changes have been made to this document.

Revision History

Revision Date Description

Jan 09

Initial Draft

Table of Contents

PREFACE .........................................................................................................................3 INTENDED AUDIENCE ....................................................................................................3 REVISION HISTORY .......................................................................................................3 TABLE OF CONTENTS ......................................................................................................4 CHAPTER 1......................................................................................................................5 OVERVIEW ......................................................................................................................5 INTRODUCTION..............................................................................................................5 SPECIFICATIONS SERVER ..............................................................................................6 SUPPORTED OPERATION SYSTEMS ........................................................................................................... 6 SYSTEM REQUIREMENTS ......................................................................................................................... 6 SPECIFICATIONS CLIENT ...............................................................................................6 CHAPTER 2......................................................................................................................7 DEPLOYING ON IIS ........................................................................................................7 CHAPTER 3....................................................................................................................17 TROUBLESHOOTING & COMMON ERRORS ...................................................................17 1) INPUT OUTPUT PAGE LOAD ERROR .................................................................................................. 17 2) INPUT OUTPUT PAGE CONVERSION ERROR ...................................................................................... 19 3) DOCUMENT LOADS IN LOCALHOST BUT NOT FROM OTHER MACHINE .................................................. 23 4) SAMPLE.DOC IS ONLY LOADING EACH TIME IN VIEWER ..................................................................... 24

Chapter 1

Overview Introduction
Ajax Document Viewer is a web based online document viewer and can embedded into any web page or linked from any page. It is fast and customizable. For most companies, getting software products to market on time, on budget, and with the right features and functionality is always a challenge. But it doesn't have to be.

Ajax Document Viewer lets you easily convert any document (Microsoft Word, or Excel, or PowerPoint document) to an Adobe Flash file (file with SWF extension). This file can be shared with other users who do not have the default viewing applications installed on their machines. These files can also be published over the web and accessed from anywhere in the world. You can view the final converted file with Adobe Flash Player across various platforms and retain the formatting, graphics, fonts, special characters, and colors of source documents, regardless of the application used to create the document.

Chapter 1 Overview Specifications Server

Supported Operation Systems


The operating systems listed here have been tested with AJAX Document Viewer Server and are officially supported: Windows Server 2008 (32 bit) Windows Vista (32 bit) Windows XP Windows 2003 Windows 2000 Red Hat Enterprise Linux 4.6 Red Hat Enterprise Linux 5.1 SUSE Linux Enterprise Server 10 SP1

System Requirements
512 MB RAM (1024 MB for Vista) 450 MB of free disk space Internet Explorer 5+ or Mozilla Firefox 2+ Adobe Flash 9.0 Java SE Runtime Environment (build 1.6.0_05-b13)

Specifications Client
Any JavaScript enabled modern browser with minimum Adobe Flash 9.0 Plugin installed.

Chapter 2

Deploying on IIS

1) Install AJAXDocumentViewer as specified in the Install Guide This document assumes you have installed AJAXDocumentViewer at location C:\AJAXDocumentViewer 2) Create a directory under C drive named Project Directory will look like C:\Project 3) Copy the asp sample code from C:\AJAXDocumentViewer to C:\Project If you are setting up .net code then unzip the files and copy the files into C:\Project

4)

If installing on Windows Server, create a new Application Pool

Chapter 2 Deploying On IIS

5)

Use the default settings for Application Pool

6) Create a new Website or Virtual Directory in IIS and point to C:\Project as shown below. Make sure you give Read & Execute permissions while creating the site.

Chapter 2 Deploying On IIS

Chapter 2 Deploying On IIS

10

Chapter 2 Deploying On IIS

7) Pool

Go to Properties of AJAXDocumentViewer site and assign ADV as Application

11

Chapter 2 Deploying On IIS

8) Make sure that Execute Permissions is set as Scripts and Executables for the created site. 9) Right click on convertdocument.asp (convertdocument.aspx if you are deploying .net code), click on File Security and under Authentication Methods, enter Administrator username and password & click ok. You will be asked to verify the password.

12

Chapter 2 Deploying On IIS

10) Start the AJAXDocumentViewer Website in IIS and right click on index.asp (or index.aspx in .net code) and click on Browse. You should see the Viewer with error below

11) Note the path in browser window. The path to index.asp It should be something like http://localhost/index.asp if you have installed at default 80 port .

13

Chapter 2 Deploying On IIS

12) Go to C:\Project and open settings.xml file in notepad. You will find the xml file as below

<settings> <tempLocationURL>http://localhost/AJAXDocumentViewer/</tempLocationURL> <conversionFileURL>http://localhost/AJAXDocumentViewer/convertdocument.asp</conversionFileURL> </settings>

Update the settings.xml to reflect your environment values Change tempLocation to C:\Project\ Note - tempLocationURL & conversionFileURL should have point to same domain as your index.asp (or index.aspx in .net code) above. If you set up site to run at different port and under different name, then make sure that tempLocationURL & conversionFileURL also reflect the same.
<settings> <tempLocationURL>http://localhost/</tempLocationURL> <conversionFileURL>http://localhost/convertdocument.asp</conversionFileURL> </settings>

13) Open index.asp or index.aspx in an editor or Visual Studio. Update & ensure following variables are correct.
'**Location where document is located. This could be your directory where documents are located or you can dynamically pass it each time** documentLocation = "C:\Project\" Session("documentLocation") = documentLocation '**Location where AJAX Document Viewer was installed. installLocation = "C:\AJAXDocumentViewer\"

14) Go to C:\Project in Explorer Mode now and give Project directory write permissions. You can also Guests user and give it full rights. This is the directory where swf files will be generated and needs write permissions. In production environment, you might want to create a separate temp directory/location to keep swf files.

14

Chapter 2 Deploying On IIS

15

Chapter 2 Deploying On IIS

15)

Browse to index.asp again and you should see the document in viewer.

16

Chapter 3

Troubleshooting & Common Errors

1) Input Output Page Load Error

The above error could occur due to following reasons: a) This could mean your default application pool does not have the permission to execute the convertdocument.asp or convertdocument.aspx. Click on the Application Pool that you created and are using for AJAXDocumentViewer site (ADV in this case) and right click on it to go to properties. Go to Identity and click on option Configurable and enter Administrator username & password.

17

Chapter 3 Troubleshooting & Common Errors

Restart IIS and Recycle the Application Pool and try index.asp again in new browser window. b) Ensure your settings.xml has correct path to the convertdocument.asp or convertdocument.aspx. The conversionFileURL & tempLocationURL path domain should be same as the
domain for index.asp For example: If you are calling index.asp as http://localhost/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://localhost/</tempLocationURL> <conversionFileURL>http://localhost/convertdocument.asp</conversionFileURL> </settings> If you are calling index.asp as http://ajaxdocumentviewer:9090/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://ajaxdocumentviewer:9090/</tempLocationURL> <conversionFileURL>http://ajaxdocumentviewer:9090/convertdocument.asp</conversionFileURL> </settings> If you are calling index.asp as http://servername:9090/project/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://servername:9090/project/</tempLocationURL> <conversionFileURL>http://servername:9090/project/convertdocument.asp</conversionFileURL> </settings>

c) Vista Installation Make sure you are installed as true administrator on Vista OS. Unlike previous versions of Windows, there are differences in Vista between accounts with "computer administrator" privileges and the Administrator account. For instance, the Administrator account does not have User Account Control enabled. You won't find the Administrator account in the User Accounts Control Panel. But the MMC-based Computer Management section of the Administrative Tools Control Panel does give you access to the Administrator account. By default, the account is disabled, but you can enable it there. Your obvious conclusion might be that all you need to do is enable the Administrator account, restart Windows and then log into the Administrator account. But that doesn't work. There's an added step that Microsoft hasn't documented and that isn't all that intuitive: Not only do you have to enable the Administrator account, you also have to disable all other accounts with computer-administrator privileges.

18

Chapter 3 Troubleshooting & Common Errors

2) Input Output Page Conversion Error

The above error document conversion is not happening to swf file. This could happen due to following reasons a) Check AJAXDocumentViewer service is running in Services under Control Panel. Also go to AJAXDocumentViewer\logs or <installLocation>\logs directory and open proxyserver.log file. In it towards end you will see ======================================== INFO | jvm 1 | 2009/03/19 16:49:11 | INFO | jvm 1 | 2009/03/19 16:49:11 | Convert2SWF Proxy Daemon Started INFO | jvm 1 | 2009/03/19 16:49:11 | INFO | jvm 1 | 2009/03/19 16:49:11 | ========================================

If you do not see the above line in log, that means Convert2SWF Proxy service is not fully started. To fix this, go to Services from Control Panel and right click on service to reach Properties. Click on Log On under Properties. By default the service runs under Local System account. If service is not starting under this account, change the account to Administrator user account of the machine and start service.

19

Chapter 3 Troubleshooting & Common Errors

b) Make sure that converdocument.asp or convertdocument.aspx has Administrator user account privileges in IIS.

20

Chapter 3 Troubleshooting & Common Errors

c) Make sure that tempLocation directory (C:\Project in this case) has write permissions to users and IIS User.

21

Chapter 3 Troubleshooting & Common Errors

d) Ensure your settings.xml has correct path to the convertdocument.asp or convertdocument.aspx. The conversionFileURL & tempLocationURL path domain should be same
as the domain for index.asp For example: If you are calling index.asp as http://localhost/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://localhost/</tempLocationURL> <conversionFileURL>http://localhost/convertdocument.asp</conversionFileURL> </settings>

22

Chapter 3 Troubleshooting & Common Errors

If you are calling index.asp as http://ajaxdocumentviewer:9090/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://ajaxdocumentviewer:9090/</tempLocationURL> <conversionFileURL>http://ajaxdocumentviewer:9090/convertdocument.asp</conversionFileURL> </settings> If you are calling index.asp as http://servername:9090/project/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://servername:9090/project/</tempLocationURL> <conversionFileURL>http://servername:9090/project/convertdocument.asp</conversionFileURL> </settings>

3) Document loads in localhost but not from other machine


Ensure your settings.xml has correct path to the convertdocument.asp or convertdocument.aspx. The conversionFileURL & tempLocationURL path domain should be same as the
domain for index.asp For example: If you are calling index.asp as http://localhost/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://localhost/</tempLocationURL> <conversionFileURL>http://localhost/convertdocument.asp</conversionFileURL> </settings> If you are calling index.asp as http://ajaxdocumentviewer:9090/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://ajaxdocumentviewer:9090/</tempLocationURL> <conversionFileURL>http://ajaxdocumentviewer:9090/convertdocument.asp</conversionFileURL> </settings> If you are calling index.asp as http://servername:9090/project/index.asp your settings.xml will look like below <settings> <tempLocationURL>http://servername:9090/project/</tempLocationURL> <conversionFileURL>http://servername:9090/project/convertdocument.asp</conversionFileURL> </settings>

23

Chapter 3 Troubleshooting & Common Errors

4) Sample.doc is only loading each time in Viewer


Go to index.asp or index.aspx and comment line document = "Sample.doc" and uncomment line 'document=request.querystring("document") Now you can give document name through querystring. Note- This assumes your documents are under your specified documentLocation (C:\Project\ in this case). For dynamic location of documents, you can pass the full path in query string or pass it in session variable from calling page.

24

Potrebbero piacerti anche