occiware / OCCInterface

OCCI API developer online playground
MIT License
3 stars 1 forks source link

Add Forms to create, retrieve and update OCCI entities #23

Open philippemerle opened 7 years ago

philippemerle commented 7 years ago

I don't know if this feature is already supported. When creating/retrieving/updating OCCI entities (resources and links), it could be cool to have forms with widgets for each attribute instead of writing/reading JSON data directly. As OCCI provides introspection capabilities (aka GET /-/), this should not be too difficult to automatically build these graphical forms.

mdutoo commented 7 years ago

First, note that the core philosophy of OCCInterface is not to provide an advanced graphical view of OCCI Configuration, which is rather the idea behind the OCCIWare Studio, but a simple, barebone, lightweight, web developer-friendly way of seeing OCCI Resources in the web as they fundamentally are : JSON (or text, XML...). However, a form view such as requested here would allow its regular users (web cloud developers) to show OCCI resources to other people that aren't as familiar with JSON, such as their hierarchy or customers, or to do prettier demonstrations of OCCInterface (screenshot slides, webinars). In this light, a form view does not contrevene to OCCInterface's core philosophy, but answers another, complimentary need.

Nowadays, the OCCI JSON is displayed by OCCInterface not as a mere stringification of JSON, but by React components dedicated to displaying nicely JSON : reactifyJSON components. And this even though it is set as a regular JSON Object. These React components are assembled by iterateRec while introspecting said JSON, which is used through toolify() by CodeView's rendering : called at line 42 and included in the React view component tree at line 47.

Forms such as envisioned by Philippe can be added by building on this mechanism and on work already done in #14 (action param - generate JSON) :