This document summarizes a technical talk on the UI structure and web APIs of BEXIS. It discusses how the shell provides the application view container and handles layout, themes, and content rendering. Modules can integrate their user interfaces and actions within the shell. The talk also covers how the web APIs are implemented using ASP.NET MVC and Web API to provide a RESTful interface for entities without HTML rendering. Examples of API calls for authentication, datasets, and metadata are also provided.
8. Shell: Themes
• Changing themes affects:
– Placement
– Content
BEXIS Tech Talk #6: UI Structure and Web API
9. Shell ->Theme Configuration
• Current theme can be set
– In the app’s config file
• Each theme may contain more than one
layout
• Active layout of the current theme can be set
– In the app’s config file
BEXIS Tech Talk #6: UI Structure and Web API
10. Shell -> Content Rendering
• @RenderSection
– Renders a named section in the bound view
• @RenderBody
– Renders the body, the default unnamed section
• @Html.RenderAuto
– Renders an action result
– Utilizes the content provider file (layout.xml)
BEXIS Tech Talk #6: UI Structure and Web API
11. Shell -> Content Descriptor
• Maps a content key (in the layout) to a content
provider
• A provider can be:
– an action
– A view
– An external service
• Providers may accept parameters
• Multiple call to one provider with different parameters
• Activating/ Inactivating providers’ mapping
• Multiple provider per key and output concatenation
• Providers should return string, HTML, or MvcString
BEXIS Tech Talk #6: UI Structure and Web API
12. Modules’ UI
• Layout Selection
• Action Integration
• Content Placement
BEXIS Tech Talk #6: UI Structure and Web API
13. Modules->Layout Application
• View Level
• Module Level
– At each area
• Fallback Layout
BEXIS Tech Talk #6: UI Structure and Web API
<Module>/Views/_ViewStart.cshtml
24. Web APIs
• MVC 5 Web API 2
• No Html Rendering
• JSON and XML Outputs
• Output Overriding
–CSV
BEXIS Tech Talk #6: UI Structure and Web API
25. Web API-> Mechanics
• Project Structure
– In respective modules’ Controller folder
– Derived from ApiController class
BEXIS Tech Talk #6: UI Structure and Web API
26. Web API-> Mechanics
• Registration
– In BExIS.Web.Shell->App_Start->WebApiConfig
– The Register method
– Provides a unified URL space for all the web APIs
• For all modules
BEXIS Tech Talk #6: UI Structure and Web API
27. Web API-> Mechanics
• URL space
– All APIs under one unified space /api
– Base_URL/api/<entity>/<action>
– No API versioning is considered!
BEXIS Tech Talk #6: UI Structure and Web API
28. Web API-> Mechanics
• Naming
– Controller name: entity’s plural name
– Http request carries verbs
– URLs do not contain verbs
BEXIS Tech Talk #6: UI Structure and Web API
29. Web API-> Mechanics
• Actions:
– /api/<entity>: list all the entities
• Controller’s Get() method is called
• May reduce the number of entity attributes reported
• May omit some entities
– /api/<entity>/<id>: returns the entity with
identifier <id>
• Controller’s Get(id) method is called
BEXIS Tech Talk #6: UI Structure and Web API
30. Web API-> Mechanics
• Actions:
– /api/<entity>: Creates a new entity
• based on the received form data
• Controller’s Post(value) method is called
– /api/<entity>/<id>: Updates the entity with
identifier <id>
• based on the received form data
• Controller’s Put(id, value) method is called
BEXIS Tech Talk #6: UI Structure and Web API
31. Web API-> Mechanics
• Actions:
– /api/<entity>/<id>: deletes the entity with
identifier <id>
• Controller’s Delete(id) method is called
BEXIS Tech Talk #6: UI Structure and Web API
32. • Example
– rBExIS package for R
BEXIS Tech Talk #6: UI Structure and Web API
34. Sample Web API calls: Data
• http://www.name.com/api/data
• http://www.name.com/api/data/6
– /api/data/6?header=id,name
– /api/data/6?filter=(Grade>50 AND Grade <90)
– /api/data/6?header=id,name&filter=(Grade>50)
BEXIS Tech Talk #6: UI Structure and Web API
35. Sample Web API calls: Metadata
• http://www.name.com/api/metadata
• http://www.name.com/api/metadata/6
• http://www.name.com/api/metadata/6?Conv
ertTo=EML
BEXIS Tech Talk #6: UI Structure and Web API
36. Outlook
Whats next in the talk series?
Source Control
Release Management
BEXIS Tech Talk #6: UI Structure and Web API