Friday, August 1, 2014

Implementing Forum Support for API Store (new feature)

Introduction to API Manager
As an organization implements SOA, it becomes beneficial to expose its core processes, data and services as APIs to the public. External parties can mash up these APIs in innovative ways to build new solutions. A business can increase its growth potential and partnership advancements by facilitating developments that are powered by its APIs. For example, the WSO2 Gadget Server leverages the Google Gadget API, ensuring that users of WSO2 Gadget Server can easily develop and deploy their own or third-party Google gadgets in it, in a simple, decentralized manner.


However, leveraging APIs in a collaborative manner introduces new challenges in exercising control, establishing trust, security and regulation. As a result, proper API management is crucial.
WSO2 API Manager overcomes these challenges through a set of features for API creation, publishing, life cycle management, versioning, monetization, governance, security etc. It provides Web interfaces for development teams to deploy and monitor APIs, and also an easy way to consumers to subscribe to, discover and consume APIs through a user-friendly storefront.

The WSO2 API Manager is an on-going project with continuous improvements and enhancements introduced with each new release to address new business challenges and customer expectations.


Project :

This is a project relating to wso2 API Manager which I contributed while I was an intern there.

The basic requirement was for an application developer to be able to initiate discussions on various topics and other developers to be able to reply and carry on with the discussions. The replies would be on a flat (single level) structure. The topic creator can also categorize (tag) a topic choosing from a pre-defined set of categories.


At first we thought of  two ways one can initiate a forum discussion

1. Create a generic forum topic by visiting the forums page and clicking on a button.
2. Browse to an API detail page and click on a button to start a new forum topic. In this case the forum topic will be linked to the API and hence one can filter out discussions for a given API. This requirement brings out the need for the same visibility rules to be applied on the API as well as to its corresponding forum discussions.

Latter it was decided to create the basic features of the forum first and then the approach for initiating a forum discussion will be decided.

The implementation consists of a back-end , REST api for the backend and front-end (UI) components. The back-end contains the core business logic of the forum's functionality and  implemented on top of a defined interface. The plan was to have the back-end as a separate carbon component. The REST api is built on top of jaggery. The front-end is too a jaggery UI.

I contributed mostly in the part of the REST api for the backend and to add features to the jaggery UI.
Jaggery provides functionality to call java classes directly by following format.







Technologies and architecture styles used:       jqeury
REST
        Java Script
Jaggery
css library (bootsrap)

REST API was implemented for the following tasks
Method type
Topics
Reply
GET
1. topic list


2. particular topic with replies


3. topic list matches for specific key word given as the search parameter

POST
adding new topic
adding new reply
PUT
updating a topic
updating a reply
DELETE
deleting a topic
deleting a reply

Following are the screenshots of the completed task.

Forum Topics page
  • pagination support is added
  • Topics can be deleted if the tenant has sufficient permissions
Forum Reply Page
  • pagination support is added
  • The topic can be edited. Both the topic title and description ( REST Update)
  • Reply can be added and edited

Forum topic page



















Forum Reply Page


No comments:

Post a Comment