WebDrawer 8.3 fileTypes question

Hello!  I have searched every place I could think of, but have not found an answer to this question.  In the hptrim.config file for WebDrawer 8.3, there is a <fileTypes> node listing various file extensions.  What is its purpose?

On a related note, if I wanted to exclude a particular file type from search results, is there a reasonable way to do that?

Thanks!

--Carol

 

  • Verified Answer

    fileTypes might not be named as well as it could be.  The ServiceAPI (upon which WebDrawer is built) allows certain file types t be loaded from the file system, for example CSS (stylesheet) files.  fileType allows you to add to this list of file types that may be loaded from the file system.  In the case of WebDrawer there are font files which are not a part of the default set but which we want to allow.

     

    And yes, there is a reasonable way to exclude a particular file type.  In hptrim.config you will find the routeDefaults, these define defaults for requests.  You will need toadd a filter atrribute to two of these routes.

    Add a filter to the one with the model 'Records'.  This filters the quick search and the standard form search.

     

    <add
        name="Record"
        model="Records"
        template="WDRecordList"
        filter="not extension:doc"
        properties="RecordRecordType,RecordExtension,RecordTitle,RecordNumber,RecordIsElectronic"
    />

     

     

    Also add a filter to the FormSearch route.  This covers searches done usig any search forms you might have defined.

     

        <add
          name="FormSearch"
          model="FormSearch"
          filter="not extension:doc"
          properties="RecordRecordType,RecordExtension,RecordTitle,RecordNumber,RecordIsElectronic"
        />

     

    Lastly, for eelgance you may choose not to code the filter string directly into the config but instead to create a saved search and filter using that.  In this example I have a saved search named 'NotDocuments' to filter out .Doc files.

        <add
          name="Record"
          model="Records"
          template="WDRecordList"
          filter="saved:NotDocuments"
          properties="RecordRecordType,RecordExtension,RecordTitle,RecordNumber,RecordIsElectronic"
        />

    Lastly, I have a range of posts on my blog about potential WebDrawer customisation, not sure if I mention this one there buth there are others that might be of interest.

     

  • Perfect, David! Thanks for the thorough answer.  And, I agree that your blog entries are very helpful in the area of webDrawer customization and other things.  I have just about memorized the webDrawer posts, having read them all multiple times.  It is great information, so thank you for that as well!  (There is no mention of this particular "filter" technique there, though.  Since you've gone to all of the trouble to write this up, you should copy / paste it into a new blog entry. )

     

  • If you have a moment sometime and your WebDrawer site is not top secret could I review it?  I like to showcase customised WebDrawer sites in an effort to encourage others.

     

    thanks,

     

    David