Related MOStlyREST Wiki Pages
- MOStlyREST Requirements, Installation, and Examples
- MOStlyREST API Registration
- Enabling/Disabling a Users MOStlyREST API Access
- Managing the MOStlyREST API Settings
- MOStlyREST com_rest API Parameters and Explanations
- MOStlyREST com_rest_content API Parameters and Explanations
- MOStlyREST com_rest_stats API Parameters and Explanations
- MOStlyREST Samples and Examples
- MOStlyREST PHPXref Class Documentation
What is it?
The Wikipedia explanation - Representational_State_Transfer. Another great article can be found here as well.
Why we use it?
MiaCMS is a stable and secure CMS for building sites and managing content. With the addition of the Brilaps REST API, MiaCMS will allow for advanced external interaction. Meaning that interaction with the site and its content no longer has to occur directly through normal browsing methods. For the first time you can start to consume MiaCMS's internals as external services via the data type of your choosing (i.e.) JSON, XML, or Serialized PHP. Mambo, the CMS Mia was original forked from, has been a popular platform for building 3rd party extensions for quite some time now. The extension/plugin system has served well for building applications that fit natively into the CMS and we have seen many powerful extensions developed over the years. We feel one major gap Mambo has always had is the lack of a viable method of interacting with the system externally/programmatically. Brilaps aims to tackle this problem in the new CMS we are helping to build known as MiaCMS. If you've heard of "Software As A Service", we're calling this movement "Mia As A Service".
The new MOStlyREST API is modeled after many other successful REST implementations. If you have worked with other REST interfaces in the past then working with this one should be pretty simple. If not then you'll have to come up to speed with REST in general. However, learning REST is certainly not a waste of time as many popular sites are now offering REST based services.
Here are a few examples:
- Amazon - http://aws.amazon.com
- Digg - http://apidoc.digg.com
What have we built?
The com_rest ComponentBrilaps has created a new component for MiaCMS called com_rest. This component implements a base REST component for other components to build on top of. These could be native core components and/or 3rd party custom components. This base component handles common tasks such as user API registration, API key regeneration, API key request validation, enabling/disabling of the REST interface, data encoding, setting of proper HTML header status codes and content types, error handling, logging of API requests, plus more. To summarize the base com_rest component extends the MiaCMS core and preps it for REST based interaction. This all done through standard conventions and no core hacks are required. At this point this REST implementation only allows for read access, but one could extend for write access as well if they were to implement security measures like OAuth for example.
The com_rest_content ComponentThis component is a RESTified com_content. com_content, as everyone has come to know it today, produces the content which is displayed to the end users of your MiaCMS site. com_rest_content is focused on producing content which can be accessed programmatically. com_rest_content builds off the com_rest base component and implements the actual data retrieval services it intends to offer like the most popular content items, specific content items, searching of content, listing of sections and related categories, etc. Outside of being a great standalone REST component com_rest_content serves as a great example component to learn from while trying to build your own RESTified components. Brilaps has also built a few sample external applications that make use of com_rest and com_rest_content to show what's possible. These are just rough demo apps so don't mind the lack of polish. The first is called the "Sample MiaCMS Rest Client" or SMRC and the second is a Yahoo! Widget called Bridget (Brilaps + Widget = Bridget) which can be run on Windows or Mac OS X.
The com_rest_stats ComponentThis component implements a set of standard REST parameters for interacting with Mia's statistical data. This provides valuable information to REST clients like the popular site search strings, number of hits per content item, hits by browser type, by operating system, by host, etc. It also provides a replica of mod_whosonline which can be used to see how may guests and registers users are current browsing your site.
ExamplesBrilaps has also built a few sample external applications that make use of com_rest and com_rest_content to show what's possible. These are just rough demo apps so don't mind the lack of polish. The first is called the "Sample MiaCMS Rest Client" or SMRC and is used to show off a mashup of web services. The second is a desktop widget called Bridget (Brilaps + Widget = Bridget) which can be run on Windows or Mac OS X. This ones aims to show off Mambo and MOStlyREST on the desktop.
What can you build?
Implementing REST for your components allows you and/or 3rd party developers to consume those MiaCMS resources from external interfaces. These could be desktop widgets, other web sites, RSS feeds, a standalone applications, etc. The possibilities are really endless. MiaCMS can now be an engine and not just a fancy car. So REST enable your existing components if it makes sense and/or build something brand new. We are confident the Brilaps REST component can serve as the basis for a whole new era of 3rd Party MiaCMS development. See above for related pages and documentation.