(ats4-dev07) how to build a custom search panel for symyx notebook

16
(ATS4-DEV07) How to Build a Custom Search Panel for Accelrys ELN David Pirkle Principal Software Engineer, R & D [email protected]

Upload: biovia

Post on 18-Jul-2015

176 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook

(ATS4-DEV07) How to Build a Custom Search Panel for Accelrys

ELN David Pirkle

Principal Software Engineer, R & D

[email protected]

Page 2: (ATS4-DEV07) 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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook

• Searching capabilities within Accelrys ELN

Demo

Page 4: (ATS4-DEV07) 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: (ATS4-DEV07) 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: (ATS4-DEV07) How to Build a Custom Search Panel for Symyx Notebook

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

• An implementation of the IQueryBuilderGrid interface

Demo

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

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

• Possible ways to create the Query

Demo

Page 10: (ATS4-DEV07) 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: (ATS4-DEV07) 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 – 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

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

Search Extension Configuration

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

Search Extension Configuration

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

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

• 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