Phriction Projects Wikis Bioimaging And Optics Platform Image Processing Composing an URL to pre-fill an image.sc forum post History Version 1 vs 2
Version 1 vs 2
Version 1 vs 2
Content Changes
Content Changes
* Why pre-filing information in a URL for a forum post ?
For Fiji or QuPath plugins (or in general, like in a c4science documentation), it can be useful to provide a way for a user to ask for help in the image.sc forum. It can occur that the user ask for help but forgets to put some basic information in its post helpful to solve his issue.
One way to improve this situation is by providing an URL to the image.sc forum populated whith pre-filled information, thus facilitating both the sharing of information as well as its correct tagging in the forum categories.
* Pre-filling a forum post by providing information in the URL
The default link to the image.sc forum is [`https:\\forum.image.sc`](https:\\forum.image.sc).
* Why pre-filing information in a URL for a forum post ?
For Fiji or QuPath plugins (or in general, like in a c4science documentation), it can be useful to provide a way for a user to ask for help in the image.sc forum. It can occur that the user ask for help but forgets to put some basic information in its post helpful to solve his issue.
One way to improve this situation is by providing an URL to the image.sc forum populated whith pre-filled information, thus facilitating both the sharing of information as well as its correct tagging in the forum categories.
* Pre-filling a forum post by providing information in the URL
The default link to the image.sc forum is [https://forum.image.sc/](https://forum.image.sc/).
* Opening an URL within an imageJ/Fiji Command using Scijava
Example source code in the ABBA project : https://github.com/BIOP/ijp-imagetoatlas/blob/master/src/main/java/ch/epfl/biop/atlas/aligner/commands/ABBAForumHelpCommand.java
Code broken down:
- In an ImageJ2 command, one first needs to get a `PlatformService` using a scijava `@Paramater` annotation:
```
@Parameter
PlatformService ps;
```
The String for the URL can be built and opened like this:
```
String nl = "%0D%0A"; // new line code in url GET method
// Image Sc URL
String imageScForumUrl = "https://forum.image.sc/";
// Fill the title
String title = "Help for ABBA in Fiji: [your question here]";
// Fill the body
String body = "[Detail your issue here]"+nl;
body += nl;
body += "---"+nl;
body += nl;
body += "OS and Dependencies Info"+nl;
body +="```"+nl;
body +="OS "+ System.getProperty("os.name")+nl;
body +="ImageJ "+ VersionUtils.getVersion(ImageJ.class)+nl;
body +="IJ "+ VersionUtils.getVersion(IJ.class)+nl;
body +="ABBA "+ VersionUtils.getVersion(ABBALaunch.class)+nl;
... // Add any dependency you would like to get the version to
body +="```"; // End of the post
String fullUrl = imageScForumUrl+"new-topic?"
+"title="+title+"&"
+"body="+body+"&"
+"category=usage-issues&" //
+"tags=myawesomeplugin,fiji"; // Replace with tags relevant for your use case
ps.open(new URL(fullUrl)); // Actually opens the post in the user's default navigator
```
Note the `System.getProperty("os.name")` field which can be used to mention the OS (mac, win, etc.), and the way to gather runtime version number of dependencies: `VersionUtils.getVersion(AClassContainedInThePackage.class)`, where you need to import `
import org.scijava.util.VersionUtils`.
Here's how this is rendered in the navigator when launched by the user:
{F17834424, size=full}
* Why pre-filing information in a URL for a forum post ?
For Fiji or QuPath plugins (or in general, like in a c4science documentation), it can be useful to provide a way for a user to ask for help in the image.sc forum. It can occur that the user ask for help but forgets to put some basic information in its post helpful to solve his issue.
One way to improve this situation is by providing an URL to the image.sc forum populated whith pre-filled information, thus facilitating both the sharing of information as well as its correct tagging in the forum categories.
* Pre-filling a forum post by providing information in the URL
The default link to the image.sc forum is [`https:\\forum.image.sc`](https:\\forum.image.sc).sc forum is [https://forum.image.sc/](https://forum.image.sc/).
* Opening an URL within an imageJ/Fiji Command using Scijava
Example source code in the ABBA project : https://github.com/BIOP/ijp-imagetoatlas/blob/master/src/main/java/ch/epfl/biop/atlas/aligner/commands/ABBAForumHelpCommand.java
Code broken down:
- In an ImageJ2 command, one first needs to get a `PlatformService` using a scijava `@Paramater` annotation:
```
@Parameter
PlatformService ps;
```
The String for the URL can be built and opened like this:
```
String nl = "%0D%0A"; // new line code in url GET method
// Image Sc URL
String imageScForumUrl = "https://forum.image.sc/";
// Fill the title
String title = "Help for ABBA in Fiji: [your question here]";
// Fill the body
String body = "[Detail your issue here]"+nl;
body += nl;
body += "---"+nl;
body += nl;
body += "OS and Dependencies Info"+nl;
body +="```"+nl;
body +="OS "+ System.getProperty("os.name")+nl;
body +="ImageJ "+ VersionUtils.getVersion(ImageJ.class)+nl;
body +="IJ "+ VersionUtils.getVersion(IJ.class)+nl;
body +="ABBA "+ VersionUtils.getVersion(ABBALaunch.class)+nl;
... // Add any dependency you would like to get the version to
body +="```"; // End of the post
String fullUrl = imageScForumUrl+"new-topic?"
+"title="+title+"&"
+"body="+body+"&"
+"category=usage-issues&" //
+"tags=myawesomeplugin,fiji"; // Replace with tags relevant for your use case
ps.open(new URL(fullUrl)); // Actually opens the post in the user's default navigator
```
Note the `System.getProperty("os.name")` field which can be used to mention the OS (mac, win, etc.), and the way to gather runtime version number of dependencies: `VersionUtils.getVersion(AClassContainedInThePackage.class)`, where you need to import `
import org.scijava.util.VersionUtils`.
Here's how this is rendered in the navigator when launched by the user:
{F17834424, size=full}
c4science · Help