Module: Origo XML-RPC Table Author: Christian Decker Overview ========== Origo XML-RPC Table is a replacement module for some Origo pages, namely the release list and the Project list. Main Goals were implementing a solid framework for paging and ordering the results from an XML-RPC Call. Needed changes ================ Due to the limited functionality give by project.list_partial in the Origo API we had to extend it both by adding new arguments and changing the return value. Arguments: besides the information needed for the pagination (page, pagesize) we had to add arguments for ordering (order and direction). Return Value: besides the information returned previously we needed a summary, description, pretty name and categorization (added by Ueli) such as OS, Programming Language, etc. Besides these informations we also needed some additional information about the overall project count for the paging. The reason we had to order the projects with the XML-RPC call is that in the frontend we have only a subset of the projects and therefore sorting over them was not feasible. On the other hand we had all needed information about the releases and could sort them in the frontend, keeping the XML-RPC API unchanged. Usage ======= Pagination and tabulation is done with a simple call to the function _origo_xmlrpc_table_get_page($dataprovider). The argument $dataprovider is the name of a function that will be called to fetch data. The $dataprovider takes care of fetching the needed information, building the header information, building the rows (like the rows provided to theme_table in the drupal API) and optional arguments and return all the data to _origo_xmlrpc_table_get_page. Implementation ================ As stated above the tabulation and pagination is done using a simple callback function that provides header, data and optional arguments that will then be fed back into the theming engine of drupal itself. Release Listing ================= The release listing was done with downgradability in mind: for example the collapsed releases only marked as such on the server side, but then hidden on the client side, this allows it to have Users with no active JavaScript to just see all releases expanded, still giving them access to them. All of this was done with unintrusiveness in mind, disabling JavaScript will not interfere with the user perception or even make parts inaccessible. The control for collapsed or expanded releases is done in a single place since in the future it is planned that the project admin gets control over whether to expand them or not. Sorting is done using small helper functions in the dataprovider itself demonstrating the functionality. A minimalistic attempt at comparing version numbers was done. Future ======== It may be a good idea to make files sortable by extension instead of the full filename. The release details page can easily be made sortable now.