Layout Server Object Extension and Print Layout Task Install guide with Notes

November 22, 2008

Layout Server Object Extension and Print Layout Task Install guide for a 2 System Setup

via Print Layout Task / Server Object Extension for .NET Web ADF (manual install)

The system I am setting this Extension up on is a 2 machine AGS system as illustrated below:

agssetup

(From http://edndoc.esri.com/arcobjects/9.1/ArcGISServer/HelpPages/Server_typical.gif)

I found this led to some difficulties getting the scripts running and have tried to make notes.  All added notes are in bold. (Original Material from Author markdeaton)

Installing the Layout Server Extension (SOC):

1. Copy LayoutSOE.dll into the machine

2. Register with regasm /codebase /tlb (Details about this at the end of the
doc in the ‘About Registering Assemblies’ section)

3. Add the assembly to the GAC with gacutil /i (Details about this at the end of the
doc in the ‘About Registering Assemblies’ section)

Installing the Layout Server Extension Property Page (Desktop admin):
This machine is where you plan to use ArcCatalog to administer AGS.  It can be any machine with ArcCatalog in stalled, including the webserver or SOM box.

4. Close ArcCatalog on and ArcGIS Desktop machine

5. Make sure ArcGIS Server is up and running.

6. Make sure you are logged as an ArcGIS Server admin (User account used must be in AGSAdmin group on SOM/SOC box).

7. Copy LayoutSOE.dll into the machine

8. Register with regasm /codebase /tlb(Details about this at the end of the
doc in the ‘About Registering Assemblies’ section)

9. Add the assembly to the GAC with gacutil /i (Details about this at the end of the
doc in the ‘About Registering Assemblies’ section)

10. Copy LayoutSOEPropPage.dll into the machine

11. Register with regasm /codebase /tlb (Details about this at the end of the
doc in the ‘About Registering Assemblies’ section)

12. Restart ArcGIS Server. (I stopped and Started via Windows “Services”)

Installing the Print Task (webServer):

1. Copy LayoutSOETask.dll in the webServer.

2. Copy LayoutSOE.dll in the webServer

3. Register both assemblies with regasm /codebase /tlb

4. Add the assembly to the GAC with gacutil /i

5. Run UpdateManager.exe passing true to install and false to uninstall.
UpdateManager will make sure that the print task is recognized by ArcGIS
Manager and that the task will look like any other task in any application
created with Manager (style will match the template you choose).

UpdateManager.exe is run from the cmd prompt:

cmd

In cases where you are not using the default web server directory open the code for the “UpdateManager”.  Look for the following code in “Program.cs”:

namespace UpdateManager
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine(“Must pass true or false”);
Console.WriteLine(“Press any key to continue…”);
Console.ReadLine();
return;
}
Console.WriteLine(“Finding IIS Root Folder…”);
string root = findIISRoot();
if (root == “”)
{
Console.WriteLine(“Error”);
Console.WriteLine(“  Cannot find IIS root folder. Is IIS installed in the machine?”);
Console.WriteLine(“Press any key to continue…”);
Console.ReadLine();

return;            }

Change:

string root = findIISRoot();

To match correct path and rebuild project:

string root = @”f:\inetpub\wwwroot” //findIISRoot();

Replace UpdateManager.exe with rebuilt pjoject

6. Restart IIS.

Getting started:
Open Readme_ArcScripts.doc and follow the Script.  I found that with our current setup, The “Layout SOE” could not be added via AGS Manager.  It could only be added via a custom web application in Visual Studio 2005.

Adding the task to custom web applications (web server):

13. Create a new webApp with Manager and add the mapService that has the
layoutSOE extension enabled. Make sure that the mapService as added via
an AGS Local Connection.

14. Add the ArcGIS Identity to the webApp.

In cases where you cannot change ArcGIS Identity from VS 2005, save the project and change settings on he webserver.  On the webserver go to “Internet Information Services” -> Right Click on your WebApp -> Click “Properties” -> Click on “ASP.Net” tab -> Click on “Edit Configuration”-> Click on “Applications” and Check “Local Impersonation” and add username and password.  User and password need to be members on AGSUsers group on all machaines and have identical passwords.
asp

15. Open default.aspx in design mode with visual studio.

16.Add the task assembly (LayoutSOETask.dll) to the toolbox by right
clicking the toolbox; selecting ‘choose items’ and browsing to the
assembly (LayoutSOETask.dll). The next image shows the LayoutSOETask
once added to the toolbox in Visual Studio.

clipboard03

17. Drag the task from the toolbox into the taskManager (“TaskManager1″) control.

18. Set the Task Results Panel property (a dialog will show up automatically)

clipboard05

clipboard06

19. Push F4 with the LayoutSOETask control selected to open it’s properties.

properties
Make sure that the properties dialog is opened for the LayoutSOETask
control, and not the TaskManager control.

20. In the Properties dialog, go to the ‘resources’ category and set the
MapControlID (the map), then set the resourceName to the service added
in step #2. If this list is empty make sure that you have added an AGS
Map Service with the LayoutSOE capability enabled, AND that this map
service is AGS Local Resource.  I found that in some cases, initially the resource with the Layout SOE enabled under the”MapResourceName” was not avaialble.  To solve this click on “MapControlID” and reselect the map.

clipboard07

21. Also change the visible property of the LayoutSOETask control to false. Otherwise the task will always be visible by default without even opening it. when the application starts.

About Registering Assemblies:
Regasm registration
Go to Start-All Programs- Microsoft .Net Framework 2.0 – SDK Command Prompt
Type: regasm full_path_to_the_assembly /codebase /tlb
For example
Regasm D:\Demos\Layout\LayoutSOE.dll /codebase /tlb
Gacutil registration
Type gacutil /i full_path_to_the_assembly

Note: This document was created by people who have used this utility in the past. If you
have any suggestions-improvements on this document please contact the author so the
document can be updated.  Need a way to contact the Author.


Code Gallery : ArcGIS Server Web ADF for the Microsoft .NET Framework

November 20, 2008

I seem to be having better luck with the manual install.  I can get it running on the SOM with some tweaks to the instructions.  So far I am having no luck with the webserver.  Once I get everything running I will post the edits.

Print Layout Task / Server Object Extension for .NET Web ADF (Windows installer)

This demo adds printing capabilities to the .Net WebADF framework. The custom task allows you to generate high-quality maps from a web browser and export maps to pdf, jpeg, ai, and other formats. Using the task, you can select the configuration of your final map product by selecting from several ArcMap preconfigured layouts; you can also change the content of… Download

Print Layout Task / Server Object Extension for .NET Web ADF (manual install)

This demo adds printing capabilities to the .Net WebADF framework. The custom task allows you to generate high-quality maps from a web browser and export maps to pdf, jpeg, ai, and other formats. Using the task, you can select the configuration of your final map product by selecting from several ArcMap preconfigured layouts; you can also change the content of… Download

via Code Gallery : ArcGIS Server Web ADF for the Microsoft .NET Framework