Пример #1
0
 /**
  * Make a synchronous call to compute the status of the given lookup list. This call will return a
  * JSON status string that contains the list of plugins/features IDs that were found. It's up to
  * the caller to determine it the list contains the requested item (plugin). If it's not in the
  * list, it's not installed.
  *
  * @param lookup Expected an multi-dimensional Object array with rows that contain: plugin-id,
  *     min-version, update-site, feature-id.
  * @return A JSON status for the given plugin(s)
  */
 @ControllerAction
 public Object synchronousComputeInstalledPlugins(final Object lookup) {
   final IConfigurationProcessor processor = getProcessor();
   ConfigurationStatus status = processor.getStatus(new NullProgressMonitor(), lookup, true);
   String jsonStatus = JSON.toString(status);
   return jsonStatus;
 }
Пример #2
0
 /**
  * Returns an immediate JSON notification result regarding the installed plugins.<br>
  * The status of the result can be any of the {@link ConfigurationStatus} status constants.
  *
  * @return An immediate JSON notification result regarding the installed plugins
  */
 @ControllerAction
 public Object getInstalledPlugins() {
   IConfigurationProcessor processor = getProcessor();
   // We rely on the fact that the ConfigurationStatus implements the JSON Convertible interface
   String processorResult = JSON.toString(processor.getStatus(null, null, false));
   // Construct a response which is similar to the notification structure being fired when
   // computeInstalledGems is invoked. This makes the JS side handling easier in both case.
   return BrowserNotifier.toJSONNotification(
       IBrowserNotificationConstants.EVENT,
       IBrowserNotificationConstants.EVENT_TYPE_RESPONSE,
       processorResult);
 }