I cannot edit http files or use the http client on IntelliJ, how can I resolve this? - intellij-idea

I am trying to learn Spring Boot and as part of this I need to send http requests to test the functionality of the API I have created.
When following along with this video, the teacher had an 'actions for URL' selection which I do not see in my own editor. Note that the point in the video I linked shows this.
After updating (to IDEA 2021.1) and restarting I still could not see this option.
I tried to create my own .http file, but am not able to work with this type of file.
After more research I found that I should have a plugin called 'http client' installed by default. I cannot find this in my installed plugins or by searching through the marketplace.
When downloading and installing manually (from here), I now get this error which I cannot resolve.
Please can someone give me a pointer to get this plugin working.

I assume you're using the Community Edition, so it probably doesn't have it since according to the JetBrains blog, HTTP Client is built-in on the Ultimate Edition.
You can also check the zip file for the plugin here.

Related

Tracking method for QGIS Plugin Usage

I have a QGIS3 python plugin that I would like to track its users' usage. Is it possible to add a http request to the headers? How can I do it?
The biggest obstacle is that an http request package should be installed (like requests). This easy to do in the osgeo4w shell for a particular installation of QGIS, but it can't be done from within a plugin (as far as I can tell).
However, there's nothing to stop you from inserting requests.post(path,headers,data) into your plugin script files.

Is there any API to automate extension installation in XWiki?

I use xwiki Enterprise 7.4. The official way to install extensions is to use either Import feature or Extension Manager. Both ways require user interaction. I would like to automate extension installation process, so no user interactions for extension installation. Is it possible? I've automated spaces/pages creation via REST API. Maybe it's possible to use REST API to do it, I can't find it in documentation.
Why do I need it? It's simple: I've automated all the steps of deployment/migration process for my application and I would like to automate xwiki extension installation too.
As indicated by Vincent, you can use the extension script service from inside XWiki. This script service is what the UI is using so everything the UI is doing can be done also by any script (as long as the script author has proper rights).
I just wrote a Velocity example on http://extensions.xwiki.org/xwiki/bin/view/Extension/Extension+Script+Module#HNon-interactiveandsynchronousinstall:
{{velocity}}
## Create install request for extension with id org.xwiki.contrib:extension-tweak and version 1.3 on current wiki
#set($installRequest = $services.extension.createInstallRequest('org.xwiki.contrib:extension-tweak', '1.3', "wiki:${xcontext.database}"))
## Disable interactive mode
$installRequest.setInteractive(false)
## Start install
#set($installJob = $services.extension.install($installRequest))
## Wait until install is done
$installJob.join()
{{/velocity}}
All you need is to put the Thomas' script in a page. You can use the REST API for that. See: http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HPageresources
Then you call the URL from your application.
Ex: you put the code in XWiki/AutoInstall with a REST call and then you can call this page with the following url:
http://localhost:8080/xwiki/bin/get/XWiki/AutoInstall
I suggest to use the "get" action from the URL to avoid unnecessary informations.
The XWiki Core dev team is aware of this and it's in the roadmap but it's not done yet. For example you can see that it was planned for the 8.0 roadmap but it slipped (http://www.xwiki.org/xwiki/bin/view/Roadmaps/Archives8xCycle/).
Continue improving upgrade tools: Scriptable upgrades (priority 1), Simulation (priority 2)
It seems there's no issue created for this at the moment. Would be great if you could create a JIRA issue at http://xwiki.org in the XWiki Platform project.
Now regarding extensions, there's some Script Service that can be used to manipulate extensions, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Extension+Script+Module
However this documentation is pretty terse. You could check the java code at https://github.com/xwiki/xwiki-platform/blob/95abd2951123431c1624c124b49ca7a88b41be00/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/src/main/java/org/xwiki/extension/script/ExtensionManagerScriptService.java#L84-L84
I've not personally used this script service so I can't give real examples of using this API

How to work with apache Jmeter with ZK Framework

I am new at performance testing and I would like to load 500 virtual users and check the response time of my application.
I want to use apache jmeter with ZK Framework.
Can you please help achieve this?
I don't know whether you've already resolved your problem or not, but the first thing you will need to do is download the relevant zk plugin (zk-jmeter-plugin-0.8.0.jar) available via http://blog.zkoss.org/index.php/2013/08/06/zk-jmeter-plugin/
save the plugin .jar to %apache-jmeter-root%/lib/ext
Once you've downloaded this, run JMeter. Within the Workbench object in your JMeter hierarchy, there will be a new 'Non-Test Element' entitled 'ZK HTTP Proxy Server'. You will need to use this rather than the standard JMeter 'HTTP(S) Test Script Recorder' to record your http requests.
I'm new to JMeter and the ZK Framework myself, but I've just been working on this so hopefully this detail will be helpful.
There are some additional config files you will need once you actually get going, but I'll wait to see if you still need any more help before bombarding you with info you might already have.
Cheers,
sqeeky

Cannot Deploy Gadget-Application for Development and Testing

I want to start developing a contextual gadget for GMail apps and have been following the guide.
In the part about Installing and Testing the Gadget, it tells me to go https://code.google.com/googleapps/console/a/{Domainname} and upload the manifest file there. I have done this, the manifest file was accepted and I used the Deploy button.
I get to the page where it asks for the data permissions, click yes, and then get a Server Error. I have re-uploaded the manifest and triple-checked that the <Url> leads to a valid gadget xml. I get zero feedback about what the error could be, only that it's a Server Error and it happens every time I try. If the gadget XML is somehow invalid, I would not be able to check, as Google gives me no way to check such files for correct content.
Can anyone help, perhaps?

facebook-java-api on red5, can they work together?

I have a Adobe Flash Builder GUI application that connects to Red5 to communicate.
can i use the red5 to call facebook API calls? can anyone provide an example? all the examples that i can find are with tomcat.
thanks!
Unfortunately they can't.
facebook-java-api cannot work with red5 because it requires the session data that does not pass into red5 and uses variables that i received only by a java Servlet.
there is also a facebook java api called TinyFbClient (www.socialjava.com).
this client is small, very easy to understand with very nice examples.
here i didn't have to use sessions, but i do need to get the uid of the user i want to query on. the client side can forward that information when needed.
TinyFbClient depends on jersey (http://download.java.net/maven/2/com/sun/jersey/) but unfortunately jersy does not compile on red5 properly. if you'll try to use the binary version you'll just get the error
java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
and that is because the compiled binary cannot operate properly.
I resolved the issue by installing tomcat and allowing the user to connect to tomcat first, with tomcat i fetch the session and the relevant facebook data, stores it in a database and then with red5 i manipulate the data as needed.
hopefully this information will be found useful.
update
i had the previous error message because i did not copy the relevant jars (jersey and jsr311) to the red5 directory. unfortunately it did not solve the problem.
i tried different versions of jersey (1.0.x,1.1.x,1.2). the code did compile but any calls to a facebook api would just stop the application.
i decided to do the facebook information fetching part in tomcat and then to deliver it to red5.
Yes, it can work in Red5. Especially if you had it working in Tomcat, since we provide an embedded Tomcat server.