ARSperl Utilities: WhoUsesIt

## WhoUsesIt

### Purpose

This utility helps you figure out what schemas use a particular filter, active link, menu, etc. It also will tell you what filters call a particular external process or tell you what menus reference a particular file.

This is fairly useful if you come across a file and are unsure whether or not a filter or menu depends on it.

### Author

Jeff Murphy
jcmurphy@arsperl.org

### Usage

     USAGE
       WhoUsesIt.pl [-v] [-h] [-s schema] [-a | -f | -m | -e | -p | -M [name]]
                    [username] [password]

     DESCRIPTION
       Search all schemas and determine who uses the specified active link,
       filter, menu or escalation.

       -a   list all schemas that use this active link
       -f   .. this filter
       -m   .. this menu
       -e   .. this escalation
       -M   list all menus that use this file
       -p   list all filters that call this process
       -s   specify a specific schema to search
       -v   verbose output
       -h   get help on usage

### Examples

First we'll see who is calling a particular external process. This is a substring match, so the file name of the process need only contain the characters "mail_ip" to match.

    % ./WhoUsesIt.pl -p mail_ip
    Username: jcmurphy
    Password:
    Searching for filters that call "mail_ip"...
            PT-Mail IP List
            SM-Mail IP List
            TS-PTA-Mail_IP_List
            TS-PTA-Mail_IP_List-OLD

If we use the `-v` flag, we can see exactly where the external program is located.

    % ./WhoUsesIt.pl -p mail_ip -v
    Username: jcmurphy
    Password:
    Searching for filters that call "mail_ip"...
            PT-Mail IP List
                    /usr/ars/c/PT/pt_mail_ip_list.pl "$536870913$" "$1$"
            SM-Mail IP List
                    /usr/ars/c/SM/sm_mail_ip_list "$1$" "$-1$"
            TS-PTA-Mail_IP_List
                    /usr/ars/c/ts_mail_ip_list.pl "$536870913$" "$-1$" "$1$" 2>&1
            TS-PTA-Mail_IP_List-OLD
                    /usr/ars/c/ts_mail_ip_list "$536870913$" "$-1$" "$1$"

Now we can track down what schema uses the particular filter without going into the ARAdmin tool.

    % ./WhoUsesIt.pl -f "PT-Mail IP List"
    Username: jcmurphy
    Password:
    Searching for Filter "PT-Mail IP List" in Schema ".*" ...
            PT-Appends
                    PT-Mail IP List

Next, we can see all the filters that the schema uses.

    % ./WhoUsesIt.pl -s "PT-Appends" -f .\*
    Username: jcmurphy
    Password:
    Searching for Filter ".*" in Schema "PT-Appends" ...
            PT-Appends
                    PT-Mail IP List
                    PT-Appends-SetSubNTime
                    PT-Appends-BadPNum
            TS-PT-Appends
                    TS-PTA-BadItemNo
                    TS-PTA-Mail_IP_List-OLD
                    TS-PTA-SetViewers
                    TS-PTA-ChangeAppender
                    TS-PTA-BadAssignee
                    TS-PTA-Mail_to_IP_Flag-1
                    TS-PTA-Entity-Code-2
                    TS-PTA-ActionDate
                    TS-PTA-Entity-Code-1
                    TS-PTA-Mail_IP_List

arsperl@arsperl.org