Configuring a FORMAT MAGNIFY Procedure

How to:

This section describes how to configure a FORMAT MAGNIFY procedure.


Top of page

x
Procedure: How to Configure a FORMAT MAGNIFY Procedure

To configure a FORMAT MAGNIFY procedure:

  1. Open WebFOCUS Developer Studio.
  2. Create a new project called filemonitor.

    You can also navigate to Data Servers, EDASERVE, Applications, and select filemonitor, which was created in Defining a New Application Directory.

  3. Create a new procedure called magnify_file_indexing using the Procedure Viewer.
  4. Add a DEFINE object to the procedure.
  5. Select the fileindexing.mas Master File.
  6. Add the defined fields for paths as listed in the following table:

    The following table illustrates switching a DOS path for a URL path.

    Field

    Format

    Value

    ROOT_DOS_PATH

    A15

    ‘C:\ibi\apps\’

    ROOT_WEB_PATH

    A15

    '/approot/'

    DOS_PATH_LEN

    I6

    ARGLEN(15, ROOT_DOS_PATH, 'I6')

    WEB_PATH_LEN

    I6

    ARGLEN(15, ROOT_WEB_PATH, 'I6')

    TEMPWEBPATH

    A4000V

    STRREP(4000,FILEFNAME,DOS_PATH_LEN,
    ROOT_DOS_PATH,WEB_PATH_LEN,ROOT_WEB_PATH,
    4000,'A4000')

    FILEWEBPATHRELATIVE

    A4000V

    STRREP(4000,TEMPWEBPATH,1,'\',1,'/',4000,
    'A4000')

    FILEWEBPATHABSOLUTE

    A5000V

    STRREP(4000,TEMPWEBPATH,1,'\',1,'/',4000,
    'A4000')

    PARENTFOLDER

    A4000V

    GETTOK(FILEFNAME,4000,-2,'\',1000,'A1000')

    FILENAMEEXT

    A4000V

    GETTOK(FILEFNAME,4000,-1,'\',1000,'A1000')

    FILENAME

    A4000V

    GETTOK(FILENAMEEXT,4000,1,'.',1000,'A1000')

    Note:

    • Use the file path to retrieve the HTTP path.
    • Retrieve additional information from the file name.

     

  7. Add the defined fields to generate file metadata as listed in the following table:

    Field

    Format

    Value

    MAGNIFYACTION

    A25

    DECODE FILEMONST( 'DELETED'      'delete'
           'MODIFIED'     'add'
           'ADDED'        'add'
           'RENAMED NEW'  'add'
           'RENAMED OLD'  'delete'
           ''     'add' ELSE 'add')

    FILESIZERANGE

    A50

    IF FILESIZE LT 551200 THEN '1. 1 KB - 500 KB'
    ELSE IF FILESIZE LT 1102400 THEN '2. 501 KB - 1 MB'
    ELSE IF FILESIZE LT 10485760 THEN '3. 1 MB - 10 MB'
    ELSE IF FILESIZE LT 104857600 THEN '4. 10 MB - 100 MB'
    ELSE IF FILESIZE LT 1073741824 THEN '5. 100 MB - 1 GB'
    ELSE '6. 1 GB or higher'

    FILEFORMAT

    A56

    DECODE FILEEXTN( 'ppt'  'MS PowerPoint 97-2003/2010'
    'pptx' 'MS PowerPoint 97-2003/2010'
    'xls'  'MS Excel 97-2003/2010'
    'xlsx' 'MS Excel 97-2003/2010'
    'doc'  'MS Word 97-2003/2010'
    'docx' 'MS Word 97-2003/2010'
    'pdf'  'Portable Document Format'
    'odt'  'Open Office Writer'
    'mas'  'WebFOCUS Master File'
    'sql'  'SQL Queries'
    'zip'  'Archive'
    'txt'  'Text File'
    'jpg'  'Image' ELSE 'Unknown')
  8. Add the defined fields to generate search result metadata as listed in the following table:

    Field

    Format

    Value

    SYSSOURCE

    A25

    'File Repository'

    SEARCHTITLE

    A2000

    '<b>File: ' | FILENAME | '(' || FILEEXTN || ')</b><br>DOS Path: ' | FILEFNAME

    SEARCHTITLETEMP

    A2000

    'File: ' | FILENAME | '(' || FILEEXTN || ') DOS Path: ' | FILEFNAME

    TITLE_URL

    A4000

    FILEWEBPATHRELATIVE

    MAGNIFY_ACTUAL_MAGNIFY_DATE

    A25

    'datetime'

    MAGNIFY_USAGE_MAGNIFY_DATE

    A25

    'dd/MM/yyyy'

    MAGNIFY_ACTION_FILE_BODY

    A5000

    SYSSOURCE | ' ' | FILEFNAME | ' ' | FILEEXT | ' ' | FILEFORMAT | ' ' | SEARCHTITLETEMP

    MAGNIFY_ACTION_FILE_PROPERTY_FIELD

    A255V

    'Subject,Author,Category,Keywords'

    MAGNIFY_ACTION_FILE_PROPERTY_TITLE

    A255V

    'Subject,Author,Category,Key Terms'

    MAGNIFY_ACTION_FILE_PROPERTY_BODY

    A255V

    'Title,Subject,Author,Category,Keywords'
  9. Save and close the DEFINE object for the procedure.
  10. Add a REPORT object to the procedure.
  11. Select the fileindexing.mas Master File.
  12. Add the fields and set the column titles as listed in the following table:

    Note: The column titles are case-sensitive.

    Field

    Column Title

    FILEWEBPATHABSOLUTE

    MagnifyBaseURL

    MAGNIFYACTION

    MagnifyAction

    SEARCHTITLE

    SearchTitle

    FILEWEBPATHABSOLUTE

    MagnifyID

    FILEWEBPATHABSOLUTE

    WF_INDEX_UNIQUE_KEY

    SYSSOURCE

    C1_Source_System

    PARENTFOLDER

    C2_Parent_Directory

    FILEFORMAT

    C3_File_Format

    FILESIZERANGE

    C4_File_Size_Ranges

    TITLE_URL

    FILEDATE

    MAGNIFY_DATE

    MAGNIFY_ACTUAL_MAGNIFY_DATE

     

    MAGNIFY_USAGE_MAGNIFY_DATE

     

    MAGNIFY_ACTION_FILE_PROPERTY_FIELD

     

    MAGNIFY_ACTION_FILE_PROPERTY_TITLE

     

    MAGNIFY_ACTION_FILE_PROPERTY_BODY

     

    MAGNIFY_ACTION_FILE_BODY

     

    MAGNIFY_ACTION_FILE_BODY

     

    The following column titles are always required:

    • MagnifyBaseURL - used by Magnify to find the file for indexing
    • SearchTitle
    • MagnifyID
    • WF_INDEX_UNIQUE_KEY

    MagnifyAction, Categories, and Magnify Meta Tags are always recommended.

  13. Save and close the REPORT object for the procedure.
  14. Set the Magnify Engine statements. Before the DEFINE object, add the ENGINE objects as listed in the following table.

    Connection

    SET Parameters

    MY_PC 'http://localhost:8080/ibi_apps/saxfeed'

    Note: Sample or default URLs are for informational purposes only and may not resolve correctly, if at all.

    -- no connection --

    BASEURL=http://localhost:8080/ibi_apps/WFServlet

    -- no connection --

    DATASOURCE=file_index

    -- no connection --

    MIME=application/openurl

    -- no connection --

    BATCHSIZE=10

    Note:

    • Connection Setting, BASEURL, and DATASOURCE are required.
    • BATCHSIZE is always recommended.
    • MIME is required for file indexing.

  15. After the ENGINE objects, add a SET object.
    • Used settings: ASNAMES
    • Current value: MIXED
  16. Save the SET object for the procedure.
  17. Open the REPORT object and change the format type.
    1. Click Options.
    2. Select Output Format.
    3. Expand Unstyled Formats.
    4. Select Format Magnify (MAGNIFY).
    5. Click Apply and then OK.
  18. Save and close the procedure.
  19. Run the procedure and confirm that there are no errors.

  20. Review the search-based application.


WebFOCUS