Sharing custom filters using FilterParams import/export

@kku has just posted FilterParams 1.2.7 to the Isotammi Add-ons curated collection.

He has refined the Import/Export. It has been tested with XML with <filters> chunks. Designed to exchange the current Custom Filter with any referenced multistage Filters. It works both with and without an XML header. So it can also import an entire custom_filters.xml file.

The example custom filter in the wiki docs for FilterParams has a 3-stage custom filter. It finds People who have Events enclosed by a particular Place.

<filters>

  <object type="Person">
    <filter name="Some Event in place X" function="and" comment="People filter : who have the events">
      <rule class="MatchesEventFilter" use_regex="False" use_case="False">
        <arg value="Event in place x"/>
      </rule>
    </filter>
  </object>

  <object type="Event">
    <filter name="Event in place x" function="and" comment="Event filter : occurred in a place">
      <rule class="MatchesPlaceFilter" use_regex="False" use_case="False">
        <arg value="In place x"/>
      </rule>
    </filter>
  </object>

  <object type="Place">
    <filter name="In place x" function="and" comment="Place filter : enclosed by a place">
      <rule class="IsEnclosedBy" use_regex="False" use_case="False">
        <arg value="P0450"/>
        <arg value="0"/>
      </rule>
    </filter>
  </object>

</filters>

Try using the copy icon at the top-right of the listing (above) to clipboard those 3 Custom Filters. Then, with the People view active, open FilterParams 1.2.7 and click the Import button. The clipboarded XML will be in the text box. Click the new Import button in that dialog.

A dialog will appear that confirms 3 filters were imported and the dialog will switch to the new filter added in the current category.


If custom filters with the target names exist, an overwrite confirmation dialog will appear. If you want duplicates, you can go back to the clipboard text and edit the <filter name=""> to something unique.

Before doing a Test run of the new filter, select a Place. The default Place ID is P0450 and you may not have such an ID in your Place list.

1 Like