How to share Swagger documentation - javascript

I recently started using Swagger for my documentation but there are few things that are still unclear to me. I created my YAML document and now I would like to be able to share my documentation in a .pdf or HTML/Javascript page with the rest of my team. I can't use SwaggerHub because they don't have private repositories and Swagger Editor doesn't appear to allow to share the panel on the right.
Just to be clear, I would like to be able to get something like:
What am I missing?

I'm biased as I work on swaggerhub, but that's what the project is for:
https://swaggerhub.com
From there, you can push your swagger specs automatically to github and also make other users collaborators on the API (or just read-only).

We are trying to collaborate with another company but only have the basic four licence Team arrangement. It is a product we are developing so my API has to be private. I am using SwaggerHub but was disappointed to see that users can only see my private APIs if they are "collaborators" and hence covered by a paid licence (you can easily share public APIs on SwaggerHub). I guess this will mean hosting the HTML doco (which you can download from your SwaggerHub API) in my own Cloud-hosted instance of Swagger UI and securing it behind a logon...Open to suggestions!

Related

Can't find valid/complete documentation for api.onedrive.com

Working on a JavaScript based app (VueJS at moment) and am needing to navigate through a user's OneDrive account to find and select files. Documentation that I have found all seems to be for Microsoft's graph API, which uses a different auth method to what api.onedrive.com uses.
So far the only endpoint I have working correctly is "https://api.onedrive.com/v1.0/drive/root/children" and have been un-able to step out from there.
Any help on finding the list of endpoints and how to use them would be much appreciated.
I found interesting info about it in the following web.
OneDrive Examples for Node.js

How to use Web Script in Alfresco as a developer?

I am new to Alfresco and using Alfresco 5.2. I started learning it as an ECM and now I can understand the Share interface to some extent. But I need to master Alfresco as a developer, for which I have to nail Web Script. But I am not sure how to progress in this direction. I am not being able to understand where can I use Web Script and how can it help me. Also, I don't know how to write Web Script/JavaScript programs in Alfresco to perform complex operations. I am stuck within all the documentations and tutorials available on the Internet. Any suggestion or advice can help a lot.
There are two types of webscripts,
Java-Backed and Non-java backed,
The Javascript API exposes a smaller subset of capabilities than the Java Foundation API that's available to Java-backed webscripts, although there are ways to increase what's exposed to Javascript or to expose new custom APIs to Javascript if you like.
The other difference which is useful at certain times, is that with a Java backed webscript you have more control over what parts of the webscript framework are used. E.g. with a JS webscript, you are always obliged to use a template for the "view" (usually Freemarker) so that can be problematic if you want to send back a raw binary content stream, e.g. a document or other non-text based content. With a Java-backed webscript you can define a class that implements the WebScript interface directly or uses AbstractWebscript instead of DeclarativeWebscript. You could also do other things like look at or set request/response headers, cookies or other things that won't have access to using a Javascript controller
Please refer this documentation
Please refer this blog for web-scripts
Alfresco identifies webscripts by its URLs mentioned in desc.xml file of webscript. Webscripts are used to exchange data between share to repo.
There are two types of webscripts share(presentation) and repository (data) webscripts. Some data resides on server(repository) for e.g. (files or users info) and you might want them to be displayed on client side page or you may want to submit data to the server, then there would be specific repository side webscript or API available which provides/accept such data. For that you have to make call(setup communication) from share to repository webscript. For more info please visit http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html#what-is-the-web-script-framework
and
http://ecmarchitect.com/images/articles/alfresco-webscripts/web-script-article.pdf

Custom UI for Alfresco ECM

What are the options for implementing a custom UI for searching the alfresco repository?
I have found only customizations of the Web Scripts share which is more of a WCM thing. Could it be implemented and expanded for Custom Model searches from imported CMIS data?
Has anyone built a custom UI for communicating with the 5.0 or 5.1 alfresco repository?
Any help or search paths would be greatly appreciated.
It's up to you, really.
Latest versions of Alfresco have a nice and documented REST API, which you can consume. Additionally, web scripts you might create are also easily accessible with a simple HTTP request, so customizing is not a problem.
https://api-explorer.alfresco.com/api-explorer/
The latest thing is what Gagravarr already mentioned, Angural2 based components (which also speak with the above mentioned REST API).
Here is a blog post with almost the exact title as your question. The short answer is you can use whatever you want to build a custom app on top of Alfresco.
Yes, there are Angular2 components that will be available some day, but for now, they rely on REST API changes that have not been shipped in any stable release of Alfresco, including Community Edition. They require an early access release (201606-EA or higher) which you should not run in production.
So from whatever language you decide to use you'll be making REST calls. But to which API? There are many. Here is the order of preference you should use when selecting an API for Alfresco.
CMIS. Grab a library from Apache Chemistry.
Public REST API, see http://docs.alfresco.com/5.1/pra/1/topics/pra-welcome.html
Out-of-the-box web scripts marked "Public". See http://localhost:8080/alfresco/s/index for a list, then click down to an individual web script until you see its lifecycle.
Your own custom web scripts
Out-of-the-box web scripts with no lifecycle or something other than public.
That last one is truly a last resort. Don't do it without being fully aware that you are writing against an API that will change without warning.

AngularJS & PHP: upload my app on several servers after changes

I develop an angular-php web application which I have it running online, for different users, on 5 different subdomains, such us:
sub1.mydomain.com
sub2.mydomain.com
sub3.mydomain.com
sub4.mydomain.com
sub5.mydomain.com
Problem:
My problem is that I still develop the web-app local and whenever I change files(php, js,tpl.html,css or when add new ones) I have to upload them on each subdomain.
Question:
Is there a way/library/API whatever that I can use to make something like package (with the updated or new files) and just call it from each subdomain url , and make the appropriate updates?
Or should I just copy them to each subdomain?
Do I make myself clear, in other words just like on cms systems that we press the update button and we update a component/module.
If anyone knows a way of doing that please enlight me. Thanks.
I tried to depict what i mean.
What you are describing is called deployment.
There are a lot of ways to create a deployment mechanism so there is not a single answer to your question. Depends of the tools that you are using, the servers where your app is hosted, etc.
If not, I advise you to use Git to make versions of your app (with Github or Gitlab) and automate the deployment process when you push a new piece of code.
You can make your own scripts to deploy or use online services (surely what you need because of "systems that we press the update button").
I can't advice you one particular service but you would find what you need in Googling "deployment automation github".
I would do it with config files. Considering the code for all my substations is the same. I would have config for each sub-domain and fetch the core files from the same location but serving different data If your structure allows it.

blogengine without php or asp.net etc

Is there a way to have a blog directly integrated into my HTML/javascript-only website, without having to have something like a SQL-database and a dynamic engine like PHP or MySQL?
Maybe there is some service in the web that offers this (hopefully without ads :) ). Or maybe I can have a blog engine entirely written in javasript?
Entirely written in JavaScript? Surely that defeats the entire point of having a "blog-engine" in the first place? The point being that the data is stored somewhere and dynamically retrieved. To avoid using anything server-side (which seems to be your intent), and only use HTML/JavaScript, you'd have to store all the data for the blog in files that are served up to each visitor, and then retrieve the data from the particular, local, locations using JavaScript.
Sorry if I'm misunderstanding the point here... but this seems to be an utterly useless way of trying to go about things. Blogs are, in general, either written statically (in HTML [even though this is rare]), or are dynamically generated from a database by a server-side scripting language (most common).
Edit: As an additional point, I suppose you could include some third-party blog feed, or service, in your page, via use of JavaScript... but I'm unsure as to which (if any) blogging services would directly support this method of working. Additionally, this is quite an unreliable way of including third-party data in a page...
Here's a thought. It's not really a blog engine - but a wiki.
Entirely javascript/html/css. All lives in a single html file:
http://www.tiddlywiki.com/
not sure how it would work on a real live site, but their site is using it:
* A personal notebook
* A GTD ("Getting Things Done") productivity tool
* A collaboration tool
* For building websites (this site is a TiddlyWiki file!)
* For rapid prototyping
* ...and much more!
You could use github pages. You will get a generated blog with version control.
Other option is to use a Desktop blog tool and then update your site.
You can user iWeb if you have a Mac or CityDesk on Windows or you may try this open source tool
Edit Today I came across this tool: Zeta producer that may help.
http://code.google.com/p/showdown-blog/
Blog engine written in just JS and XML [v0.6] {JavaScript, XML}
So, what you want is to have a blog where you're website provider doesn't provide a way to serve dynamic content?
The only way I see that you can do it in that case is writing html-files (or text-files if you prefer) and adding them to the site. After that you can have some JavaScript to add them to your "blog-page".
You of course need to upload them to the website in the same way as you do for the other files, and then have a way for the JavaScript to know which pages it should fetch.
I am not aware of any JavaScript blog-engines, but you can have a look at the templating functions in for instance Prototype
Of course, that means that you will have to fetch both the template and the content through Ajax and let the client do all the processing (could be slow and possibly insecure), and you still need to have a place to upload the content and update it.
Your best bet is going to be using a generator to create the HTML/CSS/JS to upload to your server, take a look at Webby: http://webby.rubyforge.org/
IF you really need to you can use a public api for a service that lets you post small bits of info and retrieve it using javascript.
for example if you only need small posts you can make a blog in html.javascript that utilizes twitter as the engine. of course you will be limited to 140 chars. I am sure there are other services that will allow a similar idea but with less restrictions.
And of course the best option - Get a blog software or host your blog with a service provider and link to it from you site.
Good luck
One solution would be to use some application that generates the static web pages of your blog, and uploads them to your web server. This way you'd have a blog with static content that could all be managed in javascript alongside your existing site, without needing to install database, daemon software, or additional dynamic web programming languages on your server. The static content generation could happen directly on your server if possible, or you could run the html generation tool locally and upload the output.
MoveableType has a tool like this. You still need somewhere to store the content of your blog, and for this MoveableType uses MySQL by default, so you'd still need to install a database somewhere, but the database could simply be one your local desktop.
MoveableType also has support via plugins or older versions that can retrieve data from a sqlite or other database. The advantage of sqlite is that it doesn't require installing daemons like MySQL does, you can just put a sqlite file on disk somewhere, give MoveableType the path to the file, and run the script to generate your static content.
There are likely other tools like MoveableType, and I have in the past generated blog-like web pages simply by writing small scripts to generate HTML. The main issue is just that you need somewhere for these scripts to fetch data from.
Another option might be to develop your blog using XSLT, ... with XSLT, you'd put the content of your pages in XML files, and then write a template in XSL that converts your XML to HTML.
If you google for 'static blog site generation' you might find other ideas/options, including Jekyll/github mentioned in one of the other responses.

Categories