Watson Content Hub (WCH) allows developers to build rich client side applications against a consistent set of REST APIs. Visual Studio Code is a free, cross-platform, and a popular code editor, in particular in the Angular community. We have published an extension for this editor to make the development experience of single page application for WCH more convenient.

Install the extension from the Visual Studio Marketplace. On the marketplace page, we also list a number of recommended extensions from other sources. Together they result in a convenient end-to-end development experience.

Snippets

Snippets are small code templates that can be inserted into code or markup in a context-sensitive way. The WCH snippets provide templates for the most commonly used markup fragments, such as the inclusion of a content reference or of search results. They take away the need to memorize the exact syntax of these fragments. We think that the less often you need to consult documentation, the more fun it is to build awesome applications.

Create Layouts from WCH Types

The “WCH: Create Layout …” command makes it simple to create a new layout and code component for a WCH type. It displays the list of known types and lets you select from the list, so there is no need to remember type names and there is no room for typos. The list is sorted such that types without layouts are listed first, since you likely want to start with one of them.

Refer to the Prerequisites section in the documentation to configure your project accordingly.

Create a new Single Page Application for Watson Content Hub

The “WCH: Create New Project …” command allows you to create an Angular SPA with WCH support from scratch. It asks the user for the API URL and the project name and then creates the necessary code artifacts. If the WCH tenant already contains type and layout definitions, they are pulled from the server and are used as a basis for a component model. The resulting application can be run immediately and is eagerly waiting for further customization.

Note: WCH can host only one application per tenant at a time, so when you push your new application it replaces an existing application, e.g. the pre-deployed Oslo starter application. In case you would like to use the Oslo application as a starter and modify it, there is no need to use the “WCH: Create New Project …” command, just download the source code and get going.

This extension is being developed actively. We would be happy to get feedback, either in the form of a rating or via the Q&A section in the marketplace. Are you are missing a feature that would make you even more productive? Let us know!

Resources

1 comment on"Enhance your development experience with the Visual Studio Code extension for WCH application"

  1. Bryan Daniel February 02, 2018

    Just what I was looking for!! Thanks for sharing!

Join The Discussion

Your email address will not be published. Required fields are marked *