(ats4-dev07) how to build a custom search panel for symyx notebook
TRANSCRIPT
![Page 1: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/1.jpg)
(ATS4-DEV07) How to Build a Custom Search Panel for Accelrys
ELN David Pirkle
Principal Software Engineer, R & D
![Page 2: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/2.jpg)
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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/3.jpg)
• Searching capabilities within Accelrys ELN
Demo
![Page 4: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/4.jpg)
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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/5.jpg)
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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/6.jpg)
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
![Page 7: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/7.jpg)
• An implementation of the IQueryBuilderGrid interface
Demo
![Page 8: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/8.jpg)
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)
![Page 9: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/9.jpg)
• Possible ways to create the Query
Demo
![Page 10: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/10.jpg)
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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/11.jpg)
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
![Page 12: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/12.jpg)
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
![Page 13: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/13.jpg)
Search Extension Configuration
![Page 14: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/14.jpg)
Search Extension Configuration
![Page 15: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/15.jpg)
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”
![Page 16: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook](https://reader034.vdocuments.mx/reader034/viewer/2022042701/55a9a81a1a28abcb178b460a/html5/thumbnails/16.jpg)
• 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”
Summary