(ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook Mark Benzel Principal Software Engineer, R&D [email protected]
Nov 11, 2014
(ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook
Mark BenzelPrincipal Software Engineer, R&D
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.
• Searching capabilities within Symyx Notebook
Demo
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
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
The Development Environment
• Setup an environment to create a custom assembly• These steps are similar to those discussed in (ATS3-DEV02)
Scripting with .NET Assemblies in Symyx Notebook– Create a Visual Studio or #develop project to build a class assembly
• Select a language• Set the target platform to .NET 3.5• Set the target CPU to x86• While debugging, set the build output directory to the bin directory of the
Symyx Notebook installation
• Visual Studio environment for creating a search extension
Demo
The IQueryBuilderGrid Interface
• Implement the methods required by the IQueryBuilderGrid interface
• For use with the search grid, the database fields to select are (in the following order):– VaultObject_obj.SourceRepositoryID– VaultObject_obj.DocumentID– VaultObject_obj.VaultID
• An implementation of the IQueryBuilderGrid interface
Demo
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
• Possible ways to create the Query
Demo
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
Search Extension Configuration
• Modify the SearchExtensionService.SearchExtensions application permission– Add to SearchExtensionTypes to let the SearchExtensionService
know a new search type exists– (Optional) Add a configuration data node using the named as
the “key” supplied in SearchExtensionTypes
• Adding a search extension to the SearchExtensionService.SearchExtensions application permission
Demo
Search Extension Configuration Revisited
• Configuration of the search extension is possible by adding a configuration data node with the name of the node being the same as the “key” supplied in SearchExtensionTypes
• Configuring the search extension
Demo
Publishing the Search Extension
• The possible ways of doing this were presented in (ATS3-DEV02) Scripting with .NET assemblies in Symyx Notebook. Things to keep in mind are:– 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• Use a source control system to maintain old source code versions
• See the Symyx Notebook Developer’s Guide section on “Publishing a Custom .NET Assembly”
• Presented the way in which the search panel in Symyx Notebook 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– Symyx Notebook Developer’s Guide
• Section entitled “Creating a New Search Type”• Section entitled “Publishing a Custom .NET Assembly”
Summary
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.
For more information on the Accelrys Tech Summits and other IT & Developer information, please visit:https://community.accelrys.com/groups/it-dev