Top Banner
(ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook Mark Benzel Principal Software Engineer, R&D [email protected]
19

(ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

Nov 11, 2014

Download

Technology

Accelrys

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 provide 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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

(ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

Mark BenzelPrincipal Software Engineer, R&D

[email protected]

Page 2: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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.

Page 3: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• Searching capabilities within Symyx Notebook

Demo

Page 4: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 5: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 6: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 7: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• Visual Studio environment for creating a search extension

Demo

Page 8: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 9: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• An implementation of the IQueryBuilderGrid interface

Demo

Page 10: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 11: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• Possible ways to create the Query

Demo

Page 12: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 13: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 14: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• Adding a search extension to the SearchExtensionService.SearchExtensions application permission

Demo

Page 15: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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

Page 16: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• Configuring the search extension

Demo

Page 17: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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”

Page 18: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

• 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

Page 19: (ATS3-DEV03) How to Build a Custom Search Panel for Symyx Notebook

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