The Symyx Notebook SDK provides a mechanism to extend the Vault Search system. New search types can be created that plug into the Vault Search drop down list in Notebook Explorer which in turn provides the user with new ways to find the data stored in Vault. As with the standard search types available in Notebook, results returned using the search extension will be displayed in Notebook Explorer and can saved for future use. The generated query can also be saved as a favorite.
This session will demonstrate how to create a new search query panel, generate the query based on user interaction with the panel, register the new search with the Search Extension Service and publish the extension to the Vault server. We will also cover best practices in the development of search extensions.
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
(ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook
1. (ATS4-DEV07) How to Build a
Custom Search Panel for Accelrys
ELN
David Pirkle
Principal Software Engineer, R & D
david.pirkle@accelrys.com
2. The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.
4. Overview of Notebook Searching
• Available searches
– Standard
– Advanced
– Full Text
– Properties
– Chemistry
• These return Vault object types that can be displayed in the accompanying grid:
– Document
– DocumentTemplate
– Form
– Folder
• Queries can be saved for future use
• Custom searches with accompanying user interfaces can be added
5. Developing a Search Extension
• Create the search extension assembly by implementing
the IQueryBuilderGrid interface
• Add information to the
SearchExtensionService.SearchExtensions Application
Permission to let the system know about the new search
type
• When finished with development, publish the assembly
for the new search type to Vault
6. The Development Environment
• Create a Visual Studio project to build a class assembly
– Set the target platform to .NET 3.5
– Set the target CPU to x86
– While debugging, set the build output directory to the ADM
deployment directory
– Sign the assembly
7. Demo
• An implementation of the
IQueryBuilderGrid interface
8. The IQueryBuilderGrid Interface
• Implement the methods required by the IQueryBuilderGrid
interface:
– UserControl returns the search panel UI (use lazy initialization)
– DisplayName returns the text to display in the Name dropdown menu
– IsInputValid validates query before it is executed
– ExecuteQueryRequest allows the UI to trigger a search
– BuildQuery() returns the Query the user has specified
– IsQueryCompatible used to find a panel to load a query
– LoadQuery() loads a saved query into the UI
– Configuration used for admin-supplied configuration (described later)
10. Building the Query
• Query
– Container of information necessary to generate a SQL query to send to Vault
– Includes QueryConditions, QueryClauses and a SQLGenerator
– “select” fields either defined programmatically or generated by the SQLGenerator
• QueryCondition (derived from QueryClause)
– Generates the “from” and “where” portions of a SQL statement using QueryViews, QueryFields and
QueryComparisonOperators
• QueryView and QueryField
– Generates the “from” portion of a SQL statement
– Can be generated and passed into the QueryCondition or the QueryCondition can generate them
using the names of the view and fields
• QueryComparisonOperators
– Used in QueryConditions to generate the “where” portion of the SQL statement
• QueryConditionExtensions
– Simplify the use of QueryConditions
11. SQL Generators
• Derive from the abstract base class QuerySQLGenerator
• VaultContentQuerySQLGenerator - the default
– Retrieves information about a Vault object or the parent of an object
– Retrieved information limited to VaultObject_obj View
– Used by the advanced query builder
• ChemistryQuerySQLGenerator
– Used specifically with the chemistry query builder
• VaultObjectPropertiesQuerySQLGenerator
– Can be used to search any of the Views
• PropertiesQuerySQLGenerator
– Similar to VaultObjectPropertiesQuerySQLGenerator but knows how to separate Quantities into
QueryConditions for both value and unit
– For use with the search grid, the VaultObject_obj fields to select are (in the following order):
SourceRepositoryID, DocumentID, VaultID
12. Search Extension Configuration
• Modify the SearchExtensionService.SearchExtensions
application permission
– Add to SearchExtensionTypes to let the SearchExtensionService
know a new search type exists
– Specify the assembly-qualified name of the search extension
class as the “class”
– (Optional) Add a configuration data node using as the Name the
“key” supplied in SearchExtensionTypes
15. Publishing the Search Extension
• Assemblies are stored in Vault by “fully-qualified assembly name”
– Meaning it includes version information
– Need to change the assembly version numbers before publishing the new
assembly
• Can’t un-publish an assembly
– To “undo” a publish, you need to advance the version number and publish
again
– Also update the version number in the permission configuration
– Use a source control system to maintain old source code versions
• See the Accelrys ELN Developer’s Guide section on “Publishing a
Custom .NET Assembly”
16. Summary
• Presented the way in which the search panel in Accelrys ELN
can be extended
– Create an assembly containing a class that implements the
IQueryBuilderGrid interface
– Configure a new search extension in the
SearchExtensionService.SearchExtensions application permission
– Publish the assembly to Vault
• Resource
– Accelrys ELN Developer’s Guide
• Section entitled “Creating a New Search Type”
• Section entitled “Publishing a Custom .NET Assembly”