ID: 8486

Print Friendly, PDF & Email

Server Side Search based Reports

Search and Execute is a new feature available in the Visual Asset Browser (VAB) desktop app that lets the admins perform search operations, and also execute pre-configured actions on the search results. For example, this would let us look for all assets matching a certain name and then delete all of them or export them as a spreadsheet. This feature is not limited by the maximum number of results returned in typical search operations in VAB.

A custom script may be chosen to execute on the search results. These custom scripts should be added to the assigned scripts directory in Zoom. 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 other scripting languages like Perl or Python.

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

The custom scripts should be placed in Zoom to be available for execution on search results in the Visual Asset Browser. Check the next section, Adding Scripts for Search and Execute, to check 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 Visual Asset Browser, open either a Search or Browse tab.
  2. In the Search options, 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 should select any custom action such as generate a spreadsheet (CSV or TAB) 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 Admin Console. Check the section Adding Scripts for more details about finding out the report folder. Each script will have a folder for its name inside the report folder.

  8. Everytime the script is run, three files are created as a result. These are:
    1. 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.

 

For custom scripts to be available to the Search and Execute function in the Visual 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. Login 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.
  4. Locate the script directory on your Zoom MAM Server.
  5. Copy your custom script files in this directory. These scripts will now be listed in the Select Server Action drop-down in the Visual Asset Browser.

 

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