Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Typically a widget will save any options that it wants on reloading during a onSaveWidgetOptions call.  Any json object passed to the widget framework on that call will be returned when the widget is loaded via onLoadWidgetOptions in a WidgetSaveObject.  The WidgetSaveObject has 2 interesting fields, userSave and communitySave.  The userSave object is the standard object that was saved during a onSaveWidgetOptions call and should be used for any save options that are unique to an individual user; for example their current zoom level and centerpoint on map widget or the graph type on a statistics widget. 

The communitySave object is used for giving a widget specific saved data for a given community, for example giving an intelligence community KML specific to a region of interest for a map widget or using a certain color scheme specific to business operations for a statistics widget.  The communitySave objects can only be set external to a widget in http://infinite.ikanow.com/fileUploader.jsp  To make a communitySave in the fileUploader just upload a json file with a community selected, any json available to a user when a widgetLoads will be passed into the WidgetSaveObject.communitySave when onLoadWidgetOptions is called from then on.