Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Tip of the Day/Extending/JSonTipProvider"

(Examples)
(Examples)
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
=== Examples===
 
=== Examples===
* [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.examples/src/org/eclipse/tips/examples/json/JsonTipProviderPhoton.java JSON Tip Provider]  
+
This provider consumes a json file that is stored in its own package. It contains the provider information and an array of tips with embedded html and images.
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.examples/src/org/eclipse/tips/examples/json/provider.json JSon file with the information] [[Tip of the Day/Extending/JSonTipProvider/Schema|(Schema)]]
+
* [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider Link to the project folder]
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.examples/src/org/eclipse/tips/examples/json/JsonTipProviderPhoton.java The JSON Tip Provider]  
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.examples/src/org/eclipse/tips/examples/json/provider.json The Json file with the information] [[Tip of the Day/Extending/JSonTipProvider/Schema|(The Json schema)]]
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.examples/plugin.xml#n22 The extension point]
 +
 
 +
 
 +
This provider also consumes a json file with provider information and an array of tips, but in this case, each tips points to a html page on the internet. Also notice the use of a variable to point to a base url. This can be used for local testing purposes.
 +
* [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider Location of the provider. TwitterTipProvider and twittertips.json are the used files]
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/TwitterTipProvider.java The JSON Tip Provider]
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.ide/src/org/eclipse/tips/ide/internal/provider/twittertips.json The Json file with the information] [[Tip of the Day/Extending/JSonTipProvider/Schema|(The Json schema)]]
 +
** [http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/tips/org.eclipse.jdt.tips.user/content The actual content the tips point to (mirrors may be used here)]
 +
** [https://git.eclipse.org/c/platform/eclipse.platform.ua.git/tree/org.eclipse.tips.ide/plugin.xml#n189 The extension point]

Latest revision as of 07:50, 3 June 2018

JSon Tip Provider

A JSon Tip provider requires a JSon file with information. The TipProvider implementation can be very simple. An accompanying JSon file is dynamically fetched from the internet or it is statically included with your bundle.

In case you pull it from the internet, make sure that you do not waste bandwidth by pulling a file that you already have (use the HTTP HEAD function).

Examples

This provider consumes a json file that is stored in its own package. It contains the provider information and an array of tips with embedded html and images.


This provider also consumes a json file with provider information and an array of tips, but in this case, each tips points to a html page on the internet. Also notice the use of a variable to point to a base url. This can be used for local testing purposes.

Back to the top