[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]

Browser Queries

Concepts

Browser Queries can be used in two ways. Browser Filters are used to reduce the number of displayed items of a browser view. Browser Searches are used to highlight items that are displayed in a browser view.

When a browser query is activated, each item in the browser view will be matched against at least one criterion. A criterion is defined by a column, an operation and a value. That criterion will be applied to each browser item during the query. A criterion is specified in the form of a property list, as follows

    (:column column-keyword :operation operation-keyword :value item-value)
    

where

If more than one criterion is specified, then the query definition must specify how the criteria are to be combined. Two alternatives are provided: either all or any of the criteria must match.

Customization files with the basename "browser_search_and_filter.lsp" are automatically loaded during the startup of Creo Elements/Direct Modeling. The customization files are loaded in the order :sd-corp-site-user.

Creo Elements/Direct Modeling is delivered with a predefined set of search and filter queries (as defined in the file "sd_browser_search_and_filter.lsp" in the directory "personality/sd_customize").

If the predefined queries are modified (via the Search/Filter UI) or if new queries are generated, then they will automatically be stored to the user customization file on exiting Creo Elements/Direct Modeling. That file is named "sd_browser_search_and_filter.lsp" and is located in the user customization directory. That user customization file will be loaded during the restart of Creo Elements/Direct Modeling.

Function Index Top of Page

Browser Filters

SD-CREATE-BROWSER-FILTER  [function]

(sd-create-browser-filter browser-name
                          :name name
                          :title title
                          :criteria criteria
                          :match match
                          :case-sensitive case-sensitive
                          :enable enable-form)
  
Description:
Function to create a new browser filter.

Parameters:
browser-name {STRING} - Name of the browser to which the filter will be applied.
Name of an existing browser, e.g. "parcel-gbrowser".
:name {STRING} - Name of this browser filter.
This name should be a unique filter name for the browser at hand. If the name coincides with an existing filter, then that filter will destroyed and a new filter will be recreated based on the new options. If no name is supplied, then the filter will be given the name "NONAME-FILTER"
:title {STRING} - Title of this browser filter.
This title will be displayed in all places where the browser filter is displayed in the UI (e.g. in a pulldown menu and in the filter UI). If no title is supplied, then the title "unnamed" will be used.
:criteria {LIST of PLISTs} - Query criteria for this filter.
Defines any number of query criteria for this filter. Each criterion is defined as a property list.
((:column column_1 :operation operation_1 :value value_1)
 (:column column_2 :operation operation_2 :value value_2)
   ... 
)
          
:match {KEYWORD [:all]} - Specifies the combined effect if more than one criterion is supplied.
  • :all - a query match for a browser item occurs if all criteria match.
  • :any - a query match for a browser item occurs if at least one of the criteria matches.
:case-sensitive {BOOLEAN [t]} - Specifies whether the value comparisons will be executed in a case sensitive manner or not.
If this option is nil, then upper and lower case characters will be treated as equal.
:enable {BOOLEAN [t]} - Enable condition for this filter.
If the supplied enable condition evaluates to nil then the filter will not available and cannot be selected via the filter pulldown menu or via the filter UI.

Return Value:
t - if successful
nil - if unsuccessful

Example:
(defun my-filter-enabled-p ()
  ;;return value t or nil.
  t)
       
(sd-create-browser-filter
  "parcel-gbrowser"
  :name "MY-FILTER"
  :title "My Filter"
  :case-sensitive nil
  :match :all
  :criteria '((:column :instance-name :operation :equals :value "f*")
              (:column :modifiable :value t))
  :enable '(my-filter-enabled-p))
     

Function Index Top of Page

SD-DELETE-BROWSER-FILTER  [function]

(sd-delete-browser-filter browser-name name)
Description:
Function to delete an existing browser filter uniquely identified by browser-name and name.

Parameters:
browser-name {STRING} - Name of the browser that contains the filter.
name {STRING} - Name of the browser filter to be deleted.

Return Value:
t - success
nil - invalid browser-name or name

Example:
(sd-delete-browser-filter "parcel-gbrowser" "MY-FILTER")
      

Function Index Top of Page

SD-SET-CURRENT-BROWSER-FILTER  [function]

(sd-set-current-browser-filter browser-name name
                               :activate activate
                               :persistent persistent)
  
Description:
This function sets the current filter. The specified filter is displayed in bold letters in the filter pulldown menu. If the filter is activated, then the browser view will refect the action of the filter and display a checkbox in the filter pulldown menu.

Parameters:
browser-name {STRING} - Name of the browser that contains the filter.
name {STRING} - Name of the browser filter that is to be made current.
:activate {BOOLEAN [nil]} - Activate the filter.
If this option is set to t, then the filter will be activated.
:persistent {BOOLEAN [nil]} - Persistently store the filter as current.

Return Value:
t - success
nil - failure occured

Example:
(sd-set-current-browser-filter "parcel-gbrowser" "MY-FILTER"
                               :activate t :persistent t)
    

Function Index Top of Page

Browser Searches

SD-CREATE-BROWSER-SEARCH  [function]

(sd-create-browser-search browser-name
                          :name name
                          :title title
                          :criteria criteria
                          :match match
                          :case-sensitive case-sensitive
                          :enable enable-form)
  
Description:
Function to create a new browser search.

Parameters:
browser-name {STRING} - Name of the browser to which the search will be applied.
Name of an existing browser, e.g. "parcel-gbrowser".
:name {STRING} - Name of this browser search.
This name should be a unique search name for the browser at hand. If the name coincides with an existing search, then that search will destroyed and a new search will be recreated based on the new options. If no name is supplied, then the search will be given the name "NONAME-SEARCH"
:title {STRING} - Title of this browser search.
This title will be displayed in all places where the browser search is displayed in the UI (e.g. in a pulldown menu and in the search UI). If no title is supplied, then the title "unnamed" will be used.
:criteria {LIST of PLISTs} - Query criteria for this search.
Defines any number of query criteria for this search. Each criterion is defined as a property list.
((:column column_1 :operation operation_1 :value value_1)
 (:column column_2 :operation operation_2 :value value_2)
   ... 
)
          
:match {KEYWORD [:all]} - Specifies the combined effect if more than one criterion is supplied.
  • :all - a query match for a browser item occurs if all criteria match.
  • :any - a query match for a browser item occurs if at least one of the criteria matches.
:case-sensitive {BOOLEAN [t]} - Specifies whether the value comparisons will be executed in a case sensitive manner or not.
If this option is nil, then upper and lower case characters will be treated as equal.
:enable {BOOLEAN [t]} - Enable condition for this search.
If the supplied enable condition evaluates to nil then the search will not available and cannot be selected via the search pulldown menu or via the search UI.

Return Value:
t - if successful
nil - if unsuccessful

Example:
(defun my-search-enabled-p ()
  ;; return value t or nil.
  t)
       
(sd-create-browser-search
  "parcel-gbrowser"
  :name "MY-SEARCH"
  :title "My Search"
  :case-sensitive nil
  :match :all
  :criteria '((:column :instance-name :operation :equals :value "f*")
              (:column :modifiable :value t))
  :enable '(my-search-enabled-p))
      

Function Index Top of Page

SD-DELETE-BROWSER-SEARCH  [function]

(sd-delete-browser-search browser-name name)
  
Description:
Function to delete an existing browser search uniquely identified by browser-name and name.

Parameters:
browser-name {STRING} - Name of the browser that contains the search.
name {STRING} - Name of the browser search to be deleted.

Return Value:
t - success
nil - invalid browser-name or name

Example:
(sd-delete-browser-search "parcel-gbrowser" "MY-SEARCH")
      

Function Index Top of Page

SD-SET-CURRENT-BROWSER-SEARCH  [function]

(sd-set-current-browser-search browser-name name
                               :activate activate
                               :persistent persistent)
  
Description:
This function sets the current search. The specified search is displayed in bold letters in the search pulldown menu. If the search is activated, then the browser view will refect the action of the search and display a checkbox in the search pulldown menu.

Parameters:
browser-name {STRING} - Name of the browser that contains the search.
name {STRING} - Name of the browser search that is to be made current.
:activate {BOOLEAN [nil]} - Activate the search.
If this option is set to t, then the search will be activated.
:persistent {BOOLEAN [nil]} - Persistently store the search as current.

Return Value:
t - success
nil - failure occured

Example:
(sd-set-current-browser-search "parcel-gbrowser" "MY-SEARCH"
                               :activate t :persistent t)
    

Function Index Top of Page

Customization File

SD-LOAD-BROWSER-SEARCH-AND-FILTER-CUSTOMIZATION  [function]

(sd-load-browser-search-and-filter-customization basename
                                                 :application application)
  
Description:
This function loads query customization files from the appropriate directories. In contrast to sd-load-customization-file it keeps track of the the sources of the queries in order to properly save user specific queries to the user customization file.

Parameters:
basename {STRING} - Basename of the file to be loaded.
application {STRING ["SolidDesigner"]} - Name of the application.

Return Value:
:user

Example:
(sd-load-browser-search-and-filter-customization "browser_search_and_filter.lsp"
  :application "ModelManager")
    
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2024 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved