How do I present a configuration screen for an Atlassian plugin? - plugins

I'm building a plugin to send http requests to a server whenever I open or edit a pull request in atlassian stash. I've gotten the plugin to work with hardcoded values (like the url, various url parameters, etc.) but now I need to present a configuration screen so these values can be set after installing the plugin. All I need to configure is a couple text strings and a key-value mapping of strings to strings. Nothing complicated!
Unfortunately the stash and atlassian api is a little fuzzy: there's information for linking to a servlet, or something, and describing how once you have the configuration object to connect to it, but that's all I can find. They also point at a couple examples like google maps and webdav plugins, but without any comments it might as well be latin.
Can someone point me to an example or tutorial that shows how to present a configuration panel for a stash (or atlassian) plugin?

The Atlassian plugin framework is quite a broad topic, particularly because there are subtle differences in capabilities between the various concrete products (JIRA, Confluence, FishEye, Stash, etc.) and as such, there are resources all over the net for helping understand, interact with and program against the available framework components and API endpoints. I'm working through the process of adding configuration myself and have found the following resources very helpful (although they may be generic to the Atlassian plugin framework, most of the concepts still apply):
https://developer.atlassian.com/display/DOCS/Creating+an+Admin+Configuration+Form
https://developer.atlassian.com/stash/docs/latest/reference/plugin-module-types/plugin-modules.html

Related

Is there any tool to automatically create wiki-like REST API documentation from JSON or Open API?

I have several services, each one exposed through REST API with ASP.NET Core Web API. I use Swashbuckle for ASP.NET Core tooling in order to automatically generate from my controllers and DTOs all the necessary documentation and visualize it in SwaggerUI. I found this tooling really great, with little annotations on my models and my controllers already provides many features out of the box, such as a UI client to try out the REST API endpoints.
But with this solution each service has its own dedicated SwaggerUI instance and therefore UI.
I would like to offer to my customers a wiki-like documentation with a navigation menu, where, for instance, they can browse sections regarding all the endpoints exposed by my services and have on each page the same features offered by SwaggerUI.
It can be achieved by creating my own web application but I was wondering whether an out of the box solution or some tool that might ease such integration already exists.
I tried Slate but I felt like I had to re-invent the wheel in order to automate at least the creation of the basic API documentation, namely controller definition, response definition and descriptions. Does anyone have any suggestion?
I faced this very issue recently working in a microservices architecture, you're absolutely right. There is not need to reinvent the wheel.
I really can't recommend redoc by Redocly enough in this case.
Have a look at the multiple-apis example.

Which is the difference between these google KMS client packages? (CloudKMS vs KeyManagementServiceClient)

I have a java codebase that seems to be using "com.google.api.services.cloudkms.v1.CloudKMS" to call KMS. The online docs says to use "com.google.cloud.kms.v1.KeyManagementServiceClient"
When i looked up both packages seem to be updated, however the reference docs recommend using the latter.
https://developers.google.com/resources/api-libraries/documentation/cloudkms/v1/java/latest/com/google/api/services/cloudkms/v1/CloudKMS.html
https://cloud.google.com/kms/docs/reference/libraries
Could someone tell me what is the difference between these 2 clients packages and if i should move to the one the reference links to?
In general, you should prefer the library referenced on the Reference Libraries page, currently com.google.cloud.kms. The examples and tutorials on the website will use this client library.
Probably more history than you need to know, but we have two client libraries because they run over different protocols. The new libraries (the one's listed on the reference page) use gRPC to communicate. This means less bandwidth and less time spent serializing/de-serializing JSON. On the flip side, gRPC requires HTTP/2, and some organizations can't/won't support HTTP/2 yet. As a result, we still publish and maintain legacy libraries that are REST over HTTP/1. It is strongly recommended you use the gRPC ones unless you can't use HTTP/2.
You can read more about the background and technical details in Kickstart your cryptography with new Cloud KMS client libraries and samples.

Visual REST API playground

What are some web apps that allow me to play with any REST APIs visually (by clicking) and also get some code generated (in any language) that captures what I have described visually?
Similar to Swagger or Google API Playground but allows me to talk to anything that speaks REST (assuming I have the proper auth credentials and I know what messages it understands).
Bonus points for something that can also "discover" what messages are understood, given a URL endpoint.
Microsoft has 2 that I know of
OData API explorer
The data market service explorer (requires signing in, and then you can access free data sets)
Considering that REST API's are going to follow their own conventions, terms, and have their own documentation (hopefully), this is an impossible problem. If you restrict your quest to visualizing API's that follow a "standard" form of self-documentation (see REST web service WSDL? for some hopeful scenarios) you might be able to accomplish this.
Or you can use something like http://www.programmableweb.com/ to discover tutorials, tools, examples, and mashups of various existing APIs.
You could mock an API at http://apiary.io/.
You could explore and existing one through tools (e.g. REST Console for Chrome)
What you can't have, is one-size-fits-all explorer for "every possible REST API." Some APIs follow conventions that others don't.
apigee and apihub (now part of mulesoft) are two that I frequently visit. Of the two, apigee is my preferred provider.
One of the reasons that you're not going to see a lot of websites like this is because of the same-origin policy. This means that you can't access a RESTful API located at api.google.com from a web app running at, say, www.restfiddle.com without sending all the API traffic through restfiddle.com's servers. Sites like JSFiddle can exist (and are used widely) because all the processing is done on the client side.
Browser plugins, however, are exempt from the same-origin policy. If you're using Chrome, try Postman. If your REST client doesn't need to be web-based, check out SoapUI. IntelliJ IDEA has a nice REST client as well.
Try Restlet Studio, it's the only visual API designer I've found, and seems pretty good, it imports and exports swagger & RAML.
http://studio.restlet.com/

Is the Sql Azure Dac Import/Export service WCF or REST or something else?

I downloaded the example application and was surprised to see quite complex web request building and handling.
Unfortunately I have not been able to find even one scrap of documentation about the service.
I tried using AddServiceReference in VS and svcutil.exe on the end points (both the http general one and the https region specific ones) which I found in the example project (again I couldn't find them listed anywhere on the web) and both seamed to find a wsdl of sorts which they both used to create wrapper classes. But neither one created an app.config
and no mater what kind of binding I set up for them, I can not get the client to communicate.
Is there any documentation for the service?
Is there a way to use it with WCF?
Thank you
Rabbi,
i have the same thing here, there are some non MS sites discussing this:
- http://www.britishdeveloper.co.uk/2012/05/export-and-back-up-your-sql-azure.html
- http://www.codeproject.com/Articles/287597/Sql-Azure-Import-Export-Service-bacpac-dac-Extract
There is also a DacSample site, but that doc is bit messed up, mixing the DAC client tools with the hosted solution. if i read the doc correctly and follow the links i end up going in circles. Not funny :)
Good luck!
Pete

Async requests vaadin

I find no documentation on how to update objects vaadin asynchronously. Can anyone help me? What I need is to render a table and then update the values ​​of a column with a call rather slow, and so I want to make it asynchronous ..
This has been discussed a lot on this thread on the Vaadin forum. You might want to read it, it contains a lot of useful information.
Just do the updates in another thread. UI modifications from background threads must be synchronized to application object. Add icepush, refresher or proggresbar to get changes from server to client.
As far as I know Vaadin provides two add-ons for solving this problem: ServerPush and DontPush. Both add-ons can be imported via maven and both support WebSockets as well as fallback solutions for browsers without WebSocket support. Although ServerPush provides seemingly more features than DontPush, it is lower rated than DontPush, probably because it is more complicated.
For pushing updates to the client DontPush provides a very simple solution that does not require any changes to the web application. Only the servlet-class in web.xml needs to be replaced by org.vaadin.dontpush.server.impl.jetty.DontPushServlet and the widget set has to be updated afterwards via mvn vaadin:update-widgetset. That's all. Any changes on the server will be automatically pushed to the client. I successfully tested this add-on with Chrome 14. Unfortunately, I could not get it working with Firefox 7.
According to the web page of ServerPush the ServerPush add-on should provide this functionality, too. However, I could not figure out how to setup ServerPush to be working with jetty. Moreover, it seems to be more complicated in use. It requires several changes to the web.xml as well as additional configuration files for the atmosphere server.
In contrast to DontPush ServerPush provides also an explicit pushing mechanism which allows to update the GUI manually by calling the push() method of a certain pusher component which needs to be added to the main window beforehand. However, I also failed to get this working.