## Setting Up Metadata Service

> **(ArcSDE for SQLServer)**
>
> This document describes the steps to setup up an ArcIMS metadata
> service with ArcSDE for SQLServer and to publish metadata using
> ArcCatalog.
>
> Prerequisites:

ArcIMS 4.0.1, SQLServer 2000, ArcSDE 8.3 are installed properly.

> The main steps to setup Metadata Service are:

1.  Add new users and roles in the ArcIMS authentication. This
    instruction shows how to do it with ACL (access control list) file.
    Please read ArcIMS help (see under ACL and Enabling in the ArcIMS
    help index).

2.  Create a new database and user in SQLServer

3.  Create AXL file for metadata service

4.  Create metadata service

5.  Load metadata using ArcCatalog

# Step 1. Add ArcIMS New Users and Roles

-   **Step 1.1.** Locate the Authenticate.properties file and edit it
    with a text editor. Its default location is

\<ArcIMS installation directory\> ArcIMS\\Connectors\\Java_Connector on
Windows or

> \<ArcIMS installation directory\>/ArcIMS/Middleware/Java_Connector on
> UNIX.
>
> This file has to be in the classpath of your JSP/ Java application.

-   **Step 1.2**. Set the properties as shown below. You can set many of
    these properties by simply removing the comment character (#) before
    them in the Authenticate.properties file. (Note: If you set the
    properties for both XML file-based and JDBC-based ACL, the JDBC
    settings will be used.)

    -   authenticate=True

> Enables authentication within the Java Connector.

-   aclFileName=\<full pathname to the ACL file\>/aimsacl.xml

Typically you'll place the ACL file in the same location as the
Authenticate.properties file. Slashes in the pathname must be forward
slashes (/).

-   **Step 1.3.** Create an XML file using a text editor. This file
    identifies which users will have access to which services. Things to
    keep in mind:

    -   Make sure that you name the file and store it on disk as you
        specified with aclFileName property in the Esrimap_prop file.

    -   Usernames and passwords are case sensitive.

    -   Service names specified in the ACL file should match the case of
        the names in Administrator.

    -   Only those services listed in the ACL file will be available to
        a client, even if you have other services running in
        Administrator.

> The following sample ACL file has one restricted map service, two
> non-restricted services, and a metadata service called MyMeta
>
> \<?xml version=\"1.0\"?\>
>
> \<AIMSACL\>
>
> \<USER name=\"\*\" services=\"SanFrancisco, World\" /\>
>
> \<USER name=\"private\" password=\"pass.word\" services=\"SecretData\"
> /\>
>
> \<USER name=\"mypublic \" password=\"mypublic\" services=\"mymeta\"
> roles=\"metadata_browser\" active=\"1\" /\>
>
> \<USER name=\"mypublish\" password=\"mypublish\" services=\"mymeta\"
> roles=\"metadata_publisher\" active=\"1\" /\>
>
> \<USER name=\"myauthor\" password=\"myauthor\" services=\"mymeta\"
> roles=\"metadata_service_author\" active=\"1\" /\>
>
> \<USER name=\"myadmin\" password=\"myadmin\" services=\"mymeta\"
> roles=\"metadata_administrator\" active=\"1\" /\>
>
> \</AIMSACL\>
>
> The roles for metadata:

-   *metadata_browser* - enables browsing of all public metadata
    documents of a Metadata Service (default if not specified)

-   *metadata_browser_all* - enables browsing of all public and any
    private documents published to the Metadata Service

-   *metadata_publisher* - enables publishing to the service

-   *metadata_service_author* - enables creating metadata for services.
    You apply this parameter to those Feature, Image, and Metadata
    Services that you want to create metadata for. You may then
    subsequently publish this metadata to a Metadata Service.

-   *metadata_administrator* - enables administration of database, i.e.
    ability to reset the metadata tables in the database.

> **Step 1.4.** If you're using Microsoft Windows 2000 or XP and
> Internet Information Server (IIS), you need to configure IIS for
> authentication:

1.  On the taskbar, click Start \| Settings \| Control Panel \|
    Administrative Tools \| Internet Services Manager.

2.  2\. In the left panel, double-click the machine name to expand the
    tree.

3.  Double-click Default Web Site.

4.  If you\'re running ServletExec or JRun as your servlet engine,
    double-click Scripts. If you\'re running Tomcat, double-click
    Jakarta.

5.  In the right panel, right-click ServletExec_ISAPI.dll, jrun.dll or
    isapi_redirect.dll (for ServletExec, JRun, and Tomcat respectively)
    and click Properties.

6.  Click the File Security tab.

7.  Click Edit for Anonymous access and authentication control.

8.  Uncheck both Integrated Windows authentication and Digest
    authentication. Click OK.

> Note: XP users may find Digest authentication turned on, but grayed
> out and unable to be deactivated. In this case, the steps for
> configuring IIS and XP for authentication are available on the ESRI
> Online Support Center. A direct link to the Knowledge Base article was
> not available at time of release.

-   **Step 1.5.** Stop and start the servlet engine. If the servlet
    engine is native to the Web server, stop and start the Web server.
    Stopping and restarting the servlet engine (or Web server ) allows
    your edits to the Authenticate.properties file to take
    effect---enabling authentication.

**Step 2. Create a new database and user in SQLServer**

In the following example, a new database called mymeta and a new user
called metakeeper will be created using SQLServer Enterprise Manager

-   **Step 2.1** Create mymeta database:

    -   Right click on Databases \> New database:

> Name: mymeta
>
> Click Data files tab, assign the data file location and size

Click Transaction log tab, assign the log file location and size

-   Click OK

```{=html}
<!-- -->
```
-   **Step 2.2** Create metakeeper user:

    -   Security \> right click on Logins \> New Login:

> Name: metakeeper
>
> Check on SQL Server Authentication
>
> Enter a new password for metakeeper

-   Click Database Access tab:

> In 'Specify which databases can be accessed by this login', check
> mymeta
>
> In 'Database roles for mymeta', check dbowner
>
> In 'Specify which databases can be accessed by this login', check
> 'sde'

-   Click OK

```{=html}
<!-- -->
```
-   **Step 2.3** Add permission to 'sde' user to access 'mymeta':

    -   Security \> Logins \> double click sde

    -   On the 'SQL Server Login Properties -- sde', click Database
        Access tab:

In 'Specify which databases can be accessed by this login', check mymeta

-   Click OK

```{=html}
<!-- -->
```
-   **Step 2.4** Add permission on 'sde' database for 'metakeeper' user:

    -   Databases \> right click 'sde' \> Properties

    -   On the 'sde Properties', click Permissions tab:

For metakeeper: check 'Create Table', 'Create View', and 'Create SP'

> For sde: check 'Create Table', 'Create View', and 'Create SP'

-   Click OK

```{=html}
<!-- -->
```
-   **Step 2.5** Add permission on 'mymeta' database for 'sde' user:

    -   Databases \> right click 'mymeta' \> Properties

    -   On the 'mymeta Properties', click Permissions tab:

For metakeeper: check 'Create Table', 'Create View', and 'Create SP'

-   Click OK

**Step 3. Create AXL file for metadata service**

-   Copy and paste the following AXL and save it in the same folder for
    other AXL files

-   Change the value for two tags:

    -   SDEWORKSPACE

    -   TABLE_NAME

\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>

\<ARCXML version=\"1.1\"\>

\<CONFIG\>

\<ENVIRONMENT\>

\<LOCALE country=\"US\" language=\"en\" variant=\"\" /\>

\<UIFONT color=\"0,0,0\" name=\"Arial\" size=\"12\" style=\"regular\"
/\>

\</ENVIRONMENT\>

\<METADATA_CONFIG\>

\<!\-- Remove the comments around the ADMIN_TABLE tag if you have an
Admin table. Having an Admin table is optional. \--\>

\<!\--

\<ADMIN_TABLE tablename=\"META_ADMIN\" idcolumn=\"DocUUID\"
filter=\"Approved=\'Y\'\" insert=\"INSERT INTO AdminTable (DocUUID,
Approved) VALUES (\'%s\', \'N\')\"\>

\<RESPONSE_COLUMN columnname=\"Approved\" /\>

\</ADMIN_TABLE\>

\--\>

\<!\-- Edit SDEWORKSPACE to point to the SDE Server.

name - can be any name that uniquely identifies the server to ArcIMS.

server - the name of the server machine that hosts ArcSDE.

instance - the port number for the ArcSDE instance.

database - ArcSDE database name. Specify the name or \"\" if not needed.

user - the database user name.

password - the password for the user name. \--\>

\<WORKSPACES\>

\<SDEWORKSPACE name=\"sde_ws-mymeta\" server=\"a\"
instance=\"port:5152\" database=\"mymeta\" user=\"metakeeper\"
password=\"metakeeper\" /\>

\</WORKSPACES\>

\<!\-- Edit the following METADATA_CONTENT attributes to control how the
service works.

validate - true or false. When true, the service verifies that content
required

by Metadata Explorer is present.

index_words - automatic or manual. When automatic, all documents are
indexed when

published. Setting to manual means you will run the offline indexer.

minwordlength - Sets the minimum word length for indexing. Values can be
1 or

greater, but will typically be less than 4. Any word with lengths
smaller

than this value will not be indexed. For example, with the default
minimum

word length of 3, words of one or two characters will not be indexed.

index_numbers - true or false. When true, all numbers are indexed and
searchable. Setting

this parameter to true can greatly increase your database size because
every unique number

in a document is indexed. In general, you probably want to leave this as
false unless there

is some need you need to be able to search on numbers. \--\>

\<METADATA_CONTENT validate=\"false\" index_words=\"automatic\"
minwordlength=\"3\" index_numbers=\"false\" /\>

\<!\-- Ten RDBMS tables are created to store Metadata. TABLE_NAME allows
you to

specify a table name prefix for these tables. This name should uniquely
identify

the Metadata tables. \--\>

\<TABLE_NAME prefix=\"MYMETA\_\" /\>

\</METADATA_CONFIG\>

\</CONFIG\>

\</ARCXML\>

### Step 4. Create metadata service

In this step, you will create a new metadata service using ArcIMS
administrator:

-   **Step 4.1** From ArcIMS Administrator, add new service:

> Name: mymeta
>
> Map File: \<your metadata AXL file\>
>
> Virtual Server: MetadataServer1
>
> Click OK

-   **Step 4.2** Save configuration and exit from ArcIMS Administrator.

After the service is created, if you go to SQLServer Enterprise Manager,
you will see ten new tables created in mymeta database with table name
prefix MYMETA\_.

### Step 5. Create metadata service

Now you are ready to publish your metadata using ArcCatalog!

-   **Step 5.1** Start ArcCatalog:

    -   Internet Servers \> Add Internet Server:

URL of server:\<url\>

> Check 'Show secure services'
>
> User name: mypublish (or whatever username you have for metadata
> publish role in the ACL file)
>
> Password: \<password\>

Click 'Get List' button

Check 'mymeta' service

Click 'OK'

-   **Step 5.2** Expand 'mymeta' folder

-   **Step 5.3** Drag and drop your metadata (in XML) from its source to
    mymeta

Note: Add another Internet Server connection on ArcCatalog, and connect
as mypublic (or whatever username you have for metadata browse role in
the ACL file)

### 

### Updating your metadata

Notice that a unique document ID is assigned for each document you
publish in the metadata service. This ID should be carried along with
the document whenever you update the document to avoid duplicating of
the same document in the metadata service.

You can use ArcCatalog to update metadata document published in ArcIMS
metadata service, or you can download the XML file using ArcCatalog and
edit the XML using text editor.

### Register your metadata service

The last step is to register you metadata service in GOS. Once your site
is registered, GOS will harvest metadata from your metadata service and
your metadata will be searchable in GOS portal. In the registration, you
will need to provide the URL, service name, and the user name and
password for metadata browse role.

### Further Steps

This document shows you how to setup an ArcIMS metadata service with
basic functionalities. Further steps you may need to enhance these
functionalities:

-   Add the metadata administration function, which will allow you as
    the metadata administrator to approve documents before they are
    published.

-   Use JDBC or integrate with existing user authentication system. This
    document shows you the file-based ACL, which is very basic but maybe
    sufficient for your implementation.

Please consult the ArcIMS help or go to ESRI support Website
([http://support.esri.com](http://support.esri.com/)) for more details.