Server Side Search based Reports

Search and Execute is a new feature available in the Asset Browser (VAB) desktop app that lets super admins execute pre-configured actions on the custom search results. For example, this feature can be used to look for all assets with names matching a certain string and then delete all of them or export them into a file. This feature is not limited by the maximum number of results returned in typical search operations in VAB.

Any pre-packaged or custom script may be chosen to run on the search results. Your custom scripts need be added before-hand to the assigned scripts directory on the Zoom MAM Server. You may use any scripting language to write these scripts if your system is capable of executing scripts in that language. For example, you could use Batch or PowerShell on Windows, Bash on Linux/Mac, or others like Perl or Python.

Now, let us look at Search and Execute in detail:

Generating Server-side Search-based report

Your custom scripts should be placed on the Zoom MAM Server to be available for execution on search results in the Asset Browser. Check the next section, Adding Scripts for Search and Execute, to see where to add these scripts. Once these scripts are in place, follow the steps below to use the Search and Execute feature:

  1. In the Asset Browser, open either a Search or Browse tab.
  2. From the Search options next to the Search box, select Advanced Search.

  3. Now, click on the gear icon  to launch the Advanced Search window.
  4. In the Advanced Search window, hover over any one saved or recent search and click on the Search and Execute icon  to bring up the server-side Search and Execute window.

  5. In the Search and Execute window, select an action to be performed from the Select Server Action drop-down. You could select any custom action such as generate a spreadsheet (CSV or TXT) or run a custom reporting script.

    To list new custom scripts here, check the next section about Adding scripts for Search and Execute.
  6. After selecting a custom script, click Execute. The script is submitted for execution. It is run on the results of the search that was selected to open the Search and Execute window.

  7. The results of the search may be checked in the report folder. The report folder path is set in the Web Management Console. Each script will have a folder for its name inside the report folder. Check the next section about Adding Scripts for more details about the report folder.

  8. Every time the script is run, three files are created as a result. These are:
    1. The report file gives an overview of how the script was run. Information like the user who executed the script, when the script was executed, the repository ID of the Zoom Server on which the script was run and the number of records on which the script was executed is stored.
    2. Find_Report is a text or CSV file that lists the assets on which the script is executed. These are the assets that were returned in the search query on which the script is later run.
    3. Script-Output-Report file gives the output from the script file. For example, if the script fetches metadata for each asset, then this output file will have the metadata for each asset.

Adding scripts for Search and Execute

For custom scripts to be available to the Search and Execute function in the Asset Browser, these have to be added to the default scripts directory set in Zoom. First, find out your assigned scripts and reports directory. Later, copy your scripts to the assigned scripts directory.

  1. Log in to your Web Management Console. Open Server Control Panel from the System node in the Admin Menu sidebar.
  2. Click Search and Execute to open its settings.
  3. Check for the paths under Report Directory and Script Directory. For example, here the script directory path is “/home/linux/zoom/scripts”.
    The report directory path will be needed later on to check the output after running these script files. Each script’s reports are saved in a folder with the name of the script inside the report directory.
  4. Locate the script directory on your Zoom MAM Server.
  5. Copy your custom script files in this directory. Now, these scripts will be listed in the Select Server Action drop-down in the Asset Browser.

Sample Script

Script to get metadata for all assets matching the search criteria

On Unix (getmetadata.sh)

#!/bin/bash
{
      read
      while IFS=, read -r AssetID RepositoryRevision FilePath
             do AssetIDs+=$AssetID,
      done
}  < $1
echo $(zm -s http://127.0.0.1:8880 --username admin --password admin getmetadata --fuids $AssetIDs)

Script /home/linux/zoom/script/getmetadata.sh will be called and /home/linux/zoom/report/getmetadata.sh/File_Result.csv file path will be specified as parameter, which can be obtained using $1
The script will ignore the first row which represents headers (Asset Id, Repository Revision, Path)
Here Server URL is http://127.0.0.1:8880  and Username/password is admin/admin

 Sample CSV file containing search results

Asset Id         Repository Revision       Path
528               15                                    /defproj/sampleFile
492              32                                     /defproj/file2.jpg
494             -1                                      /defproj/file1.jpg

The output of this script will look like this:

 

Asset Metadata:

    AssetID – 528 (RRN – Latest, BranchID – 1)

        1. FIPR_Date Modified : 1507562282297

        2. FIPR_Alpha Channel : false

        3. FIPR_Date Created : 1507562282297

Asset Metadata:

    AssetID – 492 (RRN – Latest, BranchID – 1)

        1. FIPR_Date Modified : 1482085800000

        2. FIPR_Print Size X : 42.89

        3. FIPR_Alpha Channel : false

        4. FIPR_Resolution X : 72.0

        5. FIPR_Image Height : 1744

        6. FIPR_Print Size Y : 24.22

        7. FIPR_Color Depth : 8-bit

        8. FIPR_Image Width : 3088

        9. FIPR_Resolution Y : 72.0

        10. FIPR_Date Created : 1416162600000

        11. FIPR_Application : Windows Phone

        12. CAME_Shutter Speed Value : 7756642/1000000

        13. FIPR_Resolution Unit : inches

        14. CAME_Make : Nokia

        15. CAME_White Balance : 0

        16. CAME_F Number : 18999/10000

        17. CAME_Exposure Time : 4624/1000000

        18. FIPR_Color Space : sRGB

        19. IPTC_Date Created : 1416162600000

        20. CAME_ISO Speed Ratings : 100

        21. CAME_Metering Mode : Average

        22. CAME_Scene Capture Type : Standard

        23. CAME_Exposure Mode : Auto exposure

        24. CAME_Date Time Original : 1416162600000

        25. CAME_Model : Lumia 720

        26. CAME_Aperture Value : 1851998/1000000

        27. CAME_Digital Zoom Ratio : 100/100

Asset Metadata:

    AssetID – 494 (RRN – Latest, BranchID – 1)

        1. FIPR_Date Modified : 1482085800000

        2. FIPR_Print Size X : 42.89

        3. FIPR_Alpha Channel : false

        4. FIPR_Resolution X : 72.0

        5. FIPR_Image Height : 1744

        6. FIPR_Print Size Y : 24.22

        7. FIPR_Color Depth : 8-bit

        8. FIPR_Image Width : 3088

        9. FIPR_Resolution Y : 72.0

        10. FIPR_Date Created : 1416162600000

        11. FIPR_Application : Windows Phone

        12. CAME_Shutter Speed Value : 6969395/1000000

        13. FIPR_Resolution Unit : inches

        14. CAME_Make : Nokia

        15. CAME_White Balance : 0

        16. CAME_F Number : 18999/10000

        17. CAME_Exposure Time : 7980/1000000

        18. FIPR_Color Space : sRGB

        19. IPTC_Date Created : 1416162600000

        20. CAME_ISO Speed Ratings : 100

        21. CAME_Metering Mode : Average

        22. CAME_Scene Capture Type : Standard

        23. CAME_Exposure Mode : Auto exposure

        24. CAME_Date Time Original : 1416162600000

        25. CAME_Model : Lumia 720

        26. CAME_Aperture Value : 1851998/1000000

        27. CAME_Digital Zoom Ratio : 100/100