Your SlideShare is downloading. ×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

(ATS6-DEV07) Building widgets for ELN home page

274

Published on

From a developer’s perspective, the Accelrys ELN Home Page is a container of widgets. It manages the layout of widgets, and handles the persistence of their settings. Several widgets are provided …

From a developer’s perspective, the Accelrys ELN Home Page is a container of widgets. It manages the layout of widgets, and handles the persistence of their settings. Several widgets are provided with the application: one for creating new experiments, another for tracking work in progress, and an inbox widget for messages sent through the notebook. This out-of-the-box set can be supplemented by building custom widgets.

This session will show several custom widgets examples to demonstrate the basic concepts of widget development and the API they implement. We will also discuss best practices, and how to make your widget a good citizen of the Home Page.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
274
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. (ATS6-DEV07) Building Widgets forthe Accelrys ELN Home PageBill BuoteCTO ADQMADQM Business UnitBill.Buote@accelrys.com
  • 2. • The information on the roadmap and future softwaredevelopment efforts are intended to outline generalproduct direction and should not be relied on in making apurchasing decision.
  • 3. Home Page• The Home Page is a container of widgets• Handles widget layout and persistence of widget settings
  • 4. Home Page
  • 5. Demo• A quick overview of the home page and out-of-the-boxwidgets
  • 6. HomePageWidget• To start developing a custom widget, extendHomePageWidget (Widget SDK)• Subclass is responsible for returning factory classes thatcreate:– widget view– widget settings view• Subclass must also manage widget settings
  • 7. • Primary Namespaces– Symyx.Notebook.HomePage– Symyx.Notebook.Applications.HomePage• New widget– Main class derives from• Symyx.Notebook.Applications.HomePage.HomePageWidget– View class derives from• Symyx.Notebook.HomePage.UserControlWidgetView– Factory class derives from• Symyx.Notebook.HomePage.WidgetViewBuilder– Custom configuration? Derive from• Symyx.Notebook.HomePage.UserControlConfigurationView• Symyx.Notebook.HomePage.ConfigurationViewBuilder– Custom configuration storage• Symyx.Notebook.HomePage.Widget.WidgetMementoWidget Development
  • 8. Demo• First example: RSS Feed Widget– Display
  • 9. RSS Feed Widget
  • 10. Widget View• The widget view is the user control that appears on thehome page• Create your view by extending UserControlWidgetView
  • 11. Publishing a Widget• See the sample code in the PublishWidgetToVault project• Command line utility takes 6 parameters:– Server– Username– Password– Vault path of widget folder– Widget title– Assembly-qualified name of the main widget class
  • 12. Refreshing the Widget View• View may need to periodically refresh (ex., inbox widget)• Manual refresh supported by refresh button in widgettitle bar• Refresh button triggers call to RefreshView• If you want auto-refresh, your view must handle this• Use ShowBusySpinner and HideBusySpinner while view isupdating
  • 13. Widget View• Use DisplayMessage for messages such as errors• Override Dispose to dispose of resources
  • 14. Demo• Second example: RSS Feed Widget– Settings
  • 15. RSS Feed Widget
  • 16. Adding Widget Settings - Overview• Extend WidgetMemento to persist settings• Extend UserControlConfigurationView for settings UI• Extend ConfigurationViewBuilder as a factory for thesettings UI• Modify the widget view to respond to settings
  • 17. Settings Persistence• Extend Widget.WidgetMemento• Implement properties for settings in the memento• Add serialization decorators (DataContract and DataMember)• Use your memento in the main widget class by overridingSaveToMemento and RestoreFromMemento• Implement properties for settings in the main widget• Also override ResetDefaultValues so the Reset button worksOK
  • 18. Settings UI• Extend UserControlConfigurationView• Override OnWidgetSet or use Widget property to access themain widget and its state• Override SetConfigurationView, and update the UI based onthe state of the main widget• Add event handlers to set the state of the main widget as UI ismanipulated• Widget view subscribes to ConfigurationChanged event of themain widget in its override of OnWidgetSet
  • 19. ConfigurationViewBuilder• ConfigurationViewBuilder is a factory that creates thesettings UI• Extend ConfigurationViewBuilder, overridingCreateConfigurationView and CreateConfigurationView• Override ConfigurationViewBuilders in the main widgetto return this new class
  • 20. Demo• Third example: Structure Search Widget
  • 21. Structure Search Widget
  • 22. Widgets that Search• Work in Progress widget is an example of a widget that presentssearch results• Extend QueryWidget to implement the main widget class for aquery-based widget• QueryWidgetViewBuilder can be used as is to create widget viewsthat execute a query and present the results in a grid• Auto-refresh also handled for you• Extend QueryWidgetConfigurationView to implement the settingsUI• The configuration view sets the main widget’s Query property,when the settings UI is changed
  • 23. Demo• Fourth example: Pipeline Pilot Protocol Widget
  • 24. Pipeline Protocol Widget
  • 25. ProtocolWidget• ProtocolWidget can be configured to run a Pipeline Pilotprotocol that produces HTML• Views the result in the WebBrowser control• Modify the PipelinePilot | RunProtocol application permissionto add a new configuration key that specifies the location inthe protocol tree where you will publish widget protocols– Name: WidgetProtocolRoot– Value: Protocols/Web Services/Accelrys/Notebook Widgets• If you need to pass parameters to a protocol, override theGenerateProtocolParameters method
  • 26. Performance Considerations• Performance and memory profiling are critical• Widgets that refresh periodically can have a significant negativeimpact on performance• Consider adding random amount to refresh interval to avoidsimultaneous refreshes (QueryWidgetView will handle this for you)• Notebook has 2 connections to Vault, so Widgets that refresh andtalk to Vault have the biggest potential to degrade systemperformance• QueryWidgetView handles connection limitation for you(VaultObjectGrid.GridLoader set to aKeyedAsynchronousGridLoadStrategy that uses "share" as a key)
  • 27. Summary• Learned how to build custom widgets– Extend base classes in Symyx.Notebook.Applications.HomePageand Symyx.Notebook.HomePage– QueryWidget base classes can be extended for widgets thatsearch– Performance and memory considerations• Sample widgets and documentation in the Notebook SDK
  • 28. 28Thank you.Accelrys, Inc.9 Industrial RoadMilford, MA 01757

×